Hint: Use junit-jupiter for full JUnit 5, not just api [OK]
Common Mistakes:
Assuming api artifact is enough
Ignoring missing scope tag
Thinking version causes ClassNotFoundException
5. You want to add JUnit 5 to your Maven project but only for running tests, not for compiling main code. Which is the best complete dependency snippet to add in pom.xml?
hard
A.
org.junit.vintage
junit-vintage-engine
5.9.2
test
B.
org.junit.jupiter
junit-jupiter-engine
5.9.2
compile
C.
org.junit.jupiter
junit-jupiter
5.9.2
test
D.
org.junit.jupiter
junit-jupiter-api
5.9.2
runtime
Solution
Step 1: Identify full JUnit 5 dependency
The junit-jupiter artifact includes API and engine for tests.
Step 2: Confirm scope for test-only usage
Setting scope to test ensures dependency is used only during testing.
Final Answer:
Complete JUnit 5 dependency with test scope -> Option C
Quick Check:
JUnit 5 + test scope =
org.junit.jupiter
junit-jupiter
5.9.2
test
[OK]
Hint: Use junit-jupiter with scope test for proper test setup [OK]
Common Mistakes:
Using compile or runtime scope instead of test
Using only junit-jupiter-engine or vintage-engine
Confusing API artifact with full junit-jupiter
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.