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/interfacesstate/SubInterfaceCustomizerTest.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java') diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java index ec1baebe2..0d0a2cc83 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java @@ -18,15 +18,16 @@ package io.fd.honeycomb.translate.v3po.interfacesstate; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; import io.fd.honeycomb.translate.v3po.test.ContextTestUtils; -import io.fd.honeycomb.translate.v3po.test.InterfaceTestUtils; -import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest; import io.fd.honeycomb.translate.v3po.util.NamingContext; +import io.fd.honeycomb.vpp.test.read.ListReaderCustomizerTest; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -47,6 +48,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev150527.sub._interface.base.attributes.Tags; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.openvpp.jvpp.core.dto.SwInterfaceDetails; +import org.openvpp.jvpp.core.dto.SwInterfaceDetailsReplyDump; +import org.openvpp.jvpp.core.dto.SwInterfaceDump; public class SubInterfaceCustomizerTest extends ListReaderCustomizerTest { @@ -130,7 +133,10 @@ public class SubInterfaceCustomizerTest extends iface.subId = VLAN_IF_ID; iface.supSwIfIndex = SUPER_IF_INDEX; final List ifaces = Collections.singletonList(iface); - InterfaceTestUtils.whenSwInterfaceDumpThenReturn(api, ifaces); + + final SwInterfaceDetailsReplyDump reply = new SwInterfaceDetailsReplyDump(); + reply.swInterfaceDetails = ifaces; + when(api.swInterfaceDump(any(SwInterfaceDump.class))).thenReturn(future(reply)); final List allIds = getCustomizer().getAllIds(getSubInterfaceId(SUPER_IF_NAME, VLAN_IF_ID), ctx); -- cgit 1.2.3-korg