diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-05-23 15:22:24 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-06-02 10:10:21 +0000 |
commit | ffd80be44b795865b42edd60d587a577db54cae3 (patch) | |
tree | 3045587eb1974e91b916e5fb2b7bb479cc0e4808 /v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java | |
parent | f1da426ffcd61fc4b498dfa4192c0cde19b552e2 (diff) |
HONEYCOMB-61: Detect VPP disconnect using keepalives
Change-Id: Ic664dbf452504d0fff97e8c766d735d9c5d95c72
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java index 3d75d09e2..5ac108560 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/vppstate/VppStateTest.java @@ -113,17 +113,16 @@ public class VppStateTest { } private void whenShowVersionThenReturn(int retval, Version version) throws ExecutionException, InterruptedException { - final CompletionStage<ShowVersionReply> replyCS = mock(CompletionStage.class); - final CompletableFuture<ShowVersionReply> replyFuture = mock(CompletableFuture.class); - when(replyCS.toCompletableFuture()).thenReturn(replyFuture); + final CompletableFuture<ShowVersionReply> replyFuture = new CompletableFuture<>(); final ShowVersionReply reply = new ShowVersionReply(); reply.retval = 0; // success reply.buildDate = version.getBuildDate().getBytes(); reply.program = version.getName().getBytes(); reply.version = version.getBranch().getBytes(); reply.buildDirectory = version.getBuildDirectory().getBytes(); - when(replyFuture.get()).thenReturn(reply); - when(api.showVersion(any(ShowVersion.class))).thenReturn(replyCS); + + replyFuture.complete(reply); + when(api.showVersion(any(ShowVersion.class))).thenReturn(replyFuture); } private void whenL2FibTableDumpThenReturn(final List<L2FibTableEntry> entryList) throws ExecutionException, InterruptedException { @@ -305,7 +304,7 @@ public class VppStateTest { @Test(expected = IllegalArgumentException.class) public void testReadBridgeDomainNotExisting() throws Exception { doReturn(Optional.absent()).when(mappingContext).read(getMappingIid("NOT EXISTING", "bd-test-instance")); - + final Optional<? extends DataObject> read = readerRegistry.read(InstanceIdentifier.create(VppState.class).child(BridgeDomains.class).child( BridgeDomain.class, new BridgeDomainKey("NOT EXISTING")), ctx); |