I am currently in the process of using Mockito to mock my service layer objects in a Spring MVC application in which I want to test my Controller methods. However, as I have been reading on the specifics of Mockito, I have found that the methods doReturn(...).when(...)
is equivalent to when(...).thenReturn(...)
. So, my question is what is the point of having two methods that do the same thing or what is the subtle difference between doReturn(...).when(...)
and when(...).thenReturn(...)
?
Any help would be appreciated.