Replace this lambda with a method reference

See gh-15401
This commit is contained in:
igor-suhorukov
2018-12-07 00:52:04 +03:00
committed by Stephane Nicoll
parent 71173f2db5
commit 5c1813aef8
13 changed files with 21 additions and 19 deletions

View File

@@ -72,7 +72,7 @@ public final class OAuth2ClientPropertiesRegistrationAdapter {
map.from(properties::getAuthorizationGrantType).as(AuthorizationGrantType::new)
.to(builder::authorizationGrantType);
map.from(properties::getRedirectUri).to(builder::redirectUriTemplate);
map.from(properties::getScope).as((scope) -> StringUtils.toStringArray(scope))
map.from(properties::getScope).as(StringUtils::toStringArray)
.to(builder::scope);
map.from(properties::getClientName).to(builder::clientName);
return builder.build();

View File

@@ -794,7 +794,7 @@ public class WebMvcAutoConfigurationTests {
@Test
public void cachePeriod() {
this.contextRunner.withPropertyValues("spring.resources.cache.period:5")
.run((context) -> assertCachePeriod(context));
.run(this::assertCachePeriod);
}
private void assertCachePeriod(AssertableWebApplicationContext context) {
@@ -817,7 +817,7 @@ public class WebMvcAutoConfigurationTests {
this.contextRunner
.withPropertyValues("spring.resources.cache.cachecontrol.max-age:5",
"spring.resources.cache.cachecontrol.proxy-revalidate:true")
.run((context) -> assertCacheControl(context));
.run(this::assertCacheControl);
}
@Test