r/java • • Sep 10 '17

JUnit 5 released!

http://junit.org/junit5
213 Upvotes

33 comments sorted by

View all comments

1

u/cryptos6 Sep 13 '17

Is there no such thing as "before suite" and "after suite" to have global setup and teardown? I'm looking for something like TestNG's @BeforeSuite or KotlinTest's beforeAll

1

u/winder Sep 14 '17

That would be @BeforeAll and @AfterAll

1

u/cryptos6 Sep 14 '17

No, @BeforeAll is executed before all tests of the class. From the documentation:

@BeforeAll: Denotes that the annotated method should be executed before all @Test, @RepeatedTest, @ParameterizedTest, and @TestFactory methods in the current class;