import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import com.google.common.util.concurrent.Futures;
import java.net.InetSocketAddress;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import com.google.common.util.concurrent.Futures;
-
public class KeepaliveSalFacadeTest {
- private static final RemoteDeviceId REMOTE_DEVICE_ID = new RemoteDeviceId("test", new InetSocketAddress("localhost", 22));
+ private static final RemoteDeviceId REMOTE_DEVICE_ID =
+ new RemoteDeviceId("test", new InetSocketAddress("localhost", 22));
@Mock
private RemoteDeviceHandler<NetconfSessionPreferences> underlyingSalFacade;
invocationOnMock.callRealMethod();
return currentKeepalive;
}
- }).when(executorServiceSpy).schedule(Mockito.<Runnable> any(),
- Mockito.anyLong(), Matchers.<TimeUnit> any());
+ }).when(executorServiceSpy).schedule(Mockito.<Runnable>any(),
+ Mockito.anyLong(), Matchers.<TimeUnit>any());
Mockito.when(currentKeepalive.isDone()).thenReturn(true);
}
final DOMRpcResult result = new DefaultDOMRpcResult(Builders.containerBuilder().withNodeIdentifier(
new YangInstanceIdentifier.NodeIdentifier(NetconfMessageTransformUtil.NETCONF_RUNNING_QNAME)).build());
- doReturn(Futures.immediateCheckedFuture(result)).when(deviceRpc).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
+ doReturn(Futures.immediateCheckedFuture(result))
+ .when(deviceRpc).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));
final KeepaliveSalFacade keepaliveSalFacade =
new KeepaliveSalFacade(REMOTE_DEVICE_ID, underlyingSalFacade, executorServiceSpy, 1L, 1L);
proxyRpc = (DOMRpcService) invocationOnMock.getArguments()[2];
return null;
}
- }).when(underlyingSalFacade).onDeviceConnected(any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class));
+ }).when(underlyingSalFacade).onDeviceConnected(
+ any(SchemaContext.class), any(NetconfSessionPreferences.class), any(DOMRpcService.class));
doReturn(Futures.immediateFailedCheckedFuture(new IllegalStateException("illegal-state")))
.when(deviceRpc).invokeRpc(any(SchemaPath.class), any(NormalizedNode.class));