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

assertInstanceOf not converted from JUnit5 to assertJ #606

Merged
merged 17 commits into from
Nov 5, 2024

Conversation

timo-abele
Copy link
Contributor

@timo-abele timo-abele commented Sep 21, 2024

What's changed?

What's your motivation?

Reproducing an observed conversion miss.

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

I'm not sure with sub recipe should convert this so I am using the best practices recipe as a catch-all.

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

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/junit5/EnclosedToNested.java
    • lines 24-25

@timtebeek timtebeek added good first issue Good for newcomers recipe Recipe request labels Oct 21, 2024
@timtebeek timtebeek changed the title Demo: instanceof not converted from JUnit5 to assertJ assertInstanceOf not converted from JUnit5 to assertJ Oct 21, 2024
@timtebeek
Copy link
Contributor

Thanks for the suggestion! This likely needs a dedicated recipe, similar to the other examples seen here:

- org.openrewrite.java.testing.assertj.JUnitAssertArrayEqualsToAssertThat
- org.openrewrite.java.testing.assertj.JUnitAssertEqualsToAssertThat
- org.openrewrite.java.testing.assertj.JUnitAssertFalseToAssertThat
- org.openrewrite.java.testing.assertj.JUnitAssertNotEqualsToAssertThat
- org.openrewrite.java.testing.assertj.JUnitAssertNotNullToAssertThat
- org.openrewrite.java.testing.assertj.JUnitAssertNullToAssertThat
- org.openrewrite.java.testing.assertj.JUnitAssertSameToAssertThat
- org.openrewrite.java.testing.assertj.JUnitAssertTrueToAssertThat
- org.openrewrite.java.testing.assertj.JUnitFailToAssertJFail
- org.openrewrite.java.testing.assertj.JUnitAssertThrowsToAssertExceptionType

Anyone welcome to fill in the missing piece here to make it a reality.

@timtebeek timtebeek requested review from timtebeek and removed request for jevanlingen November 4, 2024 09:14
timtebeek and others added 2 commits November 4, 2024 15:09
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@jevanlingen jevanlingen left a comment

Choose a reason for hiding this comment

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

Apply bot comments

@openrewrite openrewrite deleted a comment from github-actions bot Nov 4, 2024
Copy link
Contributor

@jevanlingen jevanlingen left a comment

Choose a reason for hiding this comment

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

Apply bot comments

@openrewrite openrewrite deleted a comment from github-actions bot Nov 4, 2024
timtebeek and others added 3 commits November 5, 2024 10:05
…InstanceOfToAssertThat.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@timtebeek timtebeek marked this pull request as ready for review November 5, 2024 09:18
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.

Thanks for the help both! Great to convert these cases too.

@timtebeek timtebeek merged commit da61d95 into openrewrite:main Nov 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers recipe Recipe request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants