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
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestClient
  2. Serializable
  3. Product
  4. Equals
  5. ZClient
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

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. final def @@[LowerEnv <: UpperEnv, UpperEnv <: Any, LowerIn <: UpperIn, UpperIn <: Body, LowerErr >: Throwable, UpperErr >: LowerErr, LowerOut >: Response, UpperOut >: LowerOut](aspect: ZClientAspect[LowerEnv, UpperEnv, LowerIn, UpperIn, LowerErr, UpperErr, LowerOut, UpperOut]): ZClient[UpperEnv, UpperIn, LowerErr, LowerOut]
    Definition Classes
    ZClient
  5. 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)}
  6. 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)
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. val behavior: Ref[HttpApp[Any, Throwable]]
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  10. final def contramap[In2](f: (In2) => Body): ZClient[Any, In2, Throwable, Response]
    Definition Classes
    ZClient
  11. final def contramapZIO[Env1 <: Any, Err1 >: Throwable, In2](f: (In2) => ZIO[Env1, Err1, Body]): ZClient[Env1, In2, Err1, Response]
    Definition Classes
    ZClient
  12. final def delete(pathSuffix: String)(implicit trace: Trace, ev: <:<[Body, Body]): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  13. final def delete(pathSuffix: String, body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  14. final def dieOn(f: (Throwable) => Boolean)(implicit ev1: IsSubtypeOfError[Throwable, Throwable], ev2: CanFail[Throwable], trace: Trace): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def get(pathSuffix: String)(implicit trace: Trace, ev: <:<[Body, Body]): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  17. final def get(pathSuffix: String, body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def head(pathSuffix: String)(implicit trace: Trace, ev: <:<[Body, Body]): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  20. final def head(pathSuffix: String, body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  21. final def header(key: String, value: String): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  22. val headers: Headers
    Definition Classes
    TestClient → ZClient
  23. final def host(host: String): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  24. val hostOption: Option[String]
    Definition Classes
    TestClient → ZClient
  25. def installSocketApp[Env1](app: Http[Any, Throwable, WebSocketChannelEvent, Unit]): ZIO[Env1, Nothing, Unit]
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. final def map[Out2](f: (Response) => Out2): ZClient[Any, Body, Throwable, Out2]
    Definition Classes
    ZClient
  28. final def mapZIO[Env1 <: Any, Err1 >: Throwable, Out2](f: (Response) => ZIO[Env1, Err1, Out2]): ZClient[Env1, Body, Err1, Out2]
    Definition Classes
    ZClient
  29. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  32. final def patch(pathSuffix: String, body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  33. final def path(segment: String): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  34. val pathPrefix: Path
    Definition Classes
    TestClient → ZClient
  35. final def port(port: Int): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  36. val portOption: Option[Int]
    Definition Classes
    TestClient → ZClient
  37. final def post(pathSuffix: String, body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  38. def productElementNames: Iterator[String]
    Definition Classes
    Product
  39. final def put(pathSuffix: String, body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  40. val queries: QueryParams
    Definition Classes
    TestClient → ZClient
  41. def query(key: String, value: String): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  42. 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
  43. def request(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]
    Definition Classes
    TestClient → ZClient
  44. final def request(request: Request)(implicit ev: <:<[Body, Body], trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  45. final def request(method: Method, pathSuffix: String, body: Body)(implicit trace: Trace): ZIO[Any, Throwable, Response]
    Definition Classes
    ZClient
  46. final def retry[Env1 <: Any](policy: Schedule[Env1, Throwable, Any]): ZClient[Env1, Body, Throwable, Response]
    Definition Classes
    ZClient
  47. final def scheme(scheme: Scheme): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  48. val schemeOption: Option[Scheme]
    Definition Classes
    TestClient → ZClient
  49. val serverSocketBehavior: Ref[SocketApp[Any]]
  50. def socket[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]
    Definition Classes
    TestClient → ZClient
  51. final def socket[Env1 <: Any](url: String, app: SocketApp[Env1], headers: Headers)(implicit trace: Trace): ZIO[Env1 with Scope, Throwable, Response]
    Definition Classes
    ZClient
  52. final def socket[Env1 <: Any](pathSuffix: String)(app: SocketApp[Env1])(implicit trace: Trace): ZIO[Env1 with Scope, Throwable, Response]
    Definition Classes
    ZClient
  53. final def ssl(ssl: ClientSSLConfig): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  54. val sslConfig: Option[ClientSSLConfig]
    Definition Classes
    TestClient → ZClient
  55. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  56. final def uri(uri: URI): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  57. final def url(url: URL): ZClient[Any, Body, Throwable, Response]
    Definition Classes
    ZClient
  58. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  59. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  60. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

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 Product

Inherited from Equals

Inherited from ZClient[Any, Body, Throwable, Response]

Inherited from AnyRef

Inherited from Any

Ungrouped