diff options
Diffstat (limited to 'v3po/v3po2vpp/src/test')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java | 30 | ||||
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java | 14 |
2 files changed, 24 insertions, 20 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java index 133e5ec54..0e0875baf 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java @@ -32,8 +32,8 @@ import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.jvpp.VppBaseCallException; import io.fd.jvpp.VppInvocationException; -import io.fd.jvpp.core.dto.GreAddDelTunnel; -import io.fd.jvpp.core.dto.GreAddDelTunnelReply; +import io.fd.jvpp.core.dto.GreTunnelAddDel; +import io.fd.jvpp.core.dto.GreTunnelAddDelReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceAugmentation; @@ -73,33 +73,33 @@ public class GreCustomizerTest extends WriterCustomizerTest implements AddressTr } private void whenGreAddDelTunnelThenSuccess() { - final GreAddDelTunnelReply reply = new GreAddDelTunnelReply(); + final GreTunnelAddDelReply reply = new GreTunnelAddDelReply(); reply.swIfIndex = IFACE_ID; - doReturn(future(reply)).when(api).greAddDelTunnel(any(GreAddDelTunnel.class)); + doReturn(future(reply)).when(api).greTunnelAddDel(any(GreTunnelAddDel.class)); } private void whenGreAddDelTunnelThenFailure() { - doReturn(failedFuture()).when(api).greAddDelTunnel(any(GreAddDelTunnel.class)); + doReturn(failedFuture()).when(api).greTunnelAddDel(any(GreTunnelAddDel.class)); } - private GreAddDelTunnel verifyGreAddDelTunnelWasInvoked(final Gre gre) throws VppInvocationException { - ArgumentCaptor<GreAddDelTunnel> argumentCaptor = ArgumentCaptor.forClass(GreAddDelTunnel.class); - verify(api).greAddDelTunnel(argumentCaptor.capture()); - final GreAddDelTunnel actual = argumentCaptor.getValue(); - assertEquals(0, actual.isIpv6); - assertArrayEquals(ipAddressToArray(gre.getSrc()), actual.srcAddress); - assertArrayEquals(ipAddressToArray(gre.getDst()), actual.dstAddress); - assertEquals(gre.getOuterFibId().intValue(), actual.outerFibId); + private GreTunnelAddDel verifyGreAddDelTunnelWasInvoked(final Gre gre) throws VppInvocationException { + ArgumentCaptor<GreTunnelAddDel> argumentCaptor = ArgumentCaptor.forClass(GreTunnelAddDel.class); + verify(api).greTunnelAddDel(argumentCaptor.capture()); + final GreTunnelAddDel actual = argumentCaptor.getValue(); + assertEquals(0, actual.tunnel.isIpv6); + assertArrayEquals(ipAddressToArray(gre.getSrc()), actual.tunnel.src.un.getIp4().ip4Address); + assertArrayEquals(ipAddressToArray(gre.getDst()), actual.tunnel.dst.un.getIp4().ip4Address); + assertEquals(gre.getOuterFibId().intValue(), actual.tunnel.outerFibId); return actual; } private void verifyGreAddWasInvoked(final Gre gre) throws VppInvocationException { - final GreAddDelTunnel actual = verifyGreAddDelTunnelWasInvoked(gre); + final GreTunnelAddDel actual = verifyGreAddDelTunnelWasInvoked(gre); assertEquals(ADD_GRE, actual.isAdd); } private void verifyGreDeleteWasInvoked(final Gre gre) throws VppInvocationException { - final GreAddDelTunnel actual = verifyGreAddDelTunnelWasInvoked(gre); + final GreTunnelAddDel actual = verifyGreAddDelTunnelWasInvoked(gre); assertEquals(DEL_GRE, actual.isAdd); } diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java index 0e0775916..33617fbc6 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java @@ -37,12 +37,15 @@ import io.fd.jvpp.core.dto.GreTunnelDetails; import io.fd.jvpp.core.dto.GreTunnelDetailsReplyDump; import io.fd.jvpp.core.dto.GreTunnelDump; import io.fd.jvpp.core.dto.SwInterfaceDetails; +import io.fd.jvpp.core.types.Address; +import io.fd.jvpp.core.types.GreTunnel; import org.junit.Test; import org.mockito.Mock; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentation; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.VppInterfaceStateAugmentationBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.Gre; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190128.interfaces.state._interface.GreBuilder; +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.interfaces.rev140508.InterfacesState; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; @@ -78,11 +81,12 @@ public class GreCustomizerTest extends ReaderCustomizerTest<Gre, GreBuilder> imp final GreTunnelDetailsReplyDump value = new GreTunnelDetailsReplyDump(); final GreTunnelDetails greTunnelDetails = new GreTunnelDetails(); - greTunnelDetails.isIpv6 = 0; - greTunnelDetails.dstAddress = ipv4AddressNoZoneToArray("1.2.3.4"); - greTunnelDetails.srcAddress = ipv4AddressNoZoneToArray("1.2.3.5"); - greTunnelDetails.outerFibId = 55; - greTunnelDetails.swIfIndex = 0; + greTunnelDetails.tunnel = new GreTunnel(); + greTunnelDetails.tunnel.isIpv6 = 0; + greTunnelDetails.tunnel.dst = ipv4AddressToAddress(new Ipv4Address("1.2.3.4")); + greTunnelDetails.tunnel.src = ipv4AddressToAddress(new Ipv4Address("1.2.3.5")); + greTunnelDetails.tunnel.outerFibId = 55; + greTunnelDetails.tunnel.swIfIndex = 0; value.greTunnelDetails = Lists.newArrayList(greTunnelDetails); doReturn(future(value)).when(api).greTunnelDump(any(GreTunnelDump.class)); |