I am trying to understand how to use
Mockito for
testing.
I understand
JUnit. Among other things you can instantiate a dummy object of a class you want to test and perform various assertions on its methods and functionality.
But if you have already the class written you want to test, what is the point of using a mock object (e.g. Mockito) as opposed to a dummy object? What can you do with a mock object that you can't do with a dummy object? Is it just a matter of convenience? that you don't have to insert dummy values into your dummy object, using instead, for example, the 'when' logic on a Mockito mock object?
I am a newbie and trying to understand. All suggestions and comments are welcome!