summaryrefslogtreecommitdiffstats
path: root/v3po
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
commitb8f86e7069a67031514c43caf8022e8553159fa7 (patch)
treed112017e36341e114fea4cdefdc5b2a8a90b2030 /v3po
parent80804f713cdd8d3c30c7e2dd19cbc2a61a1a70c0 (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')
-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)