Which annotation in Spring Boot is used to indicate that a class should be considered as a candidate for creating beans?
- @BeanCandidate
- @BeanCandidateClass
- @BeanScan
- @ComponentScan
In Spring Boot, the @ComponentScan annotation is used to indicate that a class should be considered as a candidate for creating beans. It allows Spring to scan packages and identify classes annotated with @Component, @Service, and other stereotype annotations, making them eligible for bean creation and dependency injection. It's a crucial part of Spring Boot's auto-configuration.
Loading...
Related Quiz
- Consider a scenario where you need to validate user input in a Spring Boot application, ensuring that it meets specific business rules that cannot be expressed with standard JSR-303 annotations. How would you implement this?
- The @SpringBootTest annotation in Spring Boot is used to _____.
- To create conditional beans within custom Auto Configuration, you can use the @_____ annotation with a specific condition.
- In what scenario would you use the @Modifying annotation in a Spring Data JPA repository method?
- In Spring Boot, how do you customize the behavior of a mocked object for specific arguments using Mockito?