Packages

final case class TestClient(behavior: Ref[PartialFunction[Request, ZIO[Any, Response, 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[PartialFunction[Request, ZIO[Any, Response, 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 addHandler[R](handler: PartialFunction[Request, ZIO[R, Response, Response]]): ZIO[R, Nothing, Unit]

    Adds a flexible handler for requests that are submitted by test cases

    Adds a flexible handler for requests that are submitted by test cases

    R

    Environment of the new handler's effect.

    handler

    New behavior to be added to the TestClient

    Example:
    1. TestClient.addHandler{case request  if request.method == Method.GET => ZIO.succeed(Response.ok)}
  5. 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)
  6. final def apply(request: Request)(implicit trace: Trace): ZIO[zio.&[Any, Scope], Throwable, Response]
    Definition Classes
    Driver
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. val behavior: Ref[PartialFunction[Request, ZIO[Any, Response, Response]]]
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  10. final def disableStreaming(implicit ev: <:<[Throwable, Throwable]): ZClient.Driver[Any, Throwable]
    Definition Classes
    Driver
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  13. def headers: Headers
  14. def installSocketApp[Env1](app: WebSocketApp[Any]): ZIO[Env1, Nothing, Unit]
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def mapError[Err2](f: (Throwable) ⇒ Err2): ZClient.Driver[Any, Err2]
    Definition Classes
    Driver
  17. def method: Method
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  21. 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
  22. 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
  23. final def request(req: Request)(implicit trace: Trace): ZIO[zio.&[Any, Scope], Throwable, Response]
    Definition Classes
    Driver
  24. final def retry[Env1 <: Any, Err1 >: Throwable](policy: Schedule[Env1, Err1, Any]): ZClient.Driver[Env1, Err1]
    Definition Classes
    Driver
  25. val serverSocketBehavior: Ref[WebSocketApp[Any]]
  26. 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
  27. def sslConfig: Option[ClientSSLConfig]
  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def url: URL
  30. def version: Version
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. 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