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;
}
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);
}
}
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;
}
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));
}
}
Aggregations