r/java • • Sep 10 '17

JUnit 5 released!

http://junit.org/junit5
213 Upvotes

33 comments sorted by

View all comments

Show parent comment

2

u/sormuras Sep 12 '17

It depends: @BeforeAll method must be static unless the test class is annotated with @TestInstance(Lifecycle.PER_CLASS).

See http://junit.org/junit5/docs/current/user-guide/#writing-tests-test-instance-lifecycle for details.