use of org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataRequest in project open-smart-grid-platform by OSGP.
the class SetDataRequestBuilder method fromParameterMap.
public static SetDataRequest fromParameterMap(final Map<String, String> requestParameters) {
final SetDataRequest setDataRequest = new SetDataRequest();
setDataRequest.setDeviceIdentification(requestParameters.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION));
final List<SetDataSystemIdentifier> systems = new SetDataSystemIdentifierBuilder().withSettings(requestParameters).buildList();
setDataRequest.getSystem().addAll(systems);
return setDataRequest;
}
use of org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataRequest in project open-smart-grid-platform by OSGP.
the class SetDataSteps method aSetDataRequestIsReceived.
@When("^a set data request is received$")
public void aSetDataRequestIsReceived(final Map<String, String> requestParameters) throws Throwable {
final String organizationIdentification = (String) ScenarioContext.current().get(PlatformKeys.KEY_ORGANIZATION_IDENTIFICATION, PlatformDefaults.DEFAULT_ORGANIZATION_IDENTIFICATION);
ScenarioContext.current().put(PlatformKeys.KEY_ORGANIZATION_IDENTIFICATION, organizationIdentification);
final String userName = (String) ScenarioContext.current().get(PlatformKeys.KEY_USER_NAME, PlatformDefaults.DEFAULT_USER_NAME);
ScenarioContext.current().put(PlatformKeys.KEY_USER_NAME, userName);
final SetDataRequest setDataRequest = SetDataRequestBuilder.fromParameterMap(requestParameters);
final SetDataAsyncResponse response = this.client.setDataAsync(setDataRequest);
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, response.getAsyncResponse().getCorrelationUid());
}
Aggregations