PortInUseException interface changed. Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
This commit is contained in:
parent
a693a4ed64
commit
0fc60d82c6
@ -132,9 +132,8 @@ public class DSMRSerialAutoDeviceTest {
|
|||||||
try (InputStream inputStream = new ByteArrayInputStream(new byte[] {})) {
|
try (InputStream inputStream = new ByteArrayInputStream(new byte[] {})) {
|
||||||
when(mockSerialPort.getInputStream()).thenReturn(inputStream);
|
when(mockSerialPort.getInputStream()).thenReturn(inputStream);
|
||||||
// Trigger device to go into error stage with port in use.
|
// Trigger device to go into error stage with port in use.
|
||||||
doAnswer(a -> {
|
doThrow(new PortInUseException(new Exception())).when(mockIdentifier)
|
||||||
throw new PortInUseException();
|
.open(eq(DSMRBindingConstants.DSMR_PORT_NAME), anyInt());
|
||||||
}).when(mockIdentifier).open(eq(DSMRBindingConstants.DSMR_PORT_NAME), anyInt());
|
|
||||||
DSMRSerialAutoDevice device = new DSMRSerialAutoDevice(serialPortManager, DUMMY_PORTNAME, listener,
|
DSMRSerialAutoDevice device = new DSMRSerialAutoDevice(serialPortManager, DUMMY_PORTNAME, listener,
|
||||||
new DSMRTelegramListener(), scheduler, 1);
|
new DSMRTelegramListener(), scheduler, 1);
|
||||||
device.start();
|
device.start();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user