Mockito, testing, nulls and exceptions

Personally, I prefer Mockito over any other mocking framework – Scala or Java. It has its caveats, but I strongly believe in its core testing methodology (stub mocks → invoke tested unit → assert output), its API is relatively simple, and it has a lot of (useful) features.

In Mockito, you have several options to achieve that; explicitly using verifyNoMoreInteractions on every test case; defining a Strictness test rule; or even returning “smart nulls” instead of plain nulls. See this SO question for details.