exam questions

Exam 2V0-72.22 All Questions

View all questions & answers for the 2V0-72.22 exam

Exam 2V0-72.22 topic 1 question 49 discussion

Actual exam question from VMware's 2V0-72.22
Question #: 49
Topic #: 1
[All 2V0-72.22 Questions]

Which statement about @TestPropertySource annotation is true? (Choose the best answer.)

  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
quakquak3
1 month, 1 week ago
Selected Answer: D
@TestPropertySource can be used for both adding properties from a file or adding properties as key-value-pairs. But relative paths for property file locations are treated as relative to the test class package, not the project root, see https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/context/TestPropertySource.html#locations()
upvoted 1 times
...
Azuni
5 months, 1 week ago
Answer is correct as specified in: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/context/TestPropertySource.html
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago