Dear devs, I'd like to start a discussion to migrate to a higher JUnit version.
The main motivations are: - Making full use of Java 8 Lambdas for writing easier to read tests and a better performing way of composing failure messages. - Improved test structures with nested and dynamic tests. - Much better support for parameterized tests to avoid separating parameterized and non-parameterized parts into different test classes. - Composable dependencies and better hooks for advanced use cases (TestLogger). - Better exception verification - More current infrastructure - Better parallelizable Why now? - JUnit5 is now mature enough to consider it for such a complex project - We are porting more and more e2e tests to JUnit and it would be a pity to do all the work twice (okay some already has been done and would result in adjustments, but the sooner we migrate, the less needs to be touched twice) Why JUnit5? There are other interesting alternatives, such as TestNG. I'm happy to hear specific alternatives. For now, I'd like to focus on JUnit4 for an easier migration path. Please discuss if you would also be interested in moving onward. To get some overview, I'd like to see some informal +1 for the options: [ ] Stick to JUnit4 for the time being [ ] Move to JUnit5 (see migration path below) [ ] Alternative idea + advantages over JUnit5 + some very rough migration path --- Migrating from JUnit4 to JUnit5 can be done in some steps, so that we can gradually move from JUnit4 to JUnit5. 0. (There is a way to use JUnit4 + 5 at the same time in a project - you'd use a specific JUnit4 runner to execute JUnit5. I'd like to skip this step as it would slow down migration significantly) 1. Use JUnit5 with vintage runner. JUnit4 tests run mostly out of the box. The most important difference is that only 3 base rules are supported and the remainder needs to be migrated. Luckily, most of our rules derive from the supported ExternalResource. So in this step, we would need to migrate the rules. 2. Implement new tests in JUnit5. 3. Soft-migrate old tests in JUnit5. This is mostly a renaming of annotation (@Before -> @BeforeEach, etc.). Adjust parameterized tests (~400), replace rule usages (~670) with extensions, exception handling (~1600 tests), and timeouts (~200). This can be done on a test class by test class base and there is no hurry. 4. Remove vintage runner, once most tests are migrated by doing a final push for lesser used modules. Let me know what you think and I'm happy to answer all questions. -- Arvid Heise | Senior Java Developer <https://www.ververica.com/> Follow us @VervericaData -- Join Flink Forward <https://flink-forward.org/> - The Apache Flink Conference Stream Processing | Event Driven | Real Time -- Ververica GmbH | Invalidenstrasse 115, 10115 Berlin, Germany -- Ververica GmbH Registered at Amtsgericht Charlottenburg: HRB 158244 B Managing Directors: Timothy Alexander Steinert, Yip Park Tung Jason, Ji (Toni) Cheng