Search in sources :

Example 1 with SetConfigurationAsyncRequest

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));
}
Also used : SetConfigurationAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationAsyncRequest) AsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest) SetConfigurationResponse(org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationResponse) OsgpResultType(org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType) SetConfigurationAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationAsyncRequest) Then(io.cucumber.java.en.Then)

Example 2 with SetConfigurationAsyncRequest

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);
    }
}
Also used : SetConfigurationAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationAsyncRequest) AsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest) SetConfigurationAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationAsyncRequest) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) Then(io.cucumber.java.en.Then)

Aggregations

Then (io.cucumber.java.en.Then)2 AsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest)2 SetConfigurationAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationAsyncRequest)2 OsgpResultType (org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType)1 SetConfigurationResponse (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationResponse)1 SoapFaultClientException (org.springframework.ws.soap.client.SoapFaultClientException)1