From ea2c8e4b507be93db613b393031e387f0e487f9d Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Tue, 5 Feb 2019 19:23:27 +0000 Subject: [PATCH] Fix usages of any(.class) matchers (#4453) In Mockito 2, if a method expects a primitive type, but an any(.class) matcher is used in its place, it will throw an error. To prepare for this upcoming breakage, change all existing any(.class) matchers to use the correct any() matcher. --- .../java/com/google/cloud/spanner/BaseSessionPoolTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BaseSessionPoolTest.java b/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BaseSessionPoolTest.java index 0b96be56d005..8209fe2fd3a9 100644 --- a/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BaseSessionPoolTest.java +++ b/google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BaseSessionPoolTest.java @@ -17,6 +17,7 @@ package com.google.cloud.spanner; import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyLong; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; @@ -45,8 +46,7 @@ public ScheduledExecutorService get() { // To prevent maintenance loop from running. doReturn(mockFuture) .when(mockExecutor) - .scheduleAtFixedRate( - any(Runnable.class), any(Long.class), any(Long.class), any(TimeUnit.class)); + .scheduleAtFixedRate(any(Runnable.class), anyLong(), anyLong(), any(TimeUnit.class)); return mockExecutor; }