Search in sources :

Example 1 with ActualPowerQualityRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest in project open-smart-grid-platform by OSGP.

the class ActualPowerQualitySteps method theGetActualMeterReadsRequestGeneratingAnErrorIsReceived.

@When("^the get actual power quality request generating an error is received$")
public void theGetActualMeterReadsRequestGeneratingAnErrorIsReceived(final Map<String, String> settings) throws Throwable {
    final ActualPowerQualityRequest request = ActualPowerQualityRequestFactory.fromParameterMap(settings);
    final ActualPowerQualityAsyncResponse asyncResponse = this.requestClient.doRequest(request);
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
    final ActualPowerQualityAsyncRequest actualPowerQualityAsyncRequest = ActualPowerQualityRequestFactory.fromScenarioContext();
    try {
        final ActualPowerQualityResponse response = this.responseClient.getResponse(actualPowerQualityAsyncRequest);
        fail("Expected exception, but got a response: %s", response.toString());
    } catch (final Exception exception) {
        ScenarioContext.current().put(PlatformKeys.RESPONSE, exception);
    }
}
Also used : ActualPowerQualityResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityResponse) ActualPowerQualityAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncResponse) ActualPowerQualityRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest) ActualPowerQualityAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncRequest) When(io.cucumber.java.en.When)

Example 2 with ActualPowerQualityRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest in project open-smart-grid-platform by OSGP.

the class ActualPowerQualitySteps method theGetActualMeterReadsRequestIsReceived.

@When("^the get actual power quality request is received$")
public void theGetActualMeterReadsRequestIsReceived(final Map<String, String> settings) throws Throwable {
    final ActualPowerQualityRequest request = ActualPowerQualityRequestFactory.fromParameterMap(settings);
    final ActualPowerQualityAsyncResponse asyncResponse = this.requestClient.doRequest(request);
    assertThat(asyncResponse).as("AsyncResponse should not be null").isNotNull();
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
Also used : ActualPowerQualityAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncResponse) ActualPowerQualityRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest) When(io.cucumber.java.en.When)

Example 3 with ActualPowerQualityRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest in project open-smart-grid-platform by OSGP.

the class ActualPowerQualityRequestFactory method fromParameterMap.

public static ActualPowerQualityRequest fromParameterMap(final Map<String, String> requestParameters) {
    final String profileType = getString(requestParameters, PlatformKeys.KEY_POWER_QUALITY_PROFILE_TYPE);
    final ActualPowerQualityRequest actualPowerQualityRequest = new ActualPowerQualityRequest();
    actualPowerQualityRequest.setDeviceIdentification(requestParameters.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION));
    actualPowerQualityRequest.setProfileType(profileType);
    return actualPowerQualityRequest;
}
Also used : ReadSettingsHelper.getString(org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString) ActualPowerQualityRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest)

Aggregations

ActualPowerQualityRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest)3 When (io.cucumber.java.en.When)2 ActualPowerQualityAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncResponse)2 ActualPowerQualityAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncRequest)1 ActualPowerQualityResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityResponse)1 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)1