1
0
mirror of synced 2026-08-04 17:27:13 +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
@@ -43,9 +43,7 @@ public class StaticServerHttpHeadersWriter implements ServerHttpHeadersWriter {
HttpHeaders headers = exchange.getResponse().getHeaders();
boolean containsOneHeaderToAdd = Collections.disjoint(headers.keySet(), this.headersToAdd.keySet());
if (containsOneHeaderToAdd) {
this.headersToAdd.forEach((name, values) -> {
headers.put(name, values);
});
this.headersToAdd.forEach(headers::put);
}
return Mono.empty();
}
@@ -111,9 +111,8 @@ public class CurrentSecurityContextArgumentResolverTests {
SecurityContext context = SecurityContextHolder.getContext();
Authentication authentication = context.getAuthentication();
context.setAuthentication(null);
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() -> {
this.resolver.resolveArgument(showSecurityContextAuthenticationWithPrincipal(), null, null, null);
});
assertThatExceptionOfType(SpelEvaluationException.class).isThrownBy(() -> this.resolver
.resolveArgument(showSecurityContextAuthenticationWithPrincipal(), null, null, null));
context.setAuthentication(authentication);
}