diff --git a/src/main/java/org/mockito/internal/exceptions/Reporter.java b/src/main/java/org/mockito/internal/exceptions/Reporter.java index f661b81e5c..75e98edcac 100644 --- a/src/main/java/org/mockito/internal/exceptions/Reporter.java +++ b/src/main/java/org/mockito/internal/exceptions/Reporter.java @@ -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.", "" @@ -561,7 +561,7 @@ public static MockitoException misplacedArgumentMatcher(List 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 ",