summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java')
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java29
1 files changed, 13 insertions, 16 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java
index 75e0d3bb1..d90aeb14d 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/VxlanGpeCustomizerTest.java
@@ -16,8 +16,6 @@
package io.fd.honeycomb.translate.v3po.interfaces;
-import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMapping;
-import static io.fd.honeycomb.translate.v3po.test.ContextTestUtils.getMappingIid;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -31,7 +29,6 @@ import static org.mockito.Mockito.when;
import com.google.common.net.InetAddresses;
import io.fd.honeycomb.translate.v3po.DisabledInterfacesManager;
-import io.fd.honeycomb.translate.v3po.test.ContextTestUtils;
import io.fd.honeycomb.translate.v3po.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
@@ -133,12 +130,12 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest {
final VxlanGpe vxlanGpe = generateVxlanGpe();
whenVxlanGpeAddDelTunnelThenSuccess();
- ContextTestUtils.mockEmptyMapping(mappingContext, ifaceName, "test-instance");
+ noMappingDefined(mappingContext, ifaceName, "test-instance");
customizer.writeCurrentAttributes(id, vxlanGpe, writeContext);
verifyVxlanGpeAddWasInvoked(vxlanGpe);
- verify(mappingContext).put(eq(getMappingIid(ifaceName, "test-instance")), eq(
- getMapping(ifaceName, 0).get()));
+ verify(mappingContext).put(eq(mappingIid(ifaceName, "test-instance")), eq(
+ mapping(ifaceName, 0).get()));
}
@Test
@@ -147,15 +144,15 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest {
final int ifaceId = 0;
whenVxlanGpeAddDelTunnelThenSuccess();
- ContextTestUtils.mockMapping(mappingContext, ifaceName, ifaceId, "test-instance");
+ defineMapping(mappingContext, ifaceName, ifaceId, "test-instance");
customizer.writeCurrentAttributes(id, vxlanGpe, writeContext);
verifyVxlanGpeAddWasInvoked(vxlanGpe);
// Remove the first mapping before putting in the new one
- verify(mappingContext).delete(eq(getMappingIid(ifaceName, "test-instance")));
- verify(mappingContext).put(eq(getMappingIid(ifaceName, "test-instance")),
- eq(getMapping(ifaceName, ifaceId).get()));
+ verify(mappingContext).delete(eq(mappingIid(ifaceName, "test-instance")));
+ verify(mappingContext).put(eq(mappingIid(ifaceName, "test-instance")),
+ eq(mapping(ifaceName, ifaceId).get()));
}
@Test
@@ -171,8 +168,8 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest {
verifyVxlanGpeAddWasInvoked(vxlanGpe);
// Mapping not stored due to failure
verify(mappingContext, times(0))
- .put(eq(getMappingIid(ifaceName, "test-instance")), eq(
- getMapping(ifaceName, 0).get()));
+ .put(eq(mappingIid(ifaceName, "test-instance")), eq(
+ mapping(ifaceName, 0).get()));
return;
}
fail("WriteFailedException.CreateFailedException was expected");
@@ -194,11 +191,11 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest {
final VxlanGpe vxlanGpe = generateVxlanGpe();
whenVxlanGpeAddDelTunnelThenSuccess();
- ContextTestUtils.mockMapping(mappingContext, ifaceName, 1, "test-instance");
+ defineMapping(mappingContext, ifaceName, 1, "test-instance");
customizer.deleteCurrentAttributes(id, vxlanGpe, writeContext);
verifyVxlanGpeDeleteWasInvoked(vxlanGpe);
- verify(mappingContext).delete(eq(getMappingIid(ifaceName, "test-instance")));
+ verify(mappingContext).delete(eq(mappingIid(ifaceName, "test-instance")));
}
@Test
@@ -206,14 +203,14 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest {
final VxlanGpe vxlanGpe = generateVxlanGpe();
whenVxlanGpeAddDelTunnelThenFailure();
- ContextTestUtils.mockMapping(mappingContext, ifaceName, 1, "test-instance");
+ defineMapping(mappingContext, ifaceName, 1, "test-instance");
try {
customizer.deleteCurrentAttributes(id, vxlanGpe, writeContext);
} catch (WriteFailedException.DeleteFailedException e) {
assertTrue(e.getCause() instanceof VppBaseCallException);
verifyVxlanGpeDeleteWasInvoked(vxlanGpe);
- verify(mappingContext, times(0)).delete(eq(getMappingIid(ifaceName, "test-instance")));
+ verify(mappingContext, times(0)).delete(eq(mappingIid(ifaceName, "test-instance")));
return;
}
fail("WriteFailedException.DeleteFailedException was expected");