Search in sources :

Example 6 with AlarmType

use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmType in project open-smart-grid-platform by OSGP.

the class AlarmRegisterMappingTest method testWithEmptySet.

/**
 * Test to see if an AlarmRegister object is mapped correctly with an empty Set.
 */
@Test
public void testWithEmptySet() {
    // build test data
    final Set<AlarmType> alarmTypeSet = new TreeSet<>();
    final AlarmRegister original = new AlarmRegister(alarmTypeSet);
    // actual mapping
    final org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.AlarmRegister mapped = this.monitoringMapper.map(original, org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.AlarmRegister.class);
    // check mapping
    assertThat(mapped).isNotNull();
    assertThat(mapped.getAlarmTypes()).isNotNull();
    assertThat(mapped.getAlarmTypes().isEmpty()).isTrue();
}
Also used : TreeSet(java.util.TreeSet) AlarmType(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmType) AlarmRegister(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmRegister) Test(org.junit.jupiter.api.Test)

Aggregations

AlarmType (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmType)6 TreeSet (java.util.TreeSet)5 Test (org.junit.jupiter.api.Test)5 RetrievePushNotificationAlarmResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.RetrievePushNotificationAlarmResponse)3 PushNotificationAlarm (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.PushNotificationAlarm)3 AlarmRegister (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmRegister)2 AlarmNotification (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmNotification)1 AlarmNotifications (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmNotifications)1