java.lang.Object
io.helidon.webserver.testing.junit5.websocket.DirectWsClient
All Implemented Interfaces:
RuntimeType.Api<WsClientConfig>, WsClient

public class DirectWsClient extends Object implements WsClient
A client for WebSocket, that directly invokes routing (and bypasses network).
  • Method Details

    • create

      public static DirectWsClient create(WsRouting routing)
      Create a new client based on the provided routing.
      Parameters:
      routing - used to discover route to handle a new connection
      Returns:
      a new instance for the provided routing
    • connect

      public void connect(URI uri, WsListener clientListener)
      Description copied from interface: WsClient
      Starts a new WebSocket connection and runs it in a new virtual thread. This method returns when the connection is established and a new WsSession is started.
      Specified by:
      connect in interface WsClient
      Parameters:
      uri - URI to connect to
      clientListener - listener to handle WebSocket
    • connect

      public void connect(String path, WsListener listener)
      Description copied from interface: WsClient
      Starts a new WebSocket connection and runs it in a new virtual thread. This method returns when the connection is established and a new WsSession is started.
      Specified by:
      connect in interface WsClient
      Parameters:
      path - path to connect to, if client uses a base URI, this is resolved against the base URI
      listener - listener to handle WebSocket
    • prototype

      public WsClientConfig prototype()
      Description copied from interface: RuntimeType.Api
      The prototype as it was received when creating this runtime object instance.
      Specified by:
      prototype in interface RuntimeType.Api<WsClientConfig>
      Returns:
      prototype object used to create this instance