I'm creating a test that is trying to invoke an endpoint in my system.
the flow is like that
when i run the test i see that Quarkus test web server is listening on localhost
INFO: Quarkus 2.4.1.Final on JVM started in 25.464s. Listening on: http://localhost:8081
Im addressing (with rest assured) the subdomain subdomain.localhost
@QuarkusTest
class TestClass {
@Test
public void someTest() {
RestAssured.given().log().all()
.baseUri("http://subdomain.localhost:8081") <--
.basePath("/api")
.contentType(ContentType.JSON)
.accept(ContentType.JSON)
.get("/endpoint")
.then()
.statusCode(200);
}
}
and getting exception:
java.net.UnknownHostException: subdomain.localhost: nodename nor servname provided, or not known
i found that if adding the subdomain to the hosts
file (on mac \etc\hosts
)
127.0.0.1 subdomain.localhost
it works but I'm looking for a different solution
is there any way to make Quarkus test web server listen to subdomain as well?