use of org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationAsyncRequest in project open-smart-grid-platform by OSGP.
the class SetConfigurationSteps method thePlatformBufferesASetConfigurationResponseMessageForDevice.
@Then("^the platform buffers a set configuration response message for device \"([^\"]*)\"$")
public void thePlatformBufferesASetConfigurationResponseMessageForDevice(final String deviceIdentification, final Map<String, String> expectedResponseData) throws Throwable {
final SetConfigurationAsyncRequest request = new SetConfigurationAsyncRequest();
final AsyncRequest asyncRequest = new AsyncRequest();
asyncRequest.setDeviceId(deviceIdentification);
asyncRequest.setCorrelationUid((String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID));
request.setAsyncRequest(asyncRequest);
final SetConfigurationResponse response = Wait.untilAndReturn(() -> {
final SetConfigurationResponse retval = this.client.getSetConfiguration(request);
assertThat(retval).isNotNull();
return retval;
});
assertThat(response.getResult()).isEqualTo(getEnum(expectedResponseData, PlatformKeys.KEY_RESULT, OsgpResultType.class));
}
use of org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationAsyncRequest in project open-smart-grid-platform by OSGP.
the class SetConfigurationSteps method thePlatformBufferesASetConfigurationResponseMessageForDeviceContainsSoapFault.
@Then("^the platform buffers a set configuration response message for device \"([^\"]*)\" contains soap fault$")
public void thePlatformBufferesASetConfigurationResponseMessageForDeviceContainsSoapFault(final String deviceIdentification, final Map<String, String> expectedResponseData) throws Throwable {
final SetConfigurationAsyncRequest request = new SetConfigurationAsyncRequest();
final AsyncRequest asyncRequest = new AsyncRequest();
asyncRequest.setDeviceId(deviceIdentification);
asyncRequest.setCorrelationUid((String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID));
request.setAsyncRequest(asyncRequest);
try {
this.client.getSetConfiguration(request);
} catch (final SoapFaultClientException ex) {
ScenarioContext.current().put(PlatformKeys.RESPONSE, ex);
GenericResponseSteps.verifySoapFault(expectedResponseData);
}
}
Aggregations