diff options
Diffstat (limited to 'nat/nat2vpp/src/test/java/io')
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); |