diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-09-23 07:21:11 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-09-23 07:21:14 +0200 |
commit | e7a0775b21c2ea6b7bb8efb63b5384df26e27fbb (patch) | |
tree | d007d5f9df01f759d6996d2b1b9b1bd04bb8f35f /v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java | |
parent | a4928d560b31df507472b17ac641c3f242d17b3a (diff) |
HONEYCOMB-116: utility for stubbing jvpp methods
- introduces FutureProducer (inspired by https://gerrit.fd.io/r/#/c/2650/)
- updates unit tests for v3po and lisp
Change-Id: I56488bb1dcd6fcaf6821a58f99b528677e095662
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java index 8af2683d1..71b7dccf3 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java @@ -23,7 +23,6 @@ import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; import io.fd.honeycomb.vpp.test.read.ReaderCustomizerTest; -import java.util.concurrent.CompletableFuture; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppStateBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.Version; @@ -53,15 +52,13 @@ public class VersionCustomizerTest extends ReaderCustomizerTest<Version, Version @Test public void testReadCurrentAttributes() throws Exception { - final CompletableFuture<ShowVersionReply> replyFuture = new CompletableFuture<>(); final ShowVersionReply reply = new ShowVersionReply(); reply.version = new byte[] {}; reply.program = new byte[] {}; reply.buildDate = new byte[] {}; reply.buildDirectory = new byte[] {}; - replyFuture.complete(reply); - when(api.showVersion(any(ShowVersion.class))).thenReturn(replyFuture); + when(api.showVersion(any(ShowVersion.class))).thenReturn(future(reply)); getCustomizer().readCurrentAttributes(InstanceIdentifier.create(Version.class), new VersionBuilder(), ctx); verify(api).showVersion(any(ShowVersion.class)); } |