Enables tests that use a client without needing a live Server
Value parameters
- behavior
-
Contains the user-specified behavior that takes the place of the usual Server
Attributes
- Companion
- object
- Source
- TestClient.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Adds an exact 1-1 behavior
Adds an exact 1-1 behavior
Value parameters
- expectedRequest
-
The request that will trigger the response
- response
-
The response to be returned when a user submits the response
Attributes
- Example
-
TestClient.addRequestResponse(Request.get(URL.root), Response.ok) - Source
- TestClient.scala
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
Type parameters
- R
-
Environment of the new route
Value parameters
- route
-
New route to be added to the TestClient
Attributes
- Example
-
TestClient.addRoute { Method.ANY / trailing -> handler(Response.ok) } - Source
- TestClient.scala
Adds Routes to the TestClient
Adds routes to handle requests that are submitted by test cases
Adds routes to handle requests that are submitted by test cases
Type parameters
- R
-
Environment of the new route
Value parameters
- routes
-
New routes to be added to the TestClient
Attributes
- Example
-
TestClient.addRoutes { Routes( Method.GET / trailing -> handler { Response.text("fallback") }, Method.GET / "hello" / "world" -> handler { Response.text("Hey there!") }, ) } - Source
- TestClient.scala
Attributes
- Source
- TestClient.scala
Attributes
- Source
- TestClient.scala
Attributes
- Source
- TestClient.scala
Attributes
- Definition Classes
- Source
- TestClient.scala
Sets a fallback behaviour for when the TestClient attempts to access any unspecified routes
Sets a fallback behaviour for when the TestClient attempts to access any unspecified routes
Type parameters
- R
-
Environment of the handler
Value parameters
- fallbackHandler
-
The function to execute when the client attempts to perform a request not part of it's behavior
Attributes
- Example
-
ref <- Ref.Synchronized.make[Seq[Request]](Nil) _ <- TestClient.setFallbackHandler(req => ref.update(_.appended(req)) - Source
- TestClient.scala
Attributes
- Source
- TestClient.scala
Attributes
- Source
- TestClient.scala
Attributes
- Source
- TestClient.scala
Attributes
- Source
- TestClient.scala
Inherited methods
Attributes
- Inherited from:
- Driver
- Source
- ZClient.scala
Attributes
- Inherited from:
- Driver
- Source
- ZClient.scala
Attributes
- Inherited from:
- Driver
- Source
- ZClient.scala
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Driver
- Source
- ZClient.scala
Attributes
- Inherited from:
- Driver
- Source
- ZClient.scala