nerdexam
Broadcom-VMware

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…

Testing

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)
  • A
    83% (49)
  • B
    5% (3)
  • D
    10% (6)
  • E
    2% (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 @MessagingTest slice 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) - @RestClientTest does exist for testing RestTemplate/RestClient clients, 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

#Spring Boot Testing#Test Slices#@DataJpaTest#@WebMvcTest

Community Discussion

No community discussion yet for this question.

Full 2V0-72.22PSE Practice