Which annotation is used to test only the web layer in a Spring Boot application?

  • @ComponentTest
  • @ServiceTest
  • @SpringBootTest
  • @WebMvcTest
The @WebMvcTest annotation is used to test the web layer of a Spring Boot application. It focuses on setting up the application context with only the necessary components for testing the web layer, such as controllers and web-related beans.
Add your answer
Loading...

Leave a comment

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