Package-level declarations

Request matching and recording. Use RequestSpecificationBuilder inside get { } / post { } blocks to match by path, headers, query parameters, and body.

Types

Link copied to clipboard

Base builder for matching part content type and content.

Link copied to clipboard

Configures request body matching inside RequestSpecificationBuilder.body.

Link copied to clipboard
class CapturedRequest<P : Any>(request: ApplicationRequest, type: KClass<P>)

Represents an HTTP request that has been captured and provides utilities to access the request's body and its string representation.

Link copied to clipboard

Configures matching for a multipart data part inside MultipartSpecBuilder.part.

Link copied to clipboard
Link copied to clipboard

Selects which HTML form encoding a BodySpecBuilder.form matcher accepts.

Link copied to clipboard

Configures form field and file-part matching for BodySpecBuilder.form.

Link copied to clipboard

Configures matching for non-form multipart bodies.

Link copied to clipboard

Immutable snapshot of an HTTP request for recording purposes.

Link copied to clipboard
open class RequestSpecification<P : Any>

Represents a specification for matching incoming HTTP requests based on defined criteria, such as HTTP method, request path, and request body.

Link copied to clipboard
open class RequestSpecificationBuilder<P : Any>(requestType: KClass<P>)

Properties

Link copied to clipboard
const val DEFAULT_STUB_PRIORITY: Int = 0

The default priority value assigned to a stub when no explicit priority is specified.

Functions

Link copied to clipboard
fun <T> predicateMatcher(description: String? = null, predicate: (T?) -> Boolean): Matcher<T?>

Creates a matcher that evaluates objects against a specified predicate.

Link copied to clipboard

Extension function for easier usage.

Link copied to clipboard

Extension function to assert that the headers should not contain a specific header.

Link copied to clipboard
fun <T> successCallMatcher(description: String? = null, call: (T?) -> Unit): Matcher<T?>

Creates a matcher that tests whether the specified function call can execute successfully without throwing an exception when invoked with a given input value.