Search in sources :

Example 6 with ActionDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionDto in project open-smart-grid-platform by OSGP.

the class BundleServiceTest method assertResult.

private void assertResult(final BundleMessagesRequestDto result) {
    assertThat(result).isNotNull();
    assertThat(result.getActionList()).isNotNull();
    for (final ActionDto actionDto : result.getActionList()) {
        assertThat(actionDto.getRequest()).isNotNull();
        assertThat(actionDto.getResponse()).isNotNull();
    }
}
Also used : ActionDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionDto)

Example 7 with ActionDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionDto in project open-smart-grid-platform by OSGP.

the class BundleServiceTest method testException.

@Test
public void testException() {
    final List<ActionDto> actionDtoList = this.makeActions();
    final BundleMessagesRequestDto dto = new BundleMessagesRequestDto(actionDtoList);
    this.getStub(FindEventsRequestDto.class).failWith(new ProtocolAdapterException("simulate error"));
    final BundleMessagesRequestDto result = this.callExecutors(dto, this.messageMetadata);
    this.assertResult(result);
}
Also used : BundleMessagesRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.BundleMessagesRequestDto) FindEventsRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.FindEventsRequestDto) ActionDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionDto) ProtocolAdapterException(org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ProtocolAdapterException) Test(org.junit.jupiter.api.Test)

Example 8 with ActionDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionDto in project open-smart-grid-platform by OSGP.

the class BundleServiceTest method testHappyFlow.

@Test
public void testHappyFlow() {
    final List<ActionDto> actionDtoList = this.makeActions();
    final BundleMessagesRequestDto dto = new BundleMessagesRequestDto(actionDtoList);
    final BundleMessagesRequestDto result = this.callExecutors(dto, this.messageMetadata);
    this.assertResult(result);
}
Also used : BundleMessagesRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.BundleMessagesRequestDto) ActionDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionDto) Test(org.junit.jupiter.api.Test)

Aggregations

ActionDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionDto)8 BundleMessagesRequestDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.BundleMessagesRequestDto)5 Test (org.junit.jupiter.api.Test)3 ArrayList (java.util.ArrayList)2 FindEventsRequestDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.FindEventsRequestDto)2 ConnectionException (org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ConnectionException)1 ProtocolAdapterException (org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ProtocolAdapterException)1 ClearAlarmRegisterRequestDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.ClearAlarmRegisterRequestDto)1 FaultResponseParameterDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.FaultResponseParameterDto)1 OsgpException (org.opensmartgridplatform.shared.exceptionhandling.OsgpException)1 MessageMetadata (org.opensmartgridplatform.shared.infra.jms.MessageMetadata)1