Skip to content

Commit c112569

Browse files
committed
Document that the SpringExtension requires JUnit Jupiter 6.0 or higher
Closes gh-35900
1 parent f58d0f6 commit c112569

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

framework-docs/modules/ROOT/pages/testing/testcontext-framework/support-classes.adoc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ in JUnit and TestNG.
88
[[testcontext-junit-jupiter-extension]]
99
== SpringExtension for JUnit Jupiter
1010

11-
The Spring TestContext Framework offers full integration with the JUnit Jupiter testing
12-
framework, originally introduced in JUnit 5. By annotating test classes with
13-
`@ExtendWith(SpringExtension.class)`, you can implement standard JUnit Jupiter-based unit
14-
and integration tests and simultaneously reap the benefits of the TestContext framework,
15-
such as support for loading application contexts, dependency injection of test instances,
16-
transactional test method execution, and so on.
11+
The `SpringExtension` integrates the Spring TestContext Framework into the JUnit Jupiter
12+
testing framework.
13+
14+
NOTE: As of Spring Framework 7.0, the `SpringExtension` requires JUnit Jupiter 6.0 or higher.
15+
16+
By annotating test classes with `@ExtendWith(SpringExtension.class)`, you can implement
17+
standard JUnit Jupiter-based unit and integration tests and simultaneously reap the
18+
benefits of the TestContext framework, such as support for loading application contexts,
19+
dependency injection of test instances, transactional test method execution, and so on.
1720

1821
Furthermore, thanks to the rich extension API in JUnit Jupiter, Spring provides the
1922
following features above and beyond the feature set that Spring supports for JUnit 4 and

spring-test/src/main/java/org/springframework/test/context/junit/jupiter/SpringExtension.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@
9090
* {@link SpringExtensionConfig#useTestClassScopedExtensionContext()
9191
* @SpringExtensionConfig(useTestClassScopedExtensionContext = true)}.
9292
*
93+
* <p><strong>NOTE:</strong> This class requires JUnit Jupiter 6.0 or higher.
94+
*
9395
* @author Sam Brannen
9496
* @author Simon Baslé
9597
* @since 5.0

0 commit comments

Comments
 (0)