Step

class Step(source)

One scripted answer of a FakeHttpTransport stub: after a virtual-time delay, respond with a built response, a Fixture, a response the consumer's lambda builds, or a TransportFailure. A stub's steps run in order and the last repeats.

Stable Core, source compatibility only. Built only through the companion's factories; immutable and safe to share between stubs and threads. Overloads: Step.respond(429, HttpHeaders { add("Retry-After", "30") }) is the String-body overload with its defaults, Step.respond { ... } the lambda overload, Step.fail(TransportFailure.Timeout()) returns the same failure instance on every repeat and Step.fail { TransportFailure.Timeout() } a fresh one per call. A step holds no request data; toString() prints its kind and delay, never a header value or a body. An exception thrown inside a lambda propagates out of execute (a test-authoring error).

Types

Link copied to clipboard
object Companion

The factories.

Properties

Link copied to clipboard

The delay before the step answers; virtual when the caller runs on the test scheduler.

Functions

Link copied to clipboard
open override fun toString(): String

A diagnostic string for logs: the step's kind and delay, never a header value or a body. Its format is not part of the API and may change.