use of org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto in project open-smart-grid-platform by OSGP.
the class DlmsHelper method readSendDestinationAndMethod.
public SendDestinationAndMethodDto readSendDestinationAndMethod(final DataObject resultData, final String description) throws ProtocolAdapterException {
final List<DataObject> sendDestinationAndMethodElements = this.readList(resultData, description);
if (sendDestinationAndMethodElements == null) {
return null;
}
final TransportServiceTypeDto transportService = this.readTransportServiceType(sendDestinationAndMethodElements.get(0), "Transport Service from " + description);
final String destination = this.readString(sendDestinationAndMethodElements.get(1), "Destination from " + description);
final MessageTypeDto message = this.readMessageType(sendDestinationAndMethodElements.get(2), "Message from " + description);
return new SendDestinationAndMethodDto(transportService, destination, message);
}
use of org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto in project open-smart-grid-platform by OSGP.
the class PushSetupSmsMappingTest method checkSendDestinationAndMethodMapping.
// method to test SendDestinationAndMethod mapping
private void checkSendDestinationAndMethodMapping(final PushSetupSms pushSetupSms, final PushSetupSmsDto pushSetupSmsDto) {
final SendDestinationAndMethod sendDestinationAndMethod = pushSetupSms.getSendDestinationAndMethod();
final SendDestinationAndMethodDto sendDestinationAndMethodDto = pushSetupSmsDto.getSendDestinationAndMethod();
// make sure neither is null
assertThat(sendDestinationAndMethod).isNotNull();
assertThat(sendDestinationAndMethodDto).isNotNull();
// make sure all instance variables are equal
assertThat(sendDestinationAndMethodDto.getTransportService().name()).isEqualTo(sendDestinationAndMethod.getTransportService().name());
assertThat(sendDestinationAndMethodDto.getMessage().name()).isEqualTo(sendDestinationAndMethod.getMessage().name());
assertThat(sendDestinationAndMethodDto.getDestination()).isEqualTo(sendDestinationAndMethod.getDestination());
}
use of org.opensmartgridplatform.dto.valueobjects.smartmetering.SendDestinationAndMethodDto in project open-smart-grid-platform by OSGP.
the class PushSetupAlarmMappingTest method checkSendDestinationAndMethodMapping.
// method to test SendDestinationAndMethod mapping
private void checkSendDestinationAndMethodMapping(final PushSetupAlarm pushSetupAlarm, final PushSetupAlarmDto pushSetupAlarmDto) {
final SendDestinationAndMethod sendDestinationAndMethod = pushSetupAlarm.getSendDestinationAndMethod();
final SendDestinationAndMethodDto sendDestinationAndMethodDto = pushSetupAlarmDto.getSendDestinationAndMethod();
// make sure neither is null
assertThat(sendDestinationAndMethod).isNotNull();
assertThat(sendDestinationAndMethodDto).isNotNull();
// make sure all instance variables are equal
assertThat(sendDestinationAndMethodDto.getTransportService().name()).isEqualTo(sendDestinationAndMethod.getTransportService().name());
assertThat(sendDestinationAndMethodDto.getMessage().name()).isEqualTo(sendDestinationAndMethod.getMessage().name());
assertThat(sendDestinationAndMethodDto.getDestination()).isEqualTo(sendDestinationAndMethod.getDestination());
}
Aggregations