Skip to content

Instantly share code, notes, and snippets.

@indrekots
Created January 4, 2014 09:04
Show Gist options
  • Save indrekots/8253276 to your computer and use it in GitHub Desktop.
Save indrekots/8253276 to your computer and use it in GitHub Desktop.
Subbing a behavior which throws an exception in Mockito
Mockito.when(userDao.getUserById(111)).thenThrow(new NoResultException());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment