junit5
junit5 copied to clipboard
Assumptions should support most/all features of Assertions
I am trying to use something like
Assumptions.assumeThrows(Exception.class, () -> program.run());
to ignore the test if no exception was thrown. The test should e.g. check whether cleanup/rollback is done correctly on error.
But assumeThrows
does not exist.
The idea behind is: There is a separate test with
Assertions.assertThrows(Exception.class, () -> program.run());
that will fail if the method does not throw an exception.
If the method does not throw an exception, there should be one failing test only pointing to the problem.
The idea of this feature request is to add all features of Assertions also at Assumptions. A think this could be easily doable if we would generate the code using Assertions as source and replace all assertions by assumptions?