Search in sources :

Example 1 with SetEventNotificationsAsyncRequest

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

the class SetEventNotificationsSteps method thePlatformBuffersASetEventNotificationResponseMessageForDevice.

@Then("^the platform buffers a set event notification response message for device \"([^\"]*)\"")
public void thePlatformBuffersASetEventNotificationResponseMessageForDevice(final String deviceIdentification, final Map<String, String> expectedResult) throws Throwable {
    final SetEventNotificationsAsyncRequest request = new SetEventNotificationsAsyncRequest();
    final AsyncRequest asyncRequest = new AsyncRequest();
    asyncRequest.setDeviceId(deviceIdentification);
    asyncRequest.setCorrelationUid((String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID));
    request.setAsyncRequest(asyncRequest);
    Wait.until(() -> {
        SetEventNotificationsResponse response = null;
        try {
            response = this.client.getSetEventNotificationsResponse(request);
        } catch (final Exception e) {
        // do nothing
        }
        assertThat(response).isNotNull();
        assertThat(response.getResult()).isEqualTo(Enum.valueOf(OsgpResultType.class, expectedResult.get(PlatformKeys.KEY_RESULT)));
    });
}
Also used : SetEventNotificationsResponse(org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.SetEventNotificationsResponse) SetEventNotificationsAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.SetEventNotificationsAsyncRequest) AsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest) OsgpResultType(org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType) SetEventNotificationsAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.SetEventNotificationsAsyncRequest) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) Then(io.cucumber.java.en.Then)

Aggregations

Then (io.cucumber.java.en.Then)1 AsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest)1 OsgpResultType (org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType)1 SetEventNotificationsAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.SetEventNotificationsAsyncRequest)1 SetEventNotificationsResponse (org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.SetEventNotificationsResponse)1 SoapFaultClientException (org.springframework.ws.soap.client.SoapFaultClientException)1