Package org.mockserver.model
package org.mockserver.model
-
ClassDescriptionBody<T>Declarative capture rule (WS2.2): when an expectation matches an incoming request, each capture rule extracts a value from the request and stores it into scenario state under the
CaptureRule.intoname, so a later request's response template can read it back viascenario.get(name)(WS2.1).The part of the request a capture rule reads from.Shared deterministic probability-draw logic for chaos injection, used by bothHttpChaosProfile(HTTP fault injection) andLlmChaosProfile(LLM fault injection).A conditional (if-then-else) request matcher.Serialisable predicate descriptors for LLM conversation matching.Describes a cross-protocol scenario correlation: when a protocol event matchingCrossProtocolScenario.trigger(and optionallyCrossProtocolScenario.matchPattern) is observed, the named scenario is advanced toCrossProtocolScenario.targetState.Identifies the protocol event that triggers a cross-protocol scenario state transition.Represents a single step in an ordered multi-action expectation pipeline.Controls what happens to an expectation's primary response when a blockingbefore-actionfails or times out.A body matcher that matches when the request body is "similar enough" to an expected string, using a deterministic string-similarity metric (normalised Jaro-Winkler) with a configurable threshold between0.0and1.0.Response action for true bidirectional gRPC streaming.Reactive rule for bidirectional gRPC streaming: each inbound client message is matched against rules in order; the first rule whoseGrpcBidiRule.matchJsonmatches the inbound message JSON emits itsGrpcBidiRule.responsesas DATA frames.Declarative gRPC fault/chaos injection profile for probabilistically returning gRPC error statuses (UNAVAILABLE, DEADLINE_EXCEEDED, RESOURCE_EXHAUSTED, INTERNAL, etc.) on matched gRPC method calls, with latency, quota, and count-window controls.Declarative HTTP fault/chaos injection for mocked and forwarded responses: probabilistic connection-drop injection, error status injection (e.g. 500, 503, 429 with an optionalRetry-Afterheader), latency injection, and response-body corruption (truncateBodyAtFractionkeeps only a leading fraction of the body bytes;malformedBodyappends a broken-JSON fragment) for testing client-side body-parsing resilience, and a slow ("dribbled") response (slowResponseChunkSize+slowResponseChunkDelaysend the body in small chunks with a delay between each) for testing read timeouts on a trickling response.Well-known stream-level error codes for HTTP/2 (RFC 7540 section 7) and HTTP/3 (RFC 9114 section 8.1).Forward a request to an upstream host; if upstream returns a configured status code (default 500-599) or times out, return a fallback mock response.Identifies a memoizable body-conversion target.A minimal, self-contained predicate that gates whether aHttpResponseModifierapplies.KeysAndValuesModifier<T extends KeysAndValues<I,T>, K extends KeysAndValuesModifier<T, K, I>, I extends KeyAndValue> KeysToMultiValuesModifier<T extends KeysToMultiValues<I,T>, K extends KeysToMultiValuesModifier<T, K, I>, I extends KeyToMultiValue> Declarative fault/chaos injection for anHttpLlmResponse, for testing agent resilience: probabilistic provider errors (e.g. 429/529 with aRetry-Afterheader), mid-stream truncation, and malformed SSE chunks.Matches amultipart/form-datarequest body at the field level.Opt-in normalisation applied to LLM prompt text beforeConversationPredicatessubstring/regex comparisons are evaluated.Declarative request to simulate a server preemption (Kubernetes node drain / Spot reclamation / a SIGTERM the platform sends before killing the pod): the server cordons itself (rejecting new exchanges), drains in-flight requests for a bounded window, and optionally signals HTTP/2 clients to stop with a GOAWAY.How new exchanges arriving while cordoned are turned away, and how HTTP/2 clients are told to drain.Declarative, protocol-agnostic rate-limiting / quota action attached to anExpectation(a sibling ofchaos).Declarative retry/backoff recovery primitive attached to anHttpResponse: "fail the first K matches, then serve the configured success response".Configuration for a mocked rerank response (Cohere/v1/rerank, Voyage/v1/rerank, ...).Controls how GraphQL body matching compares the selection set (fields).A chunk sink for streaming response bodies.Declarative TCP-layer fault/chaos injection profile, applied at the raw byte level before HTTP decoding.Represents a timed auto-transition for a scenario state machine.Token usage for an LLM completion.Body matcher that delegates matching to a WASM module stored in theWasmStore.