- mock
Creates mock with a specified strategy for its answers to interactions. It's
quite an advanced featu
- when
- verify
- times
Allows verifying exact number of invocations. E.g:
verify(mock, times(2)).someMethod("some arg");
- spy
Creates a spy of the real object. The spy calls real methods unless they are
stubbed. Real spies sho
- never
Alias to times(0), see Mockito#times(int) Verifies that interaction did not
happen. E.g:
verify(moc
- any
- doAnswer
Use doAnswer() when you want to stub a void method with generic Answer. Stubbing
voids requires diff
- doReturn
Same as #doReturn(Object) but sets consecutive values to be returned. Remember
to usedoReturn() in t
- doThrow
Use doThrow() when you want to stub the void method with an exception. Stubbing
voids requires diffe
- verifyNoMoreInteractions
Checks if any of given mocks has any unverified interaction. You can use this
method after you verif
- eq