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

WebClientOptionsInject failure #18

Open
leung018 opened this issue Jul 30, 2021 · 2 comments
Open

WebClientOptionsInject failure #18

leung018 opened this issue Jul 30, 2021 · 2 comments

Comments

@leung018
Copy link

Dear sirs

I just follow the example in the document

@ExtendWith(VertxExtension::class)
class LocalhostTest {
    // Define the WebClient options
    @WebClientOptionsInject
    var options = WebClientOptions()
        .setDefaultHost("google.com")
        .setDefaultPort(9000)

    @Test
    fun testLocalhost(vertx: Vertx, testContext: VertxTestContext?, client: WebClient?) {
        testRequest(client, HttpMethod.GET, "/path")
            .expect(statusCode(200), statusMessage("Ciao!"))
            .send(testContext)
    }
}

But I cannot inject the host and port. Connection refused: localhost/127.0.0.1:80

Connection refused: localhost/127.0.0.1:80
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:80
Caused by: java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:669)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:944)
@jponge
Copy link
Contributor

jponge commented Aug 2, 2021

/cc @slinkydeveloper

@dodalovicgran
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants