Search in sources :

Example 1 with AsyncRequest

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

the class GetConfigurationSteps method thePlatformBuffersAGetConfigurationResponseMessageForDeviceContainsSoapFault.

@Then("^the platform buffers a get configuration response message for device \"([^\"]*)\" contains soap fault$")
public void thePlatformBuffersAGetConfigurationResponseMessageForDeviceContainsSoapFault(final String deviceIdentification, final Map<String, String> expectedResponseData) throws Throwable {
    final GetConfigurationAsyncRequest request = new GetConfigurationAsyncRequest();
    final AsyncRequest asyncRequest = new AsyncRequest();
    asyncRequest.setDeviceId(deviceIdentification);
    asyncRequest.setCorrelationUid((String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID));
    request.setAsyncRequest(asyncRequest);
    Wait.until(() -> {
        GetConfigurationResponse response = null;
        try {
            response = this.client.getGetConfiguration(request);
        } catch (final Exception e) {
        // do nothing
        }
        assertThat(response).isNotNull();
    });
}
Also used : GetConfigurationAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.GetConfigurationAsyncRequest) GetConfigurationAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.GetConfigurationAsyncRequest) AsyncRequest(org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest) GetConfigurationResponse(org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.GetConfigurationResponse) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) Then(io.cucumber.java.en.Then)

Example 2 with AsyncRequest

use of org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest 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)

Example 3 with AsyncRequest

use of org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest 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 4 with AsyncRequest

use of org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest 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)

Example 5 with AsyncRequest

use of org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest 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)12 AsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.common.AsyncRequest)12 OsgpResultType (org.opensmartgridplatform.adapter.ws.schema.core.common.OsgpResultType)9 SoapFaultClientException (org.springframework.ws.soap.client.SoapFaultClientException)8 IOException (java.io.IOException)2 GeneralSecurityException (java.security.GeneralSecurityException)2 GetConfigurationAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.GetConfigurationAsyncRequest)2 GetConfigurationResponse (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.GetConfigurationResponse)2 SetConfigurationAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SetConfigurationAsyncRequest)2 StartDeviceTestAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestAsyncRequest)2 StartDeviceTestResponse (org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.StartDeviceTestResponse)2 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)2 WebServiceSecurityException (org.opensmartgridplatform.shared.exceptionhandling.WebServiceSecurityException)2 SetRebootAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.core.adhocmanagement.SetRebootAsyncRequest)1 SetRebootResponse (org.opensmartgridplatform.adapter.ws.schema.core.adhocmanagement.SetRebootResponse)1 Configuration (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.Configuration)1 DaliConfiguration (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.DaliConfiguration)1 IndexAddressMap (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.IndexAddressMap)1 LightType (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.LightType)1 LinkType (org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.LinkType)1