From 4a608e97dcadbe2a8f2767abb6a32eca5c051352 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 13 Oct 2020 10:35:51 +0200 Subject: [PATCH] Cross reference @NestedTestConfiguration and supported annotations See gh-19930 --- .../test/annotation/Commit.java | 7 +++++- .../test/annotation/DirtiesContext.java | 7 +++++- .../test/annotation/Rollback.java | 7 +++++- .../test/context/ActiveProfiles.java | 6 ++++- .../test/context/BootstrapWith.java | 6 ++++- .../test/context/ContextConfiguration.java | 6 ++++- .../test/context/ContextHierarchy.java | 6 ++++- .../test/context/NestedTestConfiguration.java | 22 +++++++++++++++---- .../test/context/TestConstructor.java | 4 ++++ .../test/context/TestExecutionListeners.java | 6 ++++- .../test/context/TestPropertySource.java | 3 +++ .../test/context/TestPropertySources.java | 6 ++++- .../test/context/web/WebAppConfiguration.java | 7 +++++- 13 files changed, 79 insertions(+), 14 deletions(-) diff --git a/spring-test/src/main/java/org/springframework/test/annotation/Commit.java b/spring-test/src/main/java/org/springframework/test/annotation/Commit.java index dae764b1f01..9e881a5de4d 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/Commit.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/Commit.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,6 +44,11 @@ import java.lang.annotation.Target; * {@code @Commit} and {@code @Rollback} on the same test method or on the * same test class is unsupported and may lead to unpredictable results. * + *

As of Spring Framework 5.3, this annotation will be inherited from an + * enclosing test class by default. See + * {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration} + * for details. + * * @author Sam Brannen * @since 4.2 * @see Rollback diff --git a/spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java b/spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java index 78f884b0b92..9441c9133d3 100644 --- a/spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java +++ b/spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +43,11 @@ import java.lang.annotation.Target; *

This annotation may be used as a meta-annotation to create custom * composed annotations. * + *

As of Spring Framework 5.3, this annotation will be inherited from an + * enclosing test class by default. See + * {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration} + * for details. + * *

Supported Test Phases

* * * @author Sam Brannen diff --git a/spring-test/src/main/java/org/springframework/test/context/TestPropertySources.java b/spring-test/src/main/java/org/springframework/test/context/TestPropertySources.java index 486ea15cae1..8aee4028664 100644 --- a/spring-test/src/main/java/org/springframework/test/context/TestPropertySources.java +++ b/spring-test/src/main/java/org/springframework/test/context/TestPropertySources.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,10 @@ import java.lang.annotation.Target; * completely optional since {@code @TestPropertySource} is a * {@linkplain java.lang.annotation.Repeatable repeatable} annotation. * + *

As of Spring Framework 5.3, this annotation will be inherited from an + * enclosing test class by default. See + * {@link NestedTestConfiguration @NestedTestConfiguration} for details. + * * @author Anatoliy Korovin * @author Sam Brannen * @since 5.2 diff --git a/spring-test/src/main/java/org/springframework/test/context/web/WebAppConfiguration.java b/spring-test/src/main/java/org/springframework/test/context/web/WebAppConfiguration.java index 4df60f17755..7b5e4520b1c 100644 --- a/spring-test/src/main/java/org/springframework/test/context/web/WebAppConfiguration.java +++ b/spring-test/src/main/java/org/springframework/test/context/web/WebAppConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,11 @@ import java.lang.annotation.Target; *

This annotation may be used as a meta-annotation to create custom * composed annotations. * + *

As of Spring Framework 5.3, this annotation will be inherited from an + * enclosing test class by default. See + * {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration} + * for details. + * * @author Sam Brannen * @since 3.2 * @see org.springframework.web.context.WebApplicationContext