Skip to content

assertInstanceOf not converted from JUnit5 to assertJ#606

Merged
timtebeek merged 17 commits intoopenrewrite:mainfrom
timo-abele:demo/assertj-instanceof-miss
Nov 5, 2024
Merged

assertInstanceOf not converted from JUnit5 to assertJ#606
timtebeek merged 17 commits intoopenrewrite:mainfrom
timo-abele:demo/assertj-instanceof-miss

Conversation

@timo-abele
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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 a review from jevanlingen November 4, 2024 09:14
@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
Copy Markdown
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
Copy Markdown
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

jevanlingen and others added 2 commits November 4, 2024 16:56
Co-authored-by: Tim te Beek <timtebeek@gmail.com>
@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
Copy Markdown
Member

@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
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