Skip to content

Commit

Permalink
Replace usages of anyObject() in exception descriptions to use any() (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
takezoe authored and epeee committed Jun 22, 2020
1 parent ddfe44e commit ccb0006
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/mockito/internal/exceptions/Reporter.java
Expand Up @@ -243,11 +243,11 @@ public static MockitoException invalidUseOfMatchers(int expectedMatchersCount, L
"",
"This exception may occur if matchers are combined with raw values:",
" //incorrect:",
" someMethod(anyObject(), \"raw String\");",
" someMethod(any(), \"raw String\");",
"When using matchers, all arguments have to be provided by matchers.",
"For example:",
" //correct:",
" someMethod(anyObject(), eq(\"String by matcher\"));",
" someMethod(any(), eq(\"String by matcher\"));",
"",
"For more info see javadoc for Matchers class.",
""
Expand Down Expand Up @@ -561,7 +561,7 @@ public static MockitoException misplacedArgumentMatcher(List<LocalizedMatcher> l
"You cannot use argument matchers outside of verification or stubbing.",
"Examples of correct usage of argument matchers:",
" when(mock.get(anyInt())).thenReturn(null);",
" doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());",
" doThrow(new RuntimeException()).when(mock).someVoidMethod(any());",
" verify(mock).someMethod(contains(\"foo\"))",
"",
"This message may appear after an NullPointerException if the last matcher is returning an object ",
Expand Down

0 comments on commit ccb0006

Please sign in to comment.