Search in sources :

Example 1 with StartDeviceTestAsyncRequest

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

the class StartDeviceSteps method thePlatformBuffersNoStartDeviceTestResponseMessageForDevice.

@Then("^the platform buffers no start device test response message for device \"([^\"]*)\"$")
public void thePlatformBuffersNoStartDeviceTestResponseMessageForDevice(final String deviceIdentification) throws InterruptedException {
    final StartDeviceTestAsyncRequest request = new StartDeviceTestAsyncRequest();
    final AsyncRequest asyncRequest = new AsyncRequest();
    asyncRequest.setDeviceId(deviceIdentification);
    asyncRequest.setCorrelationUid((String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID));
    request.setAsyncRequest(asyncRequest);
    Wait.until(() -> {
        StartDeviceTestResponse response = null;
        try {
            response = this.client.getStartDeviceTestResponse(request);
        } catch (final Exception e) {
        // do nothing
        }
        assertThat(response).isNotNull();
        assertThat(response.getResult()).isNotEqualTo(OsgpResultType.NOT_FOUND);
    });
}
Also used : StartDeviceTestAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestAsyncRequest) AsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) IOException(java.io.IOException) WebServiceSecurityException(org.opensmartgridplatform.shared.exceptionhandling.WebServiceSecurityException) GeneralSecurityException(java.security.GeneralSecurityException) StartDeviceTestAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestAsyncRequest) StartDeviceTestResponse(org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestResponse) Then(io.cucumber.java.en.Then)

Example 2 with StartDeviceTestAsyncRequest

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

the class StartDeviceSteps method thePlatformBuffersAStartDeviceResponseMessageForDevice.

@Then("^the platform buffers a start device response message for device \"([^\"]*)\"$")
public void thePlatformBuffersAStartDeviceResponseMessageForDevice(final String deviceIdentification, final Map<String, String> expectedResult) throws InterruptedException {
    final StartDeviceTestAsyncRequest request = new StartDeviceTestAsyncRequest();
    final AsyncRequest asyncRequest = new AsyncRequest();
    asyncRequest.setDeviceId(deviceIdentification);
    asyncRequest.setCorrelationUid((String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID));
    request.setAsyncRequest(asyncRequest);
    Wait.until(() -> {
        StartDeviceTestResponse response = null;
        try {
            response = this.client.getStartDeviceTestResponse(request);
        } catch (final Exception e) {
        // do nothing
        }
        assertThat(response).isNotNull();
        assertThat(response.getResult()).isEqualTo(getEnum(expectedResult, PlatformKeys.KEY_RESULT, OsgpResultType.class));
    });
}
Also used : StartDeviceTestAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestAsyncRequest) AsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest) OsgpResultType(org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) IOException(java.io.IOException) WebServiceSecurityException(org.opensmartgridplatform.shared.exceptionhandling.WebServiceSecurityException) GeneralSecurityException(java.security.GeneralSecurityException) StartDeviceTestAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestAsyncRequest) StartDeviceTestResponse(org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestResponse) Then(io.cucumber.java.en.Then)

Aggregations

Then (io.cucumber.java.en.Then)2 IOException (java.io.IOException)2 GeneralSecurityException (java.security.GeneralSecurityException)2 AsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest)2 StartDeviceTestAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestAsyncRequest)2 StartDeviceTestResponse (org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestResponse)2 WebServiceSecurityException (org.opensmartgridplatform.shared.exceptionhandling.WebServiceSecurityException)2 SoapFaultClientException (org.springframework.ws.soap.client.SoapFaultClientException)2 OsgpResultType (org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType)1