- mockStatic
Enable static mocking for all methods of a class.
- when
Expect calls to private methods without having to specify the method name. The
method will be looked
- mock
Creates mock with a specified strategy for its answers to interactions. It's
quite advanced feature
- verifyStatic
Verifies certain behavior happened at least once / exact number of times /
never. E.g:
verifyStatic
- spy
Spy on objects that are final or otherwise not "spyable" from normal Mockito.
- whenNew
Allows specifying expectations on new invocations. For example you might want to
throw an exception
- doReturn
Same as #doReturn(Object) but sets consecutive values to be returned. Remember
to usedoReturn() in t
- doNothing
Use doNothing() for setting void methods to do nothing. Beware that void methods
on mocks do nothing
- doThrow
Use doThrow() when you want to stub the void method with an exception. Stubbing
voids requires diffe
- doAnswer
Use doAnswer() when you want to stub a void method with generic Answer. Stubbing
voids requires diff
- verifyZeroInteractions
Verifies that no interactions happened on given mocks (can be both instance and
class mocks). Delega
- method