Is it possible to have an assertion in the @AfterAll method?

360 Views Asked by At

I would like to have an assertion in the @AfterAll method after aggregating data from a @ParameterizedTest. Unfortunately, it doesn't work because the exceptions thrown within the @AfterAll method are not propagated up.

class ExampleTest {

    @AfterAll
    static void afterAll() {
        throw new RuntimeException("will not fail the test");
    }
}

Is there any way to have an assertion after all test methods have completed?

Edit: it appears to be a problem with Intellij. I reported it as a bug.

0

There are 0 best solutions below