Search in sources :

Example 1 with GetPowerQualityProfileRequest

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

the class PowerQualityProfileSteps method theGetPowerQualityProfileRequestDataIsReceived.

@When("^the get power quality profile request data is received$")
public void theGetPowerQualityProfileRequestDataIsReceived(final Map<String, String> settings) throws Throwable {
    final GetPowerQualityProfileRequest request = GetPowerQualityProfileRequestFactory.fromParameterMap(settings);
    final GetPowerQualityProfileAsyncResponse asyncResponse = this.requestClient.doRequest(request);
    assertThat(asyncResponse).as("AsyncResponse should not be null").isNotNull();
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
Also used : GetPowerQualityProfileRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileRequest) GetPowerQualityProfileAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileAsyncResponse) When(io.cucumber.java.en.When)

Example 2 with GetPowerQualityProfileRequest

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

the class GetPowerQualityProfileRequestFactory method fromParameterMap.

public static GetPowerQualityProfileRequest fromParameterMap(final Map<String, String> requestParameters) {
    final GetPowerQualityProfileRequest getPowerQualityProfileRequestData = new GetPowerQualityProfileRequest();
    final DateTime beginDate = dateFromParameterMap(requestParameters, PlatformKeys.KEY_BEGIN_DATE);
    final DateTime endDate = dateFromParameterMap(requestParameters, PlatformKeys.KEY_END_DATE);
    final String profileType = getString(requestParameters, PlatformKeys.KEY_POWER_QUALITY_PROFILE_TYPE);
    final CaptureObjectDefinitions captureObjecDefinitions = CaptureObjectDefinitionsFactory.fromParameterMap(requestParameters);
    getPowerQualityProfileRequestData.setDeviceIdentification(requestParameters.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION));
    getPowerQualityProfileRequestData.setBeginDate(DateConverter.createXMLGregorianCalendar(beginDate.toDate()));
    getPowerQualityProfileRequestData.setEndDate(DateConverter.createXMLGregorianCalendar(endDate.toDate()));
    getPowerQualityProfileRequestData.setProfileType(profileType);
    getPowerQualityProfileRequestData.setSelectedValues(captureObjecDefinitions);
    return getPowerQualityProfileRequestData;
}
Also used : ReadSettingsHelper.getString(org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString) GetPowerQualityProfileRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileRequest) CaptureObjectDefinitions(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.CaptureObjectDefinitions) DateTime(org.joda.time.DateTime)

Aggregations

GetPowerQualityProfileRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileRequest)2 When (io.cucumber.java.en.When)1 DateTime (org.joda.time.DateTime)1 CaptureObjectDefinitions (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.CaptureObjectDefinitions)1 GetPowerQualityProfileAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileAsyncResponse)1 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)1