Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update report message to use any() instead of anyObject() #1931

Merged
merged 1 commit into from May 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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