From afd142caa030c7e16fbf6b709c29ce18c1e7b4a1 Mon Sep 17 00:00:00 2001 From: Ahmed Tawila Date: Thu, 16 Nov 2017 10:50:25 +0200 Subject: [PATCH] fix Sneaky Runnable test --- .../com/baeldung/sneakythrows/SneakyRunnableTest.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core-java/src/test/java/com/baeldung/sneakythrows/SneakyRunnableTest.java b/core-java/src/test/java/com/baeldung/sneakythrows/SneakyRunnableTest.java index cd31f545b9..794e70d475 100644 --- a/core-java/src/test/java/com/baeldung/sneakythrows/SneakyRunnableTest.java +++ b/core-java/src/test/java/com/baeldung/sneakythrows/SneakyRunnableTest.java @@ -6,12 +6,8 @@ import static junit.framework.TestCase.assertEquals; public class SneakyRunnableTest { - @Test + @Test(expected = InterruptedException.class) public void whenCallSneakyRunnableMethod_thenThrowException() { - try { - new SneakyRunnable().run(); - } catch (Exception e) { - assertEquals(InterruptedException.class, e.getStackTrace()); - } + new SneakyRunnable().run(); } }