method

fun <P : Any> method(configuration: StubConfiguration, httpMethod: HttpMethod, requestType: KClass<P>, block: RequestSpecificationBuilder<P>.() -> Unit): BuildingStep<P>(source)

Creates a RequestSpecification for the given HTTP method and request type, and returns a BuildingStep for further stub configuration.

Return

A BuildingStep for further customization and stub registration.

Parameters

configuration

The StubConfiguration to use for this request specification.

httpMethod

The HTTP method to match for incoming requests.

requestType

The class type of the expected request body.

block

Lambda to configure the RequestSpecificationBuilder.


fun <P : Any> method(name: String? = null, httpMethod: HttpMethod, requestType: KClass<P>, block: RequestSpecificationBuilder<P>.() -> Unit): BuildingStep<P>(source)

Defines a stubbed HTTP RequestSpecification for the given method and request type, optionally naming the stub.

Return

A BuildingStep for further stub configuration and registration.

Parameters

name

Optional identifier for the stub.

httpMethod

The HTTP method to match (e.g., GET, POST).

requestType

The expected type of the request payload.

block

Lambda to configure the RequestSpecificationBuilder.