Exam 2v0-7222 All QuestionsBrowse all questions from this exam
Question 40

Refer to the exhibit.

Which two statements are correct regarding the HelloAutoConfig auto-configuration class when it is specified in the META-INF/spring.factories file? (Choose two.)

    Correct Answer: B, D

    A HelloService bean will be created from the helloService() method only when there is no other HelloService bean in the ApplicationContext. This is indicated by the @ConditionalOnMissingBean annotation. This auto-configuration class is used only when the HelloService.class is on the classpath. This is indicated by the @ConditionalOnClass annotation.

Discussion
Azuni

The answers are correct. Refer to: 1) https://docs.spring.io/spring-boot/docs/1.2.5.RELEASE/reference/html/boot-features-developing-auto-configuration.html#boot-features-class-conditions 2) https://docs.spring.io/spring-boot/docs/1.2.5.RELEASE/reference/html/boot-features-developing-auto-configuration.html#boot-features-bean-conditions

2211094Options: BC

Correct is BC