1
0
mirror of synced 2026-08-05 09:47:05 +00:00

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
@@ -221,9 +221,9 @@ public class RSocketMessageHandlerITests {
@Bean
PayloadSocketAcceptorInterceptor rsocketInterceptor(RSocketSecurity rsocket) {
rsocket.authorizePayload((authorize) -> {
authorize.route("secure.*").authenticated().anyExchange().permitAll();
}).basicAuthentication(Customizer.withDefaults());
rsocket.authorizePayload(
(authorize) -> authorize.route("secure.*").authenticated().anyExchange().permitAll())
.basicAuthentication(Customizer.withDefaults());
return rsocket.build();
}
@@ -247,9 +247,8 @@ public class RSocketMessageHandlerITests {
@MessageMapping({ "secure.send", "send" })
Mono<Void> send(Mono<String> payload) {
return payload.doOnNext(this::add).then(Mono.fromRunnable(() -> {
doNotifyAll();
}));
return payload.doOnNext(this::add).then(Mono.fromRunnable(() -> doNotifyAll()));
}
private synchronized void doNotifyAll() {
@@ -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();
}
@@ -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() {