Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

WebClientOptionsInject failure #18

@leung018

Description

@leung018

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions