SYSTEM Cited by 1 source
JUnit 5¶
JUnit 5 (aka JUnit Jupiter) is the current generation of the JVM's standard-library test framework, released 2017. It replaced JUnit 4's single-runner model with a modular architecture: the Jupiter engine (new programming model), the Vintage engine (JUnit 4 compatibility), and Platform (runner / discovery APIs, used by Surefire, Failsafe, Gradle, IDEs).
Key primitives: @Test, @BeforeEach / @AfterEach,
@BeforeAll / @AfterAll, @ParameterizedTest, @Nested,
@DisplayName, @Tag, extension model via
@ExtendWith(...Extension.class).
Relevance to Testcontainers ingest¶
- Testcontainers ships a
junit-jupiterMaven module that adds@Testcontainers(class-level) and@Container(field-level) annotations for declarative container lifecycle per test class. Zalando ZMS uses this alongside theAbstractIntegrationTestbase-class idiom (patterns/shared-static-container-across-tests). - The per-class annotation model has documented limits:
containers cannot be shared between test classes and the
extension "has only been tested with sequential test
execution" — the reason many teams prefer the static-field
pattern over
@Container.
Seen in¶
- sources/2021-02-24-zalando-integration-tests-with-testcontainers — Zalando Marketing Services uses JUnit 5 as its test framework for Testcontainers-based integration tests.
Related¶
- systems/testcontainers — integrates via
junit-jupitermodule. - systems/spring-boot —
@SpringBootTestworks on top of JUnit 5 via Spring'sSpringExtension. - systems/maven-surefire-plugin · systems/maven-failsafe-plugin — the canonical Maven runners for JUnit 5 test discovery.