java.lang.Object
io.helidon.webserver.testsupport.TestClient

public class TestClient extends Object
Client API designed to create request directly on Routing without a network layer. It can be used together with RouteMock to provide some specific behaviors.
  • Method Details

    • create

      public static TestClient create(Supplier<Routing> routingBuilder)
      Creates new TestClient instance with specified routing.
      Parameters:
      routingBuilder - a routing builder to test; will be built as a first step of this method execution
      Returns:
      new instance
      Throws:
      NullPointerException - if routing parameter is null
    • create

      public static TestClient create(Routing routing, io.helidon.media.common.MediaContext mediaContext)
      Creates new TestClient instance with specified routing.
      Parameters:
      routing - a routing to test
      mediaContext - media context
      Returns:
      new instance
      Throws:
      NullPointerException - if routing parameter is null
    • create

      public static TestClient create(Routing routing, io.helidon.media.common.MediaSupport mediaSupport)
      Creates new TestClient instance with specified routing.
      Parameters:
      routing - a routing to test
      mediaSupport - media support
      Returns:
      new instance
      Throws:
      NullPointerException - if routing parameter is null
    • create

      public static TestClient create(Routing routing)
      Creates new TestClient instance with specified routing.
      Parameters:
      routing - a routing to test
      Returns:
      new instance
      Throws:
      NullPointerException - if routing parameter is null
    • path

      public TestRequest path(String path)
      Creates a request of provided URI path.
      Parameters:
      path - a path to request
      Returns:
      new test request builder