'Connection refused to wiremock when doing native test Quarkus : Connect to localhost:8080 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1]

I am facing a problem when using Wiremock with Quarkus. when launching integration test (native mode).

Connect to localhost:8080 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connexion refusée (Connection refused)
org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connexion refusée (Connection refused)
    at app//org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
    at app//org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
    at app//org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
    at app//org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at app//org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
    at app//org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at app//org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at app//org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
    at app//com.github.tomakehurst.wiremock.client.HttpAdminClient.safelyExecuteRequest(HttpAdminClient.java:473)
    at app//com.github.tomakehurst.wiremock.client.HttpAdminClient.executeRequest(HttpAdminClient.java:454)
    at app//com.github.tomakehurst.wiremock.client.HttpAdminClient.addStubMapping(HttpAdminClient.java:131)
    at app//com.github.tomakehurst.wiremock.client.WireMock.register(WireMock.java:298)
    at app//com.github.tomakehurst.wiremock.client.WireMock.register(WireMock.java:293)
    at app//com.github.tomakehurst.wiremock.client.WireMock.givenThat(WireMock.java:104)
    at app//com.api.lambda.adapter.LambdaHandlerTest.initWiremock(LambdaHandlerTest.java:44)
package com.api.lambda.adapter;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class LambdaHandlerNativeTest extends LambdaHandlerTest {

    // Execute the same tests but in native mode.
}

Any idea?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source