Search in sources :

Example 26 with DlmsDeviceBuilder

use of org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDeviceBuilder in project open-smart-grid-platform by OSGP.

the class DlmsConnectionFactoryTest method createsConnectionManagerForLls1Device.

@Test
void createsConnectionManagerForLls1Device() throws Exception {
    final DlmsDevice device = new DlmsDeviceBuilder().withLls1Active(true).build();
    final DlmsMessageListener listener = new InvocationCountingDlmsMessageListener();
    when(this.lls1Connector.connect(this.messageMetadata, device, listener)).thenReturn(this.connection);
    final DlmsConnectionManager expected = this.newConnectionManager(device, listener, this.lls1Connector);
    this.factory.createAndHandleConnection(this.messageMetadata, device, listener, this.task);
    this.assertConnectionManagerForDevice(expected);
}
Also used : DlmsMessageListener(org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.DlmsMessageListener) InvocationCountingDlmsMessageListener(org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.InvocationCountingDlmsMessageListener) InvocationCountingDlmsMessageListener(org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.InvocationCountingDlmsMessageListener) DlmsDevice(org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice) DlmsDeviceBuilder(org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDeviceBuilder) Test(org.junit.jupiter.api.Test)

Example 27 with DlmsDeviceBuilder

use of org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDeviceBuilder in project open-smart-grid-platform by OSGP.

the class BundleMessageProcessorTest method setUp.

@BeforeEach
void setUp() throws OsgpException, JMSException {
    this.dlmsDevice = new DlmsDeviceBuilder().withHls5Active(true).build();
    this.messageMetadata = MessageMetadata.fromMessage(this.message);
    when(this.throttlingClientConfig.clientEnabled()).thenReturn(false);
}
Also used : DlmsDeviceBuilder(org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDeviceBuilder) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 28 with DlmsDeviceBuilder

use of org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDeviceBuilder in project open-smart-grid-platform by OSGP.

the class GetFirmwareFileResponseMessageProcessorTest method setUp.

@BeforeEach
void setUp() {
    this.dlmsDevice = new DlmsDeviceBuilder().withHls5Active(true).build();
    lenient().when(this.throttlingClientConfig.clientEnabled()).thenReturn(false);
}
Also used : DlmsDeviceBuilder(org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDeviceBuilder) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

DlmsDeviceBuilder (org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDeviceBuilder)28 Test (org.junit.jupiter.api.Test)25 DlmsDevice (org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice)24 DlmsMessageListener (org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.DlmsMessageListener)18 InvocationCountingDlmsMessageListener (org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.InvocationCountingDlmsMessageListener)17 MessageMetadata (org.opensmartgridplatform.shared.infra.jms.MessageMetadata)6 ConnectionException (org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ConnectionException)4 BeforeEach (org.junit.jupiter.api.BeforeEach)3 Builder (org.opensmartgridplatform.shared.infra.jms.MessageMetadata.Builder)3 RequestMessage (org.opensmartgridplatform.shared.infra.jms.RequestMessage)3 FunctionalException (org.opensmartgridplatform.shared.exceptionhandling.FunctionalException)2 Consumer (java.util.function.Consumer)1 DataObject (org.openmuc.jdlms.datatypes.DataObject)1 SystemEventDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.SystemEventDto)1