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());
}
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;
}
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);
}
Aggregations