Skip to content
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

Update AssertJ recipes to current recipe code style #633

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

jevanlingen
Copy link
Contributor

What's changed?

The AssertJ recipes use an older recipe code style; replaced all of 'm with an anonymous class + remove boilerplate code. The class JUnitAssertInstanceOfToAssertThat (created in #606) i is used as the base template for all changed recipes.

What's your motivation?

Code convergence

Any additional context

Recipes in other packages I have left out of the scope of this PR. For example, the cleanup recipes also use the “old” recipe style.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@jevanlingen jevanlingen self-assigned this Nov 5, 2024
@jevanlingen jevanlingen added the recipe Recipe request label Nov 5, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions could not be made:

  • src/main/java/org/openrewrite/java/testing/assertj/JUnitAssertFalseToAssertThat.java
    • lines 27-27
  • src/main/java/org/openrewrite/java/testing/assertj/JUnitAssertNotEqualsToAssertThat.java
    • lines 27-27
  • src/main/java/org/openrewrite/java/testing/assertj/JUnitAssertNotNullToAssertThat.java
    • lines 27-27
  • src/main/java/org/openrewrite/java/testing/assertj/JUnitAssertNullToAssertThat.java
    • lines 27-27
  • src/main/java/org/openrewrite/java/testing/assertj/JUnitAssertSameToAssertThat.java
    • lines 27-27
  • src/main/java/org/openrewrite/java/testing/assertj/JUnitAssertTrueToAssertThat.java
    • lines 27-27

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see this initial work already; helpful to have some examples to point out best practices (as opposed to what you were seeing). I've left a few more comments on patterns we can clear out; please apply those not just where I've left my remarks, but anywhere in these affected files.

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great simplification, thanks a lot! Should help to propagate the proper patterns.

@timtebeek timtebeek merged commit 909f0eb into main Nov 5, 2024
2 checks passed
@timtebeek timtebeek deleted the improvement-of-assertj-recipes branch November 5, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Recipe request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants