We continue this answer . There is another difference: if you want your method to return different values, for example, when it was first called, called the second time, etc., then you can pass values, for example, ...
PowerMockito.doReturn(false, false, true).when(SomeClass.class, "SomeMethod", Matchers.any(SomeClass.class));
That way, it will return false when the method is called in one test case, and then it will return false again and finally true.
AZ_ Nov 28 '16 at 2:48 2016-11-28 14:48
source share