James Chen
11/24/2022, 6:50 PMexternalServices
. This is the mock I have right now in my `testApplication`:
externalServices {
hosts("<ws://test.com>") {
install(io.ktor.server.websocket.WebSockets) {}
routing {
webSocket("/") {
this.send("hello")
}
}
}
}
My test will hang when it tries to connect to <ws://test.com>
and eventually return a io.ktor.client.network.sockets.ConnectTimeoutException: Connect timeout has expired [url=<ws://test.com>, connect_timeout=unknown ms]
error. Can externalServices
mock out ws servers? If not, are there any suggestions on how to mock a ws server for testing? Thank you!James Chen
11/24/2022, 6:50 PM