Skip to content

Commit ea2c8e4

Browse files
TimvdLippekolea2
authored andcommitted
Fix usages of any(<Primitive>.class) matchers (#4453)
In Mockito 2, if a method expects a primitive type, but an any(<Primitive>.class) matcher is used in its place, it will throw an error. To prepare for this upcoming breakage, change all existing any(<Primitive>.class) matchers to use the correct any<Primitive>() matcher.
1 parent dba0848 commit ea2c8e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BaseSessionPoolTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.spanner;
1818

1919
import static org.mockito.Mockito.any;
20+
import static org.mockito.Mockito.anyLong;
2021
import static org.mockito.Mockito.doReturn;
2122
import static org.mockito.Mockito.mock;
2223
import static org.mockito.Mockito.spy;
@@ -45,8 +46,7 @@ public ScheduledExecutorService get() {
4546
// To prevent maintenance loop from running.
4647
doReturn(mockFuture)
4748
.when(mockExecutor)
48-
.scheduleAtFixedRate(
49-
any(Runnable.class), any(Long.class), any(Long.class), any(TimeUnit.class));
49+
.scheduleAtFixedRate(any(Runnable.class), anyLong(), anyLong(), any(TimeUnit.class));
5050
return mockExecutor;
5151
}
5252

0 commit comments

Comments
 (0)