Remove unnecessary lambda blocks

Remove lambda blocks that aren't needed and replace instead with a
simple expression.

Issue gh-8945
This commit is contained in:
Phillip Webb
2020-07-29 18:18:00 -07:00
committed by Rob Winch
parent 52f20b5281
commit 612fb22a7f
13 changed files with 48 additions and 73 deletions

View File

@@ -336,12 +336,10 @@ public class HeaderSpecTests {
@Test
public void headersWhenCustomHeadersWriter() {
this.expectedHeaders.add(CUSTOM_HEADER, CUSTOM_VALUE);
this.http.headers((headers) -> headers.writer((exchange) -> {
return Mono.just(exchange).doOnNext((it) -> {
it.getResponse().getHeaders().add(CUSTOM_HEADER, CUSTOM_VALUE);
}).then();
this.http.headers((headers) -> headers.writer((exchange) -> Mono.just(exchange)
.doOnNext((it) -> it.getResponse().getHeaders().add(CUSTOM_HEADER, CUSTOM_VALUE)).then()
}));
));
assertHeaders();
}

View File

@@ -186,9 +186,7 @@ final class HtmlUnitWebTestClient {
}
private ClientRequest withClientCookies(ClientRequest request) {
return ClientRequest.from(request).cookies((c) -> {
c.addAll(clientCookies());
}).build();
return ClientRequest.from(request).cookies((c) -> c.addAll(clientCookies())).build();
}
private MultiValueMap<String, String> clientCookies() {