Search in sources :

Example 1 with OsgpResultType

use of org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType in project open-smart-grid-platform by OSGP.

the class UpdateDeviceCdmaSettingsSteps method thePlatformShouldBufferAnUpdateDeviceCdmaSettingsResponseMessage.

@Then("^the platform should buffer an update device CDMA settings response message$")
public void thePlatformShouldBufferAnUpdateDeviceCdmaSettingsResponseMessage(final Map<String, String> responseParameters) {
    final String deviceIdentification = (String) ScenarioContext.current().get(PlatformKeys.KEY_DEVICE_IDENTIFICATION);
    final String correlationUid = (String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID);
    final OsgpResultType expectedResult = Enum.valueOf(OsgpResultType.class, responseParameters.get(PlatformKeys.KEY_RESULT));
    LOGGER.info("THEN: Buffer UpdateCdmaSettingsResponse [correlationUid={}, deviceIdentification={}, result={}]", correlationUid, deviceIdentification, expectedResult);
    final UpdateDeviceCdmaSettingsAsyncRequest request = new UpdateDeviceCdmaSettingsAsyncRequest();
    request.setDeviceId(deviceIdentification);
    request.setCorrelationUid(correlationUid);
    Wait.until(() -> {
        UpdateDeviceCdmaSettingsResponse response = null;
        try {
            response = this.client.getUpdateDeviceCdmaSettingsResponse(request);
        } catch (final WebServiceSecurityException e) {
        // do nothing
        }
        assertThat(response).isNotNull();
        assertThat(response.getResult()).isEqualTo(expectedResult);
    });
}
Also used : UpdateDeviceCdmaSettingsAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsAsyncRequest) UpdateDeviceCdmaSettingsResponse(org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsResponse) OsgpResultType(org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType) ReadSettingsHelper.getString(org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString) WebServiceSecurityException(org.opensmartgridplatform.shared.exceptionhandling.WebServiceSecurityException) Then(io.cucumber.java.en.Then)

Aggregations

Then (io.cucumber.java.en.Then)1 OsgpResultType (org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType)1 UpdateDeviceCdmaSettingsAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsAsyncRequest)1 UpdateDeviceCdmaSettingsResponse (org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsResponse)1 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)1 WebServiceSecurityException (org.opensmartgridplatform.shared.exceptionhandling.WebServiceSecurityException)1