Spring Boot - Advanced Patterns
You want to create a custom auto-configuration that only creates a bean if no other bean of the same type exists and a property
app.feature.enabled is true. Which combination of annotations should you use on your configuration class and bean method?
A) @Configuration on class, @ConditionalOnMissingBean and @ConditionalOnProperty on bean method
B) @Component on class, @ConditionalOnBean on bean method
C) @Configuration on class, @ConditionalOnClass on bean method
D) @EnableAutoConfiguration on class, no conditions on bean method