Open timo-abele opened 5 months ago
Hi @timo-abele ; Yes would fit right in with some of the other AssertTrue migration recipes we already have in https://github.com/openrewrite/rewrite-testing-frameworks/tree/a426e409ca3b8e04c6470e86cc09d61346e7c0f4/src/main/java/org/openrewrite/java/testing/cleanup
We could even implement this as a Refaster recipe, similar to what we recently added to rewrite-static-analysis in
Given that there's good examples to work from already I'm going to mark this one as good first issue; anyone welcome to pick this up!
What problem are you trying to solve?
I have in my code some (Junit5)
AssertTrue(false, "this shouldn't happen")
, because someone didn't usefail
when they should have.Describe the solution you'd like
The Junit5 cleanup recipe should convert such cases to
fail("this shouldn't happen")
. The AssertJ best pratices recipe might add a similar recipe.Have you considered any alternatives or workarounds?
Additional context
Are you interested in contributing this feature to OpenRewrite?
no