mirror of
https://github.com/google/nomulus
synced 2026-08-17 20:56:10 +00:00
Migrate org.mockito.Matchers#any* to org.mockito.ArgumentMatchers
The former is deprecated and replaced by the latter in Mockito 2. However, there is a
functional difference: ArgumentMatchers will reject `null` and check the type
if the matcher specified a type (e.g. `any(Class)` or `anyInt()`). `any()` will
remain to accept anything.
For more information see []
Tested:
TAP --sample ran all affected tests and none failed
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=250690285
This commit is contained in:
@@ -48,7 +48,7 @@ import javax.annotation.Nullable;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.ArgumentMatchers;
|
||||
|
||||
/** Unit tests for {@link GenerateAllocationTokensCommand}. */
|
||||
public class GenerateAllocationTokensCommandTest
|
||||
@@ -93,7 +93,7 @@ public class GenerateAllocationTokensCommandTest
|
||||
.doThrow(fakeException)
|
||||
.doCallRealMethod()
|
||||
.when(spyCommand)
|
||||
.saveTokens(Mockito.any());
|
||||
.saveTokens(ArgumentMatchers.any());
|
||||
runCommand("--number", "1");
|
||||
assertAllocationTokens(createToken("123456789ABCDEFG", null, null));
|
||||
assertInStdout("123456789ABCDEFG");
|
||||
|
||||
Reference in New Issue
Block a user