News for hackers. Stuff that matters.
Re:Mockito 2.1.0 by david-given on Monday October 03, 2016 @11:30AM (#12628168)
In my experience, Mockito never actually gets to that point, because my program has called an unmocked stub, tried to use the return result, and NPEd in an obscure and hard-to-debug manner before verification call.
Re:Mockito 2.1.0 by uw_rob on Monday October 03, 2016 @12:38PM (#12628959)
In my experience with Mockito and unit tests I haven't ever ran into this. However it seems like a very valid concern, and I could definitely see it causing problems.

I wonder if it is possible to use reflection and have mockito throw an exception if a stub method is called.

Re:Mockito 2.1.0 by lmm on Tuesday October 04, 2016 @03:47AM (#12633937)
Not really. You can set a custom default answer and you can write a method that creates mocks with that answer, but there are enough rough edges that it ends up amounting to writing your own test framework. Much easier to just use EasyMock.