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:
+1
-3
@@ -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();
|
||||
}
|
||||
|
||||
+2
-3
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user