Use parenthesis with single-arg lambdas
Use regular expression search/replace to ensure all single-arg lambdas have parenthesis. This aligns with the style used in Spring Boot and ensure that single-arg and multi-arg lambdas are consistent. Issue gh-8945
This commit is contained in:
+6
-6
@@ -156,10 +156,10 @@ public class MockWebServerPropertySource extends PropertySource<MockWebServer> i
|
||||
|
||||
if ("/introspect".equals(request.getPath())) {
|
||||
return Optional.ofNullable(request.getHeader(HttpHeaders.AUTHORIZATION))
|
||||
.filter(authorization -> isAuthorized(authorization, "client", "secret"))
|
||||
.map(authorization -> parseBody(request.getBody()))
|
||||
.map(parameters -> parameters.get("token"))
|
||||
.map(token -> {
|
||||
.filter((authorization) -> isAuthorized(authorization, "client", "secret"))
|
||||
.map((authorization) -> parseBody(request.getBody()))
|
||||
.map((parameters) -> parameters.get("token"))
|
||||
.map((token) -> {
|
||||
if ("00ed5855-1869-47a0-b0c9-0f3ce520aee7".equals(token)) {
|
||||
return NO_SCOPES_RESPONSE;
|
||||
} else if ("b43d1500-c405-4dc9-b9c9-6cfd966c34c9".equals(token)) {
|
||||
@@ -181,8 +181,8 @@ public class MockWebServerPropertySource extends PropertySource<MockWebServer> i
|
||||
|
||||
private Map<String, Object> parseBody(Buffer body) {
|
||||
return Stream.of(body.readUtf8().split("&"))
|
||||
.map(parameter -> parameter.split("="))
|
||||
.collect(Collectors.toMap(parts -> parts[0], parts -> parts[1]));
|
||||
.map((parameter) -> parameter.split("="))
|
||||
.collect(Collectors.toMap((parts) -> parts[0], (parts) -> parts[1]));
|
||||
}
|
||||
|
||||
private static MockResponse response(String body, int status) {
|
||||
|
||||
+2
-2
@@ -37,11 +37,11 @@ public class OAuth2ResourceServerSecurityConfiguration extends WebSecurityConfig
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests(authz -> authz
|
||||
.authorizeRequests((authz) -> authz
|
||||
.antMatchers("/message/**").hasAuthority("SCOPE_message:read")
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.oauth2ResourceServer(oauth2 -> oauth2
|
||||
.oauth2ResourceServer((oauth2) -> oauth2
|
||||
.authenticationManagerResolver(this.authenticationManagerResolver)
|
||||
);
|
||||
// @formatter:on
|
||||
|
||||
Reference in New Issue
Block a user