Closed timtebeek closed 2 months ago
Hi @timtebeek, I would like to add the following recipes:
- org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertion:
chainedAssertion: startsWith
assertToReplace: isFalse
dedicatedAssertion: doesNotStartWith
requiredType: java.lang.String
- org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertion:
chainedAssertion: endsWith
assertToReplace: isFalse
dedicatedAssertion: doesNotEndWith
requiredType: java.lang.String
- org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertion:
chainedAssertion: matches
assertToReplace: isFalse
dedicatedAssertion: doesNotMatch
requiredType: java.lang.String
Should I send a PR?
Hi! Yes please! Those are easiest for me to see through
With the additions in https://github.com/openrewrite/rewrite-testing-frameworks/pull/594 I think we can close this issue already; we could still identify and add more if needed of course, but there's no need to keep the issue open without a clear example to cover next. Thanks again @Tahanima !
What problem are you trying to solve?
Right now we already simplify quite a few AssertJ assertions that look at
isTrue
. https://github.com/openrewrite/rewrite-testing-frameworks/blob/8a037e86a611ec4de6bb34d8816184d4df76f0ed/src/main/resources/META-INF/rewrite/assertj.yml#L86-L100Some of these also have negated variants that we could quite easily cover as well:
We should add recipes for negated variants as well, starting with the one above and any similar ones we find.