How to override default behavior of unstubbed void methods in Mockito?
<p>I am mocking a fairly complex object hierarchy, and as I am working through it, there's a large number of methods that can be involved. If I miss and leave unstubbed a non-void method, Mockito by default makes it return null which quickly triggers a NPE and it's easy for me to locate it. However, if I miss a void method, the default behavior is to do nothing, which frequently leads to failures further downstream and much harder to debug. I'd like to change this default, e.g. throw a custom exception, but don't seem to find a way.
Thanks in advance! </p>