I would like to create a JUnit 5 test suite that runs some tests. However, I would like the test suite to execute something before it starts running the tests. Is there a way to do this? I have tried using the @BeforeAll
annotation, but I don't think it's applicable in this sense, nothing seems to be happening.
I have:
@RunWith(JUnitPlatform.class)
@SelectPackages("org.foo")
public class FooITSuite
{
@BeforeAll
public void setUp()
{
System.out.println("Lift-off!!!");
}
}
Is this at all possible?
The tests do execute, but the setUp
method does not get executed.