summaryrefslogtreecommitdiffstats
path: root/documentapi
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@verizonmedia.com>2019-10-18 15:19:59 +0200
committerHåkon Hallingstad <hakon@verizonmedia.com>2019-10-18 15:19:59 +0200
commit579754fa5b5f4768a75fc3aed08f70ffb29db0e3 (patch)
tree825e5366b8253535bb9366722006ef49c6e83c53 /documentapi
parent19ab63311c9354db919a9a9ac38d34342e1ca204 (diff)
Use mockito-core 3.1.0
Diffstat (limited to 'documentapi')
-rw-r--r--documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/RoutingPolicyRepositoryTest.java2
-rw-r--r--documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/TargetCachingSlobrokHostFetcherTest.java24
2 files changed, 13 insertions, 13 deletions
diff --git a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/RoutingPolicyRepositoryTest.java b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/RoutingPolicyRepositoryTest.java
index c86a591de60..823eebd46c3 100644
--- a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/RoutingPolicyRepositoryTest.java
+++ b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/RoutingPolicyRepositoryTest.java
@@ -5,7 +5,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/TargetCachingSlobrokHostFetcherTest.java b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/TargetCachingSlobrokHostFetcherTest.java
index 404a3660208..cdc5878321a 100644
--- a/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/TargetCachingSlobrokHostFetcherTest.java
+++ b/documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/TargetCachingSlobrokHostFetcherTest.java
@@ -12,9 +12,9 @@ import java.util.stream.Collectors;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -56,9 +56,9 @@ public class TargetCachingSlobrokHostFetcherTest {
Fixture() {
when(mockMirror.updates()).thenReturn(1);
when(routingContext.getMirror()).thenReturn(mockMirror);
- when(mockSlobrokPolicy.lookup(anyObject(), eq(idOfIndex(1)))).thenReturn(dummyEntries(1));
- when(mockSlobrokPolicy.lookup(anyObject(), eq(idOfIndex(2)))).thenReturn(dummyEntries(2));
- when(mockSlobrokPolicy.lookup(anyObject(), eq(idOfWildcardLookup()))).thenReturn(dummyEntries(1, 2, 3, 4));
+ when(mockSlobrokPolicy.lookup(any(), eq(idOfIndex(1)))).thenReturn(dummyEntries(1));
+ when(mockSlobrokPolicy.lookup(any(), eq(idOfIndex(2)))).thenReturn(dummyEntries(2));
+ when(mockSlobrokPolicy.lookup(any(), eq(idOfWildcardLookup()))).thenReturn(dummyEntries(1, 2, 3, 4));
}
}
@@ -68,7 +68,7 @@ public class TargetCachingSlobrokHostFetcherTest {
String spec = fixture.hostFetcher.getTargetSpec(1, fixture.routingContext);
assertEquals(resolvedSpecOfIndex(1), spec);
- verify(fixture.mockSlobrokPolicy, times(1)).lookup(anyObject(), eq(idOfIndex(1)));
+ verify(fixture.mockSlobrokPolicy, times(1)).lookup(any(), eq(idOfIndex(1)));
}
@Test
@@ -79,7 +79,7 @@ public class TargetCachingSlobrokHostFetcherTest {
String spec2 = fixture.hostFetcher.getTargetSpec(1, fixture.routingContext);
assertEquals(spec1, spec2);
// Only invoked once
- verify(fixture.mockSlobrokPolicy, times(1)).lookup(anyObject(), anyString());
+ verify(fixture.mockSlobrokPolicy, times(1)).lookup(any(), anyString());
}
@Test
@@ -97,8 +97,8 @@ public class TargetCachingSlobrokHostFetcherTest {
assertEquals(spec1_1, spec1_2);
assertEquals(spec2_1, spec2_2);
- verify(fixture.mockSlobrokPolicy, times(1)).lookup(anyObject(), eq(idOfIndex(1)));
- verify(fixture.mockSlobrokPolicy, times(1)).lookup(anyObject(), eq(idOfIndex(2)));
+ verify(fixture.mockSlobrokPolicy, times(1)).lookup(any(), eq(idOfIndex(1)));
+ verify(fixture.mockSlobrokPolicy, times(1)).lookup(any(), eq(idOfIndex(2)));
}
@Test
@@ -106,7 +106,7 @@ public class TargetCachingSlobrokHostFetcherTest {
Fixture fixture = new Fixture();
when(fixture.mockMirror.updates()).thenReturn(1).thenReturn(2);
- when(fixture.mockSlobrokPolicy.lookup(anyObject(), eq(idOfIndex(1))))
+ when(fixture.mockSlobrokPolicy.lookup(any(), eq(idOfIndex(1))))
.thenReturn(dummyEntries(1)).thenReturn(dummyEntries(2));
String spec1 = fixture.hostFetcher.getTargetSpec(1, fixture.routingContext);
@@ -125,7 +125,7 @@ public class TargetCachingSlobrokHostFetcherTest {
spec = fixture.hostFetcher.getTargetSpec(null, fixture.routingContext);
assertNotNull(spec);
- verify(fixture.mockSlobrokPolicy, times(2)).lookup(anyObject(), eq(idOfWildcardLookup()));
+ verify(fixture.mockSlobrokPolicy, times(2)).lookup(any(), eq(idOfWildcardLookup()));
}
}