Search in sources :

Example 1 with GenerateAndReplaceKeysRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysRequest in project open-smart-grid-platform by OSGP.

the class ReplaceKeysSteps method multipleGenerateAndReplaceKeysRequestsAreReceived.

@When("multiple generate and replace keys requests are received")
public void multipleGenerateAndReplaceKeysRequestsAreReceived(final Map<String, String> settings) throws Throwable {
    final List<Map<String, String>> listOfSettingsPerRequest = this.createSettingPerRequest(settings);
    final List<String> correlationUIDs = new ArrayList<>();
    for (final Map<String, String> settingsPerRequest : listOfSettingsPerRequest) {
        final GenerateAndReplaceKeysRequest request = GenerateAndReplaceKeysRequestFactory.fromParameterMap(settingsPerRequest);
        final GenerateAndReplaceKeysAsyncResponse asyncResponse = this.smartMeteringConfigurationClient.generateAndReplaceKeys(request);
        correlationUIDs.add(asyncResponse.getCorrelationUid());
    }
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, correlationUIDs);
}
Also used : ArrayList(java.util.ArrayList) GenerateAndReplaceKeysAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse) HashMap(java.util.HashMap) Map(java.util.Map) GenerateAndReplaceKeysRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysRequest) When(io.cucumber.java.en.When)

Example 2 with GenerateAndReplaceKeysRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysRequest in project open-smart-grid-platform by OSGP.

the class GenerateAndReplaceKeysRequestFactory method fromParameterMap.

public static GenerateAndReplaceKeysRequest fromParameterMap(final Map<String, String> requestParameters) {
    final GenerateAndReplaceKeysRequest generateAndReplaceKeysRequest = new GenerateAndReplaceKeysRequest();
    generateAndReplaceKeysRequest.setDeviceIdentification(getString(requestParameters, PlatformKeys.KEY_DEVICE_IDENTIFICATION, PlatformDefaults.DEFAULT_DEVICE_IDENTIFICATION));
    return generateAndReplaceKeysRequest;
}
Also used : GenerateAndReplaceKeysRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysRequest)

Example 3 with GenerateAndReplaceKeysRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysRequest in project open-smart-grid-platform by OSGP.

the class ReplaceKeysSteps method theGenerateAndReplaceKeysRequestIsReceived.

@When("^the generate and replace keys request is received$")
public void theGenerateAndReplaceKeysRequestIsReceived(final Map<String, String> settings) throws Throwable {
    ScenarioContext.current().put(PlatformKeys.KEY_DEVICE_IDENTIFICATION, settings.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION));
    final GenerateAndReplaceKeysRequest request = GenerateAndReplaceKeysRequestFactory.fromParameterMap(settings);
    final GenerateAndReplaceKeysAsyncResponse asyncResponse = this.smartMeteringConfigurationClient.generateAndReplaceKeys(request);
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
Also used : GenerateAndReplaceKeysAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse) GenerateAndReplaceKeysRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysRequest) When(io.cucumber.java.en.When)

Aggregations

GenerateAndReplaceKeysRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysRequest)3 When (io.cucumber.java.en.When)2 GenerateAndReplaceKeysAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1