use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceRequest in project open-smart-grid-platform by OSGP.
the class AddDeviceSteps method receivingASmartmeteringAddDeviceRequest.
@When("^receiving a smartmetering add device request$")
public void receivingASmartmeteringAddDeviceRequest(final Map<String, String> settings) throws Throwable {
final String deviceIdentification = settings.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION);
ScenarioContext.current().put(PlatformKeys.KEY_DEVICE_IDENTIFICATION, deviceIdentification);
this.putKeyInScenarioContext(settings, PlatformKeys.KEY_DEVICE_MASTERKEY);
this.putKeyInScenarioContext(settings, PlatformKeys.KEY_DEVICE_AUTHENTICATIONKEY);
this.putKeyInScenarioContext(settings, PlatformKeys.KEY_DEVICE_ENCRYPTIONKEY);
this.putKeyInScenarioContext(settings, PlatformSmartmeteringKeys.MBUS_DEFAULT_KEY);
final AddDeviceRequest request = AddDeviceRequestFactory.fromParameterMap(settings);
final AddDeviceAsyncResponse asyncResponse = this.smartMeteringInstallationClient.addDevice(request);
this.checkAndSaveCorrelationId(asyncResponse.getCorrelationUid());
assertThat(asyncResponse.getDeviceIdentification()).as("Device identification in response").isEqualTo(deviceIdentification);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceRequest in project open-smart-grid-platform by OSGP.
the class AddDeviceRequestFactory method fromParameterMap.
public static AddDeviceRequest fromParameterMap(final Map<String, String> requestParameters) {
final AddDeviceRequest addDeviceRequest = new AddDeviceRequest();
addDeviceRequest.setDevice(DeviceFactory.fromParameterMap(requestParameters));
addDeviceRequest.setDeviceModel(DeviceModelFactory.fromParameterMap(requestParameters));
return addDeviceRequest;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceRequest 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);
}
}
Aggregations