use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncResponse 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.ActualPowerQualityAsyncResponse 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.ActualPowerQualityAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringMonitoringEndpoint method getActualPowerQuality.
@PayloadRoot(localPart = "ActualPowerQualityRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public ActualPowerQualityAsyncResponse getActualPowerQuality(@OrganisationIdentification final String organisationIdentification, @RequestPayload final org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest request, @MessagePriority final String messagePriority, @ResponseUrl final String responseUrl, @ScheduleTime final String scheduleTime, @BypassRetry final String bypassRetry) throws OsgpException {
final ActualPowerQualityRequest requestData = this.monitoringMapper.map(request, ActualPowerQualityRequest.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_ACTUAL_POWER_QUALITY).withMessageType(MessageType.GET_ACTUAL_POWER_QUALITY).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, requestData);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.monitoringMapper.map(asyncResponse, ActualPowerQualityAsyncResponse.class);
}
Aggregations