Skip to content

Instantly share code, notes, and snippets.

@jbleduigou
Created January 22, 2020 20:17
Show Gist options
  • Save jbleduigou/a47a144b5113ce3f6b16ee487ee1db38 to your computer and use it in GitHub Desktop.
Save jbleduigou/a47a144b5113ce3f6b16ee487ee1db38 to your computer and use it in GitHub Desktop.
An IntelliJ live template for asserting exceptions with Junit 5
Throwable exception = assertThrows(IllegalArgumentException.class, () -> $SELECTION$);
assertThat(
exception.getMessage(),
is("Okay, Houston, we've had a problem here"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment