-
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
More best pratices for AssertJ #548
Conversation
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
… This recipe will find instances of: -`assertThat(boolean).isEqualTo(true)` and replace them with `isTrue()`. -`assertThat(boolean).isEqualTo(false)` and replace them with `isFalse()`. Signed-off-by: Marvin Froeder <velo.br@gmail.com>
src/test/java/org/openrewrite/java/testing/assertj/IsEqualToBooleanTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/assertj/IsEqualToBooleanTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/assertj/IsEqualToBooleanTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/assertj/IsEqualToEmptyStringTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/assertj/IsEqualToEmptyStringTest.java
Outdated
Show resolved
Hide resolved
Great start here @velo ! Much appreciated. I'll fix the above suggestions and the formatting and get that merged in after my next call |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Appretiate that, I'm having terrible connectivity issues today, trying to
download intellij for the past hour with no joy.
[image: --]
Marvin Froeder
[image: https://]about.me/velo
<https://about.me/velo?promo=email_sig&utm_source=email_sig&utm_medium=email_sig&utm_campaign=external_links>
…On Mon, Jul 8, 2024 at 1:48 PM Tim te Beek ***@***.***> wrote:
Great start here @velo <https://github.com/velo> ! Much appreciated. I'll
fix the above suggestions and the formatting and get that merged in after
my next call
—
Reply to this email directly, view it on GitHub
<#548 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABBLDWANVUW2FT4EKRJ6R3ZLK7GBAVCNFSM6AAAAABKRF7TLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJUGY3TOOJQHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
FWIW, I applied this clean to my source and got this PR from 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.
Great additions, thanks a lot for adding these. Like how you immediately discovered the right patterns to use to fit in with the other cases already covered. And great to see this applied to querydsl already.
Let me know if you'd like to build recipe runs into your CI to keep any such issues out going forward!
Ow, that would be awesome... I'm recurrently running AssertJCleanup and upgradetojava21 on src/test/java contents. I'm planning on creating a recipe for That would also be a massive improvement to have |
Ah neat! I'd already pieced together the required steps for Maven once before here: langchain4j/langchain4j#673 |
@timtebeek I think I missed something |
Forgive my ignorance, but what exactly based on the link provided? I see a new test added with no immediate link to the work done here for as much as I can see in between conference sessions here. |
Sorry, I had a much more elaborated message, and seems I messed up. I tried to follow your advice on running recipes as part of build and getting code suggestions from it. I'm obviously missing some basic step, as I have the files from langchain4j PR, but no code suggestions. If you have any advice, I would appreciate Cheers |
What's changed?
1 - Created a new recipe that converts
assertThat( true ).isEqualTo( true )
toassertThat( true ).isTrue()
, same for false2 - added new recipe to best practices on assertJ
3 - Added ChainedAssertions for Iterator hasNext
What's your motivation?
Noticed a lot of
isEqualTo(true)
on https://github.com/OpenFeign/querydsl/ and want to get it sortedChecklist
Hrmm, I'm a little short of intellij, can anyone help me out of formatting this, sorry