Spring Boot - Inversion of Control and Dependency Injection
How can you ensure a Spring component annotated with
@Component is only registered when the 'test' profile is active?@Component is only registered when the 'test' profile is active?@Profile annotation restricts bean registration to specified profiles.@Component and @Profile("test") to activate only in 'test' profile.@Component("test") sets bean name, not profile; spring.profiles.active is a property, not annotation; @ConditionalOnProperty checks properties, not profiles.@Profile("test") alongside @Component. -> Option D15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions