use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetPushSetupSmsAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setPushSetupSms.
@PayloadRoot(localPart = "SetPushSetupSmsRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetPushSetupSmsAsyncResponse setPushSetupSms(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetPushSetupSmsRequest 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.PushSetupSms pushSetupSms = this.configurationMapper.map(request.getSetPushSetupSmsRequestData().getPushSetupSms(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.PushSetupSms.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_PUSH_SETUP_SMS).withMessageType(MessageType.SET_PUSH_SETUP_SMS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, pushSetupSms);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, SetPushSetupSmsAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetPushSetupSmsAsyncResponse in project open-smart-grid-platform by OSGP.
the class SetPushSetupSms method theSetPushSetupSmsRequestIsReceived.
@When("^the set PushSetupSms request is received$")
public void theSetPushSetupSmsRequestIsReceived(final Map<String, String> settings) throws Throwable {
final SetPushSetupSmsRequest setPushSetupSmsRequest = SetPushSetupSmsRequestFactory.fromParameterMap(settings);
final SetPushSetupSmsAsyncResponse setPushSetupSmsAsyncResponse = this.smartMeteringConfigurationClient.setPushSetupSms(setPushSetupSmsRequest);
LOGGER.info("Set push setup sms response is received {}", setPushSetupSmsAsyncResponse);
assertThat(setPushSetupSmsAsyncResponse).as("Set push setup sms response should not be null").isNotNull();
ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setPushSetupSmsAsyncResponse.getCorrelationUid());
ScenarioContext.current().put(PlatformSmartmeteringKeys.HOSTNAME, settings.get(PlatformSmartmeteringKeys.HOSTNAME));
ScenarioContext.current().put(PlatformSmartmeteringKeys.PORT, settings.get(PlatformSmartmeteringKeys.PORT));
}
Aggregations