Packages

final case class TestClient(behavior: Ref[Routes[Any, Response]], serverSocketBehavior: Ref[WebSocketApp[Any]]) extends http.ZClient.Driver[Any, Throwable] with Product with Serializable

Enables tests that use a client without needing a live Server

behavior

Contains the user-specified behavior that takes the place of the usual Server

Linear Supertypes
Serializable, Serializable, Product, Equals, ZClient.Driver[Any, Throwable], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestClient
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Driver
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TestClient(behavior: Ref[Routes[Any, Response]], serverSocketBehavior: Ref[WebSocketApp[Any]])

    behavior

    Contains the user-specified behavior that takes the place of the usual Server

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addRequestResponse(expectedRequest: Request, response: Response): ZIO[Any, Nothing, Unit]

    Adds an exact 1-1 behavior

    Adds an exact 1-1 behavior

    expectedRequest

    The request that will trigger the response

    response

    The response to be returned when a user submits the response

    Example:
    1. TestClient.addRequestResponse(Request.get(URL.root), Response.ok)
  5. def addRoute[R](route: Route[R, Response]): ZIO[R, Nothing, Unit]

    Adds a route definition to handle requests that are submitted by test cases

    Adds a route definition to handle requests that are submitted by test cases

    R

    Environment of the new route

    route

    New route to be added to the TestClient

    Example:
    1. TestClient.addRoute { Method.ANY / trailing -> handler(Response.ok) }
  6. def addRoutes[R](route: Route[R, Response], routes: Route[R, Response]*): ZIO[R, Nothing, Unit]

    Adds routes to handle requests that are submitted by test cases

    Adds routes to handle requests that are submitted by test cases

    R

    Environment of the new route

    routes

    New routes to be added to the TestClient

    Example:
    1. TestClient.addRoutes {
        Routes(
          Method.GET / trailing          -> handler { Response.text("fallback") },
          Method.GET / "hello" / "world" -> handler { Response.text("Hey there!") },
        )
      }
  7. def addRoutes(app: Routes[Any, Response]): ZIO[Any, Nothing, Unit]

    Adds an HttpApp to the TestClient

    Adds an HttpApp to the TestClient

    app

    The HttpApp to be added to the TestClient

    Example:
    1. TestClient.addRoutes(HttpApp.empty)
  8. final def apply(request: Request)(implicit trace: Trace): ZIO[zio.&[Any, Scope], Throwable, Response]
    Definition Classes
    Driver
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. val behavior: Ref[Routes[Any, Response]]
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  12. final def disableStreaming(implicit ev: <:<[Throwable, Throwable]): ZClient.Driver[Any, Throwable]
    Definition Classes
    Driver
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  15. def headers: Headers
  16. def installSocketApp[Env1](app: WebSocketApp[Any]): ZIO[Env1, Nothing, Unit]
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def mapError[Err2](f: (Throwable) ⇒ Err2): ZClient.Driver[Any, Err2]
    Definition Classes
    Driver
  19. def method: Method
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  23. final def refineOrDie[Err2](pf: PartialFunction[Throwable, Err2])(implicit ev1: IsSubtypeOfError[Throwable, Throwable], ev2: CanFail[Throwable], trace: Trace): ZClient.Driver[Any, Err2]
    Definition Classes
    Driver
  24. def request(version: Version, method: Method, url: URL, headers: Headers, body: Body, sslConfig: Option[ClientSSLConfig], proxy: Option[Proxy])(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    TestClient → Driver
  25. final def request(req: Request)(implicit trace: Trace): ZIO[zio.&[Any, Scope], Throwable, Response]
    Definition Classes
    Driver
  26. final def retry[Env1 <: Any, Err1 >: Throwable](policy: Schedule[Env1, Err1, Any]): ZClient.Driver[Env1, Err1]
    Definition Classes
    Driver
  27. val serverSocketBehavior: Ref[WebSocketApp[Any]]
  28. def socket[Env1](version: Version, url: URL, headers: Headers, app: WebSocketApp[Env1])(implicit trace: Trace): ZIO[Env1 with Scope, Throwable, Response]
    Definition Classes
    TestClient → Driver
  29. def sslConfig: Option[ClientSSLConfig]
  30. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  31. def url: URL
  32. def version: Version
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def widenError[E1](implicit ev: <:<[Throwable, E1]): ZClient.Driver[Any, E1]
    Definition Classes
    Driver

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from ZClient.Driver[Any, Throwable]

Inherited from AnyRef

Inherited from Any

Ungrouped