Search in sources :

Example 1 with SetRebootAsyncRequest

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

the class SetRebootSteps method thenThePlatformBuffersASetRebootResponseMessage.

@Then("^the platform buffers a set reboot response message for device \"([^\"]*)\"$")
public void thenThePlatformBuffersASetRebootResponseMessage(final String deviceIdentification, final Map<String, String> expectedResult) {
    final SetRebootAsyncRequest request = new SetRebootAsyncRequest();
    final AsyncRequest asyncRequest = new AsyncRequest();
    asyncRequest.setDeviceId(deviceIdentification);
    asyncRequest.setCorrelationUid((String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID));
    request.setAsyncRequest(asyncRequest);
    Wait.until(() -> {
        SetRebootResponse response = null;
        try {
            response = this.client.getSetRebootResponse(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 : AsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest) SetRebootAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.adhocmanagement.SetRebootAsyncRequest) SetRebootAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.adhocmanagement.SetRebootAsyncRequest) OsgpResultType(org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType) SetRebootResponse(org.opensmartgridplatform.adapter.ws.schema.core.adhocmanagement.SetRebootResponse) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) Then(io.cucumber.java.en.Then)

Aggregations

Then (io.cucumber.java.en.Then)1 SetRebootAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.adhocmanagement.SetRebootAsyncRequest)1 SetRebootResponse (org.opensmartgridplatform.adapter.ws.schema.core.adhocmanagement.SetRebootResponse)1 AsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest)1 OsgpResultType (org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType)1 SoapFaultClientException (org.springframework.ws.soap.client.SoapFaultClientException)1