Which two statements are true regarding @WebMvcTest? (Choose two.)
Which two statements are true regarding @WebMvcTest? (Choose two.)
The statements 'It auto-configures a MockMvc' and 'It will only scan for @Controller beans in the source code' are true regarding @WebMvcTest. @WebMvcTest is used for testing Spring MVC controllers, and it does not start a full server but nonetheless provides the necessary configuration to test @Controller classes and similar components. It auto-configures MockMvc, which is a crucial part of testing Spring MVC handlers. It also restricts the component scanning to only @Controller beans, making it efficient for controller layer testing.
Sorry CD is not correct but rather AD, why because @WebMvcTest is specifically designed for testing Spring MVC components without starting a full application server
CD is correct answer.