summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-09-23 07:21:11 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-09-23 07:21:14 +0200
commite7a0775b21c2ea6b7bb8efb63b5384df26e27fbb (patch)
treed007d5f9df01f759d6996d2b1b9b1bd04bb8f35f /v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java
parenta4928d560b31df507472b17ac641c3f242d17b3a (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/vpp/L2FibEntryCustomizerTest.java')
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java
index 1f15788f0..728ba9306 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vpp/L2FibEntryCustomizerTest.java
@@ -25,11 +25,9 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import io.fd.honeycomb.translate.v3po.test.ContextTestUtils;
-import io.fd.honeycomb.translate.v3po.test.TestHelperUtils;
-import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
import io.fd.honeycomb.translate.v3po.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
-import java.util.concurrent.CompletableFuture;
+import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress;
@@ -46,7 +44,6 @@ import org.openvpp.jvpp.VppBaseCallException;
import org.openvpp.jvpp.VppInvocationException;
import org.openvpp.jvpp.core.dto.L2FibAddDel;
import org.openvpp.jvpp.core.dto.L2FibAddDelReply;
-import org.openvpp.jvpp.core.dto.L2InterfaceVlanTagRewriteReply;
public class L2FibEntryCustomizerTest extends WriterCustomizerTest {
private static final String BD_CTX_NAME = "bd-test-instance";
@@ -76,15 +73,11 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest {
}
private void whenL2FibAddDelThenSuccess() {
- final CompletableFuture<L2FibAddDelReply> replyFuture = new CompletableFuture<>();
- final L2FibAddDelReply reply = new L2FibAddDelReply();
- replyFuture.complete(reply);
- doReturn(replyFuture).when(api).l2FibAddDel(any(L2FibAddDel.class));
+ doReturn(future(new L2FibAddDelReply())).when(api).l2FibAddDel(any(L2FibAddDel.class));
}
private void whenL2FibAddDelThenFailure() {
- doReturn(TestHelperUtils.<L2InterfaceVlanTagRewriteReply>createFutureException()).when(api)
- .l2FibAddDel(any(L2FibAddDel.class));
+ doReturn(failedFuture()).when(api).l2FibAddDel(any(L2FibAddDel.class));
}
private L2FibAddDel generateL2FibAddDelRequest(final long mac, final byte isAdd) {