-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Closed
Copy link
Labels
in: testIssues in the test moduleIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
Rob Winch opened SPR-15959 and commented
Currently ExchangeResult.assertWithDiagnostics
accepts a Runnable
which works fine for assertions within ExchangeResult
because other methods have a reference to the ExchangeResult
to create a Runnable
which performs the assertion.
However, a Runnable
does not work nicely for an external user who wants to perform an assertion. Currently they must do something like:
FluxExchangeResult<String> result = client.get()
.exchange()
.expectStatus()
.isOk()
.returnResult(String.class);
result.assertWithDiagnostics(() -> assertThat(result.getResponseCookies().isEmpty()));
It would be nice if assertWithDiagnostics
accepted a Consuer<ExchangeResult>
so that the code can be refactored to be something like:
client.get()
.exchange()
.expectStatus()
.isOk()
.returnResult(String.class)
.assertWithDiagnostics( result -> assertThat(result.getResponseCookies().isEmpty()));
Affects: 5.0 RC4
Issue Links:
- Ensure that WebClient disposes the HTTP client connection once the client response is consumed [SPR-15920] #20474 Ensure that WebClient disposes the HTTP client connection once the client response is consumed
Referenced from: commits d742fc1
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement