To perform unit testing on the web layer of a Spring Boot application without loading the complete context, use the _____ annotation.
- @SpringBootTest
- @UnitTest
- @WebLayerTest
- @WebMvcTest
To perform unit testing on the web layer of a Spring Boot application without loading the complete context, you should use the @WebMvcTest annotation. This annotation focuses only on the web layer and is suitable for testing controllers.
Loading...
Related Quiz
- In Spring Boot, the _____ interface is used to represent a reactive stream that emits multiple items.
- What is the purpose of password encoding in Spring Security?
- To conditionally apply an auto-configuration based on the value of a configuration property, the _____ annotation is used in Spring Boot.
- 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.
- How would you implement a custom caching strategy in Spring Boot if the default ones do not meet your requirements?