mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Document @SpringExtensionConfig in the reference manual
This commit also updates the Javadoc for the SpringExtension and @SpringExtensionConfig to point out that the SpringExtension always uses a test-class scoped ExtensionContext if @TestInstance(Lifecycle.PER_CLASS) semantics are in effect. Closes gh-36240
This commit is contained in:
+6
-1
@@ -88,7 +88,12 @@ import org.springframework.util.ReflectionUtils.MethodFilter;
|
||||
* be configured to use a test-class scoped extension context by annotating a
|
||||
* top-level test class with
|
||||
* {@link SpringExtensionConfig#useTestClassScopedExtensionContext()
|
||||
* @SpringExtensionConfig(useTestClassScopedExtensionContext = true)}.
|
||||
* @SpringExtensionConfig(useTestClassScopedExtensionContext = true)}. Note,
|
||||
* however, that the {@code SpringExtension} will always use a test-class scoped
|
||||
* {@code ExtensionContext} if your top-level test class is configured to use JUnit
|
||||
* Jupiter’s {@code @TestInstance(Lifecycle.PER_CLASS)} semantics, in which case
|
||||
* there is no need to declare
|
||||
* {@code @SpringExtensionConfig(useTestClassScopedExtensionContext = true)}.
|
||||
*
|
||||
* <p><strong>NOTE:</strong> This class requires JUnit Jupiter 6.0 or higher.
|
||||
*
|
||||
|
||||
+5
@@ -60,6 +60,11 @@ public @interface SpringExtensionConfig {
|
||||
* {@code ExtensionContext}. Thus, there is no need to declare this annotation
|
||||
* attribute with a value of {@code false}.
|
||||
*
|
||||
* <p>Similarly, if your top-level test class is configured to use JUnit Jupiter’s
|
||||
* {@code @TestInstance(Lifecycle.PER_CLASS)} semantics, the {@code SpringExtension}
|
||||
* will always use a test-class scoped {@code ExtensionContext}, and there is no need
|
||||
* to declare {@code @SpringExtensionConfig(useTestClassScopedExtensionContext = true)}.
|
||||
*
|
||||
* @see SpringExtension
|
||||
* @see SpringExtension#getTestInstantiationExtensionContextScope(org.junit.jupiter.api.extension.ExtensionContext)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user