Skip to content

Instantly share code, notes, and snippets.

@r-winkler
Created August 29, 2016 13:57
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/f36218181e00e6a2128561392270c034 to your computer and use it in GitHub Desktop.
Save r-winkler/f36218181e00e6a2128561392270c034 to your computer and use it in GitHub Desktop.
@Test
void exceptionTesting() {
Throwable exception = expectThrows(IllegalArgumentException.class, () -> {
throw new IllegalArgumentException("id must not be null");
});
assertEquals("id must not be null", exception.getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment