From d5f90ffcfb495ff8bac05e8e50e286749870bd87 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 7 Dec 2018 11:10:10 +0100 Subject: [PATCH] Polish "Replace this lambda with a method reference" Closes gh-15401 --- .../client/OAuth2ClientPropertiesRegistrationAdapter.java | 3 +-- .../assertj/ApplicationContextAssertProviderTests.java | 3 +-- .../boot/context/properties/bind/BindResultTests.java | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapter.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapter.java index 450b6822c62..ab29f182ebc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapter.java +++ b/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 { 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(); } diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java index fa55d6d443f..7cf8cba6a2f 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java @@ -131,8 +131,7 @@ public class ApplicationContextAssertProviderTests { public void getSourceContextWhenContextFailsShouldThrowException() { ApplicationContextAssertProvider context = get( this.startupFailureSupplier); - assertThatIllegalStateException() - .isThrownBy(context::getSourceApplicationContext) + assertThatIllegalStateException().isThrownBy(context::getSourceApplicationContext) .withCause(this.startupFailure).withMessageContaining("failed to start"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java index f6e7b3c754f..44e9e63dee6 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java @@ -66,8 +66,8 @@ public class BindResultTests { @Test public void getWhenHasNoValueShouldThrowException() { BindResult 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