VMware vRealize Automation 8.x (2022) — Question 49
Which statement about @TestPropertySource annotation is true? (Choose the best answer.)
Answer options
- A. Java system properties have higher precedence than the properties loaded from @TestPropertySource.
- B. Properties defined @PropertySource are not loaded if @TestPropertySource is used.
- C. @TestPropertySource annotation loads a properties file relative to the root of the project by default.
- D. Inlined properties defined in @TestPropertySource can be used to override properties defined in property files.
Correct answer: D
Explanation
Option D is correct because inlined properties defined within the @TestPropertySource annotation can indeed overwrite those defined in property files. Options A and B are incorrect as they misrepresent the behavior of property loading precedence, while option C is misleading since @TestPropertySource does not necessarily default to loading from the root of the project.