2V0-72.22PSE · Question #42
Which three dependencies are provided by the spring-boot-starter-test? (Choose three.)
The correct answer is B. Hamcrest C. spring-test D. Junit. spring-boot-starter-test is Spring Boot's opinionated test starter that bundles the most commonly needed testing libraries so you don't have to declare them individually. JUnit (D) provides the test runner and annotations (@Test, etc.), Hamcrest (B) provides the expressive…
Question
Which three dependencies are provided by the spring-boot-starter-test? (Choose three.)
Options
- ACucumber
- BHamcrest
- Cspring-test
- DJunit
- EEasyMock
- FPowerMock
How the community answered
(24 responses)- A4% (1)
- B88% (21)
- F8% (2)
Explanation
spring-boot-starter-test is Spring Boot's opinionated test starter that bundles the most commonly needed testing libraries so you don't have to declare them individually. JUnit (D) provides the test runner and annotations (@Test, etc.), Hamcrest (B) provides the expressive matcher library used in assertThat(...) assertions, and spring-test (C) provides the Spring TestContext Framework for loading ApplicationContext and using @SpringBootTest.
The distractors are wrong because Spring Boot's testing stack is built around Mockito (not EasyMock or PowerMock), so E and F are not included. Cucumber (A) is a BDD framework you must add as a separate dependency - it is not part of the default starter.
Memory tip: Think "JHS" - JUnit runs, Hamcrest matches, Spring-test wires. Everything else (Mockito is also included but not a choice here; Cucumber, EasyMock, PowerMock are always opt-in) must be added manually.
Topics
Community Discussion
No community discussion yet for this question.