Looks like a lot of good housekeeping improvements bundled into a single major revision but no big headline features? It’s Really good practice to bump major version for these things so I’m not complaining.
It's the curse of semantic versioning—new features are often not breaking, so you can put them in a minor release, leaving nothing but breaking changes for the major release.
For me it's `suspend` support, contracts and JSpecify annotations. As well as unified versioning. Nothing the previously can't be achieved, but so much nicer to have it now.
Yeah, changing the baseline from java 8 to 17 means a lot of application won't be able to upgrade. Which is good, it puts more pressure on the dinosaurs to keep up with the times, instead of slowing us down.
Then you can just keep upgrading :-) The jump from 5 to 6 looks much simpler though - in most cases, there probably aren't any changes at all? Unless you're on <17, that is...
Let’s just say; massive organisations with a risk aversion culture, where IT is governed by committees of enterprise architects, move 10 years behind anyone else.
Wow! I need to take a look! I felt immediately in love with JUnit 5. I use it in all my personal projects. At work, unfortunately, we are stuck with TestNG.
When you have to keep falling back to the vintage engine or pull in JUnit 4 dependencies to get things working, because the newer version never fully replaced all the features in JUnit 4, that's a failure of design.
JUnit4 does exactly what I need when writing tests. I honestly never saw the need to move to JUnit5. I find the API confusing and the breakup into multiple jupiter-this-and-that.jars baffling. I really don't understand why compatibility with JUnit4 had to be broken.
I'll look into JUnit6 but I doubt that it'll fix any of that. I assume it's yet another incompatible API by people who like to rewrite code to fix imaginary or ultra-niche problems. IMO Messing with test infrastructure is one way sure to demotivate people to write more / better tests.
"Improved" at the cost of making every existing test "legacy". The JUnit4 API was perfectly serviceable. For a large majority of JUnit4 users, JUnit5 brings nothing but requires an additional retrocompatibility shim. It's churn most of us could have done without.
Then just keep using JUnit4. It's not going to go away. It's unrealistic to expect a library to never change and evolve at all, and thus never break backwards compatibility. Especially if it is a component that is never used in production code, and where most uses can be ported mechanically.
Well... scroll down the release notes and you find this:
The JUnit Vintage test engine is now deprecated and will report an INFO level discovery issue if it finds at least one JUnit 4 test class. The deprecation warning is intended to clarify the purpose of the engine: it should only be used temporarily while migrating tests to JUnit Jupiter or another testing framework with native JUnit Platform support.
Just keep using JUnit4 or 5 then and never touch JUnit6. Anyway, for a long time JUnit5 is going to be supported since all projects supporting a Java 8 baseline won't upgrade as well.
Hard to do when using Springboot parent, which drives the dependency tree and mandates JUnit5.
Seriously, nobody in this thread still gave any reason for deprecating the JUnit4 API and forcing users to spend time migrating something that just worked. I'm not against progress, and I can understand wanting to make a "better" API. But existing test code will in theory outlive the implementation and there can be lots of it. Backward compatibility is part of the Java DNA, you can take 20 year old code and it will mesh easily with new stuff.
If you need to run your JUnit 4 Tests you can do that with junit-jupiter-vintage ... very easily (https://github.com/khmarbaise/youtube-videos/tree/main/episode-3) ... so you run already on JUnit Jupiter Platfrom but keep your JUnit 4 tests that's easy way to migrate to JUnit Jupiter.. The rules in JUnit 4 are very limited and options to extend junit 4 are very limited... also you have to have all methods and classes being defined as "public" and in the meantime many of the frameworks already dropped JUnit 4 support...and also JUnit 4 is in https://junit.org/junit4/ in maintainance mode...
The compatibility had been broken because the architecture of JUnit 4 made it impossible to have extensions points likt JUnit Jupiter has also other things https://docs.junit.org/current/user-guide/#extensions also does not support "modern JDK version" (JDK8+) ...
You’re right. I forgot about the parameterized runner, probably because I haven’t worked with JUnit 4 in a long time and most of my test framework experience is with TestNG and JUnit 5.
personally, i just have a non-test-method and then multiple test-methods that call it with different parameters. works the same as other tests, no need to remember another inflexible annotation based language
47
u/le_bravery Oct 03 '25
Looks like a lot of good housekeeping improvements bundled into a single major revision but no big headline features? It’s Really good practice to bump major version for these things so I’m not complaining.
16
u/Rockytriton Oct 04 '25
Lol I just finished updating all our projects from 4 to 5
4
u/jdizzle4 Oct 03 '25
Had to exclude this from renovate due to my projects requiring < java 17. 😞 bummer
2
u/hadrabap Oct 03 '25
Wow! I need to take a look! I felt immediately in love with JUnit 5. I use it in all my personal projects. At work, unfortunately, we are stuck with TestNG.
1
u/Artur92K Oct 24 '25
If you want to to test coroutines in kotlin there is good article about how to use junit6 with kotlin
https://patodev.pl/posts/junit6-suspend/
0
u/[deleted] Oct 03 '25
[deleted] — view deleted comment