Skip to content

Instantly share code, notes, and snippets.

@indrekots
Created January 18, 2014 11:14
Show Gist options
  • Save indrekots/8489083 to your computer and use it in GitHub Desktop.
Save indrekots/8489083 to your computer and use it in GitHub Desktop.
Verifying the number of times a method is called with Mockito
Mockito.verify(userDao, Mockito.times(2)).save(Mockito.any(User.class));
@facundofarias
Copy link

In case of Collections, we can use: Mockito.anyCollectionOf(User.class)

@chaminiPrashakthi
Copy link

what is save here? Is that the method that you check number of occurences???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment