From b0e814b05bde07318279a3922cfd2f3fa62f6850 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Sun, 31 May 2020 21:38:16 +0900 Subject: [PATCH] Replace usages of anyObject() in exception descriptions to use any() (#1931) --- src/main/java/org/mockito/internal/exceptions/Reporter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ",