Search in sources :

Example 6 with ActivityCalendar

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());
}
Also used : ActivityCalendar(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActivityCalendar) ActivityCalendarDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ActivityCalendarDto) Test(org.junit.jupiter.api.Test)

Example 7 with ActivityCalendar

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);
}
Also used : ActivityCalendar(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActivityCalendar)

Aggregations

ActivityCalendar (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActivityCalendar)7 Test (org.junit.jupiter.api.Test)5 CosemDateTime (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CosemDateTime)2 SeasonProfile (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SeasonProfile)2 ActivityCalendarDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.ActivityCalendarDto)2 ArrayList (java.util.ArrayList)1 AsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse)1 ActivityCalendarType (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ActivityCalendarType)1 ConfigureDefinableLoadProfileAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ConfigureDefinableLoadProfileAsyncResponse)1 GenerateAndReplaceKeysAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse)1 GetAdministrativeStatusAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse)1 GetConfigurationObjectAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetConfigurationObjectAsyncResponse)1 GetFirmwareVersionAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetFirmwareVersionAsyncResponse)1 GetFirmwareVersionGasAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetFirmwareVersionGasAsyncResponse)1 GetKeysAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysAsyncResponse)1 GetMbusEncryptionKeyStatusAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusAsyncResponse)1 GetMbusEncryptionKeyStatusByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusByChannelAsyncResponse)1 ReplaceKeysAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ReplaceKeysAsyncResponse)1 SetActivityCalendarAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetActivityCalendarAsyncResponse)1 SetAdministrativeStatusAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetAdministrativeStatusAsyncResponse)1