ConditionalTest: explicitly check that exceptions are not thrown

This commit is contained in:
Paul Campbell 2018-07-19 06:37:13 +01:00
parent 4662e35478
commit 7d03dd3e15

View file

@ -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();
}
}