summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/test
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-10-28 13:12:19 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-11-01 20:59:57 +0100
commitf335d213be6acd95835003bb7f5e591018fc06c2 (patch)
tree04d88058268eaa74767c9494ac14caf054d42c98 /v3po/v3po2vpp/src/test
parentb10781b9ba682beaf23aa5d6183afa222aa93206 (diff)
HONEYCOMB-272: bump mockito version to 2.2.9
ArgumentMatchers.any() does not match null anymore, so some of the tests has been updated. Change-Id: I5de0fdfe87fc8e5c8ce24bfae8daeaba032195ff Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test')
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java45
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java7
2 files changed, 7 insertions, 45 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java
index ccf1f83b3..8a4e9213d 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java
@@ -35,10 +35,8 @@ import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
import io.fd.vpp.jvpp.core.dto.InputAclSetInterfaceReply;
import java.util.Arrays;
import java.util.Collections;
-import org.hamcrest.BaseMatcher;
-import org.hamcrest.Description;
-import org.hamcrest.Matcher;
import org.junit.Test;
+import org.mockito.ArgumentMatcher;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.Mockito;
@@ -129,44 +127,13 @@ public class IetfAclCustomizerTest extends WriterCustomizerTest {
inOrder.verify(api).inputAclSetInterface(inputAclSetInterfaceWriteRequest()); // assignment
}
- private Matcher<ClassifyAddDelTable> actionOnMissEquals(final int action) {
- return new BaseMatcher<ClassifyAddDelTable>() {
- public Object item;
-
- @Override
- public void describeTo(final Description description) {
- description.appendText("Expected ClassifyAddDelTable[missNextIndex=" + action + "] but was " + item);
- }
-
- @Override
- public boolean matches(final Object item) {
- this.item = item;
- if (item instanceof ClassifyAddDelTable) {
- return ((ClassifyAddDelTable) item).missNextIndex == action;
- }
- return false;
- }
- };
+ private ArgumentMatcher<ClassifyAddDelTable> actionOnMissEquals(final int action) {
+ return table -> table.missNextIndex == action;
}
- private Matcher<ClassifyAddDelSession> actionOnHitEquals(final int action) {
- return new BaseMatcher<ClassifyAddDelSession>() {
- public Object item;
-
- @Override
- public void describeTo(final Description description) {
- description.appendText("Expected ClassifyAddDelSession[hitNextIndex=" + action + "] but was " + item);
- }
-
- @Override
- public boolean matches(final Object item) {
- this.item = item;
- if (item instanceof ClassifyAddDelSession) {
- return ((ClassifyAddDelSession) item).hitNextIndex == action;
- }
- return false;
- }
- };
+
+ private ArgumentMatcher<ClassifyAddDelSession> actionOnHitEquals(final int action) {
+ return session -> session.hitNextIndex == action;
}
private Deny deny() {
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java
index 522ab7297..00b424d9d 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/ip/Ipv4AddressCustomizerTest.java
@@ -182,12 +182,7 @@ public class Ipv4AddressCustomizerTest extends WriterCustomizerTest {
private static ArgumentMatcher<InstanceIdentifier<?>> matchInstanceIdentifier(
Class<?> desiredClass) {
- return new ArgumentMatcher<InstanceIdentifier<?>>() {
- @Override
- public boolean matches(final Object o) {
- return o instanceof InstanceIdentifier && ((InstanceIdentifier) o).getTargetType().equals(desiredClass);
- }
- };
+ return o -> o instanceof InstanceIdentifier && (o.getTargetType().equals(desiredClass));
}
@Test(expected = WriteFailedException.UpdateFailedException.class)