File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -688,6 +688,7 @@ The following example demonstrates how to declare inlined properties:
688
688
----
689
689
<1> Declare `timezone` and `port` properties.
690
690
691
+ See <<testcontext-ctx-management-property-sources>> for examples and further details.
691
692
692
693
[[spring-testing-annotation-dirtiescontext]]
693
694
===== `@DirtiesContext`
@@ -2841,6 +2842,24 @@ The following example sets two inlined properties:
2841
2842
----
2842
2843
<1> Setting two properties by using two variations of the key-value syntax.
2843
2844
2845
+ [NOTE]
2846
+ ====
2847
+ As of Spring Framework 5.2, `@TestPropertySource` can be used as _repeatable annotation_.
2848
+ That means that you can have multiple declarations of `@TestPropertySource` on a single
2849
+ test class, with the `locations` and `properties` from later `@TestPropertySource`
2850
+ annotations overriding those from previous `@TestPropertySource` annotations.
2851
+
2852
+ In addition, you may declare multiple composed annotations on a test class that are each
2853
+ meta-annotated with `@TestPropertySource`, and all of those `@TestPropertySource`
2854
+ declarations will contribute to your test property sources.
2855
+
2856
+ Directly present `@TestPropertySource` annotations always take precedence over
2857
+ meta-present `@TestPropertySource` annotations. In other words, `locations` and
2858
+ `properties` from a directly present `@TestPropertySource` annotation will override the
2859
+ `locations` and `properties` from a `@TestPropertySource` annotation used as a
2860
+ meta-annotation.
2861
+ ====
2862
+
2844
2863
2845
2864
====== Default Properties File Detection
2846
2865
You can’t perform that action at this time.
0 commit comments