WebSocketSyncBackendStub

sttp.client4.testing.WebSocketSyncBackendStub
See theWebSocketSyncBackendStub companion class

A stub of a synchronous backend.

Attributes

Companion
class
Graph
Supertypes
trait SyncBackend
trait Backend[Identity]
class AbstractBackendStub[Identity, WebSockets]
trait GenericBackend[Identity, WebSockets]
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Inherited classlikes

class WhenRequest(p: GenericRequest[_, _] => Boolean)

Attributes

Inherited from:
AbstractBackendStub
Supertypes
class Object
trait Matchable
class Any

Inherited types

Attributes

Inherited from:
WebSocketSyncBackendStub

Value members

Concrete methods

Create a stub backend which delegates send requests to the given fallback backend, if the request doesn't match any of the specified predicates.

Create a stub backend which delegates send requests to the given fallback backend, if the request doesn't match any of the specified predicates.

Attributes

Inherited methods

override def close(): F[Unit]

Close the backend, releasing any resources (such as thread or connection pools) that have been allocated when opening or using the backend.

Close the backend, releasing any resources (such as thread or connection pools) that have been allocated when opening or using the backend.

Attributes

Definition Classes
Inherited from:
AbstractBackendStub
override def monad: MonadError[Identity]

A monad instance for the F effect type. Allows writing wrapper backends, which map/`flatMap`` over the return value of send.

A monad instance for the F effect type. Allows writing wrapper backends, which map/`flatMap`` over the return value of send.

Attributes

Definition Classes
Inherited from:
SyncBackend
override def send[T](request: GenericRequest[T, WebSockets & Effect[Identity]]): F[Response[T]]

Send the given request. Should only be used when implementing new backends, or backend wrappers. Client code should instead use the send methods on the request type, e.g. Request.send.

Send the given request. Should only be used when implementing new backends, or backend wrappers. Client code should instead use the send methods on the request type, e.g. Request.send.

Attributes

Definition Classes
Inherited from:
AbstractBackendStub

Specify how the stub backend should respond to any request (catch-all).

Specify how the stub backend should respond to any request (catch-all).

Note that the stubs are immutable, and each new specification that is added yields a new stub instance.

Attributes

Inherited from:
AbstractBackendStub
def whenRequestMatches(p: GenericRequest[_, _] => Boolean): WhenRequest

Specify how the stub backend should respond to requests matching the given predicate.

Specify how the stub backend should respond to requests matching the given predicate.

Note that the stubs are immutable, and each new specification that is added yields a new stub instance.

Attributes

Inherited from:
AbstractBackendStub
def whenRequestMatchesPartial(partial: PartialFunction[GenericRequest[_, _], Response[_]]): Self

Specify how the stub backend should respond to requests using the given partial function.

Specify how the stub backend should respond to requests using the given partial function.

Note that the stubs are immutable, and each new specification that is added yields a new stub instance.

Attributes

Inherited from:
AbstractBackendStub