use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsRequest in project open-smart-grid-platform by OSGP.
the class ActualMeterReadsSteps method theGetActualMeterReadsRequestIsReceived.
@When("^the get actual meter reads request is received$")
public void theGetActualMeterReadsRequestIsReceived(final Map<String, String> settings) throws Throwable {
final ActualMeterReadsRequest request = ActualMeterReadsRequestFactory.fromParameterMap(settings);
final ActualMeterReadsAsyncResponse 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.ActualMeterReadsRequest in project open-smart-grid-platform by OSGP.
the class ActualMeterReadsSteps method theGetActualMeterReadsRequestGeneratingAnErrorIsReceived.
@When("^the get actual meter reads request generating an error is received$")
public void theGetActualMeterReadsRequestGeneratingAnErrorIsReceived(final Map<String, String> settings) throws Throwable {
final ActualMeterReadsRequest request = ActualMeterReadsRequestFactory.fromParameterMap(settings);
final ActualMeterReadsAsyncResponse asyncResponse = this.requestClient.doRequest(request);
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
final ActualMeterReadsAsyncRequest actualMeterReadsAsyncRequest = ActualMeterReadsRequestFactory.fromScenarioContext();
assertThat(actualMeterReadsAsyncRequest).as("ActualMeterReadsAsyncRequest should not be null").isNotNull();
try {
final ActualMeterReadsResponse response = this.responseClient.getResponse(actualMeterReadsAsyncRequest);
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.ActualMeterReadsRequest in project open-smart-grid-platform by OSGP.
the class ActualMeterReadsRequestFactory method fromParameterMap.
public static ActualMeterReadsRequest fromParameterMap(final Map<String, String> requestParameters) {
final ActualMeterReadsRequest actualMeterReadsRequest = new ActualMeterReadsRequest();
actualMeterReadsRequest.setDeviceIdentification(requestParameters.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION));
return actualMeterReadsRequest;
}
Aggregations