In Spring Boot, using the _____ annotation in test classes allows selectively enabling parts of the application context, making tests more focused and faster.

  • @DataJpaTest
  • @MockBean
  • @SpringBootTest
  • @WebMvcTest
In Spring Boot, the @WebMvcTest annotation allows you to focus only on the web layer while testing. It loads only the necessary components for testing the controllers and does not load the complete application context, making tests more focused and faster.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *