2V0-72-22 practice question 12 of 15
Which statement about @TestPropertySource annotation is true? (Choose the best
Full set: 79 questionsThe @TestPropertySource annotation in Spring's testing framework provides a way to configure properties for integration tests. The properties attribute of this annotation allows for defining "inlined properties" as an array of strings. These inlined properties have a higher precedence than properties loaded from resource locations specified in the locations attribute of the same annotation. This feature is particularly useful for overriding specific properties for a single test case without needing to create a separate properties file.
A. Properties from @TestPropertySource have higher precedence than Java system properties, not the other way around.
B. Properties from @PropertySource are still loaded; @TestPropertySource simply has higher precedence and can override them.
C. By default, @TestPropertySource loads properties from the classpath, not relative to the project root.
1. Spring Framework Documentation, 6.1.x, "Testing - Context configuration with test property sources". Section 10.5.6. The documentation states, "Inlined properties have higher precedence than properties loaded from a resource location." It also details the full precedence order.
2. Spring Framework API Documentation for org.springframework.test.context.TestPropertySource. The Javadoc for the properties attribute explicitly mentions its higher precedence over properties loaded from locations.
Keep practicing
Take the free 2V0-72-22 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 2V0-72-22 practice questions
- Question 1Which two statements describe Spring JdbcTemplate? (Choose two.)
- Question 2Which two options will inject the value of the daily.limit system property? (Choose two.)
- Question 3Which two statements are true regarding Spring and Spring Boot Testing? (Choose two.)
- Question 4Which two statements are correct regarding Spring Boot auto-configuration customization? …
- Question 5Which two statements are true about @Controller annotated classes? (Choose two.)
- Question 6Which statement is true? (Choose the best
