VMware vRealize Automation 8.x (2022) — Question 13
Which two statements are correct when @SpringBootApplication is annotated on a class? (Choose two.)
Answer options
- A. It causes Spring Boot to enable auto-configuration by default.
- B. Component scanning will start from the package of the class.
- C. All other annotations on the class will be ignored.
- D. Methods in the class annotated with @Bean will be ignored.
- E. A separate ApplicationContext will be created for each class annotated with @SpringBootApplication.
Correct answer: A, B
Explanation
Option A is correct as @SpringBootApplication indeed triggers auto-configuration by default. Option B is also correct since component scanning starts from the package of the class with the annotation. Options C, D, and E are incorrect as they misrepresent the behavior of the annotation; other annotations and methods with @Bean are not ignored, and only one ApplicationContext is created for the application.