Search in sources :

Example 1 with ActualMeterReadsGasAsyncRequest

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();
}
Also used : ActualMeterReadsGasAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncRequest) ActualMeterReadsGasResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasResponse) Then(io.cucumber.java.en.Then)

Example 2 with ActualMeterReadsGasAsyncRequest

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;
}
Also used : ActualMeterReadsGasAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncRequest)

Example 3 with 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);
    }
}
Also used : ActualMeterReadsGasAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncRequest) ActualMeterReadsGasRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest) ActualMeterReadsGasAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse) When(io.cucumber.java.en.When)

Aggregations

ActualMeterReadsGasAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncRequest)3 Then (io.cucumber.java.en.Then)1 When (io.cucumber.java.en.When)1 ActualMeterReadsGasAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse)1 ActualMeterReadsGasRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest)1 ActualMeterReadsGasResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasResponse)1