Skip to content

Commit

Permalink
Add native method to MissingMethodInvocationException (#3283)
Browse files Browse the repository at this point in the history
Fixes #3281
  • Loading branch information
franzwong committed Mar 1, 2024
1 parent 8431ae2 commit ea6ff8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -123,7 +123,7 @@ public static MockitoException missingMethodInvocation() {
" when(mock.getArticles()).thenReturn(articles);",
"",
"Also, this error might show up because:",
"1. you stub either of: final/private/equals()/hashCode() methods.",
"1. you stub either of: final/private/native/equals()/hashCode() methods.",
" Those methods *cannot* be stubbed/verified.",
" " + NON_PUBLIC_PARENT,
"2. inside when() you don't call method on mock but on some other object.",
Expand Down
Expand Up @@ -108,7 +108,7 @@ public void shouldReportMissingMethodInvocationWhenStubbing() {
"For example:",
" when(mock.getArticles()).thenReturn(articles);",
"Also, this error might show up because:",
"1. you stub either of: final/private/equals()/hashCode() methods.",
"1. you stub either of: final/private/native/equals()/hashCode() methods.",
" Those methods *cannot* be stubbed/verified.",
" Mocking methods declared on non-public parent classes is not supported.",
"2. inside when() you don't call method on mock but on some other object.");
Expand Down

0 comments on commit ea6ff8c

Please sign in to comment.