use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType in project open-smart-grid-platform by OSGP.
the class AdministrativeStatusTypeMappingTest method testNull.
// check if mapping succeeds if the object is null.
@Test
public void testNull() {
// build test data
final AdministrativeStatusType administrativeStatusType = null;
// actual mapping
final AdministrativeStatusTypeDto administrativeStatusTypeDto = this.configurationMapper.map(administrativeStatusType, AdministrativeStatusTypeDto.class);
// check if value is mapped correctly
assertThat(administrativeStatusTypeDto).isNull();
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType in project open-smart-grid-platform by OSGP.
the class AdministrativeStatusTypeMappingTest method testForValueOn.
// To see if mapping succeeds when a value is set to On.
@Test
public void testForValueOn() {
// build test data
final AdministrativeStatusType administrativeStatusType = AdministrativeStatusType.ON;
// actual mapping
final AdministrativeStatusTypeDto administrativeStatusTypeDto = this.configurationMapper.map(administrativeStatusType, AdministrativeStatusTypeDto.class);
// check if value is mapped correctly
assertThat(administrativeStatusTypeDto).isNotNull();
assertThat(administrativeStatusTypeDto.name()).isEqualTo(administrativeStatusType.name());
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType in project open-smart-grid-platform by OSGP.
the class AdministrativeStatusTypeMappingTest method testForValueUndefined.
// To see if mapping succeeds when a value is set to undefined.
@Test
public void testForValueUndefined() {
// build test data
final AdministrativeStatusType administrativeStatusType = AdministrativeStatusType.UNDEFINED;
// actual mapping
final AdministrativeStatusTypeDto administrativeStatusTypeDto = this.configurationMapper.map(administrativeStatusType, AdministrativeStatusTypeDto.class);
// check if value is mapped correctly
assertThat(administrativeStatusTypeDto).isNotNull();
assertThat(administrativeStatusTypeDto.name()).isEqualTo(administrativeStatusType.name());
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType in project open-smart-grid-platform by OSGP.
the class AdministrativeStatusTypeMappingTest method testForValueOff.
// To see if mapping succeeds when a value is set to Off.
@Test
public void testForValueOff() {
// build test data
final AdministrativeStatusType administrativeStatusType = AdministrativeStatusType.OFF;
// actual mapping
final AdministrativeStatusTypeDto administrativeStatusTypeDto = this.configurationMapper.map(administrativeStatusType, AdministrativeStatusTypeDto.class);
// check if value is mapped correctly
assertThat(administrativeStatusTypeDto).isNotNull();
assertThat(administrativeStatusTypeDto.name()).isEqualTo(administrativeStatusType.name());
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType in project open-smart-grid-platform by OSGP.
the class SetAdministrativeStatusRequestMessageProcessor method handleMessage.
@Override
protected void handleMessage(final MessageMetadata deviceMessageMetadata, final Object dataObject) throws FunctionalException {
final AdministrativeStatusType administrativeStatusType = (AdministrativeStatusType) dataObject;
this.configurationService.setAdministrativeStatus(deviceMessageMetadata, administrativeStatusType);
}
Aggregations