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
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

Immutable snapshot of an HTTP request for recording purposes.

Link copied to clipboard
open class RequestSpecification<P : Any>(val method: Matcher<HttpMethod>? = null, val path: Matcher<String>? = null, val headers: List<Matcher<Headers>> = listOf(), val body: List<Matcher<P?>> = listOf(), val bodyString: List<Matcher<String?>> = listOf(), val priority: Int = DEFAULT_STUB_PRIORITY, requestType: KClass<P>)

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.