2V0-72.22PSE · Question #72
Which two options are application slices that can be tested with Spring Boot Testing? (Choose two.)
The correct answer is A. Repository C. Web. Spring Boot's slice testing framework isolates specific application layers using dedicated annotations, and Repository (@DataJpaTest, @DataMongoTest, etc.) and Web (@WebMvcTest, @WebFluxTest) are the two most prominently featured slices in both the documentation and the Spring…
Question
Which two options are application slices that can be tested with Spring Boot Testing? (Choose two.)
Options
- ARepository
- BMessaging
- CWeb
- DContainer
- EClient
How the community answered
(59 responses)- A83% (49)
- B5% (3)
- D10% (6)
- E2% (1)
Explanation
Spring Boot's slice testing framework isolates specific application layers using dedicated annotations, and Repository (@DataJpaTest, @DataMongoTest, etc.) and Web (@WebMvcTest, @WebFluxTest) are the two most prominently featured slices in both the documentation and the Spring Professional certification curriculum. These slices load only the beans relevant to that layer - @WebMvcTest wires up controllers, filters, and MVC config without a full context, while @DataJpaTest wires up JPA repositories and an in-memory database.
Why the distractors are wrong:
- B (Messaging) - there is no built-in
@MessagingTestslice in core Spring Boot; messaging integration testing requires a full or custom context. - D (Container) - not a Spring Boot testing concept at all; containers relate to deployment, not test slicing.
- E (Client) -
@RestClientTestdoes exist for testingRestTemplate/RestClientclients, but it is a secondary slice not typically listed among the two canonical slices the certification exam highlights.
Memory tip: Think of the two most common "sides" of a web application - the front door (Web layer, @WebMvcTest) and the back door (Repository layer, @DataJpaTest). Those two slices cover the ends of a typical request-response lifecycle and are the exam's go-to pair.
Topics
Community Discussion
No community discussion yet for this question.