-
Notifications
You must be signed in to change notification settings - Fork 96
Closed
Labels
Description
What problem are you trying to solve?
Right now we already simplify quite a few AssertJ assertions that look at isTrue.
rewrite-testing-frameworks/src/main/resources/META-INF/rewrite/assertj.yml
Lines 86 to 100 in 8a037e8
| - org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertion: | |
| chainedAssertion: equals | |
| assertToReplace: isTrue | |
| dedicatedAssertion: isEqualTo | |
| requiredType: java.lang.String | |
| - org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertion: | |
| chainedAssertion: equalsIgnoreCase | |
| assertToReplace: isTrue | |
| dedicatedAssertion: isEqualToIgnoringCase | |
| requiredType: java.lang.String | |
| - org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertion: | |
| chainedAssertion: contains | |
| assertToReplace: isTrue | |
| dedicatedAssertion: contains | |
| requiredType: java.lang.String |
Some of these also have negated variants that we could quite easily cover as well:
- org.openrewrite.java.testing.assertj.SimplifyChainedAssertJAssertion:
chainedAssertion: matches
assertToReplace: isFalse
dedicatedAssertion: doesNotMatch
requiredType: java.lang.StringWe should add recipes for negated variants as well, starting with the one above and any similar ones we find.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done