Search in sources :

Example 1 with ActualMeterReadsGasRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest in project open-smart-grid-platform by OSGP.

the class ActualMeterReadsGasSteps method theGetActualMeterReadsRequestIsReceived.

@When("^the get actual meter reads gas request is received$")
public void theGetActualMeterReadsRequestIsReceived(final Map<String, String> settings) throws Throwable {
    final ActualMeterReadsGasRequest request = ActualMeterReadsGasRequestFactory.fromParameterMap(settings);
    final ActualMeterReadsGasAsyncResponse asyncResponse = this.requestClient.doRequest(request);
    assertThat(asyncResponse).as("AsyncResponse should not be null").isNotNull();
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
Also used : ActualMeterReadsGasRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest) ActualMeterReadsGasAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse) When(io.cucumber.java.en.When)

Example 2 with ActualMeterReadsGasRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest in project open-smart-grid-platform by OSGP.

the class ActualMeterReadsGasRequestFactory method fromParameterMap.

public static ActualMeterReadsGasRequest fromParameterMap(final Map<String, String> settings) {
    final ActualMeterReadsGasRequest actualMeterReadsGasRequest = new ActualMeterReadsGasRequest();
    actualMeterReadsGasRequest.setDeviceIdentification(getString(settings, PlatformKeys.KEY_DEVICE_IDENTIFICATION, PlatformSmartmeteringDefaults.DEFAULT_SMART_METER_GAS_DEVICE_IDENTIFICATION));
    return actualMeterReadsGasRequest;
}
Also used : ActualMeterReadsGasRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest)

Example 3 with ActualMeterReadsGasRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest 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

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