summaryrefslogtreecommitdiffstats
path: root/v3po
diff options
context:
space:
mode:
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)