Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. @Rule
  2. public ExpectedException thrown = ExpectedException.none();
  3.  
  4. @Test
  5. public void shouldThrowExpectedException(){
  6. thrown.expect(IllegalArgumentException.class);
  7. thrown.expectMessage("id must not be null");
  8. throw new IllegalArgumentException("id must not be null");
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement