ConditionalTest: explicitly check that exceptions are not thrown
This commit is contained in:
parent
4662e35478
commit
7d03dd3e15
1 changed files with 8 additions and 4 deletions
|
@ -322,8 +322,10 @@ public class ConditionalTest implements WithAssertions {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whereFalseThenDoNotThrowException() throws Exception {
|
public void whereFalseThenDoNotThrowException() throws Exception {
|
||||||
Condition.where(false)
|
assertThatCode(() ->
|
||||||
.thenThrow(new IOException());
|
Condition.where(false)
|
||||||
|
.thenThrow(new IOException()))
|
||||||
|
.doesNotThrowAnyException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -336,7 +338,9 @@ public class ConditionalTest implements WithAssertions {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whereTrueOtherwiseThenDoNotThrowException() throws Exception {
|
public void whereTrueOtherwiseThenDoNotThrowException() throws Exception {
|
||||||
Condition.where(true)
|
assertThatCode(() ->
|
||||||
.otherwiseThrow(new IOException());
|
Condition.where(true)
|
||||||
|
.otherwiseThrow(new IOException()))
|
||||||
|
.doesNotThrowAnyException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue