summaryrefslogtreecommitdiffstats
path: root/nat/nat2vpp/src/test/java
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-08-15 11:30:28 +0200
committerMarek Gradzki <mgradzki@cisco.com>2017-08-16 08:18:47 +0000
commitb8cf23cd61c2d3f57f9450570236534bce69232e (patch)
tree1840014acfe504fb58f81787e1ed52841453631f /nat/nat2vpp/src/test/java
parent3a7a67fe142749eb6b41f660d101f3fdffb8b3de (diff)
HONEYCOMB-386 - Hc2vpp Customizers update
Utilizes new default update implementation Change-Id: I9bf8473336274ba5fcfc18804f7b414937b3708e Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'nat/nat2vpp/src/test/java')
-rw-r--r--nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizerTest.java2
-rw-r--r--nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizerTest.java22
-rw-r--r--nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ifc/AbstractNatCustomizerTest.java5
3 files changed, 4 insertions, 25 deletions
diff --git a/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizerTest.java b/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizerTest.java
index c414c2b4e..e2db427a5 100644
--- a/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizerTest.java
+++ b/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizerTest.java
@@ -71,7 +71,7 @@ public class ExternalIpPoolCustomizerTest extends WriterCustomizerTest implement
verify(jvppSnat).snatAddAddressRange(expectedRequest);
}
- @Test(expected = WriteFailedException.UpdateFailedException.class)
+ @Test(expected = UnsupportedOperationException.class)
public void testUpdate() throws WriteFailedException {
final ExternalIpAddressPool data = mock(ExternalIpAddressPool.class);
customizer.updateCurrentAttributes(IID, data, data, writeContext);
diff --git a/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizerTest.java b/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizerTest.java
index 008ac087b..96726cb11 100644
--- a/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizerTest.java
+++ b/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizerTest.java
@@ -95,27 +95,7 @@ public class MappingEntryCustomizerTest extends WriterCustomizerTest implements
customizer.writeCurrentAttributes(IID, extractMappingEntry(data), writeContext);
}
- @Test(expected = IllegalArgumentException.class)
- public void testWriteNat64UnsupportedProtocol(
- @InjectTestData(resourcePath = "/nat64/static-mapping-unsupported-proto.json", id = MAPPING_TABLE_PATH) MappingTable data)
- throws WriteFailedException {
- customizer.writeCurrentAttributes(IID, extractMappingEntry(data), writeContext);
- }
-
- @Test
- public void testUpdateNat44(
- @InjectTestData(resourcePath = "/nat44/static-mapping.json", id = MAPPING_TABLE_PATH) MappingTable before,
- @InjectTestData(resourcePath = "/nat44/static-mapping-address-update.json", id = MAPPING_TABLE_PATH) MappingTable after)
- throws WriteFailedException {
- customizer.updateCurrentAttributes(IID, extractMappingEntry(before), extractMappingEntry(after), writeContext);
- final SnatAddStaticMapping expectedDeleteRequest = getExpectedNat44Request();
- verify(jvppSnat).snatAddStaticMapping(expectedDeleteRequest);
- final SnatAddStaticMapping expectedUpdateRequest = getExpectedNat44UpdateRequest();
- expectedUpdateRequest.isAdd = 1;
- verify(jvppSnat).snatAddStaticMapping(expectedUpdateRequest);
- }
-
- @Test
+ @Test(expected = UnsupportedOperationException.class)
public void testUpdateNat64(
@InjectTestData(resourcePath = "/nat64/static-mapping.json", id = MAPPING_TABLE_PATH) MappingTable before,
@InjectTestData(resourcePath = "/nat64/static-mapping-address-update.json", id = MAPPING_TABLE_PATH) MappingTable after)
diff --git a/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ifc/AbstractNatCustomizerTest.java b/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ifc/AbstractNatCustomizerTest.java
index 273d376cd..a8496529b 100644
--- a/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ifc/AbstractNatCustomizerTest.java
+++ b/nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ifc/AbstractNatCustomizerTest.java
@@ -23,7 +23,6 @@ import static org.mockito.Mockito.when;
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.snat.dto.SnatInterfaceAddDelFeature;
import io.fd.vpp.jvpp.snat.dto.SnatInterfaceAddDelFeatureReply;
import io.fd.vpp.jvpp.snat.dto.SnatInterfaceAddDelOutputFeature;
@@ -71,13 +70,13 @@ abstract class AbstractNatCustomizerTest<D extends InterfaceNatVppFeatureAttribu
verify(snatApi).snatInterfaceAddDelOutputFeature(expectedPostRoutingRequest(data, true));
}
- @Test(expected = WriteFailedException.UpdateFailedException.class)
+ @Test(expected = UnsupportedOperationException.class)
public void testUpdatePreRouting() throws Exception {
customizer.updateCurrentAttributes(getIId(IFACE_NAME), getPreRoutingConfig(), getPreRoutingConfig(),
writeContext);
}
- @Test(expected = WriteFailedException.UpdateFailedException.class)
+ @Test(expected = UnsupportedOperationException.class)
public void testUpdatePostRouting() throws Exception {
customizer.updateCurrentAttributes(getIId(IFACE_NAME), getPostRoutingConfig(), getPostRoutingConfig(),
writeContext);