snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

TestHTTPResource does not return localhost #188

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

Hi, I have notice the next thing, if in a REST endpoint I use JAX-RS to create a location of a new entity:

URI userUri = UriBuilder.fromResource(RegistrationResource.class)
                                          .path("/" + user.id).build();

And it returns http://localhost:8081/registration/1

That's fine.

Then in test I want to validate the location header so I do:

@TestHTTPResource
@TestHTTPEndpoint(RegistrationResource.class)
URL url;

And here the URL is http://0.0.0.0:8081/registration

So the value cannot be used for assertions. Maybe it should use localhost instead of 0.0.0.0?

Expected behavior

Returns localhost

Actual behavior

returns 0.0.0.0


https://github.com/quarkusio/quarkus/issues/12369


$upstream:12369$