use of org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.SetLightAsyncRequest in project open-smart-grid-platform by OSGP.
the class SetLightSteps method thePlatformBuffersASetLightResponseMessage.
@Then("^the platform buffers a set light response message for device \"([^\"]*)\"$")
public void thePlatformBuffersASetLightResponseMessage(final String deviceIdentification, final Map<String, String> expectedResult) {
final SetLightAsyncRequest request = new SetLightAsyncRequest();
final AsyncRequest asyncRequest = new AsyncRequest();
asyncRequest.setDeviceId(deviceIdentification);
asyncRequest.setCorrelationUid((String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID));
request.setAsyncRequest(asyncRequest);
Wait.until(() -> {
SetLightResponse response = null;
try {
response = this.client.getSetLightResponse(request);
} catch (final Exception e) {
// do nothing
}
assertThat(response).isNotNull();
assertThat(response.getResult()).isEqualTo(Enum.valueOf(OsgpResultType.class, expectedResult.get(PlatformKeys.KEY_RESULT)));
});
}
Aggregations