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);
}
}
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());
}
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;
}
Aggregations