Search in sources :

Example 1 with AdministrativeStatusType

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

Example 2 with AdministrativeStatusType

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

Example 3 with AdministrativeStatusType

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

Example 4 with AdministrativeStatusType

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

Example 5 with AdministrativeStatusType

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

Aggregations

AdministrativeStatusType (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType)8 Test (org.junit.jupiter.api.Test)5 AdministrativeStatusTypeDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.AdministrativeStatusTypeDto)4 ResponseMessage (org.opensmartgridplatform.shared.infra.jms.ResponseMessage)1 ResponseMessageResultType (org.opensmartgridplatform.shared.infra.jms.ResponseMessageResultType)1