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

Allow QuarkusTest to override base URL of REST client #10196

Closed
wants to merge 1 commit into from

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jun 23, 2020

Fixes: #10126

This PR provides the basic low level building blocks that are needed in order to support changing the baseURL in tests (just take a look at the changed test to see how it's meant to be used).
It can certainly be used by end users , but ideally it would also be used under the hood by higher level abstractions in the same way that QuarkusMock and InjectMock complement each other.

@boring-cyborg boring-cyborg bot added area/dependencies Pull requests that update a dependency file area/testing labels Jun 23, 2020
@geoand
Copy link
Contributor Author

geoand commented Jun 23, 2020

@kenfinnigan @asoldano what do you think about this? It obviously depends heavily on RESTEasy internals, but given how closely we collaborate, I don't think it will be a problem to have this as a first iteration - then if you agree we can look into providing proper hooks in the the RESTEasy codebase if you think we should.

@geoand
Copy link
Contributor Author

geoand commented Jun 23, 2020

@knutwannheden this solves #10126 that we talked about

@geoand
Copy link
Contributor Author

geoand commented Jun 23, 2020

PR is in draft and need a lot more testing

@kenfinnigan
Copy link
Member

Is it not possible for test profile in application.properties to define the mock URL?

@geoand
Copy link
Contributor Author

geoand commented Jun 23, 2020

Sure, but this for changing the URL per test, without having to restart or rebuild anything. Same idea as we have with QuarkusMock

@kenfinnigan
Copy link
Member

Why does the URL need to change per test? Wouldn't it be the same for all tests?

@geoand
Copy link
Contributor Author

geoand commented Jun 23, 2020

Because that limits you to only what the mock server can return, which I realize that in most cases would suffice, but limits some testing scenarios.

@knutwannheden
Copy link
Contributor

I haven't tested it yet, but AFAICT #9933 would also be sufficient for my purposes.

@geoand
Copy link
Contributor Author

geoand commented Jun 26, 2020

Yeah, the test profiles are an excellent way to change properties.

@geoand geoand added the triage/on-ice Frozen until external concerns are resolved label Jun 30, 2020
@gsmet
Copy link
Member

gsmet commented Oct 12, 2020

Lots of conflicts and didn't get any attention for a while. I will close it. We can still reopen it if we want to revisit.

@gsmet gsmet closed this Oct 12, 2020
@gsmet gsmet added the triage/wontfix This will not be worked on label Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/rest-client area/testing triage/on-ice Frozen until external concerns are resolved triage/wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow QuarkusTest to override base URL of REST client
4 participants