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 support for HttpStatus in SimplifyWebTestClientCalls #664

Conversation

barbulescu
Copy link
Contributor

SimplifyWebTestClientCalls supports only int parameters for isEqualTo method.

What's changed?

This PR adds support for:

  • isEqualTo(HttpStatus.valueOf(200))
  • isEqualTo(HttpStatusCode.valueOf(200))
  • isEqualTo(HttpStatus.OK)

What's your motivation?

Fix disabled test in SimplifyWebTestClientCallsTest and to be feature complete on this recipe.

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

Probably implementation can be improved but I am not yet familiar with OpenRewrite patterns.

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

none

Any additional context

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/spring/http/SimplifyWebTestClientCalls.java
    • lines 172-172

@timtebeek timtebeek marked this pull request as ready for review January 12, 2025 20:31
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 a lot @barbulescu ! I've only applied some light polish to minimize the diff and look more like other recipes. Great to have these cases converted as well.

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/spring/http/SimplifyWebTestClientCalls.java
    • lines 162-162

@timtebeek timtebeek merged commit d0364cb into openrewrite:main Jan 12, 2025
1 check passed
@barbulescu
Copy link
Contributor Author

np, OpenRewrite is a great tool and I am glad to help as much as I can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants