Search in sources :

Example 1 with ReplaceKeysRequest

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

the class ReplaceKeysSteps method theReplaceKeysRequestIsReceived.

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

Example 2 with ReplaceKeysRequest

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

the class ReplaceKeysRequestFactory method fromParameterMap.

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

Example 3 with ReplaceKeysRequest

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

the class ReplaceKeysSteps method multipleReplaceKeysRequestsAreReceived.

@When("^multiple replace keys requests are received$")
public void multipleReplaceKeysRequestsAreReceived(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 ReplaceKeysRequest request = ReplaceKeysRequestFactory.fromParameterMap(settingsPerRequest);
        final ReplaceKeysAsyncResponse asyncResponse = this.smartMeteringConfigurationClient.replaceKeys(request);
        correlationUIDs.add(asyncResponse.getCorrelationUid());
    }
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, correlationUIDs);
}
Also used : GenerateAndReplaceKeysAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse) ReplaceKeysAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ReplaceKeysAsyncResponse) ArrayList(java.util.ArrayList) GenerateAndReplaceKeysRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysRequest) ReplaceKeysRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ReplaceKeysRequest) HashMap(java.util.HashMap) Map(java.util.Map) When(io.cucumber.java.en.When)

Aggregations

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