From f335ec00bf803369c7208bc9a5a82d7396bee68b Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 5 Apr 2018 09:31:17 +0100 Subject: [PATCH] Polish --- ...oConfigurationAdvancedConfigurationIntegrationTests.java | 4 ++-- ...estAssuredRestDocsAutoConfigurationIntegrationTests.java | 4 ++-- .../boot/gradle/plugin/JavaPluginAction.java | 6 +++--- .../org/springframework/boot/loader/PropertiesLauncher.java | 2 +- .../test/java/org/springframework/boot/maven/Verify.java | 2 +- .../boot/web/servlet/support/ErrorPageFilterTests.java | 5 ++--- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java index c824b1958a1..a23ab806e25 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,9 +37,9 @@ import org.springframework.util.FileSystemUtils; import static io.restassured.RestAssured.given; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.is; +import static org.springframework.restdocs.operation.preprocess.Preprocessors.modifyUris; import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessRequest; import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document; -import static org.springframework.restdocs.restassured3.operation.preprocess.RestAssuredPreprocessors.modifyUris; /** * Integration tests for advanced configuration of {@link AutoConfigureRestDocs} with REST diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationIntegrationTests.java index 99d3fa697a1..204b53f227a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestAssuredRestDocsAutoConfigurationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,9 +34,9 @@ import org.springframework.util.FileSystemUtils; import static io.restassured.RestAssured.given; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.is; +import static org.springframework.restdocs.operation.preprocess.Preprocessors.modifyUris; import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessRequest; import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document; -import static org.springframework.restdocs.restassured3.operation.preprocess.RestAssuredPreprocessors.modifyUris; /** * Integration tests for {@link RestDocsAutoConfiguration} with REST Assured. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java index 83c31c37bd7..400aecbb8f0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java @@ -147,9 +147,9 @@ final class JavaPluginAction implements PluginApplicationAction { private void configureAdditionalMetadataLocations(JavaCompile compile) { compile.doFirst((task) -> { if (hasConfigurationProcessorOnClasspath(compile)) { - findMatchingSourceSet(compile).ifPresent((sourceSet) -> { - configureAdditionalMetadataLocations(compile, sourceSet); - }); + findMatchingSourceSet(compile).ifPresent( + (sourceSet) -> configureAdditionalMetadataLocations(compile, + sourceSet)); } }); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java index e9d4c215ea2..9f95a260a77 100755 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java @@ -460,7 +460,7 @@ public class PropertiesLauncher extends Launcher { private List getClassPathArchives(String path) throws Exception { String root = cleanupPath(handleUrl(path)); - List lib = new ArrayList(); + List lib = new ArrayList<>(); File file = new File(root); if (!"/".equals(root)) { if (!isAbsolutePath(root)) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java index 98111f09945..982feecff61 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java @@ -141,7 +141,7 @@ public final class Verify { private ZipEntry getEntryStartingWith(String entryName) { return this.content.entrySet().stream() - .filter(entry -> entry.getKey().startsWith(entryName)) + .filter((entry) -> entry.getKey().startsWith(entryName)) .map(Map.Entry::getValue).findFirst() .orElseThrow(() -> new IllegalStateException( "Unable to find entry starting with " + entryName)); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java index 8d84227cb45..f8ca8d411c9 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java @@ -247,9 +247,8 @@ public class ErrorPageFilterTests { @Test public void statusCode() throws Exception { - this.chain = new TestFilterChain((request, response, chain) -> { - assertThat(response.getStatus()).isEqualTo(200); - }); + this.chain = new TestFilterChain((request, response, + chain) -> assertThat(response.getStatus()).isEqualTo(200)); this.filter.doFilter(this.request, this.response, this.chain); assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getStatus()) .isEqualTo(200);