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 a recipe to rewrite @QuarkusTestResource to @WithTestResource #187

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Jul 22, 2024

@edeandrea could you check the tests make sense? I set the default value to keep the behavior people were getting with the deprecated annotation.

@edeandrea
Copy link

It looks ok to me. The only question I'd have is what if other attributes were set on @QuarkusTestResource? Would those be re-written as-is?

@gsmet
Copy link
Member Author

gsmet commented Jul 22, 2024

Yes, I don't think they would be changed. But I can add a test for it.

@gsmet
Copy link
Member Author

gsmet commented Jul 22, 2024

Done!


import io.quarkus.test.common.WithTestResource;

@WithTestResource(restrictToAnnotatedClass = true)
Copy link

@edeandrea edeandrea Jul 22, 2024

Choose a reason for hiding this comment

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

In this case where @QuarkusTestResource(restrictToAnnotatedClass = true), it would be nicer I think if we just eliminated the attribute, since the default in @WithTestResource is true.

I'm not sure if thats possible though. I don't know much about Open Rewrite.

Copy link
Member Author

Choose a reason for hiding this comment

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

We probably could but I thought about it when doing it and I decided it was not worth the hassle, given the size of my TODO list :).

Choose a reason for hiding this comment

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

Yeah I think it was one of those "this would be nice if it was easy to do" things.

@gsmet gsmet merged commit 4187db6 into quarkusio:main Jul 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants