Search in sources :

Example 1 with BundleResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse in project open-smart-grid-platform by OSGP.

the class BundleSteps method theNumberOfResponsesInTheBundleResponseShouldMatchTheNumberOfActionsInTheBundleRequest.

@Then("^the number of responses in the bundle response should match the number of actions in the bundle request$")
public void theNumberOfResponsesInTheBundleResponseShouldMatchTheNumberOfActionsInTheBundleRequest() throws Throwable {
    this.ensureBundleResponse();
    final BundleRequest request = (BundleRequest) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_REQUEST);
    final BundleResponse response = (BundleResponse) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_RESPONSE);
    this.assertSameSize(request, response);
}
Also used : BundleResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse) BundleRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleRequest) Then(io.cucumber.java.en.Then)

Example 2 with BundleResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse in project open-smart-grid-platform by OSGP.

the class BundleSteps method theOrderOfTheResponsesInTheBundleResponseShouldMatchTheOrderOfActionsInTheBundleRequest.

@Then("^the order of the responses in the bundle response should match the order of actions in the bundle request$")
public void theOrderOfTheResponsesInTheBundleResponseShouldMatchTheOrderOfActionsInTheBundleRequest() throws Throwable {
    this.ensureBundleResponse();
    final BundleRequest request = (BundleRequest) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_REQUEST);
    final BundleResponse response = (BundleResponse) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_RESPONSE);
    this.assertSameSize(request, response);
    this.assertSameOrder(request, response);
}
Also used : BundleResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse) BundleRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleRequest) Then(io.cucumber.java.en.Then)

Example 3 with BundleResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse in project open-smart-grid-platform by OSGP.

the class ActionMapperResponseService method mapAllActions.

public BundleResponse mapAllActions(final Serializable actionList) throws FunctionalException {
    final BundleMessagesResponse bundleResponseMessageDataContainer = (BundleMessagesResponse) actionList;
    final AllResponses allResponses = new ObjectFactory().createAllResponses();
    final List<? extends ActionResponse> actionValueList = bundleResponseMessageDataContainer.getBundleList();
    for (final ActionResponse actionValueResponseObject : actionValueList) {
        final ConfigurableMapper mapper = this.getMapper(actionValueResponseObject);
        final Class<?> clazz = this.getClazz(actionValueResponseObject);
        final Response response = this.doMap(actionValueResponseObject, mapper, clazz);
        allResponses.getResponseList().add(response);
    }
    final BundleResponse bundleResponse = new ObjectFactory().createBundleResponse();
    bundleResponse.setAllResponses(allResponses);
    return bundleResponse;
}
Also used : ActualMeterReadsResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ActualMeterReadsResponse) BundleResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse) GetConfigurationObjectResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse) BundleMessagesResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.BundleMessagesResponse) PeriodicMeterReadsResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.PeriodicMeterReadsResponse) UpdateFirmwareResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.UpdateFirmwareResponse) ReadAlarmRegisterResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ReadAlarmRegisterResponse) GetMbusEncryptionKeyStatusResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetMbusEncryptionKeyStatusResponse) GetKeysResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysResponse) FirmwareVersionGasResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.FirmwareVersionGasResponse) PeriodicMeterReadsGasResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.PeriodicMeterReadsGasResponse) ScanMbusChannelsResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ScanMbusChannelsResponse) GetFirmwareVersionResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetFirmwareVersionResponse) FaultResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.FaultResponse) AdministrativeStatusResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.AdministrativeStatusResponse) GetOutagesResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetOutagesResponse) FindEventsResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.FindEventsResponse) CoupleMbusDeviceByChannelResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CoupleMbusDeviceByChannelResponse) Response(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.Response) GetAllAttributeValuesResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetAllAttributeValuesResponse) GetPowerQualityProfileResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetPowerQualityProfileResponse) SetDeviceLifecycleStatusByChannelResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SetDeviceLifecycleStatusByChannelResponse) ActualMeterReadsGasResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ActualMeterReadsGasResponse) EventMessagesResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EventMessagesResponse) GetMbusEncryptionKeyStatusByChannelResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetMbusEncryptionKeyStatusByChannelResponse) ActionResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActionResponse) GetFirmwareVersionGasResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetFirmwareVersionGasResponse) AdministrativeStatusTypeResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusTypeResponse) GetGsmDiagnosticResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetGsmDiagnosticResponse) FirmwareVersionResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.FirmwareVersionResponse) ActualPowerQualityResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualPowerQualityResponse) DecoupleMbusDeviceByChannelResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DecoupleMbusDeviceByChannelResponse) ObjectFactory(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ObjectFactory) BundleResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse) BundleMessagesResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.BundleMessagesResponse) ConfigurableMapper(ma.glasnost.orika.impl.ConfigurableMapper) AllResponses(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.AllResponses) ActionResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActionResponse)

Example 4 with BundleResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse in project open-smart-grid-platform by OSGP.

the class BaseBundleSteps method getNextBundleResponse.

protected Response getNextBundleResponse() throws WebServiceSecurityException, GeneralSecurityException, IOException {
    this.ensureBundleResponse();
    final BundleResponse bundleResponse = (BundleResponse) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_RESPONSE);
    return bundleResponse.getAllResponses().getResponseList().get(this.getAndIncreaseCount(PlatformSmartmeteringKeys.BUNDLE_RESPONSE_COUNT));
}
Also used : BundleResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse)

Example 5 with BundleResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse in project open-smart-grid-platform by OSGP.

the class BaseBundleSteps method ensureBundleResponse.

protected void ensureBundleResponse() throws WebServiceSecurityException, GeneralSecurityException, IOException {
    if (ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_RESPONSE) == null) {
        final String correlationUid = (String) ScenarioContext.current().get(PlatformSmartmeteringKeys.KEY_CORRELATION_UID);
        final BundleAsyncRequest asyncRequest = new BundleAsyncRequest();
        asyncRequest.setCorrelationUid(correlationUid);
        asyncRequest.setDeviceIdentification((String) ScenarioContext.current().get(PlatformSmartmeteringKeys.DEVICE_IDENTIFICATION));
        final BundleResponse response = this.client.retrieveBundleResponse(asyncRequest);
        ScenarioContext.current().put(PlatformSmartmeteringKeys.BUNDLE_RESPONSE, response);
        assertThat(response.getAllResponses().getResponseList().size()).isEqualTo(ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_ACTION_COUNT));
    }
}
Also used : BundleAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleAsyncRequest) BundleResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse)

Aggregations

BundleResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse)6 Then (io.cucumber.java.en.Then)2 ActualMeterReadsResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ActualMeterReadsResponse)2 AdministrativeStatusResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.AdministrativeStatusResponse)2 BundleRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleRequest)2 FindEventsResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.FindEventsResponse)2 GetMbusEncryptionKeyStatusResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetMbusEncryptionKeyStatusResponse)2 ReadAlarmRegisterResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ReadAlarmRegisterResponse)2 ScanMbusChannelsResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ScanMbusChannelsResponse)2 Response (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.Response)2 ConfigurableMapper (ma.glasnost.orika.impl.ConfigurableMapper)1 ActionResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ActionResponse)1 ActualMeterReadsGasResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ActualMeterReadsGasResponse)1 AllResponses (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.AllResponses)1 AssociationLnObjectsResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.AssociationLnObjectsResponse)1 BundleAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleAsyncRequest)1 BundleAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleAsyncResponse)1 FaultResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.FaultResponse)1 GetConfigurationObjectResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetConfigurationObjectResponse)1 GetFirmwareVersionGasResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetFirmwareVersionGasResponse)1