use of org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsRequest in project open-smart-grid-platform by OSGP.
the class UpdateDeviceCdmaSettingsSteps method receiveAnUpdateDeviceCdmaSettingsRequest.
@When("^an update device CDMA settings request is received$")
public void receiveAnUpdateDeviceCdmaSettingsRequest(final Map<String, String> requestParameters) throws Throwable {
final String deviceIdentification = getString(requestParameters, PlatformKeys.KEY_DEVICE_IDENTIFICATION, PlatformDefaults.DEFAULT_DEVICE_IDENTIFICATION);
final String mastSegment = getString(requestParameters, PlatformKeys.KEY_CDMA_MAST_SEGMENT);
final Short batchNumber = getShort(requestParameters, PlatformKeys.KEY_CDMA_BATCH_NUMBER);
LOGGER.info("WHEN: Receive UpdateDeviceCdmaSettingsRequest [deviceIdentification={}, mastSegment={}, batchNumber={}]", deviceIdentification, mastSegment, batchNumber);
final UpdateDeviceCdmaSettingsRequest request = new UpdateDeviceCdmaSettingsRequest();
request.setDeviceIdentification(deviceIdentification);
if (!StringUtils.isBlank(mastSegment)) {
request.setMastSegment(mastSegment);
}
if (batchNumber != null) {
request.setBatchNumber(batchNumber);
}
final UpdateDeviceCdmaSettingsAsyncResponse asyncResponse = this.client.updateDeviceCdmaSettings(request);
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
ScenarioContext.current().put(PlatformKeys.KEY_DEVICE_IDENTIFICATION, asyncResponse.getDeviceId());
}
Aggregations