Search in sources :

Example 1 with UpdateFirmwareAsyncRequest

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

the class UpdateFirmwareSteps method thePlatformBuffersAUpdateFirmwareResponseMessage.

@Then("^the platform buffers a update firmware response message for device \"([^\"]*)\"$")
public void thePlatformBuffersAUpdateFirmwareResponseMessage(final String deviceIdentification, final Map<String, String> expectedResult) throws Throwable {
    final UpdateFirmwareAsyncRequest request = new UpdateFirmwareAsyncRequest();
    final AsyncRequest asyncRequest = new AsyncRequest();
    asyncRequest.setDeviceId(deviceIdentification);
    asyncRequest.setCorrelationUid((String) ScenarioContext.current().get(PlatformPubliclightingKeys.KEY_CORRELATION_UID));
    request.setAsyncRequest(asyncRequest);
    Wait.until(() -> {
        UpdateFirmwareResponse response = null;
        try {
            response = this.client.getUpdateFirmware(request);
        } catch (final Exception e) {
        // do nothing
        }
        assertThat(response).isNotNull();
        assertThat(response.getResult()).isEqualTo(Enum.valueOf(OsgpResultType.class, expectedResult.get(PlatformPubliclightingKeys.KEY_RESULT)));
    });
}
Also used : UpdateFirmwareAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.firmwaremanagement.UpdateFirmwareAsyncRequest) AsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest) UpdateFirmwareAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.firmwaremanagement.UpdateFirmwareAsyncRequest) OsgpResultType(org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType) UpdateFirmwareResponse(org.opensmartgridplatform.adapter.ws.schema.core.firmwaremanagement.UpdateFirmwareResponse) 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 UpdateFirmwareAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.firmwaremanagement.UpdateFirmwareAsyncRequest)1 UpdateFirmwareResponse (org.opensmartgridplatform.adapter.ws.schema.core.firmwaremanagement.UpdateFirmwareResponse)1 SoapFaultClientException (org.springframework.ws.soap.client.SoapFaultClientException)1