Browse Source

Polish "Replace this lambda with a method reference"

Closes gh-15401
pull/15424/head
Stephane Nicoll 7 years ago
parent
commit
d5f90ffcfb
  1. 3
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapter.java
  2. 3
      spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java
  3. 4
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java

3
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapter.java

@ -72,8 +72,7 @@ public final class OAuth2ClientPropertiesRegistrationAdapter { @@ -72,8 +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(StringUtils::toStringArray)
.to(builder::scope);
map.from(properties::getScope).as(StringUtils::toStringArray).to(builder::scope);
map.from(properties::getClientName).to(builder::clientName);
return builder.build();
}

3
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java

@ -131,8 +131,7 @@ public class ApplicationContextAssertProviderTests { @@ -131,8 +131,7 @@ public class ApplicationContextAssertProviderTests {
public void getSourceContextWhenContextFailsShouldThrowException() {
ApplicationContextAssertProvider<ApplicationContext> context = get(
this.startupFailureSupplier);
assertThatIllegalStateException()
.isThrownBy(context::getSourceApplicationContext)
assertThatIllegalStateException().isThrownBy(context::getSourceApplicationContext)
.withCause(this.startupFailure).withMessageContaining("failed to start");
}

4
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java

@ -66,8 +66,8 @@ public class BindResultTests { @@ -66,8 +66,8 @@ public class BindResultTests {
@Test
public void getWhenHasNoValueShouldThrowException() {
BindResult<String> result = BindResult.of(null);
assertThatExceptionOfType(NoSuchElementException.class)
.isThrownBy(result::get).withMessageContaining("No value bound");
assertThatExceptionOfType(NoSuchElementException.class).isThrownBy(result::get)
.withMessageContaining("No value bound");
}
@Test

Loading…
Cancel
Save