The preceding example loads the <<web-reactive.adoc#webflux-config, WebFlux Java configuration>>
and registers the given controller. The resulting WebFlux application is tested
@ -46,12 +51,18 @@ on the builder to customize the default WebFlux Java configuration.
@@ -46,12 +51,18 @@ on the builder to customize the default WebFlux Java configuration.
The following example shows how to set up a server from a
@ -116,14 +151,22 @@ options, including base URL, default headers, client filters, and others. These
@@ -116,14 +151,22 @@ options, including base URL, default headers, client filters, and others. These
are readily available following `bindToServer`. For all others, you need to use
`configureClient()` to transition from server to client configuration, as follows:
@ -137,15 +180,23 @@ up to the point of performing a request by using `exchange()`. What follows afte
@@ -137,15 +180,23 @@ up to the point of performing a request by using `exchange()`. What follows afte
Typically, you start by asserting the response status and headers, as follows:
Then you specify how to decode and consume the response body:
@ -156,18 +207,32 @@ Then you specify how to decode and consume the response body:
@@ -156,18 +207,32 @@ Then you specify how to decode and consume the response body:
Then you can use built-in assertions for the body. The following example shows one way to do so:
@ -176,9 +241,22 @@ You can also go beyond the built-in assertions and create your own, as the follo
@@ -176,9 +241,22 @@ You can also go beyond the built-in assertions and create your own, as the follo
EntityExchangeResult<Person> result = client.get().uri("/persons/1")
.exchange()
@ -186,6 +264,17 @@ You can also exit the workflow and get a result, as follows:
@@ -186,6 +264,17 @@ You can also exit the workflow and get a result, as follows:
@ -220,7 +317,15 @@ Alternatively, if you want to assert there is no response content, you can use c
@@ -220,7 +317,15 @@ Alternatively, if you want to assert there is no response content, you can use c
@ -230,8 +335,17 @@ When you use `expectBody()`, the response is consumed as a `byte[]`. This is use
@@ -230,8 +335,17 @@ When you use `expectBody()`, the response is consumed as a `byte[]`. This is use
raw content assertions. For example, you can use
https://jsonassert.skyscreamer.org[JSONAssert] to verify JSON content, as follows:
@ -252,6 +366,16 @@ You can also use https://github.com/jayway/JsonPath[JSONPath] expressions, as fo
@@ -252,6 +366,16 @@ You can also use https://github.com/jayway/JsonPath[JSONPath] expressions, as fo
@ -262,8 +386,8 @@ To test infinite streams (for example, `"text/event-stream"` or `"application/st
@@ -262,8 +386,8 @@ To test infinite streams (for example, `"text/event-stream"` or `"application/st
you need to exit the chained API (by using `returnResult`), immediately after the response status
and header assertions, as the following example shows:
FluxExchangeResult<MyEvent> result = client.get().uri("/events")
.accept(TEXT_EVENT_STREAM)
@ -272,15 +396,26 @@ and header assertions, as the following example shows:
@@ -272,15 +396,26 @@ and header assertions, as the following example shows:
@ -289,6 +424,18 @@ from the `reactor-test` module to do that, as the following example shows:
@@ -289,6 +424,18 @@ from the `reactor-test` module to do that, as the following example shows: