+
+ @Test
+ public void testKeepaliveRpcResponseTimeout() {
+ final var neverResolvedFuture = SettableFuture.create();
+ doReturn(neverResolvedFuture).when(deviceRpc).invokeNetconf(any(), any());
+
+ keepaliveSalFacade.onDeviceConnected(null, null, new RemoteDeviceServices(deviceRpc, null));
+
+ verify(underlyingSalFacade).onDeviceConnected(isNull(), isNull(), any(RemoteDeviceServices.class));
+
+ // Should disconnect the session because RPC result future is never resolved and keepalive delay is 1 sec
+ verify(listener, timeout(115000).times(1)).disconnect();
+ verify(deviceRpc, times(1)).invokeNetconf(any(), any());
+ }