-
Notifications
You must be signed in to change notification settings - Fork 67
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
Collapse consecutive assertThat
statements (#373)
#392
Conversation
Really nice to see you picked this up @srmalkan! Impressed with how much of the recipe already works. I've explored locally if I could get the indentation to work, but no such luck yet either. I'd expected the fix to be in setting a prefix on each of the method invocations where we change the select, but I've not yet found a working combination. Will try to explore later again. |
Yes, i thought so too. After looking at few objects, now i feel its related to setting up 'after' correctly in JRightPadded. |
Hi @timtebeek, I was able to fix formatting by setting |
Glad to see how far this has come! I think we can just adjust the |
That's correct. |
src/main/java/org/openrewrite/java/testing/assertj/CollapseConsecutiveAssertThatStatements.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/testing/assertj/CollapseConsecutiveAssertThatStatements.java
Outdated
Show resolved
Hide resolved
...t/java/org/openrewrite/java/testing/assertj/CollapseConsecutiveAssertThatStatementsTest.java
Show resolved
Hide resolved
...t/java/org/openrewrite/java/testing/assertj/CollapseConsecutiveAssertThatStatementsTest.java
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
src/main/java/org/openrewrite/java/testing/assertj/CollapseConsecutiveAssertThatStatements.java
Outdated
Show resolved
Hide resolved
…secutiveAssertThatStatements.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
src/main/java/org/openrewrite/java/testing/assertj/CollapseConsecutiveAssertThatStatements.java
Outdated
Show resolved
Hide resolved
assertThat
statements (#373)
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.
Thanks for getting this started and your patience throughout @srmalkan ! Good to see this completed, finally, and I look forward to seeing this put to use.
assertThat(..)
statements that each use the same object to a single statement #373Hi All,
I have added a recipe to collapse if consecutive AssertThat statements on the same parameter are found. It ignores cases where the parameter is a Method Invocation or lambda or existing chained assertThat statement.
I am facing a bit of difficulty in formatting the chained assertThat statement, can someone guide me on that?