Packages

final case class TestClient(behavior: Ref[HttpApp[Any, Throwable]], serverSocketBehavior: Ref[SocketApp[Any]]) extends Client 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[Any, Body, Throwable, Response], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestClient
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. ZClient
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TestClient(behavior: Ref[HttpApp[Any, Throwable]], serverSocketBehavior: Ref[SocketApp[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, Throwable, 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 asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val behavior: Ref[HttpApp[Any, Throwable]]
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  9. final def contramap[In2](f: (In2) ⇒ Body): ZClient[Any, In2, Throwable, Response]
    Definition Classes
    ZClient
  10. final def contramapZIO[Env1 <: Any, Err1 >: Throwable, In2](f: (In2) ⇒ ZIO[Env1, Err1, Body]): ZClient[Env1, In2, Err1, Response]
    Definition Classes
    ZClient
  11. final def dieOn(f: (Throwable) ⇒ Boolean)(implicit ev1: IsSubtypeOfError[Throwable, Throwable], ev2: CanFail[Throwable], trace: Trace): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def get(pathSuffix: String)(body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. final def header(key: String, value: String): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  16. val headers: Headers
    Definition Classes
    TestClient → ZClient
  17. final def host(host: String): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  18. val hostOption: Option[String]
    Definition Classes
    TestClient → ZClient
  19. def installSocketApp[Env1](app: Http[Any, Throwable, WebSocketChannelEvent, Unit]): ZIO[Env1, Nothing, Unit]
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. final def map[Out2](f: (Response) ⇒ Out2): ZClient[Any, Body, Throwable, Out2]
    Definition Classes
    ZClient
  22. final def mapZIO[Env1 <: Any, Err1 >: Throwable, Out2](f: (Response) ⇒ ZIO[Env1, Err1, Out2]): ZClient[Env1, Body, Err1, Out2]
    Definition Classes
    ZClient
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. final def path(segment: String): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  27. val pathPrefix: Path
    Definition Classes
    TestClient → ZClient
  28. final def port(port: Int): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  29. val portOption: Option[Int]
    Definition Classes
    TestClient → ZClient
  30. final def put(pathSuffix: String)(body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  31. val queries: QueryParams
    Definition Classes
    TestClient → ZClient
  32. def query(key: String, value: String): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  33. final def refineOrDie[Err2](pf: PartialFunction[Throwable, Err2])(implicit ev1: IsSubtypeOfError[Throwable, Throwable], ev2: CanFail[Throwable], trace: Trace): ZClient[Any, Body, Err2, Response]
    Definition Classes
    ZClient
  34. final def request(request: Request)(implicit ev: <:<[Body, Body], trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  35. final def request(method: Method, pathSuffix: String, body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  36. def requestInternal(body: Body, headers: Headers, hostOption: Option[String], method: Method, pathPrefix: Path, portOption: Option[Int], queries: QueryParams, schemeOption: Option[Scheme], sslConfig: Option[ClientSSLConfig], version: Version)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Attributes
    protected
    Definition Classes
    TestClient → ZClient
  37. final def retry[Env1 <: Any](policy: Schedule[Env1, Throwable, Any]): ZClient[Env1, Body, Throwable, Response]
    Definition Classes
    ZClient
  38. final def scheme(scheme: Scheme): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  39. val schemeOption: Option[Scheme]
    Definition Classes
    TestClient → ZClient
  40. val serverSocketBehavior: Ref[SocketApp[Any]]
  41. final def socket[Env1 <: Any](url: String, app: SocketApp[Env1], headers: Headers)(implicit trace: Trace): ZIO[Env1 with Scope, Throwable, Response]
    Definition Classes
    ZClient
  42. final def socket[Env1 <: Any](pathSuffix: String)(app: SocketApp[Env1])(implicit trace: Trace): ZIO[Env1 with Scope, Throwable, Response]
    Definition Classes
    ZClient
  43. def socketInternal[Env1](app: SocketApp[Env1], headers: Headers, hostOption: Option[String], pathPrefix: Path, portOption: Option[Int], queries: QueryParams, schemeOption: Option[Scheme], version: Version)(implicit trace: Trace): ZIO[Env1 with Scope, Throwable, Response]
    Attributes
    protected
    Definition Classes
    TestClient → ZClient
  44. final def ssl(ssl: ClientSSLConfig): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  45. val sslConfig: Option[ClientSSLConfig]
    Definition Classes
    TestClient → ZClient
  46. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  47. final def uri(uri: URI): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  48. final def url(url: URL): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  51. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

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[Any, Body, Throwable, Response]

Inherited from AnyRef

Inherited from Any

Ungrouped