Closed
Description
Status Quo
In the JUnit Jupiter programming model it is currently not forbidden for @Test
and lifecycle methods (i.e., @BeforeEach
, @BeforeAll
, etc.) to have a return value, even if it's assumed that no one declares anything other than void
as a return type for such methods.
For example, the following currently execute.
@Test
int test() {
fail("Boom!");
return 42;
}
@BeforeEach
int before() {
fail("Boom!");
return 42;
}
Related Issues
Deliverables
- Forbid return values from test and lifecycle methods via test predicates that exclude such methods.