Hi Lari, Thanks for your nice explanation and work in https://github.com/apache/bookkeeper/pull/4197.
>> Summary: let's use Junit 5 & AssertJ for all new tests and migrate from Junit 4 to Junit 5 when that provides some value (for example parameterized tests). I agree, and leverage annotation features in jdk17/21 support and windows support. >> I don't see much immediate value in converting existing tests from Junit 4 to Junit 5. I think we can do it gradually in no hurry. I have marked the issue as `good first issue`. This can help new contributors get familiar with our project before they make more valuable contributions. Thanks ZhangJian He On Mon, Apr 29, 2024 at 4:08 PM Lari Hotari <lhot...@apache.org> wrote: > Support for JUnit 5 tests was added in > https://github.com/apache/bookkeeper/pull/4197. Junit 4 and Junit 5 tests > can co-exist in the code base. Junit 5 (Jupiter) test runner is used for > test execution. > > While switching to use Junit 5, it's worth considering primarily using > AssertJ for more complex test assertions. AssertJ test scope dependency has > also been added in PR 4197. > One of the benefits of AssertJ is that assertion errors usually provide > good context about the failure. > > I don't see much immediate value in converting existing tests from Junit 4 > to Junit 5. There's more value in writing new tests with Junit 5 and > AssertJ. PR 4197 also adds junit-jupiter-params dependency which adds > support for Junit 5 parameterized tests. That's a very valuable addition > with Junit 5 since Junit 4 parameterized tests are very poor and limited. > Converting Junit 4 parameterized tests to Junit 5 parameterized tests > could be useful since it would make maintaining the tests easier. There > seem to be 22 test classes in BK code base that use Junit 4's > org.junit.runners.Parameterized. > > Summary: let's use Junit 5 & AssertJ for all new tests and migrate from > Junit 4 to Junit 5 when that provides some value (for example parameterized > tests). > > -Lari > > On 2024/04/25 01:58:34 ZhangJian He wrote: > > I am reaching out to propose a gradual migration of our testing framework > > from JUnit 4 to JUnit 5 across the BookKeeper. JUnit 5 offers significant > > improvements over JUnit 4, including more powerful and flexible testing > > capabilities like annotation-based coding(so we don't need to write > > assume), parallel test execution, and other features. > > > > > > I think we can write new test classes using junit5, and existing-test > > classes can be slowly migrated. > > > > Thanks > > ZhangJian He > > >