Skip to content

Deprecate JUnit 4 support #34794

Closed
Closed
@sbrannen

Description

@sbrannen

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 and SystemProfileValueSource
  • ProfileValueUtils
  • @Repeat and @Timed
  • TestAnnotationUtils
  • SpringJUnit4ClassRunner and SpringRunner
  • SpringClassRule and SpringMethodRule
  • AbstractJUnit4SpringContextTests and AbstractTransactionalJUnit4SpringContextTests
  • All Statement implementations in the org.springframework.test.context.junit4.statements package

Related Issues

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions