Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void test() throws Exception {
- try {
- MyClass c = new MyClass();
- c.throwSomeException();
- failBecauseExceptionWasNotThrown(SomeException.class);
- } catch (SomeException e) {
- assertThat(e.getMessage()).isEqualTo("Error message");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment