Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c74fc7e

Browse files
committedApr 26, 2025·
Deprecate JUnit 4 support in the TestContext framework
Closes gh-34794
1 parent 2db1a63 commit c74fc7e

File tree

61 files changed

+215
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+215
-65
lines changed
 

‎framework-docs/modules/ROOT/pages/testing/annotations/integration-junit4.adoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
[[integration-testing-annotations-junit4]]
22
= Spring JUnit 4 Testing Annotations
33

4+
[WARNING]
5+
====
6+
JUnit 4 support is deprecated since Spring Framework 7.0 in favor of the
7+
xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-extension[`SpringExtension`]
8+
and JUnit Jupiter.
9+
====
10+
411
The following annotations are supported only when used in conjunction with the
512
xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit4-runner[SpringRunner],
613
xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit4-rules[Spring's JUnit 4 rules], or
@@ -206,6 +213,3 @@ Kotlin::
206213
----
207214
<1> Repeat this test ten times.
208215
======
209-
210-
211-

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,13 @@ Kotlin::
483483
[[testcontext-junit4-runner]]
484484
=== Spring JUnit 4 Runner
485485

486+
[WARNING]
487+
====
488+
JUnit 4 support is deprecated since Spring Framework 7.0 in favor of the
489+
xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-extension[`SpringExtension`]
490+
and JUnit Jupiter.
491+
====
492+
486493
The Spring TestContext Framework offers full integration with JUnit 4 through a custom
487494
runner (supported on JUnit 4.12 or higher). By annotating test classes with
488495
`@RunWith(SpringJUnit4ClassRunner.class)` or the shorter `@RunWith(SpringRunner.class)`
@@ -538,6 +545,13 @@ be configured through `@ContextConfiguration`.
538545
[[testcontext-junit4-rules]]
539546
=== Spring JUnit 4 Rules
540547

548+
[WARNING]
549+
====
550+
JUnit 4 support is deprecated since Spring Framework 7.0 in favor of the
551+
xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-extension[`SpringExtension`]
552+
and JUnit Jupiter.
553+
====
554+
541555
The `org.springframework.test.context.junit4.rules` package provides the following JUnit
542556
4 rules (supported on JUnit 4.12 or higher):
543557

@@ -607,6 +621,13 @@ Kotlin::
607621
[[testcontext-support-classes-junit4]]
608622
=== JUnit 4 Base Classes
609623

624+
[WARNING]
625+
====
626+
JUnit 4 support is deprecated since Spring Framework 7.0 in favor of the
627+
xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupiter-extension[`SpringExtension`]
628+
for JUnit Jupiter.
629+
====
630+
610631
The `org.springframework.test.context.junit4` package provides the following support
611632
classes for JUnit 4-based test cases (supported on JUnit 4.12 or higher):
612633

0 commit comments

Comments
 (0)
Please sign in to comment.