use of org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.DlmsMessageListener in project open-smart-grid-platform by OSGP.
the class DlmsConnectionFactoryTest method createAndHandleConnectionThrowsForHls4Device.
@Test
void createAndHandleConnectionThrowsForHls4Device() {
final DlmsDevice device = new DlmsDeviceBuilder().withHls4Active(true).build();
final DlmsMessageListener listener = new InvocationCountingDlmsMessageListener();
assertThatExceptionOfType(FunctionalException.class).isThrownBy(() -> this.factory.createAndHandleConnection(this.messageMetadata, device, listener, this.task));
}
use of org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.DlmsMessageListener 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);
}
Aggregations