A service endpoint needs to return a url to another endpoint of the same service.
How to get the actual real live http port the Quarkus service is running on?
When starting the service with quarkus dev
the service runs on 8080
,
but when running tests it runs on 8081
.
The quarkus.http.port
value is always 8080
regardless whether the service run in test or not.
Th endpoint resource gets the properties quarkus.http.port
and quarkus.http.host
config properties injected to determine the url to return, but when running a QuarkusTest test case, the url still contains 8080
instead of 8081
.
Using the ConfigProvider.getConfig()
instead of injecting the values makes no difference.
Therefore the test case is not able to perform a next request based on the received url.
So how to get the actual http port value, the one Quarkus reports when starting up?