-
Notifications
You must be signed in to change notification settings - Fork 72
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
Chained AssertJ assertions should be simplified to the corresponding dedicated assertion #556
Conversation
…dedicated assertion
src/main/java/org/openrewrite/java/testing/assertj/IsEqualToNull.java
Outdated
Show resolved
Hide resolved
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.
Great work here @velo! I like how you went ahead and got a comprehensive view of what is and isn't covered already through those parameterized tests. It looks like we already pass ~2/3 of the tests here.
With some adjustments I think we can cover a few more common cases, before perhaps delegating the others to a follow up PR. Let me know your thoughts & plans here! :)
I will get them sorted |
…-testing-frameworks into sonar_chained_assertions
src/main/java/org/openrewrite/java/testing/assertj/ShortenChainedAssertJAssertion.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/testing/assertj/ShortenChainedAssertJAssertion.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/assertj/AssertJBestPracticesTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/assertj/AssertJBestPracticesTest.java
Show resolved
Hide resolved
Hi @velo, are you ok with me polishing this up and merging a smaller increment already? I'm thinking we comment out the failing cases and merge the already nice improvements on this branch. |
Hi @timtebeek Sorry, I totally reduced the score of the change to make it a bite size change meant to be merged, but somehow forgot to write an update! |
Hi @timtebeek Sorry, I totally reduced the score of the change to make it a bite size change meant to be merged, but somehow forgot to write an update! Go for it |
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.
Nice improvements here! Like how we can cover more cases with less classes; Should help extend the current offerings. I've renamed & revised the classes a bit to make it clear when to use which. Hope you agree & thanks again!
This is not ready yet, but working on it.
From time to time, I get toasted by a sonar code smell, and I decided to make something about it
https://next.sonarqube.com/sonarqube/coding_rules?open=java%3AS5838&rule_key=java%3AS5838
What's changed?
For now, created a test for all rules and start implementing missing recipes.
For now, I'm creating a PR to ask questions.
What's your motivation?
Anything 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