Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @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");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement