Search in sources :

Example 1 with UpdateDeviceCdmaSettingsRequest

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());
}
Also used : UpdateDeviceCdmaSettingsRequest(org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsRequest) ReadSettingsHelper.getString(org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString) UpdateDeviceCdmaSettingsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsAsyncResponse) ReadSettingsHelper.getShort(org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getShort) When(io.cucumber.java.en.When)

Aggregations

When (io.cucumber.java.en.When)1 UpdateDeviceCdmaSettingsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsAsyncResponse)1 UpdateDeviceCdmaSettingsRequest (org.opensmartgridplatform.adapter.ws.schema.core.devicemanagement.UpdateDeviceCdmaSettingsRequest)1 ReadSettingsHelper.getShort (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getShort)1 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)1