|
172 | 172 | * @ContextConfiguration
|
173 | 173 | * public class ExtendedTest extends BaseTest {
|
174 | 174 | * // ...
|
175 |
| - * } |
176 |
| - * </pre> |
177 |
| - * |
| 175 | + * }</pre> |
| 176 | + * <p>If {@code @TestPropertySource} is used as a <em>{@linkplain Repeatable |
| 177 | + * repeatable}</em> annotation, the following special rules apply. |
| 178 | + * <ol> |
| 179 | + * <li>All {@code @TestPropertySource} annotations at a given level in the |
| 180 | + * test class hierarchy (i.e., directly present or meta-present on a test |
| 181 | + * class) are considered to be <em>local</em> annotations, in contrast to |
| 182 | + * {@code @TestPropertySource} annotations that are inherited from a |
| 183 | + * superclass.</li> |
| 184 | + * <li>All local {@code @TestPropertySource} annotations must declare the |
| 185 | + * same value for the {@code inheritLocations} flag.</li> |
| 186 | + * <li>The {@code inheritLocations} flag is not taken into account between |
| 187 | + * local {@code @TestPropertySource} annotations. Specifically, the property |
| 188 | + * source locations for one local annotation will be appended to the list of |
| 189 | + * property source locations defined by previous local annotations. This |
| 190 | + * allows a local annotation to extend the list of test property source |
| 191 | + * locations, potentially overriding individual properties.</li> |
| 192 | + * </ol> |
178 | 193 | * @see #locations
|
179 | 194 | */
|
180 | 195 | boolean inheritLocations() default true;
|
|
232 | 247 | * @ContextConfiguration
|
233 | 248 | * public class ExtendedTest extends BaseTest {
|
234 | 249 | * // ...
|
235 |
| - * } |
236 |
| - * </pre> |
| 250 | + * }</pre> |
| 251 | + * <p>If {@code @TestPropertySource} is used as a <em>{@linkplain Repeatable |
| 252 | + * repeatable}</em> annotation, the following special rules apply. |
| 253 | + * <ol> |
| 254 | + * <li>All {@code @TestPropertySource} annotations at a given level in the |
| 255 | + * test class hierarchy (i.e., directly present or meta-present on a test |
| 256 | + * class) are considered to be <em>local</em> annotations, in contrast to |
| 257 | + * {@code @TestPropertySource} annotations that are inherited from a |
| 258 | + * superclass.</li> |
| 259 | + * <li>All local {@code @TestPropertySource} annotations must declare the |
| 260 | + * same value for the {@code inheritProperties} flag.</li> |
| 261 | + * <li>The {@code inheritProperties} flag is not taken into account between |
| 262 | + * local {@code @TestPropertySource} annotations. Specifically, inlined |
| 263 | + * properties for one local annotation will be appended to the list of |
| 264 | + * inlined properties defined by previous local annotations. This allows a |
| 265 | + * local annotation to extend the list of inlined properties, potentially |
| 266 | + * overriding individual properties.</li> |
| 267 | + * </ol> |
237 | 268 | * @see #properties
|
238 | 269 | */
|
239 | 270 | boolean inheritProperties() default true;
|
|
0 commit comments