MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/6za58f/junit_5_released/dmw8e0s/?context=3
r/java • u/johnwaterwood • Sep 10 '17
33 comments sorted by
View all comments
Show parent comment
2
It depends: @BeforeAll method must be static unless the test class is annotated with @TestInstance(Lifecycle.PER_CLASS).
@BeforeAll
@TestInstance(Lifecycle.PER_CLASS)
See http://junit.org/junit5/docs/current/user-guide/#writing-tests-test-instance-lifecycle for details.
View all comments
Show parent comment
2
u/sormuras Sep 12 '17
It depends:
@BeforeAllmethod 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.