Search in sources :

Example 1 with AddDeviceRequest

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);
}
Also used : AddDeviceRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceRequest) AddDeviceAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncResponse) When(io.cucumber.java.en.When)

Example 2 with AddDeviceRequest

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;
}
Also used : AddDeviceRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceRequest)

Example 3 with 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);
    }
}
Also used : AddDeviceAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncRequest) AddDeviceRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceRequest) AddDeviceAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncResponse) When(io.cucumber.java.en.When)

Aggregations

AddDeviceRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceRequest)3 When (io.cucumber.java.en.When)2 AddDeviceAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncResponse)2 AddDeviceAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncRequest)1