method

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

Creates a RequestSpecification with the specified HTTP method and additional configuration defined by the given block, and returns a new BuildingStep instance for further customization.

  • @param name An optional name assigned to the Stub for identification or debugging purposes.

Return

A BuildingStep instance initialized with the generated request specification.

Parameters

httpMethod

The HttpMethod to match for the request specification.

requestType

The class type of the request body.

block

A lambda used to configure the RequestSpecificationBuilder.


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

Creates a building step for a stub configuration with the specified parameters.

Return

A BuildingStep instance configured with the provided parameters.

Parameters

name

An optional name for the stub configuration.

httpMethod

The HTTP method associated with the request.

requestType

The class type of the request payload.

block

A block for specifying request details using a RequestSpecificationBuilder.