Spying with Mockito - to call or not to call a method | stevenschwenke.de
when(bloMock.doSomeStuff()).thenReturn(1);
and
doReturn(1).when(bloMock).doSomeStuff();
The very important difference is that the first option will actually call the doSomeStuff()- method while the second will not. Both will cause doSomeStuff() to return the desired 1.
Read full article from Spying with Mockito - to call or not to call a method | stevenschwenke.de
No comments:
Post a Comment