Search in sources :

Example 6 with PushSetupSmsDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.PushSetupSmsDto in project open-smart-grid-platform by OSGP.

the class PushSetupSmsMappingTest method testPushSetupSmsMappingWithEmptyLists.

// To test if a PushSetupAlarm can be mapped if instance variables are
// initialized and lists are empty.
@Test
public void testPushSetupSmsMappingWithEmptyLists() {
    // build test data
    final ArrayList<CosemObjectDefinition> pushObjectList = new ArrayList<>();
    final ArrayList<WindowElement> communicationWindow = new ArrayList<>();
    final PushSetupSms pushSetupSms = new PushSetupSmsBuilder().withEmptyLists(pushObjectList, communicationWindow).build();
    // actual mapping
    final PushSetupSmsDto pushSetupSmsDto = this.configurationMapper.map(pushSetupSms, PushSetupSmsDto.class);
    // check values
    this.checkCosemObisCodeMapping(pushSetupSms.getLogicalName(), pushSetupSmsDto.getLogicalName());
    this.checkSendDestinationAndMethodMapping(pushSetupSms, pushSetupSmsDto);
    this.checkIntegerMapping(pushSetupSms, pushSetupSmsDto);
    assertThat(pushSetupSmsDto.getPushObjectList()).isNotNull();
    assertThat(pushSetupSmsDto.getCommunicationWindow()).isNotNull();
}
Also used : WindowElement(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.WindowElement) PushSetupSms(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.PushSetupSms) ArrayList(java.util.ArrayList) CosemObjectDefinition(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CosemObjectDefinition) PushSetupSmsDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.PushSetupSmsDto) Test(org.junit.jupiter.api.Test)

Aggregations

PushSetupSmsDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.PushSetupSmsDto)6 Test (org.junit.jupiter.api.Test)3 PushSetupSms (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.PushSetupSms)3 CosemObjectDefinition (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CosemObjectDefinition)2 WindowElement (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.WindowElement)2 ArrayList (java.util.ArrayList)1 GetResult (org.openmuc.jdlms.GetResult)1 SmartMeter (org.opensmartgridplatform.domain.core.entities.SmartMeter)1 ClockStatus (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ClockStatus)1 CosemDate (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CosemDate)1 CosemDateTime (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CosemDateTime)1 CosemObisCode (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CosemObisCode)1 CosemTime (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CosemTime)1 CosemObisCodeDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.CosemObisCodeDto)1