use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetSpecialDaysAsyncResponse in project open-smart-grid-platform by OSGP.
the class SetSpecialDays method theSetSpecialDaysRequestIsReceived.
@When("^the set special days request is received$")
public void theSetSpecialDaysRequestIsReceived(final Map<String, String> requestData) throws Throwable {
final SetSpecialDaysRequest setSpecialDaysRequest = SetSpecialDaysRequestFactory.fromParameterMap(requestData);
final SetSpecialDaysAsyncResponse setSpecialDaysAsyncResponse = this.smartMeteringConfigurationClient.setSpecialDays(setSpecialDaysRequest);
LOGGER.info("Set special days response is received {}", setSpecialDaysAsyncResponse);
assertThat(setSpecialDaysAsyncResponse).as("Set special days response should not be null").isNotNull();
ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setSpecialDaysAsyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetSpecialDaysAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setSpecialDaysData.
@PayloadRoot(localPart = "SetSpecialDaysRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetSpecialDaysAsyncResponse setSpecialDaysData(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetSpecialDaysRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SpecialDaysRequest dataRequest = this.configurationMapper.map(request, org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SpecialDaysRequest.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_SPECIAL_DAYS).withMessageType(MessageType.SET_SPECIAL_DAYS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, dataRequest);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, SetSpecialDaysAsyncResponse.class);
}
Aggregations