Package org.springframework.test.web.reactive.server

Types

Link copied to clipboard
interface KotlinBodySpec<B>

Kotlin compliant WebTestClient.BodySpec for expectations on the response body decoded to a single Object, see KT-5464 for more details.

Functions

Link copied to clipboard
inline fun <T : Any, S : Publisher<T>> WebTestClient.RequestBodySpec.body(publisher: S): WebTestClient.RequestHeadersSpec<*>

Extension for RequestBodySpec.body providing a variant without explicit class parameter thanks to Kotlin reified type parameters.

inline fun <T : Any> WebTestClient.RequestBodySpec.body(producer: Any): WebTestClient.RequestHeadersSpec<*>

Extension for RequestBodySpec.body providing a body<T>(Any) variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

inline fun <T : Any> WebTestClient.RequestBodySpec.body(flow: Flow<T>): WebTestClient.RequestHeadersSpec<*>

Extension for RequestBodySpec.body providing a body(Flow<T>) variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

Link copied to clipboard
inline fun <B : Any> WebTestClient.ResponseSpec.expectBody(): KotlinBodySpec<B>

Extension for ResponseSpec.expectBody providing an expectBody<Foo>() variant and a workaround for KT-5464 which prevents to use WebTestClient.BodySpec in Kotlin.

Link copied to clipboard
inline fun <E : Any> WebTestClient.ResponseSpec.expectBodyList(): WebTestClient.ListBodySpec<E>

Extension for ResponseSpec.expectBodyList providing a expectBodyList<Foo>() variant.

Link copied to clipboard
inline fun <T : Any> WebTestClient.ResponseSpec.returnResult(): FluxExchangeResult<T>

Extension for ResponseSpec.returnResult providing a returnResult<Foo>() variant.