VMware vRealize Automation 8.x (2022) — Question 63
Which statement is true? (Choose the best answer.)
Answer options
- A. @ActiveProfiles is a class-level annotation that is used to instruct the Spring TestContext Framework to record all application events that are published in the ApplicationContext during the execution of a single test.
- B. @ActiveProfiles is a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped.
- C. @ActiveProfiles is a class-level annotation that you can use to configure the locations of properties files and inlined properties to be added to the set of PropertySources in the Environment for an ApplicationContext loaded for an integration test.
- D. @ActiveProfiles is a class-level annotation that is used to declare which bean definition profiles should be active when loaded an ApplicationContext for an integration test.
Correct answer: D
Explanation
The correct answer is D because @ActiveProfiles is specifically designed to indicate which bean profiles should be active during the loading of an ApplicationContext in integration tests. The other options confuse its purpose with event logging, configuration bootstrapping, and property file management, which are not the primary function of @ActiveProfiles.