use of org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsAsyncRequest 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);
});
}
Aggregations