Skip to content

Commit ea6ff8c

Browse files
authored
Add native method to MissingMethodInvocationException (#3283)
Fixes #3281
1 parent 8431ae2 commit ea6ff8c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/org/mockito/internal/exceptions/Reporter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public static MockitoException missingMethodInvocation() {
123123
" when(mock.getArticles()).thenReturn(articles);",
124124
"",
125125
"Also, this error might show up because:",
126-
"1. you stub either of: final/private/equals()/hashCode() methods.",
126+
"1. you stub either of: final/private/native/equals()/hashCode() methods.",
127127
" Those methods *cannot* be stubbed/verified.",
128128
" " + NON_PUBLIC_PARENT,
129129
"2. inside when() you don't call method on mock but on some other object.",

src/test/java/org/mockitousage/misuse/InvalidUsageTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void shouldReportMissingMethodInvocationWhenStubbing() {
108108
"For example:",
109109
" when(mock.getArticles()).thenReturn(articles);",
110110
"Also, this error might show up because:",
111-
"1. you stub either of: final/private/equals()/hashCode() methods.",
111+
"1. you stub either of: final/private/native/equals()/hashCode() methods.",
112112
" Those methods *cannot* be stubbed/verified.",
113113
" Mocking methods declared on non-public parent classes is not supported.",
114114
"2. inside when() you don't call method on mock but on some other object.");

0 commit comments

Comments
 (0)