Skip to content

Commit

Permalink
Fix usages of any(<Primitive>.class) matchers (#4453)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TimvdLippe authored and kolea2 committed Feb 5, 2019
1 parent dba0848 commit ea2c8e4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit ea2c8e4

Please sign in to comment.