elvyssoares

Exception Handling 2 - Original - Toy Example

Jun 10th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. @Test
  2. public void test() throws Exception {
  3.     try {
  4.         MyClass c = new MyClass();
  5.         c.throwSomeException();
  6.         failBecauseExceptionWasNotThrown(SomeException.class);
  7.     } catch (SomeException e) {
  8.         assertThat(e.getMessage()).isEqualTo("Error message");
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment