respondsWith

fun <T : Any> respondsWith(responseType: Class<T>, configurer: Consumer<ResponseDefinitionBuilder<P, T>>)(source)

Configures a typed response for this stub.

Parameters

T

The type of the response body.

responseType

The Java Class of the response type.

configurer

A Consumer that configures the ResponseDefinitionBuilder.


Configures a String response for this stub.

Shorthand for respondsWith(String.class, configurer).

Parameters

configurer

A Consumer that configures the ResponseDefinitionBuilder.