Search in sources :

Example 1 with DefinableLoadProfileConfigurationData

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

the class GetPowerQualityProfileDataMappingTest method testDefinableLoadProfileConfiguration.

@Test
public void testDefinableLoadProfileConfiguration() {
    final org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.DefinableLoadProfileConfigurationData wsDefinableLoadProfileConfigurationData = this.newDefinableLoadProfileConfigurationData();
    final DefinableLoadProfileConfigurationData definableLoadProfileConfigurationData = this.configurationMapper.map(wsDefinableLoadProfileConfigurationData, DefinableLoadProfileConfigurationData.class);
    assertThat(definableLoadProfileConfigurationData).as("Result of mapping DefinableLoadProfileConfigurationData must not be null").isNotNull();
    assertThat(definableLoadProfileConfigurationData.hasCaptureObjects()).as("DefinableLoadProfileConfigurationData should have capture objects: " + definableLoadProfileConfigurationData).isTrue();
    this.assertCaptureObjects(definableLoadProfileConfigurationData.getCaptureObjects());
    assertThat(definableLoadProfileConfigurationData.hasCapturePeriod()).as("DefinableLoadProfileConfigurationData should have a capture period: " + definableLoadProfileConfigurationData).isTrue();
    assertThat(definableLoadProfileConfigurationData.getCapturePeriod()).as("DefinableLoadProfileConfigurationData capture period").isEqualTo(CAPTURE_PERIOD);
}
Also used : DefinableLoadProfileConfigurationData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DefinableLoadProfileConfigurationData) Test(org.junit.jupiter.api.Test)

Example 2 with DefinableLoadProfileConfigurationData

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

the class DefinableLoadProfileConfigurationDataMapperTest method testDefinableLoadProfileConfigurationMapping.

@Test
public void testDefinableLoadProfileConfigurationMapping() {
    final DefinableLoadProfileConfigurationData definableLoadProfileConfigurationData = this.newDefinableLoadProfileConfigurationData();
    final DefinableLoadProfileConfigurationDto definableLoadProfileConfigurationDto = this.mapper.map(definableLoadProfileConfigurationData, DefinableLoadProfileConfigurationDto.class);
    assertThat(definableLoadProfileConfigurationDto).withFailMessage("Result of mapping DefinableLoadProfileConfigurationData must not be null").isNotNull();
    assertThat(definableLoadProfileConfigurationDto.hasCaptureObjects()).withFailMessage("DefinableLoadProfileConfigurationDto should have capture objects: " + definableLoadProfileConfigurationDto).isTrue();
    this.assertCaptureObjects(definableLoadProfileConfigurationDto.getCaptureObjects());
    assertThat(definableLoadProfileConfigurationDto.hasCapturePeriod()).withFailMessage("DefinableLoadProfileConfigurationDto should have a capture period: " + definableLoadProfileConfigurationDto).isTrue();
    assertThat(definableLoadProfileConfigurationDto.getCapturePeriod()).withFailMessage("DefinableLoadProfileConfigurationDto capture period").isEqualTo(CAPTURE_PERIOD);
}
Also used : DefinableLoadProfileConfigurationData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DefinableLoadProfileConfigurationData) DefinableLoadProfileConfigurationDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.DefinableLoadProfileConfigurationDto) Test(org.junit.jupiter.api.Test)

Example 3 with DefinableLoadProfileConfigurationData

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

the class GetPowerQualityProfileDataMappingTest method testDefinableLoadProfileConfigurationCapturePeriodOnly.

@Test
public void testDefinableLoadProfileConfigurationCapturePeriodOnly() {
    final org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.DefinableLoadProfileConfigurationData wsDefinableLoadProfileConfigurationData = this.newDefinableLoadProfileConfigurationDataCapturePeriodOnly();
    final DefinableLoadProfileConfigurationData definableLoadProfileConfigurationData = this.configurationMapper.map(wsDefinableLoadProfileConfigurationData, DefinableLoadProfileConfigurationData.class);
    assertThat(definableLoadProfileConfigurationData).as("Result of mapping DefinableLoadProfileConfigurationData must not be null").isNotNull();
    assertThat(definableLoadProfileConfigurationData.hasCaptureObjects()).as("DefinableLoadProfileConfigurationData with capture period only must not contain capture objects: " + definableLoadProfileConfigurationData).isFalse();
    assertThat(definableLoadProfileConfigurationData.hasCapturePeriod()).as("DefinableLoadProfileConfigurationData with capture period only must contain capture period: " + definableLoadProfileConfigurationData).isTrue();
    assertThat(definableLoadProfileConfigurationData.getCapturePeriod()).as("DefinableLoadProfileConfigurationData capture period").isEqualTo(CAPTURE_PERIOD);
}
Also used : DefinableLoadProfileConfigurationData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DefinableLoadProfileConfigurationData) Test(org.junit.jupiter.api.Test)

Example 4 with DefinableLoadProfileConfigurationData

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

the class GetPowerQualityProfileDataMappingTest method testDefinableLoadProfileConfigurationCaptureObjectsOnly.

@Test
public void testDefinableLoadProfileConfigurationCaptureObjectsOnly() {
    final org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.DefinableLoadProfileConfigurationData wsDefinableLoadProfileConfigurationData = this.newDefinableLoadProfileConfigurationDataCaptureObjectsOnly();
    final DefinableLoadProfileConfigurationData definableLoadProfileConfigurationData = this.configurationMapper.map(wsDefinableLoadProfileConfigurationData, DefinableLoadProfileConfigurationData.class);
    assertThat(definableLoadProfileConfigurationData).as("Result of mapping DefinableLoadProfileConfigurationData must not be null").isNotNull();
    assertThat(definableLoadProfileConfigurationData.hasCaptureObjects()).as("DefinableLoadProfileConfigurationData with capture objects only must contain capture objects: " + definableLoadProfileConfigurationData).isTrue();
    this.assertCaptureObjects(definableLoadProfileConfigurationData.getCaptureObjects());
    assertThat(definableLoadProfileConfigurationData.hasCapturePeriod()).as("DefinableLoadProfileConfigurationData with capture objects only must not contain capture period: " + definableLoadProfileConfigurationData).isFalse();
}
Also used : DefinableLoadProfileConfigurationData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DefinableLoadProfileConfigurationData) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)4 DefinableLoadProfileConfigurationData (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DefinableLoadProfileConfigurationData)4 DefinableLoadProfileConfigurationDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.DefinableLoadProfileConfigurationDto)1