Search in sources :

Example 1 with BundleAsyncRequest

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

the class BundleRequestFactory method fromScenarioContext.

public static BundleAsyncRequest fromScenarioContext() {
    final BundleAsyncRequest asyncRequest = new BundleAsyncRequest();
    asyncRequest.setCorrelationUid(RequestFactoryHelper.getCorrelationUidFromScenarioContext());
    asyncRequest.setDeviceIdentification(RequestFactoryHelper.getDeviceIdentificationFromScenarioContext());
    return asyncRequest;
}
Also used : BundleAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleAsyncRequest)

Example 2 with BundleAsyncRequest

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

the class FunctionalExceptionsSteps method theBundleRequestGeneratingAnErrorIsReceivedWithHeaders.

@When("^the bundle request generating an error is received with headers$")
public void theBundleRequestGeneratingAnErrorIsReceivedWithHeaders(final Map<String, String> settings) throws Throwable {
    this.bundleSteps.theBundleRequestIsReceivedWithHeaders(settings);
    final BundleAsyncRequest asyncRequest = BundleRequestFactory.fromScenarioContext();
    if (this.useLongWaitTime) {
        this.smartMeteringConfigurationClient.setWaitFailMillis(LONG_WAIT_TIME);
    }
    try {
        this.smartMeteringBundleClient.retrieveBundleResponse(asyncRequest);
    } catch (final Exception exception) {
        ScenarioContext.current().put(PlatformKeys.RESPONSE, exception);
    }
}
Also used : BundleAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleAsyncRequest) When(io.cucumber.java.en.When)

Example 3 with BundleAsyncRequest

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

the class BundleAsyncRequestBuilder method build.

@Override
public BundleAsyncRequest build() {
    final BundleAsyncRequest result = new BundleAsyncRequest();
    result.setDeviceIdentification(this.deviceIdentification);
    result.setCorrelationUid(this.correlationUid);
    return result;
}
Also used : BundleAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleAsyncRequest)

Example 4 with BundleAsyncRequest

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

the class BaseBundleSteps method ensureBundleResponse.

protected void ensureBundleResponse() throws WebServiceSecurityException, GeneralSecurityException, IOException {
    if (ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_RESPONSE) == null) {
        final String correlationUid = (String) ScenarioContext.current().get(PlatformSmartmeteringKeys.KEY_CORRELATION_UID);
        final BundleAsyncRequest asyncRequest = new BundleAsyncRequest();
        asyncRequest.setCorrelationUid(correlationUid);
        asyncRequest.setDeviceIdentification((String) ScenarioContext.current().get(PlatformSmartmeteringKeys.DEVICE_IDENTIFICATION));
        final BundleResponse response = this.client.retrieveBundleResponse(asyncRequest);
        ScenarioContext.current().put(PlatformSmartmeteringKeys.BUNDLE_RESPONSE, response);
        assertThat(response.getAllResponses().getResponseList().size()).isEqualTo(ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_ACTION_COUNT));
    }
}
Also used : BundleAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleAsyncRequest) BundleResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse)

Aggregations

BundleAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleAsyncRequest)4 When (io.cucumber.java.en.When)1 BundleResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleResponse)1