-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support more than one custom annotation which registers MP REST Client provider #14711
Support more than one custom annotation which registers MP REST Client provider #14711
Conversation
@VasilisAndritsoudis very good, thanks for giving it a try :-). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I added some comments. Also it would be better with a test and with all the commits stashed. Not sure how complex it would be to add a test with a local REST service?
...st-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java
Outdated
Show resolved
Hide resolved
...st-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java
Outdated
Show resolved
Hide resolved
extensions/rest-client/runtime/src/main/java/io/quarkus/restclient/runtime/RestClientBase.java
Outdated
Show resolved
Hide resolved
I changed the parameter declaration as @gsmet suggested, however I am not sure what the other suggestion means. |
Oh sorry, I didn't realize the Optional was removed so the if should go. I am going to change this as well. |
@sberyozkin I think I fixed everything you asked. If there is anything else let me know. :) |
...st-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java
Outdated
Show resolved
Hide resolved
Can you please check my comment above about the @gsmet I reckon I should add a test extension to this branch which will register two different annotations; can also prototype a test which would verify the PR... Then I can ask @VasilisAndritsoudis to help to male sure the test passes |
@VasilisAndritsoudis I've squashed and also pushed some updates to make sure the multiple providers are picked up - please review the updates. We have an internal issue which can be resolved by accelerating this PR, so I've decided to give it a go. I'll work on some test support now, thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sberyozkin Looks great and seems like its working. I hope I was of help to you :)
@VasilisAndritsoudis Thanks, we'll need to test it. |
Good morning @gsmet, can you please restart this one for 1.12.0.CR1 ? I'm working on one more integration test (I'll ask Alexey for some guidance) but the existing one I've added to this branch is already sufficiently covering this new code as discussed on Zulip. #14466 would be good to resolve in time for |
Never mind :-), I pushed the prototype of the new test to this branch, so it is not ready for a restart yet |
@gsmet Hi, I've dropped the integration test prototype for now from this PR, as it should not really be holding it, if I can handle it with Alexey's help then I'd open a follow up PR. Hope it is ok to restart it, cancel if needed please |
@gsmet This is green now. One integration test is available. There is another which I'm going to work upon, given the feedback from Alexey (based on a dedicated test extension) - but it is not essential for this PR - it would only test a different variation of using the custom annotations - and I believe that there is no much time or bandwidth would be available until tomorrow anyway... thanks |
Hi @gsmet, and also @radcortez and @mkouba Let me summarize what this PR does. It enhances a bit the earlier code introduced as part of the (1)
This is specifically related to #14466 and is already tested in this PR or
where in both cases the client providers are registered via custom annotations (as opposed to To make it work a given extension registers one or more A few simple updates to Integration test verifying the case (1) has been added. @aloubyansky Alexey has explained how a second case (2) may be tested - it requires a test exception - I'm on it but it may take some time to fix - the integration test in this PR stresses all the added code already... |
@radcortez Roberto, I recall now we were also discussing verifying these are the valid providers - but indeed this is what Resteasy does anyway...So I thought of not duplicating it... |
…t provider Changed the RestCliendBase constructor to accept an array list of annotation classes
@aloubyansky Hi Alexey - I've added one more extension based test to So I've added one more missing test covering the case2 above: and here you can see a rest client with 2 custom annotations - it leads to 2 filters added and custom headers - checked... |
I propose backporting this PR: it only affects a very new and specific path within |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to add the test extension in the maven integration module? Seem confusing, I would never expect to find something like this there.
Can't we create the extension in a proper integration-test module? It doesn't work?
IMO, if the extension is test-specific, there is nothing wrong with that. We have other tests in the |
Hi @aloubyansky @radcortez thanks. |
But does it require to have the maven infrastructure? Can't be just added like an extension in the integration tests and testes in the deployment module with Anyway, I don't want to block this, I was just wondering if there was an easier way to do it :) |
@radcortez No, it does not work like that unfortunately :-). I've tried different options, tried to add the extension to I was actually returning here to propose to Alexey @aloubyansky to move some of the code to But until then I guess we should keep it in the current form - I'll be happy to migrate this test extension asap. |
Sure. Go ahead. |
@radcortez sounds good, thanks |
Fixes #14141.
Fixes #14466.