Skip to content

Instantly share code, notes, and snippets.

@r-winkler
Last active August 29, 2016 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r-winkler/4bf73e78e32e977fb03699e55269577c to your computer and use it in GitHub Desktop.
Save r-winkler/4bf73e78e32e977fb03699e55269577c to your computer and use it in GitHub Desktop.
@Test(expected = IllegalArgumentException.class)
public void exceptionTesting() {
try {
throw new IllegalArgumentException("id must not be null");
}
catch(IllegalArgumentException iae) {
assertEquals("id must not be null", iae.getMessage());
throw iae;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment