Request Specification
open class RequestSpecification<P : Any>(val method: <Error class: unknown class><<Error class: unknown class>>? = null, val path: <Error class: unknown class><String>? = null, val headers: List<<Error class: unknown class><<Error class: unknown class>>> = listOf(), val body: List<<Error class: unknown class><P?>> = listOf(), val bodyString: List<<Error class: unknown class><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.
This class is used to define the criteria against which incoming requests are tested. It provides functionality for checking whether a given request satisfies the specified conditions and supports prioritization for defining matching order.
Parameters
P
type of the request payload
Constructors
Link copied to clipboard
constructor(method: <Error class: unknown class><<Error class: unknown class>>? = null, path: <Error class: unknown class><String>? = null, headers: List<<Error class: unknown class><<Error class: unknown class>>> = listOf(), body: List<<Error class: unknown class><P?>> = listOf(), bodyString: List<<Error class: unknown class><String?>> = listOf(), priority: Int? = DEFAULT_STUB_PRIORITY, requestType: KClass<P>)
Properties
Link copied to clipboard
List of matchers for the request body as a String. All matchers must pass for a match to succeed.
Link copied to clipboard
The priority value used for comparing different specifications. Lower values indicate higher priority. Default value is DEFAULT_STUB_PRIORITY