From 7d03dd3e1573031b808366d1160da7eda50e9b38 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 19 Jul 2018 06:37:13 +0100 Subject: [PATCH] ConditionalTest: explicitly check that exceptions are not thrown --- .../net/kemitix/conditional/ConditionalTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/test/java/net/kemitix/conditional/ConditionalTest.java b/src/test/java/net/kemitix/conditional/ConditionalTest.java index 8e85a13..7cc8465 100644 --- a/src/test/java/net/kemitix/conditional/ConditionalTest.java +++ b/src/test/java/net/kemitix/conditional/ConditionalTest.java @@ -322,8 +322,10 @@ public class ConditionalTest implements WithAssertions { @Test public void whereFalseThenDoNotThrowException() throws Exception { - Condition.where(false) - .thenThrow(new IOException()); + assertThatCode(() -> + Condition.where(false) + .thenThrow(new IOException())) + .doesNotThrowAnyException(); } @Test @@ -336,7 +338,9 @@ public class ConditionalTest implements WithAssertions { @Test public void whereTrueOtherwiseThenDoNotThrowException() throws Exception { - Condition.where(true) - .otherwiseThrow(new IOException()); + assertThatCode(() -> + Condition.where(true) + .otherwiseThrow(new IOException())) + .doesNotThrowAnyException(); } }