Created
August 29, 2016 13:55
-
-
Save r-winkler/1bff8c57f7f6dcda15f26182cc0bbce2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Rule | |
public ExpectedException thrown = ExpectedException.none(); | |
@Test | |
public void shouldThrowExpectedException(){ | |
thrown.expect(IllegalArgumentException.class); | |
thrown.expectMessage("id must not be null"); | |
throw new IllegalArgumentException("id must not be null"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment