Search in sources :

Example 1 with Status

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

the class StatusMappingTest method properlyMapsLightSensorStatus.

@Test
void properlyMapsLightSensorStatus() {
    final Status domainStatus = new LightSensorStatus(LightSensorStatusType.LIGHT);
    final org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.Status wsStatus = this.adHocManagementMapper.map(domainStatus, org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.Status.class);
    final org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.LightSensorStatus expected = new org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.LightSensorStatus();
    expected.setStatus(org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.LightSensorStatusType.LIGHT);
    assertThat(wsStatus).isInstanceOf(org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.LightSensorStatus.class).usingRecursiveComparison().isEqualTo(expected);
}
Also used : Status(org.opensmartgridplatform.domain.core.valueobjects.Status) DeviceStatus(org.opensmartgridplatform.domain.core.valueobjects.DeviceStatus) LightSensorStatus(org.opensmartgridplatform.domain.core.valueobjects.LightSensorStatus) LightSensorStatus(org.opensmartgridplatform.domain.core.valueobjects.LightSensorStatus) Test(org.junit.jupiter.api.Test)

Example 2 with Status

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

the class StatusMappingTest method properlyMapsDeviceStatusMapped.

@Test
void properlyMapsDeviceStatusMapped() {
    final TariffValue tv1 = new TariffValue();
    tv1.setHigh(true);
    final List<TariffValue> tariffValues = Arrays.asList(tv1);
    final Status domainStatus = new DeviceStatusMapped(tariffValues, LIGHT_VALUES, PREFERRED_LINK_TYPE, ACTUAL_LINK_TYPE, LIGHT_TYPE, EVENT_NOTIFICATIONS_MASK);
    final org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.Status wsStatus = this.adHocManagementMapper.map(domainStatus, org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.Status.class);
    final org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.DeviceStatus expected = expectedDeviceStatus();
    assertThat(wsStatus).isInstanceOf(org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.DeviceStatus.class).usingRecursiveComparison().isEqualTo(expected);
}
Also used : Status(org.opensmartgridplatform.domain.core.valueobjects.Status) DeviceStatus(org.opensmartgridplatform.domain.core.valueobjects.DeviceStatus) LightSensorStatus(org.opensmartgridplatform.domain.core.valueobjects.LightSensorStatus) DeviceStatusMapped(org.opensmartgridplatform.domain.core.valueobjects.DeviceStatusMapped) TariffValue(org.opensmartgridplatform.domain.core.valueobjects.TariffValue) Test(org.junit.jupiter.api.Test)

Example 3 with Status

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

the class StatusMappingTest method properlyMapsDeviceStatus.

@Test
void properlyMapsDeviceStatus() {
    final Status domainStatus = new DeviceStatus(LIGHT_VALUES, PREFERRED_LINK_TYPE, ACTUAL_LINK_TYPE, LIGHT_TYPE, EVENT_NOTIFICATIONS_MASK);
    final org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.Status wsStatus = this.adHocManagementMapper.map(domainStatus, org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.Status.class);
    final org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.DeviceStatus expected = expectedDeviceStatus();
    assertThat(wsStatus).isInstanceOf(org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.DeviceStatus.class).usingRecursiveComparison().isEqualTo(expected);
}
Also used : Status(org.opensmartgridplatform.domain.core.valueobjects.Status) DeviceStatus(org.opensmartgridplatform.domain.core.valueobjects.DeviceStatus) LightSensorStatus(org.opensmartgridplatform.domain.core.valueobjects.LightSensorStatus) DeviceStatus(org.opensmartgridplatform.domain.core.valueobjects.DeviceStatus) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)3 DeviceStatus (org.opensmartgridplatform.domain.core.valueobjects.DeviceStatus)3 LightSensorStatus (org.opensmartgridplatform.domain.core.valueobjects.LightSensorStatus)3 Status (org.opensmartgridplatform.domain.core.valueobjects.Status)3 DeviceStatusMapped (org.opensmartgridplatform.domain.core.valueobjects.DeviceStatusMapped)1 TariffValue (org.opensmartgridplatform.domain.core.valueobjects.TariffValue)1