-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssertJ assertions not collapsed on Integer #604
Conversation
Hi @timo-abele ! Thanks for notifying us with a runnable test. :) It looks to fail on this particular line: Line 104 in 3412efb
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor suggestions to get the test going: there's no need to add the JUnit dependency here. :)
...t/java/org/openrewrite/java/testing/assertj/CollapseConsecutiveAssertThatStatementsTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/openrewrite/java/testing/assertj/CollapseConsecutiveAssertThatStatementsTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/openrewrite/java/testing/assertj/CollapseConsecutiveAssertThatStatementsTest.java
Outdated
Show resolved
Hide resolved
…secutiveAssertThatStatementsTest.java Co-authored-by: Tim te Beek <[email protected]>
…secutiveAssertThatStatementsTest.java Co-authored-by: Tim te Beek <[email protected]>
…secutiveAssertThatStatementsTest.java Co-authored-by: Tim te Beek <[email protected]>
You'll notice that the types are different; we have that prevent methods like We can likely relax the type comparison a little though, to allow for parameterized types with a bound that includes the same class, even if the generic bound is slightly different ( |
Thanks for getting this started! We can keep this open until the moment we figure out the exact change needed to get this going, as indeed we're a little too conservative right now, not chaining all the cases we could potentially. |
Explored this briefly again, but couldn't yet find an easy solution with the generics mismatch between the two method invocations. We'll merge this with the test disabled such that it's easier to pick up #605 in the future. |
What's changed?
What's your motivation?
I expected the recipe to collapse assertThats on any type, but in my project it didn't work on an
Integer
.This PR verifies my observations and serves as a starting point for
CollapseConsecutiveAssertThatStatements
does not work onIntegers
(possibly only onList
s?) #605Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
Have you considered any alternatives or workarounds?
Any additional context
Checklist