diff options
Diffstat (limited to 'lisp/lisp2vpp/src/test')
34 files changed, 334 insertions, 336 deletions
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/AdjacencyCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/AdjacencyCustomizerTest.java index 264fe6ccb..ad65a7604 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/AdjacencyCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/AdjacencyCustomizerTest.java @@ -37,8 +37,8 @@ import io.fd.hc2vpp.lisp.translate.util.EidMetadataProvider; import io.fd.hc2vpp.lisp.util.AdjacencyMappingContextTestHelper; import io.fd.hc2vpp.lisp.util.EidMappingContextHelper; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.LispAdjacenciesGetReply; -import io.fd.vpp.jvpp.core.types.LispAdjacency; +import io.fd.vpp.jvpp.core.dto.OneAdjacenciesGetReply; +import io.fd.vpp.jvpp.core.types.OneAdjacency; import java.util.List; import org.junit.Before; import org.junit.Test; @@ -122,7 +122,7 @@ public class AdjacencyCustomizerTest private void mockApi() { - LispAdjacency adjacencyOne = new LispAdjacency(); + OneAdjacency adjacencyOne = new OneAdjacency(); adjacencyOne.eidType = 0; adjacencyOne.leid = new byte[]{-64, -88, 2, 1}; adjacencyOne.leidPrefixLen = 32; @@ -130,16 +130,16 @@ public class AdjacencyCustomizerTest adjacencyOne.reidPrefixLen = 32; - LispAdjacency adjacencyTwo = new LispAdjacency(); + OneAdjacency adjacencyTwo = new OneAdjacency(); adjacencyTwo.eidType = 0; adjacencyTwo.leid = new byte[]{-64, -88, 2, 2}; adjacencyTwo.leidPrefixLen = 32; adjacencyTwo.reid = new byte[]{-64, -88, 2, 4}; adjacencyTwo.reidPrefixLen = 32; - LispAdjacenciesGetReply reply = new LispAdjacenciesGetReply(); - reply.adjacencies = new LispAdjacency[]{adjacencyOne, adjacencyTwo}; + OneAdjacenciesGetReply reply = new OneAdjacenciesGetReply(); + reply.adjacencies = new OneAdjacency[]{adjacencyOne, adjacencyTwo}; - when(api.lispAdjacenciesGet(any())).thenReturn(future(reply)); + when(api.oneAdjacenciesGet(any())).thenReturn(future(reply)); } }
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/BridgeDomainSubtableCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/BridgeDomainSubtableCustomizerTest.java index d0f9f0023..64ef4e392 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/BridgeDomainSubtableCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/BridgeDomainSubtableCustomizerTest.java @@ -24,10 +24,10 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.hc2vpp.lisp.translate.read.trait.SubtableReaderTestCase; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.vpp.jvpp.VppCallbackException; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.eid.table.grouping.EidTable; @@ -63,7 +63,7 @@ public class BridgeDomainSubtableCustomizerTest BridgeDomainSubtableBuilder builder = new BridgeDomainSubtableBuilder(); customizer.readCurrentAttributes(validId, builder, ctx); - verifyLispEidTableMapDumpCalled(L2); + verifyOneEidTableMapDumpCalled(L2); final BridgeDomainSubtable subtable = builder.build(); assertNotNull(subtable); @@ -77,7 +77,7 @@ public class BridgeDomainSubtableCustomizerTest BridgeDomainSubtableBuilder builder = new BridgeDomainSubtableBuilder(); customizer.readCurrentAttributes(validId, builder, ctx); - verifyLispEidTableMapDumpCalled(L2); + verifyOneEidTableMapDumpCalled(L2); final BridgeDomainSubtable subtable = builder.build(); assertNotNull(subtable); @@ -93,7 +93,7 @@ public class BridgeDomainSubtableCustomizerTest } catch (ReadFailedException e) { assertTrue(e.getCause() instanceof VppCallbackException); assertNull(builder.getBridgeDomainRef()); - verifyLispEidTableMapDumpNotCalled(); + verifyOneEidTableMapDumpNotCalled(); return; } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/InterfaceCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/InterfaceCustomizerTest.java index b3e12e684..e4d2da48b 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/InterfaceCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/InterfaceCustomizerTest.java @@ -20,10 +20,12 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableList; +import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest; +import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.hc2vpp.common.translate.util.NamingContext; -import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest; +import io.fd.vpp.jvpp.core.dto.OneLocatorDetails; +import io.fd.vpp.jvpp.core.dto.OneLocatorDetailsReplyDump; import java.util.List; import org.junit.Before; import org.junit.Test; @@ -36,8 +38,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.locator.sets.grouping.locator.sets.locator.set.InterfaceBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.locator.sets.grouping.locator.sets.locator.set.InterfaceKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import io.fd.vpp.jvpp.core.dto.LispLocatorDetails; -import io.fd.vpp.jvpp.core.dto.LispLocatorDetailsReplyDump; public class InterfaceCustomizerTest extends ListReaderCustomizerTest<Interface, InterfaceKey, InterfaceBuilder> { @@ -60,9 +60,9 @@ public class InterfaceCustomizerTest } private void defineDumpData() { - final LispLocatorDetailsReplyDump dump = new LispLocatorDetailsReplyDump(); + final OneLocatorDetailsReplyDump dump = new OneLocatorDetailsReplyDump(); - final LispLocatorDetails detail1 = new LispLocatorDetails(); + final OneLocatorDetails detail1 = new OneLocatorDetails(); detail1.swIfIndex = 1; detail1.ipAddress = new byte[]{-64, -88, 2, 1}; detail1.isIpv6 = 0; @@ -70,7 +70,7 @@ public class InterfaceCustomizerTest detail1.priority = 1; detail1.weight = 2; - final LispLocatorDetails detail2 = new LispLocatorDetails(); + final OneLocatorDetails detail2 = new OneLocatorDetails(); detail2.swIfIndex = 2; detail2.ipAddress = new byte[]{-64, -88, 2, 2}; detail2.isIpv6 = 0; @@ -78,9 +78,9 @@ public class InterfaceCustomizerTest detail2.priority = 2; detail2.weight = 3; - dump.lispLocatorDetails = ImmutableList.of(detail1, detail2); + dump.oneLocatorDetails = ImmutableList.of(detail1, detail2); - when(api.lispLocatorDump(Mockito.any())).thenReturn(future(dump)); + when(api.oneLocatorDump(Mockito.any())).thenReturn(future(dump)); } private void defineMappings() { diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizerTest.java index 1ae56ac49..dad3323cb 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/ItrRemoteLocatorSetCustomizerTest.java @@ -29,8 +29,8 @@ import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; import io.fd.vpp.jvpp.VppCallbackException; -import io.fd.vpp.jvpp.core.dto.LispGetMapRequestItrRlocs; -import io.fd.vpp.jvpp.core.dto.LispGetMapRequestItrRlocsReply; +import io.fd.vpp.jvpp.core.dto.OneGetMapRequestItrRlocs; +import io.fd.vpp.jvpp.core.dto.OneGetMapRequestItrRlocsReply; import java.nio.charset.StandardCharsets; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -84,7 +84,7 @@ public class ItrRemoteLocatorSetCustomizerTest assertNotNull(builder); assertEquals(EXPECTED_LOCATOR_SET_NAME, builder.getRemoteLocatorSetName()); - verifyLispGetMapRequestItrRlocsInvokedOnce(); + verifyOneGetMapRequestItrRlocsInvokedOnce(); } @Test @@ -104,7 +104,7 @@ public class ItrRemoteLocatorSetCustomizerTest assertNotNull(builder); assertNull(builder.getRemoteLocatorSetName()); - verifyLispGetMapRequestItrRlocsInvokedOnce(); + verifyOneGetMapRequestItrRlocsInvokedOnce(); return; } @@ -123,42 +123,42 @@ public class ItrRemoteLocatorSetCustomizerTest private void doReturnValidDataOnDump() { - LispGetMapRequestItrRlocsReply reply = new LispGetMapRequestItrRlocsReply(); + OneGetMapRequestItrRlocsReply reply = new OneGetMapRequestItrRlocsReply(); reply.locatorSetName = EXPECTED_LOCATOR_SET_NAME.getBytes(StandardCharsets.UTF_8); - when(api.lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class))) + when(api.oneGetMapRequestItrRlocs(any(OneGetMapRequestItrRlocs.class))) .thenReturn(CompletableFuture.completedFuture(reply)); } private void doReturnNullDataOnDump() { - when(api.lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class))) + when(api.oneGetMapRequestItrRlocs(any(OneGetMapRequestItrRlocs.class))) .thenReturn(CompletableFuture.completedFuture(null)); } private void doReturnEmptyDataOnDump() { - when(api.lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class))) - .thenReturn(CompletableFuture.completedFuture(new LispGetMapRequestItrRlocsReply())); + when(api.oneGetMapRequestItrRlocs(any(OneGetMapRequestItrRlocs.class))) + .thenReturn(CompletableFuture.completedFuture(new OneGetMapRequestItrRlocsReply())); } private void doThrowExceptionOnDump() { - when(api.lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class))). - thenReturn(new CompletableFuture<LispGetMapRequestItrRlocsReply>() { + when(api.oneGetMapRequestItrRlocs(any(OneGetMapRequestItrRlocs.class))). + thenReturn(new CompletableFuture<OneGetMapRequestItrRlocsReply>() { @Override - public LispGetMapRequestItrRlocsReply get(final long l, final TimeUnit timeUnit) + public OneGetMapRequestItrRlocsReply get(final long l, final TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException { - throw new ExecutionException(new VppCallbackException("lispGetMapRequestItrRlocs", 1, -2)); + throw new ExecutionException(new VppCallbackException("oneGetMapRequestItrRlocs", 1, -2)); } }); } - private void verifyLispGetMapRequestItrRlocsInvokedOnce() { - verify(api, times(1)).lispGetMapRequestItrRlocs(any(LispGetMapRequestItrRlocs.class)); + private void verifyOneGetMapRequestItrRlocsInvokedOnce() { + verify(api, times(1)).oneGetMapRequestItrRlocs(any(OneGetMapRequestItrRlocs.class)); } private void verifyInvalidDataCase(final ItrRemoteLocatorSetBuilder builder) { assertNotNull(builder); assertNull(builder.getRemoteLocatorSetName()); - verifyLispGetMapRequestItrRlocsInvokedOnce(); + verifyOneGetMapRequestItrRlocsInvokedOnce(); } }
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizerTest.java index e253b324a..3ceccc591 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizerTest.java @@ -34,9 +34,9 @@ import io.fd.honeycomb.test.tools.annotations.InjectablesProcessor; import io.fd.honeycomb.test.tools.annotations.SchemaContextProvider; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetails; -import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetailsReplyDump; -import io.fd.vpp.jvpp.core.dto.ShowLispStatusReply; +import io.fd.vpp.jvpp.core.dto.OneLocatorSetDetails; +import io.fd.vpp.jvpp.core.dto.OneLocatorSetDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.ShowOneStatusReply; import java.nio.charset.StandardCharsets; import java.util.Arrays; import org.junit.Before; @@ -75,10 +75,10 @@ public class LispStateCustomizerTest extends InitializingReaderCustomizerTest<Li @Before public void setUp() { identifier = InstanceIdentifier.create(LispState.class); - final ShowLispStatusReply reply = new ShowLispStatusReply(); + final ShowOneStatusReply reply = new ShowOneStatusReply(); reply.featureStatus = 1; - when(api.showLispStatus(Mockito.any())).thenReturn(future(reply)); + when(api.showOneStatus(Mockito.any())).thenReturn(future(reply)); locatorSetContext = new NamingContext("loc-set", "locator-set-context"); } @@ -103,7 +103,7 @@ public class LispStateCustomizerTest extends InitializingReaderCustomizerTest<Li final InstanceIdentifier<LispState> operationalPath = InstanceIdentifier.create(LispState.class); final InstanceIdentifier<Lisp> configPath = InstanceIdentifier.create(Lisp.class); - when(api.lispLocatorSetDump(any())).thenReturn(future(new LispLocatorSetDetailsReplyDump())); + when(api.oneLocatorSetDump(any())).thenReturn(future(new OneLocatorSetDetailsReplyDump())); invokeInitTest(operationalPath, operational, configPath, config); } @@ -149,17 +149,17 @@ public class LispStateCustomizerTest extends InitializingReaderCustomizerTest<Li } private void mockLocatorSetDump() { - LispLocatorSetDetailsReplyDump replyDump = new LispLocatorSetDetailsReplyDump(); - LispLocatorSetDetails locator1 = new LispLocatorSetDetails(); + OneLocatorSetDetailsReplyDump replyDump = new OneLocatorSetDetailsReplyDump(); + OneLocatorSetDetails locator1 = new OneLocatorSetDetails(); locator1.lsIndex = 0; locator1.lsName = "loc_1".getBytes(StandardCharsets.UTF_8); - LispLocatorSetDetails locator2 = new LispLocatorSetDetails(); + OneLocatorSetDetails locator2 = new OneLocatorSetDetails(); locator2.lsIndex = 1; locator2.lsName = "loc_2".getBytes(StandardCharsets.UTF_8); - replyDump.lispLocatorSetDetails = Arrays.asList(locator1, locator2); + replyDump.oneLocatorSetDetails = Arrays.asList(locator1, locator2); - when(api.lispLocatorSetDump(any())).thenReturn(future(replyDump)); + when(api.oneLocatorSetDump(any())).thenReturn(future(replyDump)); } @Override diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizerTest.java index 43ec43bec..53fbc568b 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocalMappingCustomizerTest.java @@ -30,8 +30,8 @@ import io.fd.hc2vpp.lisp.translate.util.EidTranslator; import io.fd.honeycomb.translate.MappingContext; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.LispEidTableDetails; -import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.OneEidTableDetails; +import io.fd.vpp.jvpp.core.dto.OneEidTableDetailsReplyDump; import java.nio.charset.StandardCharsets; import java.util.List; import org.junit.Test; @@ -89,8 +89,8 @@ public class LocalMappingCustomizerTest extends } private void defineDumpData() { - LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump(); - LispEidTableDetails detail = new LispEidTableDetails(); + OneEidTableDetailsReplyDump replyDump = new OneEidTableDetailsReplyDump(); + OneEidTableDetails detail = new OneEidTableDetails(); detail.action = 0; detail.authoritative = 1; detail.context = 4; @@ -104,13 +104,13 @@ public class LocalMappingCustomizerTest extends detail.key = "abcdefgh".getBytes(StandardCharsets.UTF_8); detail.keyId = 1; - replyDump.lispEidTableDetails = ImmutableList.of(detail); - when(api.lispEidTableDump(any())).thenReturn(future(replyDump)); + replyDump.oneEidTableDetails = ImmutableList.of(detail); + when(api.oneEidTableDump(any())).thenReturn(future(replyDump)); } private void defineDumpDataNoHmacKey() { - LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump(); - LispEidTableDetails detail = new LispEidTableDetails(); + OneEidTableDetailsReplyDump replyDump = new OneEidTableDetailsReplyDump(); + OneEidTableDetails detail = new OneEidTableDetails(); detail.action = 0; detail.authoritative = 1; detail.context = 4; @@ -122,8 +122,8 @@ public class LocalMappingCustomizerTest extends detail.ttl = 7; detail.vni = 12; - replyDump.lispEidTableDetails = ImmutableList.of(detail); - when(api.lispEidTableDump(any())).thenReturn(future(replyDump)); + replyDump.oneEidTableDetails = ImmutableList.of(detail); + when(api.oneEidTableDump(any())).thenReturn(future(replyDump)); } private void defineMappings() { diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizerTest.java index 419173857..8da35d332 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LocatorSetCustomizerTest.java @@ -25,8 +25,8 @@ import com.google.common.collect.ImmutableList; import io.fd.honeycomb.test.tools.HoneycombTestRunner; import io.fd.honeycomb.test.tools.annotations.InjectTestData; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetails; -import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.OneLocatorSetDetails; +import io.fd.vpp.jvpp.core.dto.OneLocatorSetDetailsReplyDump; import java.nio.charset.StandardCharsets; import java.util.List; import org.junit.Before; @@ -70,15 +70,15 @@ public class LocatorSetCustomizerTest } private void defineDumpData() { - LispLocatorSetDetailsReplyDump dump = new LispLocatorSetDetailsReplyDump(); - LispLocatorSetDetails detail = new LispLocatorSetDetails(); + OneLocatorSetDetailsReplyDump dump = new OneLocatorSetDetailsReplyDump(); + OneLocatorSetDetails detail = new OneLocatorSetDetails(); detail.context = 4; detail.lsName = "loc-set".getBytes(StandardCharsets.UTF_8); detail.lsIndex = 1; - dump.lispLocatorSetDetails = ImmutableList.of(detail); + dump.oneLocatorSetDetails = ImmutableList.of(detail); - when(api.lispLocatorSetDump(any())).thenReturn(future(dump)); + when(api.oneLocatorSetDump(any())).thenReturn(future(dump)); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizerTest.java index 1b582cd4d..083ac6345 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRegisterCustomizerTest.java @@ -21,7 +21,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.ShowLispMapRegisterStateReply; +import io.fd.vpp.jvpp.core.dto.ShowOneMapRegisterStateReply; import org.junit.Before; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; @@ -40,9 +40,9 @@ public class MapRegisterCustomizerTest extends LispInitializingReaderCustomizerT @Override @Before public void setUp() throws Exception { - final ShowLispMapRegisterStateReply reply = new ShowLispMapRegisterStateReply(); + final ShowOneMapRegisterStateReply reply = new ShowOneMapRegisterStateReply(); reply.isEnabled = 1; - when(api.showLispMapRegisterState(any())).thenReturn(future(reply)); + when(api.showOneMapRegisterState(any())).thenReturn(future(reply)); mockLispEnabled(); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizerTest.java index 6479f992a..d0e938ab3 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapRequestModeCustomizerTest.java @@ -22,7 +22,7 @@ import static org.mockito.Mockito.when; import static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MapRequestMode.DestinationOnly; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.ShowLispMapRequestModeReply; +import io.fd.vpp.jvpp.core.dto.ShowOneMapRequestModeReply; import org.junit.Before; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; @@ -41,9 +41,9 @@ public class MapRequestModeCustomizerTest extends LispInitializingReaderCustomiz @Override @Before public void setUp() throws Exception { - final ShowLispMapRequestModeReply reply = new ShowLispMapRequestModeReply(); + final ShowOneMapRequestModeReply reply = new ShowOneMapRequestModeReply(); reply.mode = ((byte) DestinationOnly.getIntValue()); - when(api.showLispMapRequestMode(any())).thenReturn(future(reply)); + when(api.showOneMapRequestMode(any())).thenReturn(future(reply)); mockLispEnabled(); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizerTest.java index e4a0d9990..715fb58ea 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapResolverCustomizerTest.java @@ -23,8 +23,8 @@ import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableList; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.LispMapResolverDetails; -import io.fd.vpp.jvpp.core.dto.LispMapResolverDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.OneMapResolverDetails; +import io.fd.vpp.jvpp.core.dto.OneMapResolverDetailsReplyDump; import java.util.List; import org.junit.Before; import org.junit.Test; @@ -84,15 +84,15 @@ public class MapResolverCustomizerTest } private void defineDumpData() { - final LispMapResolverDetailsReplyDump replyDump = new LispMapResolverDetailsReplyDump(); - final LispMapResolverDetails detail = new LispMapResolverDetails(); + final OneMapResolverDetailsReplyDump replyDump = new OneMapResolverDetailsReplyDump(); + final OneMapResolverDetails detail = new OneMapResolverDetails(); detail.context = 5; detail.ipAddress = new byte[]{1, 2, -88, -64}; detail.isIpv6 = 0; - replyDump.lispMapResolverDetails = ImmutableList.of(detail); + replyDump.oneMapResolverDetails = ImmutableList.of(detail); - when(api.lispMapResolverDump(any())).thenReturn(future(replyDump)); + when(api.oneMapResolverDump(any())).thenReturn(future(replyDump)); } @Override diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizerTest.java index ace07e078..49de4d569 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/MapServerCustomizerTest.java @@ -24,9 +24,9 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.LispMapServerDetails; -import io.fd.vpp.jvpp.core.dto.LispMapServerDetailsReplyDump; -import io.fd.vpp.jvpp.core.dto.LispMapServerDump; +import io.fd.vpp.jvpp.core.dto.OneMapServerDetails; +import io.fd.vpp.jvpp.core.dto.OneMapServerDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.OneMapServerDump; import java.util.Arrays; import java.util.List; import org.junit.Before; @@ -60,24 +60,24 @@ public class MapServerCustomizerTest @Override @Before public void setUp() throws Exception { - final LispMapServerDetailsReplyDump reply = new LispMapServerDetailsReplyDump(); - LispMapServerDetails server1 = new LispMapServerDetails(); + final OneMapServerDetailsReplyDump reply = new OneMapServerDetailsReplyDump(); + OneMapServerDetails server1 = new OneMapServerDetails(); //192.168.2.2 server1.ipAddress = new byte[]{-64, -88, 2, 1}; server1.isIpv6 = 0; - LispMapServerDetails server2 = new LispMapServerDetails(); + OneMapServerDetails server2 = new OneMapServerDetails(); //192.168.2.2 server2.ipAddress = new byte[]{-64, -88, 2, 2}; server2.isIpv6 = 0; - LispMapServerDetails server3 = new LispMapServerDetails(); + OneMapServerDetails server3 = new OneMapServerDetails(); //2001:0db8:0a0b:12f0:0000:0000:0000:0001 server3.ipAddress = new byte[]{32, 1, 13, -72, 10, 11, 18, -16, 0, 0, 0, 0, 0, 0, 0, 1}; server3.isIpv6 = 1; - reply.lispMapServerDetails = Arrays.asList(server1, server2, server3); - when(api.lispMapServerDump(any(LispMapServerDump.class))).thenReturn(future(reply)); + reply.oneMapServerDetails = Arrays.asList(server1, server2, server3); + when(api.oneMapServerDump(any(OneMapServerDump.class))).thenReturn(future(reply)); mockLispEnabled(); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizerTest.java index 4052b161f..c3e2c65ef 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PetrCfgCustomizerTest.java @@ -22,7 +22,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.ShowLispUsePetrReply; +import io.fd.vpp.jvpp.core.dto.ShowOneUsePetrReply; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; @@ -40,17 +40,17 @@ public class PetrCfgCustomizerTest extends LispInitializingReaderCustomizerTest } private void mockEnabledReply() { - final ShowLispUsePetrReply reply = new ShowLispUsePetrReply(); + final ShowOneUsePetrReply reply = new ShowOneUsePetrReply(); reply.address = new byte[]{-64, -88, 2, 1}; reply.status = 1; reply.isIp4 = 1; - when(api.showLispUsePetr(any())).thenReturn(future(reply)); + when(api.showOneUsePetr(any())).thenReturn(future(reply)); } private void mockDisabledReply() { - final ShowLispUsePetrReply reply = new ShowLispUsePetrReply(); + final ShowOneUsePetrReply reply = new ShowOneUsePetrReply(); reply.status = 0; - when(api.showLispUsePetr(any())).thenReturn(future(reply)); + when(api.showOneUsePetr(any())).thenReturn(future(reply)); } @Override diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PitrCfgCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PitrCfgCustomizerTest.java index c61c13b49..898b5a8ec 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PitrCfgCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/PitrCfgCustomizerTest.java @@ -22,7 +22,7 @@ import static org.mockito.Matchers.any; import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.ShowLispPitrReply; +import io.fd.vpp.jvpp.core.dto.ShowOnePitrReply; import java.nio.charset.StandardCharsets; import org.junit.Before; import org.junit.Test; @@ -62,11 +62,11 @@ public class PitrCfgCustomizerTest extends LispInitializingReaderCustomizerTest< } private void mockDumpData() { - ShowLispPitrReply replyDump = new ShowLispPitrReply(); + ShowOnePitrReply replyDump = new ShowOnePitrReply(); replyDump.locatorSetName = LOC_SET_NAME_BYTES; replyDump.status = 1; - when(api.showLispPitr(any())).thenReturn(future(replyDump)); + when(api.showOnePitr(any())).thenReturn(future(replyDump)); } @Override diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RemoteMappingCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RemoteMappingCustomizerTest.java index e00ab5095..59caeb03a 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RemoteMappingCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RemoteMappingCustomizerTest.java @@ -29,10 +29,10 @@ import io.fd.hc2vpp.lisp.context.util.EidMappingContext; import io.fd.hc2vpp.lisp.translate.util.EidTranslator; import io.fd.honeycomb.translate.MappingContext; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.LispEidTableDetails; -import io.fd.vpp.jvpp.core.dto.LispEidTableDetailsReplyDump; -import io.fd.vpp.jvpp.core.dto.LispLocatorDetails; -import io.fd.vpp.jvpp.core.dto.LispLocatorDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.OneEidTableDetails; +import io.fd.vpp.jvpp.core.dto.OneEidTableDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.OneLocatorDetails; +import io.fd.vpp.jvpp.core.dto.OneLocatorDetailsReplyDump; import java.util.Collections; import java.util.List; import org.junit.Before; @@ -89,8 +89,8 @@ public class RemoteMappingCustomizerTest private void mockDumpDataActionZero() { - LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump(); - LispEidTableDetails detail = new LispEidTableDetails(); + OneEidTableDetailsReplyDump replyDump = new OneEidTableDetailsReplyDump(); + OneEidTableDetails detail = new OneEidTableDetails(); detail.action = 0; detail.authoritative = 1; detail.context = 4; @@ -101,18 +101,18 @@ public class RemoteMappingCustomizerTest detail.ttl = 7; detail.vni = 12; - replyDump.lispEidTableDetails = ImmutableList.of(detail); + replyDump.oneEidTableDetails = ImmutableList.of(detail); - when(api.lispEidTableDump(any())).thenReturn(future(replyDump)); + when(api.oneEidTableDump(any())).thenReturn(future(replyDump)); - LispLocatorDetailsReplyDump rlocs = new LispLocatorDetailsReplyDump(); - rlocs.lispLocatorDetails = Collections.emptyList(); - when(api.lispLocatorDump(any())).thenReturn(future(rlocs)); + OneLocatorDetailsReplyDump rlocs = new OneLocatorDetailsReplyDump(); + rlocs.oneLocatorDetails = Collections.emptyList(); + when(api.oneLocatorDump(any())).thenReturn(future(rlocs)); } private void mockDumpDataActionOne() { - LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump(); - LispEidTableDetails detail = new LispEidTableDetails(); + OneEidTableDetailsReplyDump replyDump = new OneEidTableDetailsReplyDump(); + OneEidTableDetails detail = new OneEidTableDetails(); detail.action = 1; detail.authoritative = 1; detail.context = 4; @@ -123,14 +123,14 @@ public class RemoteMappingCustomizerTest detail.ttl = 7; detail.vni = 12; - replyDump.lispEidTableDetails = ImmutableList.of(detail); + replyDump.oneEidTableDetails = ImmutableList.of(detail); - when(api.lispEidTableDump(any())).thenReturn(future(replyDump)); + when(api.oneEidTableDump(any())).thenReturn(future(replyDump)); } private void mockDumpDataActionZeroWithRemotes() { - LispEidTableDetailsReplyDump replyDump = new LispEidTableDetailsReplyDump(); - LispEidTableDetails detail = new LispEidTableDetails(); + OneEidTableDetailsReplyDump replyDump = new OneEidTableDetailsReplyDump(); + OneEidTableDetails detail = new OneEidTableDetails(); detail.action = 0; detail.authoritative = 1; detail.context = 4; @@ -141,20 +141,20 @@ public class RemoteMappingCustomizerTest detail.ttl = 7; detail.vni = 12; - replyDump.lispEidTableDetails = ImmutableList.of(detail); + replyDump.oneEidTableDetails = ImmutableList.of(detail); - when(api.lispEidTableDump(any())).thenReturn(future(replyDump)); + when(api.oneEidTableDump(any())).thenReturn(future(replyDump)); - LispLocatorDetailsReplyDump rlocs = new LispLocatorDetailsReplyDump(); - LispLocatorDetails rloc = new LispLocatorDetails(); + OneLocatorDetailsReplyDump rlocs = new OneLocatorDetailsReplyDump(); + OneLocatorDetails rloc = new OneLocatorDetails(); rloc.ipAddress = new byte[]{-64, -88, 2, 1}; rloc.isIpv6 = 0; rloc.priority = 1; rloc.weight = 2; - rlocs.lispLocatorDetails = ImmutableList.of(rloc); + rlocs.oneLocatorDetails = ImmutableList.of(rloc); - when(api.lispLocatorDump(any())).thenReturn(future(rlocs)); + when(api.oneLocatorDump(any())).thenReturn(future(rlocs)); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizerTest.java index 2afe7120f..42adace42 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/RlocProbeCustomizerTest.java @@ -21,7 +21,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; -import io.fd.vpp.jvpp.core.dto.ShowLispRlocProbeStateReply; +import io.fd.vpp.jvpp.core.dto.ShowOneRlocProbeStateReply; import org.junit.Before; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureDataBuilder; @@ -40,9 +40,9 @@ public class RlocProbeCustomizerTest extends LispInitializingReaderCustomizerTes @Override @Before public void setUp() throws Exception { - final ShowLispRlocProbeStateReply reply = new ShowLispRlocProbeStateReply(); + final ShowOneRlocProbeStateReply reply = new ShowOneRlocProbeStateReply(); reply.isEnabled = 1; - when(api.showLispRlocProbeState(any())).thenReturn(future(reply)); + when(api.showOneRlocProbeState(any())).thenReturn(future(reply)); mockLispEnabled(); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizerTest.java index f9610a1aa..0e6ab6b24 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/VniTableCustomizerTest.java @@ -27,8 +27,8 @@ import com.google.common.collect.ImmutableList; import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; import io.fd.vpp.jvpp.VppCallbackException; -import io.fd.vpp.jvpp.core.dto.LispEidTableVniDetails; -import io.fd.vpp.jvpp.core.dto.LispEidTableVniDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.OneEidTableVniDetails; +import io.fd.vpp.jvpp.core.dto.OneEidTableVniDetailsReplyDump; import java.util.List; import java.util.concurrent.CompletableFuture; import org.junit.Before; @@ -57,7 +57,7 @@ public class VniTableCustomizerTest extends LispInitializingListReaderCustomizer @Test public void testReadAllSuccessfull() throws ReadFailedException { - whenLispEidTableVniDumpReturnValid(); + whenOneEidTableVniDumpReturnValid(); final List<VniTableKey> keys = getCustomizer().getAllIds(validId, ctx); assertNotNull(keys); @@ -69,7 +69,7 @@ public class VniTableCustomizerTest extends LispInitializingListReaderCustomizer @Test public void testReadAllFailed() { - whenLispEidTableVniDumpThrowException(); + whenOneEidTableVniDumpThrowException(); try { getCustomizer().getAllIds(validId, ctx); } catch (ReadFailedException e) { @@ -82,7 +82,7 @@ public class VniTableCustomizerTest extends LispInitializingListReaderCustomizer @Test public void testReadAttributes() throws ReadFailedException { - whenLispEidTableVniDumpReturnValid(); + whenOneEidTableVniDumpReturnValid(); VniTableBuilder builder = new VniTableBuilder(); customizer.readCurrentAttributes(validId, builder, ctx); @@ -92,25 +92,25 @@ public class VniTableCustomizerTest extends LispInitializingListReaderCustomizer assertEquals(12L, table.getVirtualNetworkIdentifier().longValue()); } - private void whenLispEidTableVniDumpReturnValid() { + private void whenOneEidTableVniDumpReturnValid() { - LispEidTableVniDetailsReplyDump dump = new LispEidTableVniDetailsReplyDump(); - LispEidTableVniDetails details1 = new LispEidTableVniDetails(); + OneEidTableVniDetailsReplyDump dump = new OneEidTableVniDetailsReplyDump(); + OneEidTableVniDetails details1 = new OneEidTableVniDetails(); details1.vni = 14; - LispEidTableVniDetails details2 = new LispEidTableVniDetails(); + OneEidTableVniDetails details2 = new OneEidTableVniDetails(); details2.vni = 12; - LispEidTableVniDetails details3 = new LispEidTableVniDetails(); + OneEidTableVniDetails details3 = new OneEidTableVniDetails(); details3.vni = 16; - dump.lispEidTableVniDetails = ImmutableList.of(details1, details2, details3); + dump.oneEidTableVniDetails = ImmutableList.of(details1, details2, details3); - when(api.lispEidTableVniDump(Mockito.any())).thenReturn(CompletableFuture.completedFuture(dump)); + when(api.oneEidTableVniDump(Mockito.any())).thenReturn(CompletableFuture.completedFuture(dump)); } - private void whenLispEidTableVniDumpThrowException() { - when(api.lispEidTableVniDump(Mockito.any())) + private void whenOneEidTableVniDumpThrowException() { + when(api.oneEidTableVniDump(Mockito.any())) .thenReturn(failedFuture()); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/VrfSubtableCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/VrfSubtableCustomizerTest.java index 86a9f3db6..813011b57 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/VrfSubtableCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/VrfSubtableCustomizerTest.java @@ -58,7 +58,7 @@ public class VrfSubtableCustomizerTest extends SubtableReaderTestCase<VrfSubtabl VrfSubtableBuilder builder = new VrfSubtableBuilder(); customizer.readCurrentAttributes(validId, builder, ctx); - verifyLispEidTableMapDumpCalled(L3); + verifyOneEidTableMapDumpCalled(L3); final VrfSubtable subtable = builder.build(); assertNotNull(subtable); @@ -71,7 +71,7 @@ public class VrfSubtableCustomizerTest extends SubtableReaderTestCase<VrfSubtabl VrfSubtableBuilder builder = new VrfSubtableBuilder(); customizer.readCurrentAttributes(validId, builder, ctx); - verifyLispEidTableMapDumpCalled(L3); + verifyOneEidTableMapDumpCalled(L3); final VrfSubtable subtable = builder.build(); assertNotNull(subtable); @@ -87,7 +87,7 @@ public class VrfSubtableCustomizerTest extends SubtableReaderTestCase<VrfSubtabl } catch (ReadFailedException e) { assertTrue(e.getCause() instanceof VppCallbackException); assertTrue(builder.getTableId() == null); - verifyLispEidTableMapDumpNotCalled(); + verifyOneEidTableMapDumpNotCalled(); return; } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/trait/SubtableReaderTestCase.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/trait/SubtableReaderTestCase.java index 21ac52257..225b2c39e 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/trait/SubtableReaderTestCase.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/trait/SubtableReaderTestCase.java @@ -23,21 +23,14 @@ 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 static org.mockito.MockitoAnnotations.initMocks; import com.google.common.collect.ImmutableList; import io.fd.hc2vpp.common.test.read.ReaderCustomizerTest; -import io.fd.vpp.jvpp.VppCallbackException; -import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetails; -import io.fd.vpp.jvpp.core.dto.LispEidTableMapDetailsReplyDump; -import io.fd.vpp.jvpp.core.dto.LispEidTableMapDump; +import io.fd.vpp.jvpp.core.dto.OneEidTableMapDetails; +import io.fd.vpp.jvpp.core.dto.OneEidTableMapDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.OneEidTableMapDump; import java.util.Collections; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import javax.annotation.Nonnull; -import org.junit.Before; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.opendaylight.yangtools.concepts.Builder; @@ -51,7 +44,7 @@ public abstract class SubtableReaderTestCase<D extends DataObject, B extends Bui protected final int expectedTableId = 14; @Captor - protected ArgumentCaptor<LispEidTableMapDump> requestCaptor; + protected ArgumentCaptor<OneEidTableMapDump> requestCaptor; public SubtableReaderTestCase(final Class<D> dataObjectClass, final Class<? extends Builder<? extends DataObject>> parentBuilderClass) { @@ -59,39 +52,39 @@ public abstract class SubtableReaderTestCase<D extends DataObject, B extends Bui } protected void doReturnValidNonEmptyDataOnDump() { - LispEidTableMapDetailsReplyDump reply = new LispEidTableMapDetailsReplyDump(); - LispEidTableMapDetails detailFirst = new LispEidTableMapDetails(); + OneEidTableMapDetailsReplyDump reply = new OneEidTableMapDetailsReplyDump(); + OneEidTableMapDetails detailFirst = new OneEidTableMapDetails(); detailFirst.vni = Long.valueOf(expectedVni).intValue(); detailFirst.dpTable = expectedTableId; - LispEidTableMapDetails detailSecond = new LispEidTableMapDetails(); + OneEidTableMapDetails detailSecond = new OneEidTableMapDetails(); detailSecond.vni = 13; detailSecond.dpTable = 15; - reply.lispEidTableMapDetails = ImmutableList.of(detailFirst, detailSecond); + reply.oneEidTableMapDetails = ImmutableList.of(detailFirst, detailSecond); - when(api.lispEidTableMapDump(any(LispEidTableMapDump.class))) + when(api.oneEidTableMapDump(any(OneEidTableMapDump.class))) .thenReturn(future(reply)); } protected void doReturnEmptyDataOnDump() { - LispEidTableMapDetailsReplyDump reply = new LispEidTableMapDetailsReplyDump(); - reply.lispEidTableMapDetails = Collections.emptyList(); - when(api.lispEidTableMapDump(any(LispEidTableMapDump.class))) + OneEidTableMapDetailsReplyDump reply = new OneEidTableMapDetailsReplyDump(); + reply.oneEidTableMapDetails = Collections.emptyList(); + when(api.oneEidTableMapDump(any(OneEidTableMapDump.class))) .thenReturn(future(reply)); } protected void doThrowOnDump() { - when(api.lispEidTableMapDump(any(LispEidTableMapDump.class))) + when(api.oneEidTableMapDump(any(OneEidTableMapDump.class))) .thenReturn(failedFuture()); } - protected void verifyLispEidTableMapDumpCalled(@Nonnull final MapLevel expectedLevel) { - verify(api, times(1)).lispEidTableMapDump(requestCaptor.capture()); + protected void verifyOneEidTableMapDumpCalled(@Nonnull final MapLevel expectedLevel) { + verify(api, times(1)).oneEidTableMapDump(requestCaptor.capture()); assertEquals(expectedLevel.getValue(), requestCaptor.getValue().isL2); } - protected void verifyLispEidTableMapDumpNotCalled() { - verify(api, times(1)).lispEidTableMapDump(any()); + protected void verifyOneEidTableMapDumpNotCalled() { + verify(api, times(1)).oneEidTableMapDump(any()); } } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java index d5a351ca8..4aa9335bc 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java @@ -27,7 +27,7 @@ import io.fd.hc2vpp.common.test.util.FutureProducer; import io.fd.honeycomb.translate.ModificationCache; import io.fd.honeycomb.translate.read.ReadContext; import io.fd.honeycomb.translate.write.WriteContext; -import io.fd.vpp.jvpp.core.dto.ShowLispStatusReply; +import io.fd.vpp.jvpp.core.dto.ShowOneStatusReply; import io.fd.vpp.jvpp.core.future.FutureJVppCore; import org.junit.Before; import org.junit.Test; @@ -79,15 +79,15 @@ public class LispStateCheckServiceImplTest implements FutureProducer { @Test public void testLispEnabledDisabledDump() throws Exception { - when(vppApi.showLispStatus(any())).thenReturn(future(new ShowLispStatusReply())); + when(vppApi.showOneStatus(any())).thenReturn(future(new ShowOneStatusReply())); assertFalse(impl.lispEnabled(readContext)); } @Test public void testLispEnabledEnabledDump() throws Exception { - final ShowLispStatusReply reply = new ShowLispStatusReply(); + final ShowOneStatusReply reply = new ShowOneStatusReply(); reply.featureStatus = 1; - when(vppApi.showLispStatus(any())).thenReturn(future(reply)); + when(vppApi.showOneStatus(any())).thenReturn(future(reply)); assertTrue(impl.lispEnabled(readContext)); } }
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/AdjacencyCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/AdjacencyCustomizerTest.java index 91087a879..bf19ae581 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/AdjacencyCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/AdjacencyCustomizerTest.java @@ -34,8 +34,8 @@ import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; import io.fd.hc2vpp.lisp.context.util.AdjacenciesMappingContext; import io.fd.hc2vpp.lisp.context.util.EidMappingContext; import io.fd.hc2vpp.lisp.util.EidMappingContextHelper; -import io.fd.vpp.jvpp.core.dto.LispAddDelAdjacency; -import io.fd.vpp.jvpp.core.dto.LispAddDelAdjacencyReply; +import io.fd.vpp.jvpp.core.dto.OneAddDelAdjacency; +import io.fd.vpp.jvpp.core.dto.OneAddDelAdjacencyReply; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -67,7 +67,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class AdjacencyCustomizerTest extends WriterCustomizerTest implements EidMappingContextHelper { @Captor - private ArgumentCaptor<LispAddDelAdjacency> requestCaptor; + private ArgumentCaptor<OneAddDelAdjacency> requestCaptor; private EidMappingContext localMappingContext; @@ -126,7 +126,7 @@ public class AdjacencyCustomizerTest extends WriterCustomizerTest implements Eid .setAddressType(Ipv4Afi.class) .setAddress(new Ipv4Builder().setIpv4(ADDRESS_THREE).build()).build()).build(); - when(api.lispAddDelAdjacency(any())).thenReturn(future(new LispAddDelAdjacencyReply())); + when(api.oneAddDelAdjacency(any())).thenReturn(future(new OneAddDelAdjacencyReply())); } @Test @@ -134,7 +134,7 @@ public class AdjacencyCustomizerTest extends WriterCustomizerTest implements Eid try { customizer.writeCurrentAttributes(emptyId, emptyData, writeContext); } catch (NullPointerException e) { - verify(api, times(0)).lispAddDelAdjacency(any()); + verify(api, times(0)).oneAddDelAdjacency(any()); return; } @@ -146,7 +146,7 @@ public class AdjacencyCustomizerTest extends WriterCustomizerTest implements Eid try { customizer.writeCurrentAttributes(emptyId, invalidData, writeContext); } catch (NullPointerException e) { - verify(api, times(0)).lispAddDelAdjacency(any()); + verify(api, times(0)).oneAddDelAdjacency(any()); return; } @@ -159,7 +159,7 @@ public class AdjacencyCustomizerTest extends WriterCustomizerTest implements Eid defineEidMapping(mappingContext, LOCAL_EID_ONE, new MappingId("local-eid-one"), "local-mapping-context"); defineEidMapping(mappingContext, REMOTE_EID_ONE, new MappingId("remote-eid-one"), "remote-mapping-context"); customizer.writeCurrentAttributes(validId, validData, writeContext); - verify(api, times(1)).lispAddDelAdjacency(requestCaptor.capture()); + verify(api, times(1)).oneAddDelAdjacency(requestCaptor.capture()); verifyRequest(requestCaptor.getValue(), 1, new byte[]{-64, -88, 2, 1}, 32, new byte[]{-64, -88, 2, 3}, 32, IPV4.getValue(), 2); verify(adjacenciesMappingContext, times(1)) @@ -173,7 +173,7 @@ public class AdjacencyCustomizerTest extends WriterCustomizerTest implements Eid try { customizer.writeCurrentAttributes(validId, validData, writeContext); } catch (IllegalStateException e) { - verify(api, times(0)).lispAddDelAdjacency(any()); + verify(api, times(0)).oneAddDelAdjacency(any()); return; } @@ -188,7 +188,7 @@ public class AdjacencyCustomizerTest extends WriterCustomizerTest implements Eid try { customizer.writeCurrentAttributes(validId, validData, writeContext); } catch (IllegalStateException e) { - verify(api, times(0)).lispAddDelAdjacency(any()); + verify(api, times(0)).oneAddDelAdjacency(any()); return; } @@ -205,7 +205,7 @@ public class AdjacencyCustomizerTest extends WriterCustomizerTest implements Eid try { customizer.deleteCurrentAttributes(emptyId, emptyData, writeContext); } catch (NullPointerException e) { - verify(api, times(0)).lispAddDelAdjacency(any()); + verify(api, times(0)).oneAddDelAdjacency(any()); return; } @@ -220,13 +220,13 @@ public class AdjacencyCustomizerTest extends WriterCustomizerTest implements Eid @Test public void deleteCurrentAttributes() throws Exception { customizer.deleteCurrentAttributes(validId, validData, writeContext); - verify(api, times(1)).lispAddDelAdjacency(requestCaptor.capture()); + verify(api, times(1)).oneAddDelAdjacency(requestCaptor.capture()); verifyRequest(requestCaptor.getValue(), 0, new byte[]{-64, -88, 2, 1}, 32, new byte[]{-64, -88, 2, 3}, 32, IPV4.getValue(), 2); verify(adjacenciesMappingContext, times(1)).removeForIndex("adj-one", mappingContext); } - private static void verifyRequest(final LispAddDelAdjacency request, final int isAdd, final byte[] leid, + private static void verifyRequest(final OneAddDelAdjacency request, final int isAdd, final byte[] leid, final int leidLen, final byte[] reid, final int reidLen, final int eidType, final int vni) { diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/InterfaceCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/InterfaceCustomizerTest.java index cc76905ea..1fa689f60 100755 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/InterfaceCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/InterfaceCustomizerTest.java @@ -28,8 +28,8 @@ import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispAddDelLocator; -import io.fd.vpp.jvpp.core.dto.LispAddDelLocatorReply; +import io.fd.vpp.jvpp.core.dto.OneAddDelLocator; +import io.fd.vpp.jvpp.core.dto.OneAddDelLocatorReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -46,7 +46,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class InterfaceCustomizerTest extends WriterCustomizerTest implements ByteDataTranslator { @Captor - private ArgumentCaptor<LispAddDelLocator> intfCaptor; + private ArgumentCaptor<OneAddDelLocator> intfCaptor; private InstanceIdentifier<Interface> id; private Interface intf; @@ -72,7 +72,7 @@ public class InterfaceCustomizerTest extends WriterCustomizerTest implements Byt customizer = new InterfaceCustomizer(api, new NamingContext("PREFIX", ifcCtxName)); - when(api.lispAddDelLocator(any(LispAddDelLocator.class))).thenReturn(future(new LispAddDelLocatorReply())); + when(api.oneAddDelLocator(any(OneAddDelLocator.class))).thenReturn(future(new OneAddDelLocatorReply())); } @Test(expected = NullPointerException.class) @@ -102,9 +102,9 @@ public class InterfaceCustomizerTest extends WriterCustomizerTest implements Byt public void testWriteCurrentAttributes() throws WriteFailedException { customizer.writeCurrentAttributes(id, intf, writeContext); - verify(api, times(1)).lispAddDelLocator(intfCaptor.capture()); + verify(api, times(1)).oneAddDelLocator(intfCaptor.capture()); - LispAddDelLocator request = intfCaptor.getValue(); + OneAddDelLocator request = intfCaptor.getValue(); assertNotNull(request); assertEquals(1, request.isAdd); @@ -146,9 +146,9 @@ public class InterfaceCustomizerTest extends WriterCustomizerTest implements Byt public void testDeleteCurrentAttributes() throws WriteFailedException { customizer.deleteCurrentAttributes(id, intf, writeContext); - verify(api, times(1)).lispAddDelLocator(intfCaptor.capture()); + verify(api, times(1)).oneAddDelLocator(intfCaptor.capture()); - LispAddDelLocator request = intfCaptor.getValue(); + OneAddDelLocator request = intfCaptor.getValue(); assertNotNull(request); assertEquals(0, request.isAdd); diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/ItrRemoteLocatorSetCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/ItrRemoteLocatorSetCustomizerTest.java index e11ec4262..7fc691b6e 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/ItrRemoteLocatorSetCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/ItrRemoteLocatorSetCustomizerTest.java @@ -29,8 +29,8 @@ import static org.mockito.MockitoAnnotations.initMocks; import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.vpp.jvpp.VppCallbackException; -import io.fd.vpp.jvpp.core.dto.LispAddDelMapRequestItrRlocs; -import io.fd.vpp.jvpp.core.dto.LispAddDelMapRequestItrRlocsReply; +import io.fd.vpp.jvpp.core.dto.OneAddDelMapRequestItrRlocs; +import io.fd.vpp.jvpp.core.dto.OneAddDelMapRequestItrRlocsReply; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -48,7 +48,7 @@ public class ItrRemoteLocatorSetCustomizerTest extends LispWriterCustomizerTest private static final String VALID_NAME = "loc-set"; @Captor - private ArgumentCaptor<LispAddDelMapRequestItrRlocs> requestCaptor; + private ArgumentCaptor<OneAddDelMapRequestItrRlocs> requestCaptor; private ItrRemoteLocatorSetCustomizer customizer; private InstanceIdentifier<ItrRemoteLocatorSet> validId; @@ -119,25 +119,25 @@ public class ItrRemoteLocatorSetCustomizerTest extends LispWriterCustomizerTest } private void onWriteSuccess() { - when(api.lispAddDelMapRequestItrRlocs(any(LispAddDelMapRequestItrRlocs.class))) - .thenReturn(CompletableFuture.completedFuture(new LispAddDelMapRequestItrRlocsReply())); + when(api.oneAddDelMapRequestItrRlocs(any(OneAddDelMapRequestItrRlocs.class))) + .thenReturn(CompletableFuture.completedFuture(new OneAddDelMapRequestItrRlocsReply())); } private void onWriteThrow() { - when(api.lispAddDelMapRequestItrRlocs(any(LispAddDelMapRequestItrRlocs.class))) - .thenReturn(new CompletableFuture<LispAddDelMapRequestItrRlocsReply>() { + when(api.oneAddDelMapRequestItrRlocs(any(OneAddDelMapRequestItrRlocs.class))) + .thenReturn(new CompletableFuture<OneAddDelMapRequestItrRlocsReply>() { @Override - public LispAddDelMapRequestItrRlocsReply get(final long l, final TimeUnit timeUnit) + public OneAddDelMapRequestItrRlocsReply get(final long l, final TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException { - throw new ExecutionException(new VppCallbackException("lispAddDelMapRequestItrRlocs", 1, -2)); + throw new ExecutionException(new VppCallbackException("oneAddDelMapRequestItrRlocs", 1, -2)); } }); } private void verifyWriteInvoked(final boolean add, final String name) { - verify(api, times(1)).lispAddDelMapRequestItrRlocs(requestCaptor.capture()); + verify(api, times(1)).oneAddDelMapRequestItrRlocs(requestCaptor.capture()); - final LispAddDelMapRequestItrRlocs request = requestCaptor.getValue(); + final OneAddDelMapRequestItrRlocs request = requestCaptor.getValue(); assertNotNull(request); assertEquals(booleanToByte(add), request.isAdd); assertEquals(name, toString(request.locatorSetName)); diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LispCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LispCustomizerTest.java index 733d1cd5b..b04029d0d 100755 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LispCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LispCustomizerTest.java @@ -25,8 +25,8 @@ import static org.mockito.Mockito.when; import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispEnableDisable; -import io.fd.vpp.jvpp.core.dto.LispEnableDisableReply; +import io.fd.vpp.jvpp.core.dto.OneEnableDisable; +import io.fd.vpp.jvpp.core.dto.OneEnableDisableReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.Lisp; @@ -42,7 +42,7 @@ public class LispCustomizerTest extends WriterCustomizerTest { } private void whenlispEnableDisableThenSuccess() { - when(api.lispEnableDisable(any(LispEnableDisable.class))).thenReturn(future(new LispEnableDisableReply())); + when(api.oneEnableDisable(any(OneEnableDisable.class))).thenReturn(future(new OneEnableDisableReply())); } @Test(expected = NullPointerException.class) @@ -57,10 +57,10 @@ public class LispCustomizerTest extends WriterCustomizerTest { whenlispEnableDisableThenSuccess(); customizer.writeCurrentAttributes(null, intf, null); - ArgumentCaptor<LispEnableDisable> mappingCaptor = ArgumentCaptor.forClass(LispEnableDisable.class); - verify(api, times(1)).lispEnableDisable(mappingCaptor.capture()); + ArgumentCaptor<OneEnableDisable> mappingCaptor = ArgumentCaptor.forClass(OneEnableDisable.class); + verify(api, times(1)).oneEnableDisable(mappingCaptor.capture()); - LispEnableDisable request = mappingCaptor.getValue(); + OneEnableDisable request = mappingCaptor.getValue(); assertNotNull(request); assertEquals(1, request.isEn); @@ -78,10 +78,10 @@ public class LispCustomizerTest extends WriterCustomizerTest { whenlispEnableDisableThenSuccess(); customizer.updateCurrentAttributes(null, null, lisp, null); - ArgumentCaptor<LispEnableDisable> lispCaptor = ArgumentCaptor.forClass(LispEnableDisable.class); - verify(api, times(1)).lispEnableDisable(lispCaptor.capture()); + ArgumentCaptor<OneEnableDisable> lispCaptor = ArgumentCaptor.forClass(OneEnableDisable.class); + verify(api, times(1)).oneEnableDisable(lispCaptor.capture()); - LispEnableDisable request = lispCaptor.getValue(); + OneEnableDisable request = lispCaptor.getValue(); assertNotNull(request); assertEquals(1, request.isEn); @@ -99,10 +99,10 @@ public class LispCustomizerTest extends WriterCustomizerTest { whenlispEnableDisableThenSuccess(); customizer.deleteCurrentAttributes(null, lisp, null); - ArgumentCaptor<LispEnableDisable> lispCaptor = ArgumentCaptor.forClass(LispEnableDisable.class); - verify(api, times(1)).lispEnableDisable(lispCaptor.capture()); + ArgumentCaptor<OneEnableDisable> lispCaptor = ArgumentCaptor.forClass(OneEnableDisable.class); + verify(api, times(1)).oneEnableDisable(lispCaptor.capture()); - LispEnableDisable request = lispCaptor.getValue(); + OneEnableDisable request = lispCaptor.getValue(); assertNotNull(request); assertEquals(0, request.isEn); diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizerTest.java index 8855f0564..f945415a1 100755 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocalMappingCustomizerTest.java @@ -31,8 +31,8 @@ import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; import io.fd.hc2vpp.common.translate.util.Ipv4Translator; import io.fd.hc2vpp.lisp.context.util.EidMappingContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispAddDelLocalEid; -import io.fd.vpp.jvpp.core.dto.LispAddDelLocalEidReply; +import io.fd.vpp.jvpp.core.dto.OneAddDelLocalEid; +import io.fd.vpp.jvpp.core.dto.OneAddDelLocalEidReply; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.concurrent.ExecutionException; @@ -65,7 +65,7 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements @Mock private EidMappingContext eidMappingContext; @Captor - private ArgumentCaptor<LispAddDelLocalEid> mappingCaptor; + private ArgumentCaptor<OneAddDelLocalEid> mappingCaptor; private InstanceIdentifier<LocalMapping> id; private LocalMapping mapping; @@ -106,7 +106,7 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements customizer = new LocalMappingCustomizer(api, eidMappingContext); - when(api.lispAddDelLocalEid(any(LispAddDelLocalEid.class))).thenReturn(future(new LispAddDelLocalEidReply())); + when(api.oneAddDelLocalEid(any(OneAddDelLocalEid.class))).thenReturn(future(new OneAddDelLocalEidReply())); } @@ -138,9 +138,9 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements public void testWriteCurrentAttributes() throws WriteFailedException { customizer.writeCurrentAttributes(id, mapping, writeContext); - verify(api, times(1)).lispAddDelLocalEid(mappingCaptor.capture()); + verify(api, times(1)).oneAddDelLocalEid(mappingCaptor.capture()); - LispAddDelLocalEid request = mappingCaptor.getValue(); + OneAddDelLocalEid request = mappingCaptor.getValue(); assertNotNull(request); assertEquals("Locator", new String(request.locatorSetName)); @@ -155,9 +155,9 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements public void testWriteCurrentAttributesWithHmacKey() throws WriteFailedException { customizer.writeCurrentAttributes(id, mappingWithHmacKey, writeContext); - verify(api, times(1)).lispAddDelLocalEid(mappingCaptor.capture()); + verify(api, times(1)).oneAddDelLocalEid(mappingCaptor.capture()); - LispAddDelLocalEid request = mappingCaptor.getValue(); + OneAddDelLocalEid request = mappingCaptor.getValue(); assertNotNull(request); assertEquals("Locator", new String(request.locatorSetName)); @@ -180,9 +180,9 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements when(eidMappingContext.containsEid(any(), eq(mappingContext))).thenReturn(true); customizer.deleteCurrentAttributes(id, mapping, writeContext); - verify(api, times(1)).lispAddDelLocalEid(mappingCaptor.capture()); + verify(api, times(1)).oneAddDelLocalEid(mappingCaptor.capture()); - LispAddDelLocalEid request = mappingCaptor.getValue(); + OneAddDelLocalEid request = mappingCaptor.getValue(); assertNotNull(request); assertEquals("Locator", new String(request.locatorSetName)); @@ -198,9 +198,9 @@ public class LocalMappingCustomizerTest extends WriterCustomizerTest implements when(eidMappingContext.containsEid(any(), eq(mappingContext))).thenReturn(true); customizer.deleteCurrentAttributes(id, mappingWithHmacKey, writeContext); - verify(api, times(1)).lispAddDelLocalEid(mappingCaptor.capture()); + verify(api, times(1)).oneAddDelLocalEid(mappingCaptor.capture()); - LispAddDelLocalEid request = mappingCaptor.getValue(); + OneAddDelLocalEid request = mappingCaptor.getValue(); assertNotNull(request); assertEquals("Locator", new String(request.locatorSetName)); diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java index 50cba9dd5..00c9f3eff 100755 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java @@ -31,10 +31,10 @@ import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispAddDelLocatorSet; -import io.fd.vpp.jvpp.core.dto.LispAddDelLocatorSetReply; -import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetails; -import io.fd.vpp.jvpp.core.dto.LispLocatorSetDetailsReplyDump; +import io.fd.vpp.jvpp.core.dto.OneAddDelLocatorSet; +import io.fd.vpp.jvpp.core.dto.OneAddDelLocatorSetReply; +import io.fd.vpp.jvpp.core.dto.OneLocatorSetDetails; +import io.fd.vpp.jvpp.core.dto.OneLocatorSetDetailsReplyDump; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.concurrent.ExecutionException; @@ -99,22 +99,22 @@ public class LocatorSetCustomizerTest extends LispWriterCustomizerTest { InstanceIdentifier.create(LocatorSets.class).child(LocatorSet.class, new LocatorSetKey("Locator")); - ArgumentCaptor<LispAddDelLocatorSet> locatorSetCaptor = ArgumentCaptor.forClass(LispAddDelLocatorSet.class); + ArgumentCaptor<OneAddDelLocatorSet> locatorSetCaptor = ArgumentCaptor.forClass(OneAddDelLocatorSet.class); - when(api.lispAddDelLocatorSet(any(LispAddDelLocatorSet.class))) - .thenReturn(future(new LispAddDelLocatorSetReply())); + when(api.oneAddDelLocatorSet(any(OneAddDelLocatorSet.class))) + .thenReturn(future(new OneAddDelLocatorSetReply())); when(writeContext.readAfter(validId)).thenReturn(Optional.of(locatorSet)); - final LispLocatorSetDetailsReplyDump reply = new LispLocatorSetDetailsReplyDump(); - LispLocatorSetDetails details = new LispLocatorSetDetails(); + final OneLocatorSetDetailsReplyDump reply = new OneLocatorSetDetailsReplyDump(); + OneLocatorSetDetails details = new OneLocatorSetDetails(); details.lsName = "Locator".getBytes(StandardCharsets.UTF_8); - reply.lispLocatorSetDetails = ImmutableList.of(details); + reply.oneLocatorSetDetails = ImmutableList.of(details); customizer.writeCurrentAttributes(validId, locatorSet, writeContext); - verify(api, times(1)).lispAddDelLocatorSet(locatorSetCaptor.capture()); + verify(api, times(1)).oneAddDelLocatorSet(locatorSetCaptor.capture()); - LispAddDelLocatorSet request = locatorSetCaptor.getValue(); + OneAddDelLocatorSet request = locatorSetCaptor.getValue(); assertNotNull(request); assertEquals("Locator", new String(request.locatorSetName)); @@ -166,16 +166,16 @@ public class LocatorSetCustomizerTest extends LispWriterCustomizerTest { } private void verifySuccessfullDelete(final LocatorSet locatorSet) throws WriteFailedException { - ArgumentCaptor<LispAddDelLocatorSet> locatorSetCaptor = ArgumentCaptor.forClass(LispAddDelLocatorSet.class); + ArgumentCaptor<OneAddDelLocatorSet> locatorSetCaptor = ArgumentCaptor.forClass(OneAddDelLocatorSet.class); - when(api.lispAddDelLocatorSet(any(LispAddDelLocatorSet.class))) - .thenReturn(future(new LispAddDelLocatorSetReply())); + when(api.oneAddDelLocatorSet(any(OneAddDelLocatorSet.class))) + .thenReturn(future(new OneAddDelLocatorSetReply())); customizer.deleteCurrentAttributes(null, locatorSet, writeContext); - verify(api, times(1)).lispAddDelLocatorSet(locatorSetCaptor.capture()); + verify(api, times(1)).oneAddDelLocatorSet(locatorSetCaptor.capture()); - LispAddDelLocatorSet request = locatorSetCaptor.getValue(); + OneAddDelLocatorSet request = locatorSetCaptor.getValue(); assertNotNull(request); assertEquals("Locator", new String(request.locatorSetName)); @@ -187,15 +187,15 @@ public class LocatorSetCustomizerTest extends LispWriterCustomizerTest { when(writeContext.readAfter(EID_TABLE_ID)) .thenReturn(eidTableData()); - ArgumentCaptor<LispAddDelLocatorSet> locatorSetCaptor = ArgumentCaptor.forClass(LispAddDelLocatorSet.class); + ArgumentCaptor<OneAddDelLocatorSet> locatorSetCaptor = ArgumentCaptor.forClass(OneAddDelLocatorSet.class); - when(api.lispAddDelLocatorSet(any(LispAddDelLocatorSet.class))) - .thenReturn(future(new LispAddDelLocatorSetReply())); + when(api.oneAddDelLocatorSet(any(OneAddDelLocatorSet.class))) + .thenReturn(future(new OneAddDelLocatorSetReply())); try { customizer.deleteCurrentAttributes(null, LOCATOR_SET_TO_DELETE, writeContext); } catch (IllegalStateException e) { - verify(api, times(0)).lispAddDelLocatorSet(locatorSetCaptor.capture()); + verify(api, times(0)).oneAddDelLocatorSet(locatorSetCaptor.capture()); return; } fail("testDeleteReferenced should have failed"); diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizerTest.java index 30ab07cb8..f4f3d2fb6 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRegisterCustomizerTest.java @@ -26,8 +26,8 @@ import static org.mockito.Mockito.when; import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispMapRegisterEnableDisable; -import io.fd.vpp.jvpp.core.dto.LispMapRegisterEnableDisableReply; +import io.fd.vpp.jvpp.core.dto.OneMapRegisterEnableDisable; +import io.fd.vpp.jvpp.core.dto.OneMapRegisterEnableDisableReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -43,7 +43,7 @@ public class MapRegisterCustomizerTest extends LispWriterCustomizerTest implemen private MapRegister disabledRegister; @Captor - private ArgumentCaptor<LispMapRegisterEnableDisable> requestCaptor; + private ArgumentCaptor<OneMapRegisterEnableDisable> requestCaptor; private InstanceIdentifier<MapRegister> EMPTY_ID = InstanceIdentifier.create(MapRegister.class); private MapRegister EMPTY_DATA = new MapRegisterBuilder().setEnabled(false).build(); @@ -60,8 +60,8 @@ public class MapRegisterCustomizerTest extends LispWriterCustomizerTest implemen .setEnabled(false) .build(); - when(api.lispMapRegisterEnableDisable(any(LispMapRegisterEnableDisable.class))) - .thenReturn(future(new LispMapRegisterEnableDisableReply())); + when(api.oneMapRegisterEnableDisable(any(OneMapRegisterEnableDisable.class))) + .thenReturn(future(new OneMapRegisterEnableDisableReply())); } @Test @@ -125,9 +125,9 @@ public class MapRegisterCustomizerTest extends LispWriterCustomizerTest implemen } private void verifyRequest(final boolean enabled) { - verify(api, times(1)).lispMapRegisterEnableDisable(requestCaptor.capture()); + verify(api, times(1)).oneMapRegisterEnableDisable(requestCaptor.capture()); - final LispMapRegisterEnableDisable request = requestCaptor.getValue(); + final OneMapRegisterEnableDisable request = requestCaptor.getValue(); assertEquals(booleanToByte(enabled), request.isEnabled); } }
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizerTest.java index 66384a495..c43960e20 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapRequestModeCustomizerTest.java @@ -27,8 +27,8 @@ import static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.l import static org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MapRequestMode.SourceDestination; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispMapRequestMode; -import io.fd.vpp.jvpp.core.dto.LispMapRequestModeReply; +import io.fd.vpp.jvpp.core.dto.OneMapRequestMode; +import io.fd.vpp.jvpp.core.dto.OneMapRequestModeReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -44,7 +44,7 @@ public class MapRequestModeCustomizerTest extends LispWriterCustomizerTest { private MapRequestMode destinationOnlyMode; @Captor - private ArgumentCaptor<LispMapRequestMode> requestCaptor; + private ArgumentCaptor<OneMapRequestMode> requestCaptor; private InstanceIdentifier<MapRequestMode> EMPTY_ID = InstanceIdentifier.create(MapRequestMode.class); private MapRequestMode EMPTY_DATA = new MapRequestModeBuilder().build(); @@ -57,7 +57,7 @@ public class MapRequestModeCustomizerTest extends LispWriterCustomizerTest { destinationOnlyMode = new MapRequestModeBuilder() .setMode(DestinationOnly) .build(); - when(api.lispMapRequestMode(any(LispMapRequestMode.class))).thenReturn(future(new LispMapRequestModeReply())); + when(api.oneMapRequestMode(any(OneMapRequestMode.class))).thenReturn(future(new OneMapRequestModeReply())); } @Test @@ -103,9 +103,9 @@ public class MapRequestModeCustomizerTest extends LispWriterCustomizerTest { private void verifyModeRequest( final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.MapRequestMode mode) { - verify(api, times(1)).lispMapRequestMode(requestCaptor.capture()); + verify(api, times(1)).oneMapRequestMode(requestCaptor.capture()); - final LispMapRequestMode request = requestCaptor.getValue(); + final OneMapRequestMode request = requestCaptor.getValue(); assertEquals(mode.getIntValue(), request.mode); } }
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapResolverCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapResolverCustomizerTest.java index 76017a439..bc7703b20 100755 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapResolverCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapResolverCustomizerTest.java @@ -26,8 +26,8 @@ import static org.mockito.Mockito.when; import io.fd.hc2vpp.common.translate.util.Ipv4Translator; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispAddDelMapResolver; -import io.fd.vpp.jvpp.core.dto.LispAddDelMapResolverReply; +import io.fd.vpp.jvpp.core.dto.OneAddDelMapResolver; +import io.fd.vpp.jvpp.core.dto.OneAddDelMapResolverReply; import java.util.concurrent.ExecutionException; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -49,9 +49,9 @@ public class MapResolverCustomizerTest extends LispWriterCustomizerTest implemen customizer = new MapResolverCustomizer(api, lispStateCheckService); } - private void whenLispAddDelMapResolverThenSuccess() { - when(api.lispAddDelMapResolver(any(LispAddDelMapResolver.class))) - .thenReturn(future(new LispAddDelMapResolverReply())); + private void whenOneAddDelMapResolverThenSuccess() { + when(api.oneAddDelMapResolver(any(OneAddDelMapResolver.class))) + .thenReturn(future(new OneAddDelMapResolverReply())); } @Test(expected = NullPointerException.class) @@ -69,14 +69,14 @@ public class MapResolverCustomizerTest extends LispWriterCustomizerTest implemen Ipv4Address address = new Ipv4Address("192.168.2.1"); MapResolver resolver = new MapResolverBuilder().setIpAddress(new IpAddress(address)).build(); - whenLispAddDelMapResolverThenSuccess(); + whenOneAddDelMapResolverThenSuccess(); customizer.writeCurrentAttributes(null, resolver, null); - ArgumentCaptor<LispAddDelMapResolver> resolverCaptor = ArgumentCaptor.forClass(LispAddDelMapResolver.class); - verify(api, times(1)).lispAddDelMapResolver(resolverCaptor.capture()); + ArgumentCaptor<OneAddDelMapResolver> resolverCaptor = ArgumentCaptor.forClass(OneAddDelMapResolver.class); + verify(api, times(1)).oneAddDelMapResolver(resolverCaptor.capture()); - LispAddDelMapResolver request = resolverCaptor.getValue(); + OneAddDelMapResolver request = resolverCaptor.getValue(); assertEquals(1, request.isAdd); assertEquals("192.168.2.1", arrayToIpv4AddressNoZone(request.ipAddress).getValue()); } @@ -92,14 +92,14 @@ public class MapResolverCustomizerTest extends LispWriterCustomizerTest implemen Ipv4Address address = new Ipv4Address("192.168.2.1"); MapResolver resolver = new MapResolverBuilder().setIpAddress(new IpAddress(address)).build(); - whenLispAddDelMapResolverThenSuccess(); + whenOneAddDelMapResolverThenSuccess(); customizer.deleteCurrentAttributes(null, resolver, null); - ArgumentCaptor<LispAddDelMapResolver> resolverCaptor = ArgumentCaptor.forClass(LispAddDelMapResolver.class); - verify(api, times(1)).lispAddDelMapResolver(resolverCaptor.capture()); + ArgumentCaptor<OneAddDelMapResolver> resolverCaptor = ArgumentCaptor.forClass(OneAddDelMapResolver.class); + verify(api, times(1)).oneAddDelMapResolver(resolverCaptor.capture()); - LispAddDelMapResolver request = resolverCaptor.getValue(); + OneAddDelMapResolver request = resolverCaptor.getValue(); assertEquals(0, request.isAdd); assertEquals("192.168.2.1", arrayToIpv4AddressNoZone(request.ipAddress).getValue()); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizerTest.java index a13905847..14ff2c58c 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizerTest.java @@ -27,8 +27,8 @@ import static org.mockito.Mockito.when; import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispAddDelMapServer; -import io.fd.vpp.jvpp.core.dto.LispAddDelMapServerReply; +import io.fd.vpp.jvpp.core.dto.OneAddDelMapServer; +import io.fd.vpp.jvpp.core.dto.OneAddDelMapServerReply; import java.util.Arrays; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -54,7 +54,7 @@ public class MapServerCustomizerTest extends LispWriterCustomizerTest implements private MapServer EMPTY_DATA = new MapServerBuilder().build(); @Captor - private ArgumentCaptor<LispAddDelMapServer> requestCaptor; + private ArgumentCaptor<OneAddDelMapServer> requestCaptor; @Override protected void setUpTest() throws Exception { @@ -62,7 +62,7 @@ public class MapServerCustomizerTest extends LispWriterCustomizerTest implements data = new MapServerBuilder() .setIpAddress(MAP_SERVER_KEY.getIpAddress()) .build(); - when(api.lispAddDelMapServer(any())).thenReturn(future(new LispAddDelMapServerReply())); + when(api.oneAddDelMapServer(any())).thenReturn(future(new OneAddDelMapServerReply())); } @Test @@ -79,7 +79,7 @@ public class MapServerCustomizerTest extends LispWriterCustomizerTest implements } catch (WriteFailedException e) { assertTrue(e instanceof WriteFailedException.UpdateFailedException); assertTrue(e.getCause() instanceof UnsupportedOperationException); - verify(api, times(0)).lispAddDelMapServer(any()); + verify(api, times(0)).oneAddDelMapServer(any()); } } @@ -114,9 +114,9 @@ public class MapServerCustomizerTest extends LispWriterCustomizerTest implements } private void verifyRequest(final boolean add) { - verify(api, times(1)).lispAddDelMapServer(requestCaptor.capture()); + verify(api, times(1)).oneAddDelMapServer(requestCaptor.capture()); - final LispAddDelMapServer request = requestCaptor.getValue(); + final OneAddDelMapServer request = requestCaptor.getValue(); assertEquals(booleanToByte(add), request.isAdd); assertEquals(0, request.isIpv6); diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizerTest.java index 40660a727..f46d79547 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PetrCfgCustomizerTest.java @@ -27,8 +27,8 @@ import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispUsePetr; -import io.fd.vpp.jvpp.core.dto.LispUsePetrReply; +import io.fd.vpp.jvpp.core.dto.OneUsePetr; +import io.fd.vpp.jvpp.core.dto.OneUsePetrReply; import java.util.Arrays; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -48,7 +48,7 @@ public class PetrCfgCustomizerTest extends LispWriterCustomizerTest { private PetrCfg disabledCfg; @Captor - private ArgumentCaptor<LispUsePetr> requestCaptor; + private ArgumentCaptor<OneUsePetr> requestCaptor; private InstanceIdentifier<PetrCfg> EMPTY_ID = InstanceIdentifier.create(PetrCfg.class); private PetrCfg EMPTY_DATA = new PetrCfgBuilder().build(); @@ -57,7 +57,7 @@ public class PetrCfgCustomizerTest extends LispWriterCustomizerTest { customizer = new PetrCfgCustomizer(api, lispStateCheckService); enabledCfg = new PetrCfgBuilder().setPetrAddress(new IpAddress(new Ipv4Address("192.168.2.1"))).build(); disabledCfg = new PetrCfgBuilder().build(); - when(api.lispUsePetr(any(LispUsePetr.class))).thenReturn(future(new LispUsePetrReply())); + when(api.oneUsePetr(any(OneUsePetr.class))).thenReturn(future(new OneUsePetrReply())); } @Test @@ -121,18 +121,18 @@ public class PetrCfgCustomizerTest extends LispWriterCustomizerTest { } private void verifyEnabledInvoked() { - verify(api, times(1)).lispUsePetr(requestCaptor.capture()); + verify(api, times(1)).oneUsePetr(requestCaptor.capture()); - final LispUsePetr cfg = requestCaptor.getValue(); + final OneUsePetr cfg = requestCaptor.getValue(); assertEquals(1, cfg.isIp4); assertTrue(Arrays.equals(new byte[]{-64, -88, 2, 1}, cfg.address)); assertEquals(1, cfg.isAdd); } private void verifyDisabledInvoked() { - verify(api, times(1)).lispUsePetr(requestCaptor.capture()); + verify(api, times(1)).oneUsePetr(requestCaptor.capture()); - final LispUsePetr cfg = requestCaptor.getValue(); + final OneUsePetr cfg = requestCaptor.getValue(); assertNull(cfg.address); assertEquals(0, cfg.isAdd); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PitrCfgCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PitrCfgCustomizerTest.java index ae1b145da..520b5ee72 100755 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PitrCfgCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/PitrCfgCustomizerTest.java @@ -26,8 +26,8 @@ import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispPitrSetLocatorSet; -import io.fd.vpp.jvpp.core.dto.LispPitrSetLocatorSetReply; +import io.fd.vpp.jvpp.core.dto.OnePitrSetLocatorSet; +import io.fd.vpp.jvpp.core.dto.OnePitrSetLocatorSetReply; import java.util.concurrent.ExecutionException; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -48,7 +48,7 @@ public class PitrCfgCustomizerTest extends LispWriterCustomizerTest { } private void whenLispPitrSetLocatorSetThenSuccess() { - when(api.lispPitrSetLocatorSet(any(LispPitrSetLocatorSet.class))).thenReturn(future(new LispPitrSetLocatorSetReply())); + when(api.onePitrSetLocatorSet(any(OnePitrSetLocatorSet.class))).thenReturn(future(new OnePitrSetLocatorSetReply())); } @Test(expected = NullPointerException.class) @@ -68,10 +68,10 @@ public class PitrCfgCustomizerTest extends LispWriterCustomizerTest { whenLispPitrSetLocatorSetThenSuccess(); customizer.writeCurrentAttributes(null, cfg, null); - ArgumentCaptor<LispPitrSetLocatorSet> cfgCaptor = ArgumentCaptor.forClass(LispPitrSetLocatorSet.class); - verify(api, times(1)).lispPitrSetLocatorSet(cfgCaptor.capture()); + ArgumentCaptor<OnePitrSetLocatorSet> cfgCaptor = ArgumentCaptor.forClass(OnePitrSetLocatorSet.class); + verify(api, times(1)).onePitrSetLocatorSet(cfgCaptor.capture()); - LispPitrSetLocatorSet request = cfgCaptor.getValue(); + OnePitrSetLocatorSet request = cfgCaptor.getValue(); assertEquals(1, request.isAdd); assertEquals("Locator", new String(request.lsName)); } @@ -84,10 +84,10 @@ public class PitrCfgCustomizerTest extends LispWriterCustomizerTest { customizer.writeCurrentAttributes(null, cfg, null); - ArgumentCaptor<LispPitrSetLocatorSet> cfgCaptor = ArgumentCaptor.forClass(LispPitrSetLocatorSet.class); - verify(api, times(1)).lispPitrSetLocatorSet(cfgCaptor.capture()); + ArgumentCaptor<OnePitrSetLocatorSet> cfgCaptor = ArgumentCaptor.forClass(OnePitrSetLocatorSet.class); + verify(api, times(1)).onePitrSetLocatorSet(cfgCaptor.capture()); - LispPitrSetLocatorSet request = cfgCaptor.getValue(); + OnePitrSetLocatorSet request = cfgCaptor.getValue(); assertEquals(1, request.isAdd); assertEquals("Locator", new String(request.lsName)); } @@ -110,10 +110,10 @@ public class PitrCfgCustomizerTest extends LispWriterCustomizerTest { customizer.deleteCurrentAttributes(null, cfg, null); - ArgumentCaptor<LispPitrSetLocatorSet> cfgCaptor = ArgumentCaptor.forClass(LispPitrSetLocatorSet.class); - verify(api, times(1)).lispPitrSetLocatorSet(cfgCaptor.capture()); + ArgumentCaptor<OnePitrSetLocatorSet> cfgCaptor = ArgumentCaptor.forClass(OnePitrSetLocatorSet.class); + verify(api, times(1)).onePitrSetLocatorSet(cfgCaptor.capture()); - LispPitrSetLocatorSet request = cfgCaptor.getValue(); + OnePitrSetLocatorSet request = cfgCaptor.getValue(); assertEquals(0, request.isAdd); assertEquals("Locator", new String(request.lsName)); } diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RemoteMappingCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RemoteMappingCustomizerTest.java index 5130881ed..35cc87689 100755 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RemoteMappingCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RemoteMappingCustomizerTest.java @@ -16,13 +16,28 @@ package io.fd.hc2vpp.lisp.translate.write; +import static org.hamcrest.Matchers.hasSize; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; import io.fd.hc2vpp.common.translate.util.Ipv4Translator; import io.fd.hc2vpp.lisp.context.util.EidMappingContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispAddDelRemoteMapping; -import io.fd.vpp.jvpp.core.dto.LispAddDelRemoteMappingReply; -import io.fd.vpp.jvpp.core.types.RemoteLocator; +import io.fd.vpp.jvpp.core.dto.OneAddDelRemoteMapping; +import io.fd.vpp.jvpp.core.dto.OneAddDelRemoteMappingReply; +import io.fd.vpp.jvpp.core.types.OneRemoteLocator; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -52,20 +67,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170315.lisp.feature.data.grouping.LispFeatureData; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -import static org.hamcrest.Matchers.hasSize; -import static org.junit.Assert.*; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.*; - public class RemoteMappingCustomizerTest extends WriterCustomizerTest implements Ipv4Translator { @Captor - private ArgumentCaptor<LispAddDelRemoteMapping> mappingCaptor; + private ArgumentCaptor<OneAddDelRemoteMapping> mappingCaptor; private MappingId mappingId; private RemoteMappingCustomizer customizer; @@ -130,24 +135,24 @@ public class RemoteMappingCustomizerTest extends WriterCustomizerTest implements customizer = new RemoteMappingCustomizer(api, remoteMappingContext); - when(api.lispAddDelRemoteMapping(any())).thenReturn(future(new LispAddDelRemoteMappingReply())); + when(api.oneAddDelRemoteMapping(any())).thenReturn(future(new OneAddDelRemoteMappingReply())); } @Test public void testWritePositiveMappingNoPrioNoWeight() throws WriteFailedException { customizer.writeCurrentAttributes(id, positiveMappingNoPrioNoWeight, writeContext); - verify(api, times(1)).lispAddDelRemoteMapping(mappingCaptor.capture()); + verify(api, times(1)).oneAddDelRemoteMapping(mappingCaptor.capture()); - final LispAddDelRemoteMapping request = mappingCaptor.getValue(); + final OneAddDelRemoteMapping request = mappingCaptor.getValue(); assertNotNull(request); assertEquals(1, request.isAdd); assertEquals("192.168.2.1", arrayToIpv4AddressNoZone(request.eid).getValue()); assertEquals(25, request.vni); - final List<RemoteLocator> remoteLocators = Arrays.stream(request.rlocs).collect(Collectors.toList()); - assertThat(remoteLocators, hasSize(1)); + final List<OneRemoteLocator> oneRemoteLocators = Arrays.stream(request.rlocs).collect(Collectors.toList()); + assertThat(oneRemoteLocators, hasSize(1)); - final RemoteLocator locator = remoteLocators.get(0); + final OneRemoteLocator locator = oneRemoteLocators.get(0); assertArrayEquals(new byte[]{-64, -88, 2, 2}, locator.addr); assertEquals(1, locator.isIp4); assertEquals(0, locator.priority); @@ -157,18 +162,18 @@ public class RemoteMappingCustomizerTest extends WriterCustomizerTest implements @Test public void testWritePositiveMappingPrioWeight() throws WriteFailedException { customizer.writeCurrentAttributes(id, positiveMappingPrioWeight, writeContext); - verify(api, times(1)).lispAddDelRemoteMapping(mappingCaptor.capture()); + verify(api, times(1)).oneAddDelRemoteMapping(mappingCaptor.capture()); - final LispAddDelRemoteMapping request = mappingCaptor.getValue(); + final OneAddDelRemoteMapping request = mappingCaptor.getValue(); assertNotNull(request); assertEquals(1, request.isAdd); assertEquals("192.168.2.1", arrayToIpv4AddressNoZone(request.eid).getValue()); assertEquals(25, request.vni); - final List<RemoteLocator> remoteLocators = Arrays.stream(request.rlocs).collect(Collectors.toList()); - assertThat(remoteLocators, hasSize(1)); + final List<OneRemoteLocator> oneRemoteLocators = Arrays.stream(request.rlocs).collect(Collectors.toList()); + assertThat(oneRemoteLocators, hasSize(1)); - final RemoteLocator locator = remoteLocators.get(0); + final OneRemoteLocator locator = oneRemoteLocators.get(0); assertArrayEquals(new byte[]{-64, -88, 2, 3}, locator.addr); assertEquals(1, locator.isIp4); assertEquals(2, locator.priority); @@ -189,9 +194,9 @@ public class RemoteMappingCustomizerTest extends WriterCustomizerTest implements public void testWriteCurrentAttributes() throws WriteFailedException { customizer.writeCurrentAttributes(id, negativeMapping, writeContext); - verify(api, times(1)).lispAddDelRemoteMapping(mappingCaptor.capture()); + verify(api, times(1)).oneAddDelRemoteMapping(mappingCaptor.capture()); - LispAddDelRemoteMapping request = mappingCaptor.getValue(); + OneAddDelRemoteMapping request = mappingCaptor.getValue(); assertNotNull(request); assertEquals(1, request.isAdd); @@ -214,9 +219,9 @@ public class RemoteMappingCustomizerTest extends WriterCustomizerTest implements when(remoteMappingContext.containsEid(any(), eq(mappingContext))).thenReturn(true); customizer.deleteCurrentAttributes(id, negativeMapping, writeContext); - verify(api, times(1)).lispAddDelRemoteMapping(mappingCaptor.capture()); + verify(api, times(1)).oneAddDelRemoteMapping(mappingCaptor.capture()); - LispAddDelRemoteMapping request = mappingCaptor.getValue(); + OneAddDelRemoteMapping request = mappingCaptor.getValue(); assertNotNull(request); assertEquals(0, request.isAdd); diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizerTest.java index e2a6b3e9f..6ae8277e4 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizerTest.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/RlocProbeCustomizerTest.java @@ -26,8 +26,8 @@ import static org.mockito.Mockito.when; import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.LispRlocProbeEnableDisable; -import io.fd.vpp.jvpp.core.dto.LispRlocProbeEnableDisableReply; +import io.fd.vpp.jvpp.core.dto.OneRlocProbeEnableDisable; +import io.fd.vpp.jvpp.core.dto.OneRlocProbeEnableDisableReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -43,7 +43,7 @@ public class RlocProbeCustomizerTest extends LispWriterCustomizerTest implements private RlocProbe disabledProbe; @Captor - private ArgumentCaptor<LispRlocProbeEnableDisable> requestCaptor; + private ArgumentCaptor<OneRlocProbeEnableDisable> requestCaptor; private InstanceIdentifier<RlocProbe> EMPTY_ID = InstanceIdentifier.create(RlocProbe.class); private RlocProbe EMPTY_DATA = new RlocProbeBuilder().build(); @@ -52,8 +52,8 @@ public class RlocProbeCustomizerTest extends LispWriterCustomizerTest implements customizer = new RlocProbeCustomizer(api, lispStateCheckService); enabledProbe = rlocProbe(true); disabledProbe = rlocProbe(false); - when(api.lispRlocProbeEnableDisable(any(LispRlocProbeEnableDisable.class))) - .thenReturn(future(new LispRlocProbeEnableDisableReply())); + when(api.oneRlocProbeEnableDisable(any(OneRlocProbeEnableDisable.class))) + .thenReturn(future(new OneRlocProbeEnableDisableReply())); } @Test @@ -121,8 +121,8 @@ public class RlocProbeCustomizerTest extends LispWriterCustomizerTest implements } private void verifyRequest(final boolean enabled) { - verify(api, times(1)).lispRlocProbeEnableDisable(requestCaptor.capture()); - final LispRlocProbeEnableDisable request = requestCaptor.getValue(); + verify(api, times(1)).oneRlocProbeEnableDisable(requestCaptor.capture()); + final OneRlocProbeEnableDisable request = requestCaptor.getValue(); assertEquals(booleanToByte(enabled), request.isEnabled); } }
\ No newline at end of file diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/trait/SubtableWriterTestCase.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/trait/SubtableWriterTestCase.java index 50186cd2b..64fd742e0 100644 --- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/trait/SubtableWriterTestCase.java +++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/trait/SubtableWriterTestCase.java @@ -24,22 +24,22 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; -import io.fd.vpp.jvpp.core.dto.LispEidTableAddDelMap; -import io.fd.vpp.jvpp.core.dto.LispEidTableAddDelMapReply; +import io.fd.vpp.jvpp.core.dto.OneEidTableAddDelMap; +import io.fd.vpp.jvpp.core.dto.OneEidTableAddDelMapReply; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mockito; public class SubtableWriterTestCase extends WriterCustomizerTest implements SubtableWriter { @Captor - protected ArgumentCaptor<LispEidTableAddDelMap> requestCaptor; + protected ArgumentCaptor<OneEidTableAddDelMap> requestCaptor; protected void verifyAddDelEidTableAddDelMapInvokedCorrectly(final int addDel, final int vni, final int tableId, final int isL2) { - verify(api, times(1)).lispEidTableAddDelMap(requestCaptor.capture()); + verify(api, times(1)).oneEidTableAddDelMap(requestCaptor.capture()); - final LispEidTableAddDelMap request = requestCaptor.getValue(); + final OneEidTableAddDelMap request = requestCaptor.getValue(); assertNotNull(request); assertEquals(addDel, request.isAdd); assertEquals(vni, request.vni); @@ -48,12 +48,12 @@ public class SubtableWriterTestCase extends WriterCustomizerTest implements Subt } protected void whenAddDelEidTableAddDelMapSuccess() { - when(api.lispEidTableAddDelMap(Mockito.any(LispEidTableAddDelMap.class))) - .thenReturn(future(new LispEidTableAddDelMapReply())); + when(api.oneEidTableAddDelMap(Mockito.any(OneEidTableAddDelMap.class))) + .thenReturn(future(new OneEidTableAddDelMapReply())); } protected void whenAddDelEidTableAddDelMapFail() { - when(api.lispEidTableAddDelMap(Mockito.any(LispEidTableAddDelMap.class))) + when(api.oneEidTableAddDelMap(Mockito.any(OneEidTableAddDelMap.class))) .thenReturn(failedFuture()); } } |