@BeforeAll Method as non-static
You simply need to annotate your test class (that contains the @BeforeAll
method) with the snippet below and you'll be good to go.
@TestInstance(Lifecycle.PER_CLASS)
If you want use non-static @BeforeAll
and @AfterAll
methods you should change test instance lifecycle to per_class
.
Look there: 2.10. Test Instance Lifecycle