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/interfaces/ip/Ipv4NeighbourCustomizerTest.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/interfaces/ip/Ipv4NeighbourCustomizerTest.java')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java index dcde0b43d..745276473 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java @@ -17,21 +17,20 @@ package io.fd.honeycomb.translate.v3po.interfaces.ip; import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.google.common.io.BaseEncoding; import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; -import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest; import io.fd.honeycomb.translate.v3po.util.NamingContext; import io.fd.honeycomb.translate.v3po.util.TranslateUtils; import io.fd.honeycomb.translate.write.WriteFailedException; -import java.util.concurrent.CompletableFuture; +import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; @@ -61,9 +60,7 @@ public class Ipv4NeighbourCustomizerTest extends WriterCustomizerTest { customizer = new Ipv4NeighbourCustomizer(api, new NamingContext("prefix", IFC_CTX_NAME)); requestCaptor = ArgumentCaptor.forClass(IpNeighborAddDel.class); - CompletableFuture<IpNeighborAddDelReply> future = new CompletableFuture<>(); - future.complete(new IpNeighborAddDelReply()); - when(api.ipNeighborAddDel(Mockito.any(IpNeighborAddDel.class))).thenReturn(future); + when(api.ipNeighborAddDel(any())).thenReturn(future(new IpNeighborAddDelReply())); } @Test |