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

Which two statements are correct regarding Spring Boot auto-configuration customization? (Choose two.)

    Correct Answer: A, B

    To customize Spring Boot auto-configuration, you can use the @AutoConfigureAfter and @AutoConfigureBefore annotations to control the order in which specific auto-configuration classes are applied. Additionally, you can disable specific auto-configuration classes by using the exclude attribute on the @EnableAutoConfiguation annotation. These techniques allow you to fine-tune how auto-configuration is executed in a Spring Boot application.

Discussion
AzuniOptions: AB

I believe A and B is correct. The statement in A is exactly extracted from here: https://docs.spring.io/spring-boot/docs/3.0.0/reference/html/features.html#features.developing-auto-configuration.locating-auto-configuration-candidates B is correct as it is stated as one of the many ways to customize your auto-configuration. C is not correct as you can't just create a subclass of the auto-configuration class and expect it to work. You need to import that parent auto-configuration into a configuration of your own. D is incorrect as component scanning has nothing to do with this. E is actually also correct. We have to chose only 2, I looked at which statement between A and E were exactly the same as in the Spring Docs. A was exactly the same as in the documentation. This is a very peculiar question as it's answers are not really in the studying material, except for answer B.

rhuancaOptions: BC

B and C . A. The @AutoConfigureAfter, @AutoConfigureBefore, and @AutoConfigureOrder annotations are used to control the order in which auto-configuration classes are applied, not to apply configuration in a specific order

Azuni

It can't be C. It is not enough to simply subclass an auto-configuration class. It needs to be the same type of BEAN as the auto-configured bean. Not just the class.