Open shoothzj opened 6 months ago
@shoothzj Hi shoothzj, I'm very interested in this job, can I have it processed?
@sherlock-lin Sure, go ahead, I think we'd better change less than 15 files in one Pull Reuqest.
@sherlock-lin Sure, go ahead, I think we'd better change less than 15 files in one Pull Reuqest.
Okay, I'll do it in small batches.
OpenRewrite contains support for Junit4 to Junit5 migration. It's probably worth using it to assist in the migration. https://docs.openrewrite.org/running-recipes/popular-recipe-guides/migrate-from-junit-4-to-junit-5
I'd also recommend using AssertJ for more complex assertions since the error messages that AssertJ creates are much better than ordinary asserts.
there's also a recipe for migrating to use AssertJ: https://docs.openrewrite.org/running-recipes/popular-recipe-guides/junit-asserts-to-assertj
It looks like IntelliJ Ultimate has Junit 4 -> Junit 5 refactoring in the IDE:
It doesn't seem very useful since it's not migrating the assertions. That's why OpenRewrite is more practical. There seems to be OpenRewrite recipe support in IntelliJ too.
OpenRewrite contains support for Junit4 to Junit5 migration. It's probably worth using it to assist in the migration. https://docs.openrewrite.org/running-recipes/popular-recipe-guides/migrate-from-junit-4-to-junit-5
I'd also recommend using AssertJ for more complex assertions since the error messages that AssertJ creates are much better than ordinary asserts.
there's also a recipe for migrating to use AssertJ: https://docs.openrewrite.org/running-recipes/popular-recipe-guides/junit-asserts-to-assertj
Thanks, I needed this so much. : )
@shoothzj please reopen this issue,since I configured Fix #4322 in the previous mr causing it to be closed incorrectly
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. We can write new test classes using junit5, and existing-test classes can be slowly migrated.
This issue to track tests migrate to junit5, we can migrate a package、a small module gradually.
See also: https://lists.apache.org/thread/hlyc722gy45s3y61q7n79hdcr6cgrx7v