mockito icon indicating copy to clipboard operation
mockito copied to clipboard

refactor: verifyNoMoreInteractions error message does not provide a way to solve the issue.

Open YazeedAlKhalaf opened this issue 3 years ago • 0 comments

Description

the error that is in the console is not helpful in solving the issue.

for me, through trial and error I discovered that I should verify each call for verifyNoMoreInteractions to work.

So I suggest adding a "Did you do the following ..." helper when printing the error in the console.

Now:

No more calls expected, but following found: MockCat.meow()

Proposal:

No more calls expected, but following found: MockCat.meow()

Tip: Make sure you verified every call for the mock you are running verifyNoMoreInteractions on.
Use verify(...).called(...).

YazeedAlKhalaf avatar Dec 21 '21 03:12 YazeedAlKhalaf