sparjan4u
sparjan4u

Reputation: 91

When is jUnit4 going to be deprecated?

Since junit5 out there, how long jUnit4 going to be supported? Any plans for deprecation, when is it going to be? We are just trying to gauge whether we need to migrate existing jUnit4 test cases to jUnit5 now or later at some point. The user guide says the following but wanted know more clearly how long (a year, two or more from now)? Appreciate your response.

"since the JUnit team will continue to provide maintenance and bug fix releases for the JUnit 4.x baseline, developers have plenty of time to migrate to JUnit Jupiter on their own schedule."

Upvotes: 8

Views: 4422

Answers (1)

johanneslink
johanneslink

Reputation: 5351

JUnit 4 hasn’t seen any functional upgrade in a decade. What the JUnit team does is maintain the JUnit 4 engine, called Vintage, which runs JUnit 4 on the JUnit 5 platform. As long as the platform engine API stays downwards compatible this is very likely to work. The two events that could break JUnit 4 are:

  1. The platform changes in a highly incompatible way and the Vintage engine will no longer be supported. This is not to be expected in the near future.
  2. Java changes in an incompatible way so that the original JUnit 4 code no longer works. I don’t see that looming either.

That said, using just JUnit 4 decouples you from all innovation in the field of Java test automation. Many extensions already do not support JUnit 4 anymore. My recommendation: Start using the platform at once using Vintage. Write all new tests with Jupiter and the other test engines you need. Migrate old JUnit 4 tests when you have to adapt them anyway.

Upvotes: 10

Related Questions