What are the advantages to making the non-trivial effort (even with automated tools) to convert a large number of existing JUnit4 tests to JUnit5? All the sources I see show advantages for writing new tests in JUnit5, but I don't see anything that would let me justify the effort to convert our existing JUnit4 tests rather than continuing to have JUnit4 and JUnit5 running side-by-side.
Asked
Active
Viewed 103 times
2
-
Eventually JUnit 4 will no longer be supported. – Raedwald Oct 03 '19 at 08:13
-
@Raedwald Eventually _everything_ will no longer be supported, including the code this is testing. Do you know of any time frame for dropping JUnit4 support? – KathyA. Oct 03 '19 at 13:06
1 Answers
2
As long as your JUnit4 tests do what you want and can be expressed as concisely as necessary I see no pressing reason to migrate existing tests.
In the long run you might want to get rid of the old tests in order to
- have fewer dependencies
- need less knowledge about differences of behaviour
- prevent duplicate effort for JUnit rules vs extensions or other home-made test support code
That said the JUnit platform is explicitly designed to allow JUnit 4 and 5 and other test engines present in the same project.

johanneslink
- 4,877
- 1
- 20
- 37