For integration testing in Spring Boot, the _____ annotation is used to specify that only certain parts or layers of the application should be loaded.
- @ContextConfiguration
- @IntegrationTest
- @SpringBootTest
- @WebMvcTest
In Spring Boot, to load only the web layer of an application during integration tests, you can use the @WebMvcTest annotation. It narrows down the scope of the context loaded for testing to just the web-related components.
Loading...
Related Quiz
- Which annotation is used to define a bean in the Spring context?
- The @DataJpaTest annotation in Spring Boot is typically used to test _____.
- Imagine you are starting a new Spring Boot project where you need to support both web applications and RESTful APIs. How would you set up the project to accommodate both requirements effectively?
- In Spring Boot, how do you configure the TestRestTemplate to work with a specific profile during integration testing?
- To create a simple unit test in Spring Boot, you can use the _____ annotation to load a minimal test context.