From e7a0775b21c2ea6b7bb8efb63b5384df26e27fbb Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Fri, 23 Sep 2016 07:21:11 +0200 Subject: 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 --- .../v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4NeighbourCustomizerTest.java') 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 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 -- cgit 1.2.3-korg