Skip to content

Commit afd142c

Browse files
author
Ahmed Tawila
committed
fix Sneaky Runnable test
1 parent 1bbe919 commit afd142c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎core-java/src/test/java/com/baeldung/sneakythrows/SneakyRunnableTest.java‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66

77
public class SneakyRunnableTest {
88

9-
@Test
9+
@Test(expected = InterruptedException.class)
1010
public void whenCallSneakyRunnableMethod_thenThrowException() {
11-
try {
12-
new SneakyRunnable().run();
13-
} catch (Exception e) {
14-
assertEquals(InterruptedException.class, e.getStackTrace());
15-
}
11+
new SneakyRunnable().run();
1612
}
1713
}

0 commit comments

Comments
 (0)