In Spring Boot, which annotation is used to denote that a test class should load only specific parts of the application context for Web tests?
- @ContextConfiguration
- @SpringBootTest
- @WebAppConfiguration
- @WebMvcTest
The @WebMvcTest annotation is used to load only the Web layer of the Spring application context, making it suitable for testing controllers and related components.
Loading...
Related Quiz
- To customize the response body of a Spring Boot controller method, the @_____ annotation can be used.
- Which annotation in Spring is used to automate the wiring of bean dependencies?
- How can you configure profiles in Spring Boot to optimize configuration loading during testing?
- In a Spring Cloud environment, to configure a service to discover its peers using Eureka, the property ____ must be defined in the application's properties or YAML file.
- Which of the following can be used to enable method security annotations in a Spring Security configuration class?