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

Add ReplaceMockBeanAndSpyBean Recipe #646

Merged
merged 4 commits into from
Dec 6, 2024

Conversation

123Haynes
Copy link
Contributor

@123Haynes 123Haynes commented Dec 5, 2024

What's changed?

This PR adds a recipe for replacing the deprecated annotations @MockBean and @SpyBean with @MockitoBean and @MockitoSpyBean

What's your motivation?

Anything in particular you'd like reviewers to focus on?

This is the first recipe I've written as well as the first pr to this project. Please point out anything I might've done wrong 😄

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

@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 getting this started @123Haynes ! I wonder if we even need the Java class; perhaps a declarative recipe can work just as well if there's no annotation attributes to convert.

@timtebeek timtebeek marked this pull request as draft December 6, 2024 09:23
@timtebeek timtebeek self-requested a review December 6, 2024 14:47
@timtebeek timtebeek marked this pull request as ready for review December 6, 2024 14:47
timtebeek and others added 2 commits December 6, 2024 15:49
…nAndSpyBeanTest.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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 @123Haynes ; looks great! Perfect first contribution and a good step up for Spring Boot 3.4 support.

@timtebeek timtebeek merged commit 18f671d into openrewrite:main Dec 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants