execution of a test (@Rule) or a test class (@ClassRule) • Designed to be combined — great for simple use cases • But: a single rule cannot be used for method-level and class-level callbacks, no support for instance-level callbacks
8!) • Powerful extension model with a focus on composability • API Segregation: Decouple test execution/reporting from test deﬁnition • Compatibility with older releases + migration path • Modularization + no external dependencies
M2 since 2016.2 • Eclipse support is available on a branch (see Instructions). Oﬃcial release slated for Oxygen.1. • Interim solution for other IDEs: JUnitPlatform Runner • Gradle/Maven: Plugin/Provider available • see https://github.com/junit-team/junit5-samples • Manually: ConsoleLauncher
we often cannot easily modify it. • Third-party libraries can make mistakes and ﬁx them because they have fewer users. • An extension point can potentially be used for diﬀerent features, or for implementing the same feature in a more ﬂexible way.
JUnit 5 team currently eliminates cyclic dependencies through the DeGraph Gradle plugin. Cyclic dependencies are not ideal, but Java compiles them correctly, so why is the JUnit 5 team so insistent on removing them?“