Unmatched

sealed interface Unmatched(source)

What a FakeHttpTransport does with a request no stub matches: Fail throws an UnmatchedRequestError (the default, so a stray request fails the test), Respond serves one Step (the opt-in for a lenient fake). Sealed: the fake interprets exactly these two policies, and the closed pair is the contract.

Stable Core, source compatibility only. Equality is identity; toString() prints the policy and, for Respond, its step.

Inheritors

Types

Link copied to clipboard
object Fail : Unmatched

Throw an UnmatchedRequestError; the call is recorded with matched = false.

Link copied to clipboard
class Respond(val step: Step) : Unmatched

Serve step to every unmatched request; the call is recorded with matched = false.