Mockito - Does verify method reboot number of times?

Note that it is possible to reset the times a method was called with Mockito.reset(mock)

Update: as suggested below by t7tran,using clearInvocations(T... mocks) will reset only the number of invocations


Once created, mock will remember all interactions. Then you can selectively verify whatever interaction you are interested in.

It means that your mock counts each time you call the method you want and it does not reset when you call verify.

If you want further information about that, read this ( this is where I have found these information):

http://site.mockito.org/mockito/docs/current/org/mockito/Mockito.html


Using void reset(T... mocks) will reset all stubbings on the mocks. If you just need to reset the invocation counts for subsequent verifications, use void clearInvocations(T... mocks).