use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncRequest in project open-smart-grid-platform by OSGP.
the class ActualMeterReadsGasSteps method theActualMeterReadsResultShouldBeReturned.
@Then("^the actual meter reads gas result should be returned$")
public void theActualMeterReadsResultShouldBeReturned(final Map<String, String> settings) throws Throwable {
final ActualMeterReadsGasAsyncRequest asyncRequest = ActualMeterReadsGasRequestFactory.fromScenarioContext();
final ActualMeterReadsGasResponse response = this.responseClient.getResponse(asyncRequest);
assertThat(response).as("ActualMeterReadsGasResponse should not be null").isNotNull();
assertThat(response.getConsumption()).as("Consumption should not be null").isNotNull();
assertThat(response.getCaptureTime()).as("CaptureTime should not be null").isNotNull();
assertThat(response.getLogTime()).as("LogTime should not be null").isNotNull();
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncRequest in project open-smart-grid-platform by OSGP.
the class ActualMeterReadsGasRequestFactory method fromScenarioContext.
public static ActualMeterReadsGasAsyncRequest fromScenarioContext() {
final ActualMeterReadsGasAsyncRequest actualMeterReadsGasAsyncRequest = new ActualMeterReadsGasAsyncRequest();
actualMeterReadsGasAsyncRequest.setCorrelationUid(RequestFactoryHelper.getCorrelationUidFromScenarioContext());
actualMeterReadsGasAsyncRequest.setDeviceIdentification(RequestFactoryHelper.getDeviceIdentificationFromScenarioContext());
return actualMeterReadsGasAsyncRequest;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncRequest in project open-smart-grid-platform by OSGP.
the class FunctionalExceptionsSteps method theGetActualMeterReadsGasRequestGeneratingAnErrorIsReceived.
@When("^the get actual meter reads gas request generating an error is received$")
public void theGetActualMeterReadsGasRequestGeneratingAnErrorIsReceived(final Map<String, String> requestData) throws Throwable {
final ActualMeterReadsGasRequest request = ActualMeterReadsGasRequestFactory.fromParameterMap(requestData);
final ActualMeterReadsGasAsyncResponse asyncResponse = this.actualMeterReadsGasRequestClient.doRequest(request);
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
final ActualMeterReadsGasAsyncRequest asyncRequest = ActualMeterReadsGasRequestFactory.fromScenarioContext();
try {
this.actualMeterReadsGasResponseClient.getResponse(asyncRequest);
} catch (final Exception exception) {
ScenarioContext.current().put(PlatformKeys.RESPONSE, exception);
}
}
Aggregations