What is the difference between verify() and verifyNoMoreInteractions() in Mockito?

verify() checks that a specific interaction happened on a mock, while verifyNoMoreInteractions() checks that nothing beyond the interactions you've already verified occurred on that mock.

Key Points

Example

After verifying that a repository's save() was called, adding verifyNoMoreInteractions(repository) ensures the code under test didn't also unexpectedly call delete() or update() on the same mock.

verify(repository).save(order);
verifyNoMoreInteractions(repository);

Interview Tip

A concise interview answer is

verify() confirms a specific call happened with expected arguments, while verifyNoMoreInteractions() confirms nothing else happened on that mock beyond what I've already verified. I use the latter sparingly, since it can make tests overly strict about interaction order and count.

Last updated: 16 July 2026

Previous question: How do you mock static methods in Mockito?

Next question: How do you mock final classes and methods in Mockito? Is it possible in earlier versions of Mockito?

More Mockito interview questions

All Mockito questions