elvyssoares

Exception Handling 1 - Refactored - Toy Example

Jun 10th, 2020
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.24 KB | None | 0 0
  1. @Test
  2. public void test() {
  3.     MyClass c = new MyClass();
  4.     Throwable t = catchThrowable(() -> c.throwSomeException());
  5.     assertThat(t).isInstanceOf(SomeException.class);
  6.     assertTrue(c.isA());
  7.     assertTrue(c.isB());
  8.     assertTrue(c.isC());
  9. }
Advertisement
Add Comment
Please, Sign In to add comment