Description
Overview
Support for JUnit 4 was introduced in Spring Framework 2.5 in 2007.
JUnit 4 is no longer actively maintained, and the last maintenance release was JUnit 4.13.2 in February 2021.
In addition, JUnit 4 has a Java 1.5 baseline.
Support for JUnit Jupiter (JUnit 5) was introduced in Spring Framework 5.0 in 2017.
JUnit Jupiter was initially released with JUnit 5.0 in September 2017. JUnit Jupiter is actively maintained and has a Java 8 baseline. The last maintenance release was 5.12.2 two weeks ago (April 11, 2025).
Furthermore, the JUnit team is planning to release JUnit 6.0 with a Java 17 baseline later this year (junit-team/junit5#4246).
In light of the above, it is time to phase out our support for JUnit 4 by deprecating it in Spring Framework 7.0 and deprecating it "for removal" in 7.1 or 7.2 (tentatively for removal in Spring Framework 8.0).
Components to Deprecate
-
@IfProfileValue
-
@ProfileValueSourceConfiguration
-
ProfileValueSource
andSystemProfileValueSource
-
ProfileValueUtils
-
@Repeat
and@Timed
-
TestAnnotationUtils
-
SpringJUnit4ClassRunner
andSpringRunner
-
SpringClassRule
andSpringMethodRule
-
AbstractJUnit4SpringContextTests
andAbstractTransactionalJUnit4SpringContextTests
- All
Statement
implementations in theorg.springframework.test.context.junit4.statements
package