Testing / JUnit6 Interview Questions
What is the JUnit 6 architecture and what are its three main components?
JUnit 6 retains the three-tier architecture introduced in JUnit 5, with one key change: all three components now share a single unified version number instead of having separate version schemes.
| Component | Artifact prefix | Role |
|---|---|---|
| JUnit Platform | junit-platform-* | Foundation: defines TestEngine SPI, launcher API, and the mechanism for discovering and executing tests. IDEs and build tools integrate at this layer. |
| JUnit Jupiter | junit-jupiter-* | Writing tests: provides all annotations (@Test, @BeforeEach, @ParameterizedTest, etc.), assertions, and extension APIs used by developers writing tests. |
| JUnit Vintage | junit-vintage-* | Legacy: runs JUnit 3 and JUnit 4 tests on the JUnit Platform. Deprecated in JUnit 6 -- will be removed in a future major version. |
<!-- Maven BOM: single version for all modules in JUnit 6 --> <dependencyManagement> <dependencies> <dependency> <groupId>org.junit</groupId> <artifactId>junit-bom</artifactId> <version>6.1.1</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <scope>test</scope> <!-- Version resolved by BOM: 6.1.1 --> </dependency> </dependencies> <!-- JUnit 5 used different version numbers: Platform: 1.x.x Jupiter: 5.x.x Vintage: 5.x.x JUnit 6: all three use 6.x.x -->
Key change from JUnit 5: in JUnit 5, the Platform used version 1.x.x while Jupiter and Vintage used 5.x.x. This caused confusion in dependency management. JUnit 6 unifies all three under the same 6.x.x version, making BOM usage straightforward and eliminating version mismatch errors.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
