Which annotation is primarily used for writing integration tests in Spring Boot applications?
- @Autowired
- @Component
- @RunWith(SpringRunner.class)
- @SpringBootTest
The @SpringBootTest annotation is primarily used for writing integration tests in Spring Boot applications. It loads the complete Spring application context, allowing you to perform tests in a real Spring environment.
Loading...
Related Quiz
- In what cases would you choose constructor injection over setter injection, and why?
- Which Spring Boot Starter is recommended for developing web applications?
- In Spring Boot, to apply JSR-303 Bean Validation on method parameters, the _____ annotation is used.
- When unit testing Spring Boot applications, how can you mock the behavior of methods in a class?
- How would you secure RESTful web services in Spring Security using OAuth2?