HONEYCOMB-386 - Hc2vpp Customizers update 34/8034/5
authorJan Srnicek <[email protected]>
Tue, 15 Aug 2017 09:30:28 +0000 (11:30 +0200)
committerMarek Gradzki <[email protected]>
Wed, 16 Aug 2017 08:18:47 +0000 (08:18 +0000)
Utilizes new default update implementation

Change-Id: I9bf8473336274ba5fcfc18804f7b414937b3708e
Signed-off-by: Jan Srnicek <[email protected]>
63 files changed:
acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/InterfaceAclMacIpCustomizer.java
acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/util/iface/acl/AclInterfaceAssignmentRequestTest.java
acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/InterfaceAclMacipCustomizerTest.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4Customizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4NeighbourCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/ProxyArpCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/ProxyRangeCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4AddressCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv4/subinterface/SubInterfaceIpv4NeighbourCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/Ipv6AddressCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/Ipv6Customizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/Ipv6NeighbourCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/nd/NdProxyCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/subinterface/SubInterfaceIpv6AddressCustomizer.java
l3/impl/src/main/java/io/fd/hc2vpp/l3/write/ipv6/subinterface/SubInterfaceIpv6NeighbourCustomizer.java
l3/impl/src/test/java/io/fd/hc2vpp/l3/write/ProxyArpCustomizerTest.java
l3/impl/src/test/java/io/fd/hc2vpp/l3/write/ProxyRangeCustomizerTest.java
l3/impl/src/test/java/io/fd/hc2vpp/l3/write/ipv4/Ipv4AddressCustomizerTest.java
l3/impl/src/test/java/io/fd/hc2vpp/l3/write/ipv4/SubInterfaceIpv4AddressCustomizerTest.java
l3/impl/src/test/java/io/fd/hc2vpp/l3/write/ipv6/nd/NdProxyCustomizerTest.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathsTableCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/BridgeDomainSubtableCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/InterfaceCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/ItrRemoteLocatorSetCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapResolverCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/VniTableCustomizer.java
lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/translate/write/VrfSubtableCustomizer.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/gpe/translate/write/NativeForwardPathsTableCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/ItrRemoteLocatorSetCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java
lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/MapServerCustomizerTest.java
nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizer.java
nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizer.java
nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/NatInstaceCustomizer.java
nat/nat2vpp/src/main/java/io/fd/hc2vpp/nat/write/ifc/AbstractInterfaceNatCustomizer.java
nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ExternalIpPoolCustomizerTest.java
nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/MappingEntryCustomizerTest.java
nat/nat2vpp/src/test/java/io/fd/hc2vpp/nat/write/ifc/AbstractNatCustomizerTest.java
nsh/impl/src/main/java/io/fd/hc2vpp/vppnsh/impl/config/NshEntryWriterCustomizer.java
nsh/impl/src/main/java/io/fd/hc2vpp/vppnsh/impl/config/NshMapWriterCustomizer.java
routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizer.java
routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/RoutingCustomizer.java
routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/RoutingInstanceCustomizer.java
routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizer.java
routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java
routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingInstanceCustomizerTest.java
routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizerTest.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizer.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/L2Customizer.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/LoopbackCustomizer.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizer.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizer.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfaceCustomizer.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizer.java
v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizer.java
v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java
v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java
v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java
v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/span/MirroredInterfacesCustomizerTest.java

index 9f9ac52..fc0acd2 100644 (file)
@@ -55,15 +55,6 @@ public class InterfaceAclMacIpCustomizer extends FutureJVppAclCustomizer impleme
                 .execute(getjVppAclFacade());
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<VppMacipAcl> id,
-                                        @Nonnull final VppMacipAcl dataBefore,
-                                        @Nonnull final VppMacipAcl dataAfter, @Nonnull final WriteContext writeContext)
-            throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<VppMacipAcl> id,
                                         @Nonnull final VppMacipAcl dataBefore,
index 3427dc7..fb5d614 100644 (file)
@@ -115,7 +115,6 @@ public class AclInterfaceAssignmentRequestTest implements NamingContextHelper, F
 
     private void verifyVariant(final AclInterfaceAssignmentRequest request) throws WriteFailedException {
         verifyCreateFailsWithNullPointer(request);
-        verifyUpdateFailsWithNullPointer(request);
         verifyDeleteFailsWithNullPointer(request);
     }
 
@@ -127,14 +126,6 @@ public class AclInterfaceAssignmentRequestTest implements NamingContextHelper, F
         verifyValidRequest(requestCaptor.getValue());
     }
 
-    @Test
-    public void executeAsUpdate() throws Exception {
-        createValidRequest().executeAsUpdate(api, mock(Acl.class), mock(Acl.class));
-
-        verify(api).aclInterfaceSetAclList(requestCaptor.capture());
-        verifyValidRequest(requestCaptor.getValue());
-    }
-
     @Test
     public void executeAsDelete() throws Exception {
         create(mappingContext)
@@ -190,16 +181,6 @@ public class AclInterfaceAssignmentRequestTest implements NamingContextHelper, F
         fail("Test should have thrown null pointer");
     }
 
-    private void verifyUpdateFailsWithNullPointer(final AclInterfaceAssignmentRequest request)
-            throws WriteFailedException {
-        try {
-            request.executeAsUpdate(api, mock(Acl.class), mock(Acl.class));
-        } catch (NullPointerException e) {
-            return;
-        }
-        fail("Test should have thrown null pointer");
-    }
-
     private void verifyDeleteFailsWithNullPointer(final AclInterfaceAssignmentRequest request)
             throws WriteFailedException {
         try {
index 5bf66d8..b5fa649 100644 (file)
@@ -24,7 +24,6 @@ import io.fd.hc2vpp.acl.AclTestSchemaContext;
 import io.fd.hc2vpp.acl.util.AclContextManager;
 import io.fd.hc2vpp.common.test.write.WriterCustomizerTest;
 import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
 import io.fd.vpp.jvpp.acl.dto.MacipAclInterfaceAddDel;
 import io.fd.vpp.jvpp.acl.dto.MacipAclInterfaceAddDelReply;
 import io.fd.vpp.jvpp.acl.future.FutureJVppAclFacade;
@@ -80,7 +79,7 @@ public class InterfaceAclMacipCustomizerTest extends WriterCustomizerTest implem
         verify(aclApi).macipAclInterfaceAddDel(request);
     }
 
-    @Test(expected = WriteFailedException.UpdateFailedException.class)
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdate() throws Exception {
         customizer.updateCurrentAttributes(ACL_IID, acl, acl, writeContext);
     }
index 1cdd46e..b66877f 100644 (file)
@@ -62,13 +62,6 @@ public class Ipv4AddressCustomizer extends FutureJVppCustomizer
         setAddress(true, id, interfaceName, interfaceIndex, dataAfter, writeContext);
     }
 
-    @Override
-    public void updateCurrentAttributes(InstanceIdentifier<Address> id, Address dataBefore, Address dataAfter,
-                                        WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(InstanceIdentifier<Address> id, Address dataBefore, WriteContext writeContext)
             throws WriteFailedException {
index e1fdb59..6b0859c 100644 (file)
@@ -40,13 +40,6 @@ public class Ipv4Customizer extends FutureJVppCustomizer implements WriterCustom
         LOG.debug("Handling Ipv4 leaves (mtu, forwarding) is not supported by VPP API. Ignoring configuration");
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ipv4> id,
-                                        @Nonnull final Ipv4 dataBefore, @Nonnull final Ipv4 dataAfter,
-                                        @Nonnull final WriteContext writeContext) {
-        LOG.debug("Handling Ipv4 leaves (mtu, forwarding) is not supported by VPP API. Ignoring configuration");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ipv4> id,
                                         @Nonnull final Ipv4 dataBefore, @Nonnull final WriteContext writeContext) {
index af77fed..f8edcfb 100644 (file)
@@ -72,13 +72,6 @@ public class Ipv4NeighbourCustomizer extends FutureJVppCustomizer
         LOG.debug("Neighbour {} successfully written", id);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull InstanceIdentifier<Neighbor> id, @Nonnull Neighbor dataBefore,
-                                        @Nonnull Neighbor dataAfter,
-                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<Neighbor> id, @Nonnull Neighbor data,
                                         @Nonnull WriteContext writeContext)
index ea1cf8d..7c506e9 100644 (file)
@@ -54,15 +54,6 @@ public class ProxyArpCustomizer extends FutureJVppCustomizer implements WriterCu
         LOG.debug("Proxy ARP was successfully enabled on interface {} (id={})", swIfName, swIfIndex);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<ProxyArp> id,
-                                        @Nonnull final ProxyArp dataBefore,
-                                        @Nonnull final ProxyArp dataAfter, @Nonnull final WriteContext writeContext)
-        throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-            new UnsupportedOperationException("Proxy ARP feature update is not supported."));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<ProxyArp> id,
                                         @Nonnull final ProxyArp dataBefore,
index 345cef7..8529598 100644 (file)
@@ -51,15 +51,6 @@ public class ProxyRangeCustomizer extends FutureJVppCustomizer
         createProxyArp(getProxyArpRequestFuture(dataAfter, (byte) 1 /* 1 is add */), id, dataAfter);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<ProxyRange> id,
-                                        @Nonnull final ProxyRange dataBefore,
-                                        @Nonnull final ProxyRange dataAfter, @Nonnull final WriteContext writeContext)
-        throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-            new UnsupportedOperationException("ARP proxy range update is not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<ProxyRange> id,
                                         @Nonnull final ProxyRange dataBefore,
index ba744ef..42d6b45 100644 (file)
@@ -62,13 +62,6 @@ public class SubInterfaceIpv4AddressCustomizer extends FutureJVppCustomizer
         setAddress(true, id, dataAfter, writeContext);
     }
 
-    @Override
-    public void updateCurrentAttributes(InstanceIdentifier<Address> id, Address dataBefore, Address dataAfter,
-                                        WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(InstanceIdentifier<Address> id, Address dataBefore, WriteContext writeContext)
             throws WriteFailedException {
index 818be6d..67454d3 100644 (file)
@@ -67,13 +67,6 @@ public class SubInterfaceIpv4NeighbourCustomizer extends FutureJVppCustomizer
         LOG.debug("Neighbour {} successfully written", id);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull InstanceIdentifier<Neighbor> id, @Nonnull Neighbor dataBefore,
-                                        @Nonnull Neighbor dataAfter,
-                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<Neighbor> id, @Nonnull Neighbor data,
                                         @Nonnull WriteContext writeContext)
index d6b357c..0c66bab 100644 (file)
@@ -69,15 +69,6 @@ public class Ipv6AddressCustomizer extends FutureJVppCustomizer
                 dataAfter.getPrefixLength().byteValue());
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Address> id,
-                                        @Nonnull final Address dataBefore,
-                                        @Nonnull final Address dataAfter, @Nonnull final WriteContext writeContext)
-            throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Address> id,
                                         @Nonnull final Address dataBefore,
index 6194dfd..7a4c427 100644 (file)
@@ -40,13 +40,6 @@ public class Ipv6Customizer extends FutureJVppCustomizer implements WriterCustom
         LOG.warn("Unsupported, ignoring configuration {}", dataAfter);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ipv6> id,
-                                        @Nonnull final Ipv6 dataBefore, @Nonnull final Ipv6 dataAfter,
-                                        @Nonnull final WriteContext writeContext) {
-        LOG.warn("Unsupported, ignoring configuration {}", dataAfter);
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ipv6> id,
                                         @Nonnull final Ipv6 dataBefore, @Nonnull final WriteContext writeContext) {
index 2a9ef03..ed06ab0 100644 (file)
@@ -71,13 +71,6 @@ public class Ipv6NeighbourCustomizer extends FutureJVppCustomizer
         LOG.debug("Neighbour successfully written");
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull InstanceIdentifier<Neighbor> id, @Nonnull Neighbor dataBefore,
-                                        @Nonnull Neighbor dataAfter,
-                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<Neighbor> id, @Nonnull Neighbor dataBefore,
                                         @Nonnull WriteContext writeContext)
index 5a57d96..fd7a024 100644 (file)
@@ -57,14 +57,6 @@ public final class NdProxyCustomizer extends FutureJVppCustomizer
         LOG.debug("ND proxy was successfully added for interface {}(id={}): {}", interfaceName, swIfIndex, dataAfter);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<NdProxy> id,
-                                        @Nonnull final NdProxy dataBefore, @Nonnull final NdProxy dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-            new UnsupportedOperationException("NdProxy update is not supported."));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<NdProxy> id,
                                         @Nonnull final NdProxy dataBefore,
index 455d447..2a066b4 100644 (file)
@@ -48,13 +48,6 @@ public class SubInterfaceIpv6AddressCustomizer extends FutureJVppCustomizer
         setAddress(true, id, dataAfter, writeContext);
     }
 
-    @Override
-    public void updateCurrentAttributes(InstanceIdentifier<Address> id, Address dataBefore, Address dataAfter,
-                                        WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(InstanceIdentifier<Address> id, Address dataBefore, WriteContext writeContext)
             throws WriteFailedException {
index 62818b0..fd9eb90 100644 (file)
@@ -67,13 +67,6 @@ public class SubInterfaceIpv6NeighbourCustomizer extends FutureJVppCustomizer
         LOG.debug("Neighbour {} successfully written", id);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull InstanceIdentifier<Neighbor> id, @Nonnull Neighbor dataBefore,
-                                        @Nonnull Neighbor dataAfter,
-                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<Neighbor> id, @Nonnull Neighbor data,
                                         @Nonnull WriteContext writeContext)
index e604df4..366d181 100644 (file)
@@ -68,7 +68,7 @@ public class ProxyArpCustomizerTest extends WriterCustomizerTest implements Byte
         customizer.writeCurrentAttributes(IID, data, writeContext);
     }
 
-    @Test(expected = WriteFailedException.UpdateFailedException.class)
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdate() throws WriteFailedException {
         customizer.updateCurrentAttributes(IID, data, data, writeContext);
     }
index 49f4d0b..bdc382c 100644 (file)
@@ -67,7 +67,7 @@ public class ProxyRangeCustomizerTest extends WriterCustomizerTest implements By
         customizer.writeCurrentAttributes(IID, RANGE, writeContext);
     }
 
-    @Test(expected = WriteFailedException.UpdateFailedException.class)
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdate() throws WriteFailedException {
         customizer.updateCurrentAttributes(IID, RANGE, RANGE, writeContext);
     }
index 2697813..74745c4 100644 (file)
@@ -133,7 +133,7 @@ public class Ipv4AddressCustomizerTest extends WriterCustomizerTest {
         fail("WriteFailedException was expected");
     }
 
-    @Test(expected =  WriteFailedException.UpdateFailedException.class)
+    @Test(expected =  UnsupportedOperationException.class)
     public void testUpdate() throws Exception {
         final Address data = mock(Address.class);
         customizer.updateCurrentAttributes(getAddressId(IFACE_NAME), data, data, writeContext);
index 6416a1d..24a58fe 100644 (file)
@@ -124,7 +124,7 @@ public class SubInterfaceIpv4AddressCustomizerTest extends WriterCustomizerTest
         return request;
     }
 
-    @Test(expected = WriteFailedException.UpdateFailedException.class)
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdate() throws Exception {
         final Address address = address(prefixLength());
         customizer.updateCurrentAttributes(IID, address, address, writeContext);
index bf6fe9d..e0e5068 100644 (file)
@@ -70,7 +70,7 @@ public class NdProxyCustomizerTest extends WriterCustomizerTest {
         verify(api).ip6NdProxyAddDel(request);
     }
 
-    @Test(expected = WriteFailedException.UpdateFailedException.class)
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdate() throws WriteFailedException {
         final Ipv6AddressNoZone address = new Ipv6AddressNoZone("2001::2");
         final NdProxy data = new NdProxyBuilder().setAddress(address).build();
index cbb4b2f..730f766 100644 (file)
@@ -54,16 +54,6 @@ public class NativeForwardPathCustomizer extends FutureJVppCustomizer
         createNativePath(id, dataAfter, writeContext);
     }
 
-
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<NativeForwardPath> id,
-                                        @Nonnull final NativeForwardPath dataBefore,
-                                        @Nonnull final NativeForwardPath dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        deleteNativePath(id, dataBefore, writeContext);
-        createNativePath(id, dataAfter, writeContext);
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<NativeForwardPath> id,
                                         @Nonnull final NativeForwardPath dataBefore,
index 6d2faf2..f04a13f 100644 (file)
@@ -53,18 +53,6 @@ public class NativeForwardPathsTableCustomizer extends FutureJVppCustomizer
         createFibTable(id, dataAfter);
     }
 
-
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<NativeForwardPathsTable> id,
-                                        @Nonnull final NativeForwardPathsTable dataBefore,
-                                        @Nonnull final NativeForwardPathsTable dataAfter,
-                                        @Nonnull final WriteContext writeContext)
-            throws WriteFailedException {
-        // not sure if update makes sense, but just in case
-        deleteFibTable(id);
-        createFibTable(id, dataAfter);
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<NativeForwardPathsTable> id,
                                         @Nonnull final NativeForwardPathsTable dataBefore,
index 4006628..b3fce33 100644 (file)
@@ -66,14 +66,6 @@ public class BridgeDomainSubtableCustomizer extends FutureJVppCustomizer
         LOG.debug("{} successfully written", id);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<BridgeDomainSubtable> id,
-                                        @Nonnull final BridgeDomainSubtable dataBefore,
-                                        @Nonnull final BridgeDomainSubtable dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<BridgeDomainSubtable> id,
                                         @Nonnull final BridgeDomainSubtable dataBefore,
index bb963a4..8feb2e0 100755 (executable)
@@ -79,12 +79,6 @@ public class InterfaceCustomizer extends FutureJVppCustomizer
 
     }
 
-    @Override
-    public void updateCurrentAttributes(InstanceIdentifier<Interface> id, Interface dataBefore, Interface dataAfter,
-                                        WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(InstanceIdentifier<Interface> id, Interface dataBefore,
                                         WriteContext writeContext) throws WriteFailedException {
index f841ac5..3ec2a72 100644 (file)
@@ -52,15 +52,6 @@ public class ItrRemoteLocatorSetCustomizer extends CheckedLispCustomizer impleme
         }
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<ItrRemoteLocatorSet> id,
-                                        @Nonnull final ItrRemoteLocatorSet dataBefore,
-                                        @Nonnull final ItrRemoteLocatorSet dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<ItrRemoteLocatorSet> id,
                                         @Nonnull final ItrRemoteLocatorSet dataBefore,
index dfd6a00..614d538 100755 (executable)
@@ -86,15 +86,6 @@ public class LocatorSetCustomizer extends CheckedLispCustomizer
         return locators != null && !locators.isEmpty();
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull InstanceIdentifier<LocatorSet> id,
-                                        @Nonnull LocatorSet dataBefore,
-                                        @Nonnull LocatorSet dataAfter,
-                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<LocatorSet> id,
                                         @Nonnull LocatorSet dataBefore,
index 9f24e3c..b492627 100755 (executable)
@@ -62,13 +62,6 @@ public class MapResolverCustomizer extends CheckedLispCustomizer
         }
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<MapResolver> id,
-                                        @Nonnull final MapResolver dataBefore, @Nonnull final MapResolver dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<MapResolver> id,
                                         @Nonnull final MapResolver dataBefore, @Nonnull final WriteContext writeContext)
index e9de1a9..3d33aaf 100644 (file)
@@ -48,15 +48,6 @@ public class MapServerCustomizer extends CheckedLispCustomizer
         addDelMapServer(true, instanceIdentifier, mapServer);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier,
-                                        @Nonnull MapServer mapServerBefore,
-                                        @Nonnull MapServer mapServerAfter,
-                                        @Nonnull WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(instanceIdentifier, mapServerBefore, mapServerAfter,
-                new UnsupportedOperationException("Not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull InstanceIdentifier<MapServer> instanceIdentifier, @Nonnull MapServer mapServer, @Nonnull WriteContext writeContext) throws WriteFailedException {
         lispStateCheckService.checkLispEnabledBefore(writeContext);
index e1f1371..fb3c89d 100755 (executable)
@@ -50,12 +50,6 @@ public class VniTableCustomizer extends CheckedLispCustomizer implements ListWri
         checkAtLeastOnChildExists(id, writeContext, false);
     }
 
-    @Override
-    public void updateCurrentAttributes(InstanceIdentifier<VniTable> id, VniTable dataBefore, VniTable dataAfter,
-                                        WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(InstanceIdentifier<VniTable> id, VniTable dataBefore, WriteContext writeContext)
             throws WriteFailedException {
index e7314b6..d4c4a1a 100644 (file)
@@ -58,13 +58,6 @@ public class VrfSubtableCustomizer extends FutureJVppCustomizer
         LOG.debug("{} successfully written", id);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<VrfSubtable> id,
-                                        @Nonnull final VrfSubtable dataBefore, @Nonnull final VrfSubtable dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Operation not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<VrfSubtable> id,
                                         @Nonnull final VrfSubtable dataBefore, @Nonnull final WriteContext writeContext)
index 80bb2c6..e2f55fd 100644 (file)
@@ -79,7 +79,11 @@ public class NativeForwardPathsTableCustomizerTest extends WriterCustomizerTest
     @Test
     public void testUpdateValid() throws WriteFailedException {
         when(api.gpeAddDelNativeFwdRpath(any())).thenReturn(future(new GpeAddDelNativeFwdRpathReply()));
-        customizer.updateCurrentAttributes(validId, validTableBefore(), validTable(), writeContext);
+        final NativeForwardPathsTable before = validTableBefore();
+        final NativeForwardPathsTable after = validTable();
+        // emulates what default update would do
+        customizer.deleteCurrentAttributes(validId, before, writeContext);
+        customizer.writeCurrentAttributes(validId, after, writeContext);
         verify(api, times(2)).gpeAddDelIface(requestCaptor.capture());
 
         final List<GpeAddDelIface> requests = requestCaptor.getAllValues();
index 4d76f7d..a058661 100644 (file)
@@ -84,16 +84,9 @@ public class ItrRemoteLocatorSetCustomizerTest extends LispWriterCustomizerTest
         fail("Test should have thrown exception");
     }
 
-    @Test
-    public void updateCurrentAttributes() {
-        try {
-            customizer.updateCurrentAttributes(validId, validData, validData, writeContext);
-        } catch (WriteFailedException e) {
-            assertTrue(e.getCause() instanceof UnsupportedOperationException);
-            return;
-        }
-
-        fail("Test should have thrown exception");
+    @Test(expected = UnsupportedOperationException.class)
+    public void updateCurrentAttributes() throws WriteFailedException {
+        customizer.updateCurrentAttributes(validId, validData, validData, writeContext);
     }
 
     @Test
index edb648b..52ed5df 100755 (executable)
@@ -18,7 +18,6 @@ package io.fd.hc2vpp.lisp.translate.write;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
@@ -121,18 +120,10 @@ public class LocatorSetCustomizerTest extends LispWriterCustomizerTest {
         assertEquals(1, request.isAdd);
     }
 
-    @Test
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdateCurrentAttributes() throws WriteFailedException {
         final InstanceIdentifier<LocatorSet> identifier = InstanceIdentifier.create(LocatorSet.class);
-        try {
-            customizer
-                    .updateCurrentAttributes(identifier, mock(LocatorSet.class), mock(LocatorSet.class), writeContext);
-        } catch (WriteFailedException e) {
-            assertTrue(e.getCause() instanceof UnsupportedOperationException);
-            assertEquals(identifier, e.getFailedId());
-            return;
-        }
-        fail("Test should have failed");
+        customizer.updateCurrentAttributes(identifier, mock(LocatorSet.class), mock(LocatorSet.class), writeContext);
     }
 
     @Test(expected = NullPointerException.class)
index 19f8b0a..27c7160 100644 (file)
@@ -72,15 +72,9 @@ public class MapServerCustomizerTest extends LispWriterCustomizerTest implements
     }
 
 
-    @Test
+    @Test(expected = UnsupportedOperationException.class)
     public void updateCurrentAttributes() throws Exception {
-        try {
-            customizer.updateCurrentAttributes(ID, data, data, writeContext);
-        } catch (WriteFailedException e) {
-            assertTrue(e instanceof WriteFailedException.UpdateFailedException);
-            assertTrue(e.getCause() instanceof UnsupportedOperationException);
-            verify(api, times(0)).oneAddDelMapServer(any());
-        }
+        customizer.updateCurrentAttributes(ID, data, data, writeContext);
     }
 
     @Test
index 505318c..61fedbd 100644 (file)
@@ -59,15 +59,6 @@ final class ExternalIpPoolCustomizer implements ListWriterCustomizer<ExternalIpA
         LOG.debug("Address range: {} added successfully", id);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<ExternalIpAddressPool> id,
-                                        @Nonnull final ExternalIpAddressPool dataBefore,
-                                        @Nonnull final ExternalIpAddressPool dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Address range update is not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<ExternalIpAddressPool> id,
                                         @Nonnull final ExternalIpAddressPool dataBefore,
index 0d08a55..35ed9e2 100644 (file)
@@ -126,15 +126,6 @@ final class MappingEntryCustomizer implements ListWriterCustomizer<MappingEntry,
         return false;
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<MappingEntry> id,
-                                        @Nonnull final MappingEntry dataBefore,
-                                        @Nonnull final MappingEntry dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        deleteCurrentAttributes(id, dataBefore, writeContext);
-        writeCurrentAttributes(id, dataAfter, writeContext);
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<MappingEntry> id,
                                         @Nonnull final MappingEntry dataBefore,
index 5d1c2b5..fa5cfa8 100644 (file)
@@ -37,13 +37,6 @@ final class NatInstaceCustomizer implements ListWriterCustomizer<NatInstance, Na
         LOG.trace("Writing nat-instance: {}", id);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<NatInstance> id,
-                                        @Nonnull final NatInstance dataBefore, @Nonnull final NatInstance dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        LOG.trace("Updating nat-instance: {}", id);
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<NatInstance> id,
                                         @Nonnull final NatInstance dataBefore, @Nonnull final WriteContext writeContext)
index 82af934..76d6549 100644 (file)
@@ -65,14 +65,6 @@ abstract class AbstractInterfaceNatCustomizer<D extends InterfaceNatVppFeatureAt
         getLog().debug("NAT {} enabled successfully on: {}, reply: {}", dataAfter, ifcName, reply);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<D> id,
-                                        @Nonnull final D dataBefore, @Nonnull final D dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Unable to update NAT feature"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<D> id,
                                         @Nonnull final D dataBefore, @Nonnull final WriteContext writeContext)
index c414c2b..e2db427 100644 (file)
@@ -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);
index 008ac08..96726cb 100644 (file)
@@ -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)
index 273d376..a849652 100644 (file)
@@ -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);
index 122594c..988c994 100755 (executable)
@@ -19,17 +19,18 @@ package io.fd.hc2vpp.vppnsh.impl.config;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
 
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
 import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
 import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.hc2vpp.vppnsh.impl.util.FutureJVppNshCustomizer;
+import io.fd.honeycomb.translate.MappingContext;
+import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
 import io.fd.honeycomb.translate.write.WriteContext;
 import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.hc2vpp.vppnsh.impl.util.FutureJVppNshCustomizer;
 import io.fd.vpp.jvpp.nsh.dto.NshAddDelEntry;
 import io.fd.vpp.jvpp.nsh.dto.NshAddDelEntryReply;
 import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh;
+import java.util.List;
 import java.util.concurrent.CompletionStage;
 import javax.annotation.Nonnull;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.Ethernet;
@@ -39,16 +40,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.MdType2;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.NshMdType1Augment;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.NshMdType2Augment;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.nsh.md.type2.attributes.Md2Data;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.vpp.nsh.nsh.entries.NshEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.vpp.nsh.nsh.entries.NshEntryKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.nsh.md.type2.attributes.Md2Data;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-
 /**
  * Writer customizer responsible for NshEntry create/delete.
  */
@@ -76,13 +74,6 @@ public class NshEntryWriterCustomizer extends FutureJVppNshCustomizer
         LOG.debug("Successfully created nsh entry(id={]): iid={} dataAfter={}", newEntryIndex, id, dataAfter);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<NshEntry> id,
-                                        @Nonnull final NshEntry dataBefore, @Nonnull final NshEntry dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Nsh entry update is not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<NshEntry> id,
                                         @Nonnull final NshEntry dataBefore,
index eaa1e75..23b05da 100755 (executable)
@@ -19,26 +19,26 @@ package io.fd.hc2vpp.vppnsh.impl.config;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
 
-import io.fd.honeycomb.translate.MappingContext;
-import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
 import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
 import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.hc2vpp.vppnsh.impl.util.FutureJVppNshCustomizer;
+import io.fd.honeycomb.translate.MappingContext;
+import io.fd.honeycomb.translate.spi.write.ListWriterCustomizer;
 import io.fd.honeycomb.translate.write.WriteContext;
 import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.hc2vpp.vppnsh.impl.util.FutureJVppNshCustomizer;
 import io.fd.vpp.jvpp.nsh.dto.NshAddDelMap;
 import io.fd.vpp.jvpp.nsh.dto.NshAddDelMapReply;
 import io.fd.vpp.jvpp.nsh.future.FutureJVppNsh;
 import java.util.concurrent.CompletionStage;
 import javax.annotation.Nonnull;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.None;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.Pop;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.Push;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.Swap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.VxlanGpe;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.Vxlan4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.Vxlan6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.None;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.VxlanGpe;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.vpp.nsh.nsh.maps.NshMap;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev170315.vpp.nsh.nsh.maps.NshMapKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -76,13 +76,6 @@ implements ListWriterCustomizer<NshMap, NshMapKey>, ByteDataTranslator, JvppRepl
         LOG.debug("Successfully created nsh map(id={]): iid={} dataAfter={}", newMapIndex, id, dataAfter);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<NshMap> id,
-            @Nonnull final NshMap dataBefore, @Nonnull final NshMap dataAfter,
-            @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException("Nsh map update is not supported");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<NshMap> id,
             @Nonnull final NshMap dataBefore,
index 9d87a5b..b8d34ed 100644 (file)
@@ -101,15 +101,6 @@ public class Ipv6RouteCustomizer extends FutureJVppCustomizer
         routesContext.addName(routeName, writeContext.getMappingContext());
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Route> instanceIdentifier,
-                                        @Nonnull final Route route,
-                                        @Nonnull final Route d1, @Nonnull final WriteContext writeContext)
-            throws WriteFailedException {
-        throw new WriteFailedException(instanceIdentifier,
-                new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Route> instanceIdentifier,
                                         @Nonnull final Route route,
index bd50ce7..0e99aee 100644 (file)
@@ -39,13 +39,6 @@ public class RoutingCustomizer implements WriterCustomizer<Routing> {
         LOG.debug("Writing {}", instanceIdentifier);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Routing> instanceIdentifier,
-                                        @Nonnull final Routing before, @Nonnull final Routing after,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        LOG.debug("Updating {} to {}", instanceIdentifier, after);
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Routing> instanceIdentifier,
                                         @Nonnull final Routing routing, @Nonnull final WriteContext writeContext)
index fa6885d..7d63647 100644 (file)
@@ -46,15 +46,6 @@ public class RoutingInstanceCustomizer implements ListWriterCustomizer<RoutingIn
         checkSingletonInstance(dataAfter);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<RoutingInstance> id,
-                                        @Nonnull final RoutingInstance dataBefore,
-                                        @Nonnull final RoutingInstance dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<RoutingInstance> id,
                                         @Nonnull final RoutingInstance dataBefore,
index 69b8e50..d79f9d6 100644 (file)
@@ -71,15 +71,6 @@ public class RoutingProtocolCustomizer
         }
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<RoutingProtocol> instanceIdentifier,
-                                        @Nonnull final RoutingProtocol routingProtocolBefore,
-                                        @Nonnull final RoutingProtocol routingProtocolAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(instanceIdentifier, routingProtocolBefore,
-                routingProtocolAfter, new UnsupportedOperationException("Operation not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<RoutingProtocol> instanceIdentifier,
                                         @Nonnull final RoutingProtocol routingProtocol,
index dc932cd..8a52b8c 100644 (file)
@@ -18,8 +18,6 @@ package io.fd.hc2vpp.routing.write;
 
 import static io.fd.hc2vpp.routing.helpers.InterfaceTestHelper.INTERFACE_INDEX;
 import static io.fd.hc2vpp.routing.helpers.InterfaceTestHelper.INTERFACE_NAME;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 import com.google.common.collect.ImmutableList;
 import io.fd.hc2vpp.common.test.write.WriterCustomizerTest;
@@ -119,17 +117,10 @@ public class Ipv6RouteCustomizerTest extends WriterCustomizerTest
                 requestCaptor);
     }
 
-    @Test
-    public void testUpdate() {
-        try {
-            customizer.updateCurrentAttributes(validId, Ipv6RouteData.IPV6_ROUTE_WITH_CLASSIFIER_BLACKHOLE_HOP,
-                    Ipv6RouteData.IPV6_ROUTE_WITH_CLASSIFIER_RECEIVE_HOP, writeContext);
-        } catch (WriteFailedException e) {
-            assertTrue(e.getCause() instanceof UnsupportedOperationException);
-            verifyNotInvoked(api);
-            return;
-        }
-        fail("Test should have thrown exception");
+    @Test(expected = UnsupportedOperationException.class)
+    public void testUpdate() throws WriteFailedException {
+        customizer.updateCurrentAttributes(validId, Ipv6RouteData.IPV6_ROUTE_WITH_CLASSIFIER_BLACKHOLE_HOP,
+                Ipv6RouteData.IPV6_ROUTE_WITH_CLASSIFIER_RECEIVE_HOP, writeContext);
     }
 
     @Test
index 68fcba5..2e073d7 100644 (file)
  */
 package io.fd.hc2vpp.routing.write;
 
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.mockito.Mockito.when;
 
 import io.fd.hc2vpp.common.test.write.WriterCustomizerTest;
 import io.fd.hc2vpp.routing.RoutingConfiguration;
-import io.fd.honeycomb.translate.write.WriteFailedException;
 import org.junit.Test;
 import org.mockito.Mock;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.routing.rev140524.routing.RoutingInstance;
@@ -67,15 +65,9 @@ public class RoutingInstanceCustomizerTest extends WriterCustomizerTest {
         customizer.writeCurrentAttributes(id, invalidData, writeContext);
     }
 
-    @Test
+    @Test(expected = UnsupportedOperationException.class)
     public void updateCurrentAttributes() throws Exception {
-        try {
-            customizer.updateCurrentAttributes(id, validData, validData, writeContext);
-        } catch (WriteFailedException.UpdateFailedException e) {
-            assertTrue(e.getCause() instanceof UnsupportedOperationException);
-            return;
-        }
-        fail("Test should throw WriteFailedException.UpdateFailedException");
+        customizer.updateCurrentAttributes(id, validData, validData, writeContext);
     }
 
     @Test
index 21a2bdc..6174f84 100644 (file)
@@ -125,14 +125,8 @@ public class RoutingProtocolCustomizerTest extends WriterCustomizerTest {
         fail("Test should have thrown exception");
     }
 
-    @Test
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdate() throws WriteFailedException {
-        try {
-            customizer.updateCurrentAttributes(validId, validData, validData, writeContext);
-        } catch (Exception e) {
-            assertTrue(e.getCause() instanceof UnsupportedOperationException);
-            return;
-        }
-        fail("Test should have thrown exception");
+        customizer.updateCurrentAttributes(validId, validData, validData, writeContext);
     }
 }
index bad8591..5208849 100644 (file)
@@ -74,14 +74,6 @@ public class GreCustomizer extends AbstractInterfaceTypeCustomizer<Gre> implemen
         createGreTunnel(id, swIfName, dataAfter, writeContext);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Gre> id, @Nonnull final Gre dataBefore,
-                                        @Nonnull final Gre dataAfter, @Nonnull final WriteContext writeContext)
-            throws WriteFailedException.UpdateFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Gre tunnel update is not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Gre> id, @Nonnull final Gre dataBefore,
                                         @Nonnull final WriteContext writeContext)
index 00656a1..583f023 100644 (file)
 
 package io.fd.hc2vpp.v3po.interfaces;
 
-import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
 import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer;
 import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
 import io.fd.honeycomb.translate.write.WriteContext;
 import io.fd.honeycomb.translate.write.WriteFailedException;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
 import javax.annotation.Nonnull;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev170607.interfaces._interface.L2;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 6f3cda7..f033300 100644 (file)
@@ -58,14 +58,6 @@ public final class LoopbackCustomizer extends AbstractInterfaceTypeCustomizer<Lo
         createLoopback(id, ifcName, dataAfter, writeContext);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Loopback> id, @Nonnull final Loopback dataBefore,
-                                        @Nonnull final Loopback dataAfter, @Nonnull final WriteContext writeContext)
-            throws WriteFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Modification of loopback interface is not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Loopback> id, @Nonnull final Loopback dataBefore,
                                         @Nonnull final WriteContext writeContext)
index 068796e..f21b019 100644 (file)
@@ -18,11 +18,19 @@ package io.fd.hc2vpp.v3po.interfaces;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
+import com.google.common.net.InetAddresses;
+import io.fd.hc2vpp.common.translate.util.AbstractInterfaceTypeCustomizer;
+import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.hc2vpp.v3po.DisabledInterfacesManager;
+import io.fd.honeycomb.translate.write.WriteContext;
+import io.fd.honeycomb.translate.write.WriteFailedException;
+import io.fd.vpp.jvpp.core.dto.VxlanAddDelTunnel;
+import io.fd.vpp.jvpp.core.dto.VxlanAddDelTunnelReply;
+import io.fd.vpp.jvpp.core.future.FutureJVppCore;
 import java.net.InetAddress;
 import java.util.concurrent.CompletionStage;
-
 import javax.annotation.Nonnull;
-
 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.interfaces.rev140508.InterfaceType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
@@ -34,18 +42,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.net.InetAddresses;
-
-import io.fd.hc2vpp.common.translate.util.AbstractInterfaceTypeCustomizer;
-import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.v3po.DisabledInterfacesManager;
-import io.fd.honeycomb.translate.write.WriteContext;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.vpp.jvpp.core.dto.VxlanAddDelTunnel;
-import io.fd.vpp.jvpp.core.dto.VxlanAddDelTunnelReply;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
-
 public class VxlanCustomizer extends AbstractInterfaceTypeCustomizer<Vxlan> implements JvppReplyConsumer {
 
     private static final Logger LOG = LoggerFactory.getLogger(VxlanCustomizer.class);
@@ -74,14 +70,6 @@ public class VxlanCustomizer extends AbstractInterfaceTypeCustomizer<Vxlan> impl
         createVxlanTunnel(id, swIfName, dataAfter, writeContext);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Vxlan> id, @Nonnull final Vxlan dataBefore,
-            @Nonnull final Vxlan dataAfter, @Nonnull final WriteContext writeContext)
-                    throws WriteFailedException.UpdateFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("Vxlan tunnel update is not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Vxlan> id, @Nonnull final Vxlan dataBefore,
             @Nonnull final WriteContext writeContext)
index 80b6667..1cf4d7b 100644 (file)
@@ -19,10 +19,10 @@ package io.fd.hc2vpp.v3po.interfaces;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import com.google.common.net.InetAddresses;
-import io.fd.hc2vpp.v3po.DisabledInterfacesManager;
 import io.fd.hc2vpp.common.translate.util.AbstractInterfaceTypeCustomizer;
 import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer;
 import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.hc2vpp.v3po.DisabledInterfacesManager;
 import io.fd.honeycomb.translate.write.WriteContext;
 import io.fd.honeycomb.translate.write.WriteFailedException;
 import io.fd.vpp.jvpp.core.dto.VxlanGpeAddDelTunnel;
@@ -68,15 +68,6 @@ public class VxlanGpeCustomizer extends AbstractInterfaceTypeCustomizer<VxlanGpe
         createVxlanGpeTunnel(id, swIfName, dataAfter, writeContext);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<VxlanGpe> id,
-                                        @Nonnull final VxlanGpe dataBefore,
-                                        @Nonnull final VxlanGpe dataAfter, @Nonnull final WriteContext writeContext)
-            throws WriteFailedException.UpdateFailedException {
-        throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter,
-                new UnsupportedOperationException("VxlanGpe tunnel update is not supported"));
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<VxlanGpe> id,
                                         @Nonnull final VxlanGpe dataBefore,
index 15d51a8..66ffa7f 100644 (file)
@@ -78,16 +78,6 @@ public final class MirroredInterfaceCustomizer extends FutureJVppCustomizer
                 sourceInterfaceName, destinationInterfaceName, spanState);
     }
 
-
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<MirroredInterface> instanceIdentifier,
-                                        @Nonnull final MirroredInterface mirroredInterfaceBefore,
-                                        @Nonnull final MirroredInterface mirroredInterfaceAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        deleteCurrentAttributes(instanceIdentifier, mirroredInterfaceBefore, writeContext);
-        writeCurrentAttributes(instanceIdentifier, mirroredInterfaceAfter, writeContext);
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<MirroredInterface> id,
                                         @Nonnull final MirroredInterface mirroredInterface,
index b97885f..0028996 100644 (file)
@@ -66,15 +66,6 @@ public class ArpTerminationTableEntryCustomizer extends FutureJVppCustomizer
         LOG.debug("L2 ARP termination table entry created successfully: {} {}", id, dataAfter);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<ArpTerminationTableEntry> id,
-                                        @Nonnull final ArpTerminationTableEntry dataBefore,
-                                        @Nonnull final ArpTerminationTableEntry dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException(
-                "ARP termination table entry update is not supported. It has to be deleted and then created.");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<ArpTerminationTableEntry> id,
                                         @Nonnull final ArpTerminationTableEntry dataBefore,
index e19f00b..1b5248f 100644 (file)
@@ -73,14 +73,6 @@ public class L2FibEntryCustomizer extends FutureJVppCustomizer
         LOG.debug("L2 FIB entry created successfully: {} {}", id, dataAfter);
     }
 
-    @Override
-    public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<L2FibEntry> id,
-                                        @Nonnull final L2FibEntry dataBefore, @Nonnull final L2FibEntry dataAfter,
-                                        @Nonnull final WriteContext writeContext) throws WriteFailedException {
-        throw new UnsupportedOperationException(
-                "L2 FIB entry update is not supported. It has to be deleted and then created.");
-    }
-
     @Override
     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<L2FibEntry> id,
                                         @Nonnull final L2FibEntry dataBefore, @Nonnull final WriteContext writeContext)
index 50d6754..5b371e6 100644 (file)
@@ -153,15 +153,9 @@ public class GreCustomizerTest extends WriterCustomizerTest {
         fail("WriteFailedException.CreateFailedException was expected");
     }
 
-    @Test
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdateCurrentAttributes() throws Exception {
-        try {
-            customizer.updateCurrentAttributes(id, generateGre(), generateGre(), writeContext);
-        } catch (WriteFailedException.UpdateFailedException e) {
-            assertEquals(UnsupportedOperationException.class, e.getCause().getClass());
-            return;
-        }
-        fail("WriteFailedException.UpdateFailedException was expected");
+        customizer.updateCurrentAttributes(id, generateGre(), generateGre(), writeContext);
     }
 
     @Test
index 3c6ffaf..af4f6bd 100644 (file)
@@ -27,6 +27,15 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.net.InetAddresses;
+import io.fd.hc2vpp.common.test.write.WriterCustomizerTest;
+import io.fd.hc2vpp.common.translate.util.NamingContext;
+import io.fd.hc2vpp.v3po.DisabledInterfacesManager;
+import io.fd.honeycomb.translate.write.WriteFailedException;
+import io.fd.vpp.jvpp.VppBaseCallException;
+import io.fd.vpp.jvpp.VppInvocationException;
+import io.fd.vpp.jvpp.core.dto.VxlanAddDelTunnel;
+import io.fd.vpp.jvpp.core.dto.VxlanAddDelTunnelReply;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
@@ -42,17 +51,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev170607.interfaces._interface.VxlanBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
-import com.google.common.net.InetAddresses;
-
-import io.fd.hc2vpp.common.test.write.WriterCustomizerTest;
-import io.fd.hc2vpp.common.translate.util.NamingContext;
-import io.fd.hc2vpp.v3po.DisabledInterfacesManager;
-import io.fd.honeycomb.translate.write.WriteFailedException;
-import io.fd.vpp.jvpp.VppBaseCallException;
-import io.fd.vpp.jvpp.VppInvocationException;
-import io.fd.vpp.jvpp.core.dto.VxlanAddDelTunnel;
-import io.fd.vpp.jvpp.core.dto.VxlanAddDelTunnelReply;
-
 public class VxlanCustomizerTest extends WriterCustomizerTest {
 
     private static final byte ADD_VXLAN = 1;
@@ -187,15 +185,9 @@ public class VxlanCustomizerTest extends WriterCustomizerTest {
         fail("WriteFailedException.CreateFailedException was expected");
     }
 
-    @Test
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdateCurrentAttributes() throws Exception {
-        try {
-            customizer.updateCurrentAttributes(id, generateVxlan(10), generateVxlan(11), writeContext);
-        } catch (WriteFailedException.UpdateFailedException e) {
-            assertEquals(UnsupportedOperationException.class, e.getCause().getClass());
-            return;
-        }
-        fail("WriteFailedException.UpdateFailedException was expected");
+        customizer.updateCurrentAttributes(id, generateVxlan(10), generateVxlan(11), writeContext);
     }
 
     @Test
index 1f3c7ec..f5bb60f 100644 (file)
@@ -175,15 +175,9 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest {
         fail("WriteFailedException.CreateFailedException was expected");
     }
 
-    @Test
+    @Test(expected = UnsupportedOperationException.class)
     public void testUpdateCurrentAttributes() throws Exception {
-        try {
-            customizer.updateCurrentAttributes(id, generateVxlanGpe(10), generateVxlanGpe(11), writeContext);
-        } catch (WriteFailedException.UpdateFailedException e) {
-            assertEquals(UnsupportedOperationException.class, e.getCause().getClass());
-            return;
-        }
-        fail("WriteFailedException.UpdateFailedException was expected");
+        customizer.updateCurrentAttributes(id, generateVxlanGpe(10), generateVxlanGpe(11), writeContext);
     }
 
     @Test
index 998c81f..edf31a6 100644 (file)
@@ -84,12 +84,9 @@ public class MirroredInterfacesCustomizerTest extends WriterCustomizerTest {
         assertCreateRequest(requestCaptor.getValue());
     }
 
-    @Test
+    @Test(expected = UnsupportedOperationException.class)
     public void updateCurrentAttributes() throws Exception {
         customizer.updateCurrentAttributes(validId, validData, validData, writeContext);
-        verify(api, times(2)).swInterfaceSpanEnableDisable(requestCaptor.capture());
-        assertDeleteRequest(requestCaptor.getAllValues().get(0));
-        assertCreateRequest(requestCaptor.getAllValues().get(1));
     }
 
     @Test