use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncRequest in project open-smart-grid-platform by OSGP.
the class AddDeviceSteps method theAddDeviceResponseShouldBeReturned.
@Then("^the add device response should be returned$")
public void theAddDeviceResponseShouldBeReturned(final Map<String, String> responseParameters) throws Throwable {
final String correlationUid = (String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID);
final Map<String, String> extendedParameters = SettingsHelper.addDefault(responseParameters, PlatformKeys.KEY_CORRELATION_UID, correlationUid);
final AddDeviceAsyncRequest addDeviceAsyncRequest = AddDeviceRequestFactory.fromParameterMapAsync(extendedParameters);
final AddDeviceResponse response = this.smartMeteringInstallationClient.getAddDeviceResponse(addDeviceAsyncRequest);
final String expectedResult = responseParameters.get(PlatformKeys.KEY_RESULT);
assertThat(response.getResult()).as("Result").isNotNull();
assertThat(response.getResult().name()).as("Result").isEqualTo(expectedResult);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncRequest in project open-smart-grid-platform by OSGP.
the class AddDeviceRequestFactory method fromParameterMapAsync.
public static AddDeviceAsyncRequest fromParameterMapAsync(final Map<String, String> requestParameters) {
final String correlationUid = RequestFactoryHelper.getCorrelationUidFromScenarioContext();
final String deviceIdentification = RequestFactoryHelper.getDeviceIdentificationFromStepData(requestParameters);
final AddDeviceAsyncRequest addDeviceAsyncRequest = new AddDeviceAsyncRequest();
addDeviceAsyncRequest.setCorrelationUid(correlationUid);
addDeviceAsyncRequest.setDeviceIdentification(deviceIdentification);
return addDeviceAsyncRequest;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncRequest in project open-smart-grid-platform by OSGP.
the class FunctionalExceptionsSteps method receivingASmartmeteringAddDeviceRequestWithAnInvalidDsmrVersion.
@When("^receiving a smartmetering add device request with an invalid DSMR version$")
public void receivingASmartmeteringAddDeviceRequestWithAnInvalidDsmrVersion(final Map<String, String> settings) throws Throwable {
final AddDeviceRequest request = AddDeviceRequestFactory.fromParameterMap(settings);
try {
final AddDeviceAsyncResponse asyncResponse = this.smartMeteringInstallationClient.addDevice(request);
final AddDeviceAsyncRequest addDeviceAsyncRequest = new AddDeviceAsyncRequest();
addDeviceAsyncRequest.setCorrelationUid(asyncResponse.getCorrelationUid());
addDeviceAsyncRequest.setDeviceIdentification(asyncResponse.getDeviceIdentification());
this.smartMeteringInstallationClient.getAddDeviceResponse(addDeviceAsyncRequest);
} catch (final Exception exception) {
ScenarioContext.current().put(PlatformKeys.RESPONSE, exception);
}
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncRequest in project open-smart-grid-platform by OSGP.
the class AddDeviceSteps method retrievingTheAddDeviceResponseResultsInAnException.
@Then("^retrieving the AddDevice response results in an exception$")
public void retrievingTheAddDeviceResponseResultsInAnException() throws WebServiceSecurityException {
final AddDeviceAsyncRequest addDeviceAsyncRequest = AddDeviceRequestFactory.fromScenarioContext();
try {
this.smartMeteringInstallationClient.getAddDeviceResponse(addDeviceAsyncRequest);
Assertions.fail("A SoapFaultClientException should be thrown");
} catch (final SoapFaultClientException e) {
ScenarioContext.current().put(PlatformKeys.RESPONSE, e);
}
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncRequest in project open-smart-grid-platform by OSGP.
the class AddDeviceRequestFactory method fromScenarioContext.
public static AddDeviceAsyncRequest fromScenarioContext() {
final String correlationUid = RequestFactoryHelper.getCorrelationUidFromScenarioContext();
final String deviceIdentification = RequestFactoryHelper.getDeviceIdentificationFromScenarioContext();
final AddDeviceAsyncRequest addDeviceAsyncRequest = new AddDeviceAsyncRequest();
addDeviceAsyncRequest.setCorrelationUid(correlationUid);
addDeviceAsyncRequest.setDeviceIdentification(deviceIdentification);
return addDeviceAsyncRequest;
}
Aggregations