use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActivityCalendar in project open-smart-grid-platform by OSGP.
the class ActivityCalendarMappingTest method testCompleteMapping.
// Test the mapping of a complete ActivityCalendar object
@Test
public void testCompleteMapping() {
// build test data
final ActivityCalendar activityCalendar = new ActivityCalendarBuilder().withCosemDateTime(this.cosemDateTime).withFilledList().build();
// actual mapping
final ActivityCalendarDto activityCalendarDto = this.configurationMapper.map(activityCalendar, ActivityCalendarDto.class);
// check if mapping succeeded
assertThat(activityCalendarDto).isNotNull();
assertThat(activityCalendarDto.getActivatePassiveCalendarTime()).isNotNull();
assertThat(activityCalendarDto.getSeasonProfileList()).isNotNull();
assertThat(activityCalendarDto.getCalendarName()).isEqualTo(activityCalendar.getCalendarName());
this.checkListMapping(activityCalendar.getSeasonProfileList(), activityCalendarDto.getSeasonProfileList());
this.checkCosemDateTimeMapping(activityCalendar.getActivatePassiveCalendarTime(), activityCalendarDto.getActivatePassiveCalendarTime());
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActivityCalendar in project open-smart-grid-platform by OSGP.
the class SetActivityCalendarRequestMessageProcessor method handleMessage.
@Override
protected void handleMessage(final MessageMetadata deviceMessageMetadata, final Object dataObject) throws FunctionalException {
final ActivityCalendar activityCalendar = (ActivityCalendar) dataObject;
this.configurationService.setActivityCalendar(deviceMessageMetadata, activityCalendar);
}
Aggregations