summaryrefslogtreecommitdiffstats
path: root/routing/routing-impl/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 /routing/routing-impl/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 'routing/routing-impl/src/test/java')
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java17
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingInstanceCustomizerTest.java12
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizerTest.java10
3 files changed, 8 insertions, 31 deletions
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java
index dc932cd0f..8a52b8cc6 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java
@@ -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
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingInstanceCustomizerTest.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingInstanceCustomizerTest.java
index 68fcba5ac..2e073d726 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingInstanceCustomizerTest.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingInstanceCustomizerTest.java
@@ -15,13 +15,11 @@
*/
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
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizerTest.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizerTest.java
index 21a2bdc14..6174f8473 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizerTest.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/RoutingProtocolCustomizerTest.java
@@ -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);
}
}