Search in sources :

Example 1 with SetDeviceLifecycleStatusByChannelRequest

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

the class SetDeviceLifecycleStatusByChannelRequestFactory method fromParameterMap.

public static SetDeviceLifecycleStatusByChannelRequest fromParameterMap(final Map<String, String> settings) {
    final SetDeviceLifecycleStatusByChannelRequest request = new SetDeviceLifecycleStatusByChannelRequest();
    final SetDeviceLifecycleStatusByChannelRequestData requestData = new SetDeviceLifecycleStatusByChannelRequestData();
    request.setGatewayDeviceIdentification(settings.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION));
    requestData.setChannel(Short.parseShort(settings.get(PlatformSmartmeteringKeys.KEY_CHANNEL)));
    requestData.setDeviceLifecycleStatus(DeviceLifecycleStatus.valueOf(settings.get(PlatformSmartmeteringKeys.KEY_DEVICE_LIFECYCLE_STATUS)));
    request.setSetDeviceLifecycleStatusByChannelRequestData(requestData);
    return request;
}
Also used : SetDeviceLifecycleStatusByChannelRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelRequest) SetDeviceLifecycleStatusByChannelRequestData(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelRequestData)

Example 2 with SetDeviceLifecycleStatusByChannelRequest

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

the class SetDeviceLifecycleStatusByChannel method aSetDeviceLifecycleStatusByChannelRequestIsReceived.

@When("^a set device lifecycle status by channel request is received$")
public void aSetDeviceLifecycleStatusByChannelRequestIsReceived(final Map<String, String> settings) throws Throwable {
    final SetDeviceLifecycleStatusByChannelRequest request = SetDeviceLifecycleStatusByChannelRequestFactory.fromParameterMap(settings);
    final SetDeviceLifecycleStatusByChannelAsyncResponse asyncResponse = this.smManagementRequestClient.doRequest(request);
    assertThat(asyncResponse).as("setDeviceCommunicationSettingsAsyncResponse should not be null").isNotNull();
    ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
Also used : SetDeviceLifecycleStatusByChannelRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelRequest) SetDeviceLifecycleStatusByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelAsyncResponse) When(io.cucumber.java.en.When)

Aggregations

SetDeviceLifecycleStatusByChannelRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelRequest)2 When (io.cucumber.java.en.When)1 SetDeviceLifecycleStatusByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelAsyncResponse)1 SetDeviceLifecycleStatusByChannelRequestData (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelRequestData)1