Refactor ExchangeResult

Clearly separate how the result of an exchange is represented before
the response body has been read (e.g. assertions on status and headers
only) vs later after the body is extracted to a representation
(assertions on the extracted body) or is decoded to Flux<T> (e.g. for
use with a StepVerifier).
This commit is contained in:
Rossen Stoyanchev
2017-02-19 20:45:22 -05:00
parent 20be40bf64
commit d1a64e1122
8 changed files with 284 additions and 180 deletions

View File

@@ -31,7 +31,7 @@ import reactor.test.StepVerifier;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.test.web.reactive.server.ExchangeResult;
import org.springframework.test.web.reactive.server.FluxExchangeResult;
import org.springframework.test.web.reactive.server.WebTestClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@@ -101,7 +101,7 @@ public class ResponseEntityTests {
@Test
public void entityStream() throws Exception {
ExchangeResult<Flux<Person>> result = this.client.get()
FluxExchangeResult<Person> result = this.client.get()
.uri("/persons")
.accept(TEXT_EVENT_STREAM)
.exchange()