api

http4k / org.http4k.testing / TestWsClient

TestWsClient

class TestWsClient : WsClient (source)

A class that is used for offline testing of a routed Websocket, without starting up a Server. Calls are routed synchronously to the receiving Websocket, and error are propagated to the caller.

Functions

Name Summary
close fun close(status: WsStatus): Unit
error fun error(throwable: Throwable): Unit
Push an error to the Websocket
received fun received(): Sequence<WsMessage>
send fun send(message: WsMessage): Unit

Extension Functions

Name Summary
with fun <T> T.with(vararg modifiers: (T) -> T): T