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.
Loading...
Related Quiz
- How can you optimize the JVM (Java Virtual Machine) for a Spring Boot application?
- To bind the properties defined in the YAML file to a Java object, you can use the _____ annotation in Spring Boot.
- How can you change the default port number of the embedded web server in a Spring Boot application?
- 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?
- How can you configure an array of values using the YAML configuration file in Spring Boot?