use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleRequest in project open-smart-grid-platform by OSGP.
the class BundleSteps method aABundleRequest.
@Given("^a bundle request$")
public void aABundleRequest(final Map<String, String> settings) throws Throwable {
final BundleRequest request = new BundleRequest();
request.setDeviceIdentification(getString(settings, PlatformSmartmeteringKeys.DEVICE_IDENTIFICATION, PlatformSmartmeteringDefaults.DEVICE_IDENTIFICATION));
final Actions actions = new Actions();
request.setActions(actions);
ScenarioContext.current().put(PlatformSmartmeteringKeys.BUNDLE_REQUEST, request);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleRequest in project open-smart-grid-platform by OSGP.
the class BundleSteps method theNumberOfResponsesInTheBundleResponseShouldMatchTheNumberOfActionsInTheBundleRequest.
@Then("^the number of responses in the bundle response should match the number of actions in the bundle request$")
public void theNumberOfResponsesInTheBundleResponseShouldMatchTheNumberOfActionsInTheBundleRequest() throws Throwable {
this.ensureBundleResponse();
final BundleRequest request = (BundleRequest) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_REQUEST);
final BundleResponse response = (BundleResponse) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_RESPONSE);
this.assertSameSize(request, response);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleRequest in project open-smart-grid-platform by OSGP.
the class BundleSteps method theOrderOfTheResponsesInTheBundleResponseShouldMatchTheOrderOfActionsInTheBundleRequest.
@Then("^the order of the responses in the bundle response should match the order of actions in the bundle request$")
public void theOrderOfTheResponsesInTheBundleResponseShouldMatchTheOrderOfActionsInTheBundleRequest() throws Throwable {
this.ensureBundleResponse();
final BundleRequest request = (BundleRequest) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_REQUEST);
final BundleResponse response = (BundleResponse) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_RESPONSE);
this.assertSameSize(request, response);
this.assertSameOrder(request, response);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleRequest in project open-smart-grid-platform by OSGP.
the class BaseBundleSteps method addActionToBundleRequest.
protected void addActionToBundleRequest(final Action action) {
final BundleRequest bundleRequest = (BundleRequest) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_REQUEST);
bundleRequest.getActions().getActionList().add(action);
this.increaseCount(PlatformSmartmeteringKeys.BUNDLE_ACTION_COUNT);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.BundleRequest in project open-smart-grid-platform by OSGP.
the class BundleSteps method theBundleRequestIsReceived.
@When("^the bundle request is received$")
public void theBundleRequestIsReceived() throws Throwable {
final BundleRequest request = (BundleRequest) ScenarioContext.current().get(PlatformSmartmeteringKeys.BUNDLE_REQUEST);
final BundleAsyncResponse asyncResponse = this.client.sendBundleRequest(request);
assertThat(asyncResponse).isNotNull();
ScenarioContextHelper.saveAsyncResponse(asyncResponse);
}
Aggregations