From 05067cd2640851ae7c15d420760e99015047ea2c Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Wed, 13 Mar 2019 12:13:05 +0900 Subject: [PATCH] Polish --- .../autoconfigure/web/server/ManagementPortType.java | 6 +++--- .../spring-boot-docs/src/main/asciidoc/howto.adoc | 2 +- .../verify.groovy | 7 ++----- .../src/it/jar-classifier-main/verify.groovy | 4 ++-- .../verify.groovy | 5 ++--- .../src/it/jar-classifier-source/verify.groovy | 5 ++--- .../src/it/jar-create-dir/verify.groovy | 5 ++--- .../src/it/jar-custom-dir/verify.groovy | 12 ++++-------- .../src/it/jar-custom-launcher/verify.groovy | 5 ++--- .../src/it/jar-exclude-artifact/verify.groovy | 4 ++-- .../src/it/jar-exclude-entry/verify.groovy | 4 ++-- .../src/it/jar-exclude-group/verify.groovy | 4 ++-- .../src/it/jar-executable/verify.groovy | 5 ++--- .../src/it/jar-non-executable/verify.groovy | 5 ++--- .../src/it/jar-skip/verify.groovy | 4 ++-- .../src/it/jar-system-scope-default/verify.groovy | 4 ++-- .../src/it/jar-system-scope/verify.groovy | 4 ++-- .../src/it/jar-test-scope/verify.groovy | 4 ++-- .../src/it/jar-with-kotlin-module/verify.groovy | 4 ++-- .../src/it/jar-with-unpack/verify.groovy | 4 ++-- .../src/it/prop/verify.groovy | 5 ++--- .../src/it/war-reactor/verify.groovy | 2 +- .../src/it/war-with-unpack/verify.groovy | 2 +- .../src/it/war/verify.groovy | 4 ++-- .../springframework/boot/SpringApplicationTests.java | 3 +-- ...entPortAndPathSampleActuatorApplicationTests.java | 4 ++-- .../log4j2/SampleActuatorLog4J2ApplicationTests.java | 4 ++-- .../ui/SampleActuatorUiApplicationPortTests.java | 4 ++-- .../ManagementAddressActuatorApplicationTests.java | 4 ++-- ...entPortAndPathSampleActuatorApplicationTests.java | 4 ++-- ...ManagementPortSampleActuatorApplicationTests.java | 4 ++-- .../src/it/custom/verify.groovy | 5 ++--- .../src/it/default/verify.groovy | 5 ++--- .../JerseyApplicationPathAndManagementPortTests.java | 4 ++-- .../ManagementPortSampleSecureWebFluxTests.java | 9 +++++---- 35 files changed, 72 insertions(+), 88 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementPortType.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementPortType.java index 36bb19f50157..9cebbdbec80f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementPortType.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementPortType.java @@ -45,9 +45,9 @@ public enum ManagementPortType { * Look at the given environment to determine if the {@link ManagementPortType} is * {@link #DISABLED}, {@link #SAME} or {@link #DIFFERENT}. * @param environment the Spring environment - * @return {@link #DISABLED} if `management.server.port` is set to a negative value, - * {@link #SAME} if `management.server.port` is not specified or equal to - * `server.port`and {@link #DIFFERENT} otherwise. + * @return {@link #DISABLED} if {@code management.server.port} is set to a negative + * value, {@link #SAME} if {@code management.server.port} is not specified or equal to + * {@code server.port} and {@link #DIFFERENT} otherwise. * @since 2.1.4 */ public static ManagementPortType get(Environment environment) { diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc index e28f7ca6e632..2c905172627c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -1180,7 +1180,7 @@ shown in the following example: } ---- -JAXB is only available out of the box with Java 8. If you're using a more recent java +JAXB is only available out of the box with Java 8. If you're using a more recent Java generation, add the following dependency to your project: [source,xml,indent=0,subs="verbatim,quotes,attributes"] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/verify.groovy index 1d9d2c46ae00..8a40399d7e2e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/verify.groovy @@ -4,8 +4,8 @@ import static org.junit.Assert.assertTrue import static org.junit.Assert.assertFalse File repackaged = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar") -File main = new File( basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar") -File backup = new File( basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar.original") +File main = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar") +File backup = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar.original") new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify(); assertTrue 'main artifact should exist', main.exists() @@ -22,6 +22,3 @@ assertFalse 'repackaged artifact should not have been installed', file.text.contains ("Installing " + repackaged + " to") assertFalse 'backup artifact should not have been installed', file.text.contains ("Installing " + backup + "to") - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/verify.groovy index 7b3f18aadb8e..a575beda0a6c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/verify.groovy @@ -4,8 +4,8 @@ import static org.junit.Assert.assertTrue import static org.junit.Assert.assertFalse File repackaged = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT-test.jar") -File main = new File( basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar") -File backup = new File( basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar.original") +File main = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar") +File backup = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar.original") new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify(); assertTrue 'main artifact should exist', main.exists() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/verify.groovy index 209442248740..dae20efad32e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/verify.groovy @@ -3,8 +3,8 @@ import org.springframework.boot.maven.* import static org.junit.Assert.assertTrue import static org.junit.Assert.assertFalse -File main = new File(basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar"); -File backup = new File( basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar.original") +File main = new File(basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar") +File backup = new File(basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar.original") new Verify.JarArchiveVerification(main, Verify.SAMPLE_APP).verify(); assertTrue 'backup artifact should exist', backup.exists() @@ -18,4 +18,3 @@ assertTrue 'backup artifact should have been installed', file.text.contains ("Installing " + backup + " to") assertFalse 'repackaged artifact should not have been installed', file.text.contains ("Installing " + main + " to") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/verify.groovy index ab9a28b856c5..d85fe4126222 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/verify.groovy @@ -3,8 +3,8 @@ import org.springframework.boot.maven.* import static org.junit.Assert.assertFalse import static org.junit.Assert.assertTrue -File repackaged = new File(basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar"); -File backup = new File( basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar.original") +File repackaged = new File(basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar") +File backup = new File(basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar.original") new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify(); assertTrue 'backup artifact should exist', backup.exists() @@ -14,4 +14,3 @@ assertTrue 'repackaged artifact should have been replaced', file.text.contains("Replacing artifact with classifier test with repackaged archive") assertFalse 'backup artifact should not have been installed', file.text.contains ("Installing "+backup) assertTrue 'repackaged artifact should have been installed', file.text.contains ("Installing "+repackaged) - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/verify.groovy index 7538fcfa239a..9a3e44547440 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/verify.groovy @@ -2,6 +2,5 @@ import java.io.*; import org.springframework.boot.maven.*; Verify.verifyJar( - new File( basedir, "target/foo/jar-create-dir-0.0.1.BUILD-SNAPSHOT-foo.jar" ), "some.random.Main" -); - + new File(basedir, "target/foo/jar-create-dir-0.0.1.BUILD-SNAPSHOT-foo.jar"), "some.random.Main" +) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/verify.groovy index 9e69a7b94b19..0960d4ee3e62 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/verify.groovy @@ -2,13 +2,9 @@ import java.io.*; import org.springframework.boot.maven.*; Verify.verifyJar( - new File( basedir, "target/foo/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar" ), "some.random.Main" -); + new File(basedir, "target/foo/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main" +) Verify.verifyJar( - new File( localRepositoryPath, "org/springframework/boot/maven/it/jar-custom-dir/0.0.1.BUILD-SNAPSHOT/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar" ), "some.random.Main" -); - - - - + new File(localRepositoryPath, "org/springframework/boot/maven/it/jar-custom-dir/0.0.1.BUILD-SNAPSHOT/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main" +) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/verify.groovy index 8c4a68e53f9b..738a8ad14273 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/verify.groovy @@ -2,6 +2,5 @@ import java.io.*; import org.springframework.boot.maven.*; Verify.verifyJar( - new File( basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar" ), "some.random.Main", "Hello world" -); - + new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main", "Hello world" +) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/verify.groovy index be667d688206..5fb7b201cabc 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/verify.groovy @@ -1,11 +1,11 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "target/jar-exclude-artifact-0.0.1.BUILD-SNAPSHOT.jar"); +File f = new File(basedir, "target/jar-exclude-artifact-0.0.1.BUILD-SNAPSHOT.jar") new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) verifier.assertHasNoEntryNameStartingWith("lib/servlet-api-2.5.jar") } -}.verify(); +}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy index 4f27fc368d96..caec95f97fb7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy @@ -17,11 +17,11 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "target/jar-exclude-entry-0.0.1.BUILD-SNAPSHOT.jar"); +File f = new File(basedir, "target/jar-exclude-entry-0.0.1.BUILD-SNAPSHOT.jar") new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) verifier.assertHasNoEntryNameStartingWith("lib/servlet-api-2.5.jar") } -}.verify(); +}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy index 9d326f53cbf6..cde1c84738fe 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy @@ -17,11 +17,11 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "target/jar-exclude-group-0.0.1.BUILD-SNAPSHOT.jar"); +File f = new File(basedir, "target/jar-exclude-group-0.0.1.BUILD-SNAPSHOT.jar") new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) verifier.assertHasNoEntryNameStartingWith("lib/log4j-api-2.4.1.jar") } -}.verify(); +}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/verify.groovy index 7fda11821deb..8c2522ba6845 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/verify.groovy @@ -2,7 +2,6 @@ import java.io.*; import org.springframework.boot.maven.*; Verify.verifyJar( - new File( basedir, "target/jar-executable-0.0.1.BUILD-SNAPSHOT.jar" ), + new File(basedir, "target/jar-executable-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main", "Spring Boot Startup Script", "MyFullyExecutableJarName", - "MyFullyExecutableJarDesc"); - + "MyFullyExecutableJarDesc") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/verify.groovy index 6ce822cd5670..5d0f840e1732 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/verify.groovy @@ -2,6 +2,5 @@ import java.io.*; import org.springframework.boot.maven.*; Verify.verifyJar( - new File( basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar" ), "some.random.Main", false -); - + new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main", false +) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/verify.groovy index 2c2efb7d2269..cff568c8cbc9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/verify.groovy @@ -1,7 +1,7 @@ import static org.junit.Assert.assertTrue import static org.junit.Assert.assertFalse -File f = new File( basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar") +File f = new File(basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar") assertTrue 'output file should have been generated', f.exists() -File shouldNotExist = new File( basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar.original") +File shouldNotExist = new File(basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar.original") assertFalse 'repackage goal should not have run. .original should not exist', shouldNotExist.exists() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/verify.groovy index aa22640dfd17..f279c675a6bd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/verify.groovy @@ -17,11 +17,11 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "target/jar-system-scope-default-0.0.1.BUILD-SNAPSHOT.jar"); +File f = new File(basedir, "target/jar-system-scope-default-0.0.1.BUILD-SNAPSHOT.jar") new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/sample-1.0.0.jar") } -}.verify(); +}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/verify.groovy index 534cdc7407b7..450fd339ffd6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/verify.groovy @@ -17,11 +17,11 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "target/jar-system-scope-0.0.1.BUILD-SNAPSHOT.jar"); +File f = new File(basedir, "target/jar-system-scope-0.0.1.BUILD-SNAPSHOT.jar") new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/sample-1.0.0.jar") } -}.verify(); +}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy index 1952298b0bef..08f328f75b6a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy @@ -17,11 +17,11 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "target/jar-test-scope-0.0.1.BUILD-SNAPSHOT.jar"); +File f = new File(basedir, "target/jar-test-scope-0.0.1.BUILD-SNAPSHOT.jar") new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) verifier.assertHasNoEntryNameStartingWith("lib/log4j-api-2.4.1.jar") } -}.verify(); +}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/verify.groovy index 764a89bf5639..0d4023f2a678 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/verify.groovy @@ -17,7 +17,7 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "target/jar-with-kotlin-module-0.0.1.BUILD-SNAPSHOT.jar"); +File f = new File(basedir, "target/jar-with-kotlin-module-0.0.1.BUILD-SNAPSHOT.jar") new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { @@ -27,4 +27,4 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { verifier.assertHasNonUnpackEntry("BOOT-INF/lib/kotlin-stdlib-") verifier.assertHasNonUnpackEntry("BOOT-INF/lib/kotlin-reflect-") } -}.verify(); +}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy index ee2388956620..95d942c551ee 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy @@ -17,7 +17,7 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "target/jar-with-unpack-0.0.1.BUILD-SNAPSHOT.jar"); +File f = new File(basedir, "target/jar-with-unpack-0.0.1.BUILD-SNAPSHOT.jar") new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { @@ -25,4 +25,4 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { verifier.assertHasUnpackEntry("BOOT-INF/lib/spring-core-") verifier.assertHasNonUnpackEntry("BOOT-INF/lib/spring-context-") } -}.verify(); +}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/verify.groovy index c00179462716..39e9cd8496db 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/verify.groovy @@ -2,6 +2,5 @@ import java.io.*; import org.springframework.boot.maven.*; Verify.verifyZip( - new File( basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar" ) -); - + new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar") +) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/verify.groovy index b63174c8f706..bac1bd183e4c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/verify.groovy @@ -17,7 +17,7 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "war/target/war-0.0.1.BUILD-SNAPSHOT.war") +File f = new File(basedir, "war/target/war-0.0.1.BUILD-SNAPSHOT.war") new Verify.WarArchiveVerification(f) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/verify.groovy index fd0d220f8374..ddd68ee3ab37 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/verify.groovy @@ -17,7 +17,7 @@ import java.io.*; import org.springframework.boot.maven.*; -File f = new File( basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war") +File f = new File(basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war") new Verify.WarArchiveVerification(f) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/verify.groovy index 19135817091c..e0c145c834c4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/verify.groovy @@ -2,6 +2,6 @@ import java.io.*; import org.springframework.boot.maven.*; Verify.verifyWar( - new File( basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war" ) -); + new File(basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war") +) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index 1f9319b3bf23..5ad39c3f4902 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -27,7 +27,6 @@ import javax.annotation.PostConstruct; -import org.assertj.core.api.Assertions; import org.assertj.core.api.Condition; import org.junit.After; import org.junit.Before; @@ -1080,7 +1079,7 @@ public void webApplicationSwitchedOffInListener() { ExampleConfig.class); application.addListeners( (ApplicationListener) (event) -> { - Assertions.assertThat(event.getEnvironment()) + assertThat(event.getEnvironment()) .isInstanceOf(StandardServletEnvironment.class); TestPropertySourceUtils.addInlinedPropertiesToEnvironment( event.getEnvironment(), "foo=bar"); diff --git a/spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/ManagementPortAndPathSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/ManagementPortAndPathSampleActuatorApplicationTests.java index 8f4384f188b6..568a4e02e3ab 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/ManagementPortAndPathSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/ManagementPortAndPathSampleActuatorApplicationTests.java @@ -43,10 +43,10 @@ public class ManagementPortAndPathSampleActuatorApplicationTests { @LocalServerPort - private int port = 9010; + private int port; @LocalManagementPort - private int managementPort = 9011; + private int managementPort; @Test public void testHome() { diff --git a/spring-boot-samples/spring-boot-sample-actuator-log4j2/src/test/java/sample/actuator/log4j2/SampleActuatorLog4J2ApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator-log4j2/src/test/java/sample/actuator/log4j2/SampleActuatorLog4J2ApplicationTests.java index a31e347c1556..e8788b86d0ee 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-log4j2/src/test/java/sample/actuator/log4j2/SampleActuatorLog4J2ApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator-log4j2/src/test/java/sample/actuator/log4j2/SampleActuatorLog4J2ApplicationTests.java @@ -20,7 +20,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.assertj.core.api.Assertions; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +31,7 @@ import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; @@ -60,7 +60,7 @@ public class SampleActuatorLog4J2ApplicationTests { @Test public void testLogger() { logger.info("Hello World"); - Assertions.assertThat(this.output.toString()).contains("Hello World"); + assertThat(this.output.toString()).contains("Hello World"); } @Test diff --git a/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationPortTests.java b/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationPortTests.java index 3d22ca5e2cf4..81c2741acd16 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationPortTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator-ui/src/test/java/sample/actuator/ui/SampleActuatorUiApplicationPortTests.java @@ -43,10 +43,10 @@ public class SampleActuatorUiApplicationPortTests { @LocalServerPort - private int port = 9010; + private int port; @LocalManagementPort - private int managementPort = 9011; + private int managementPort; @Test public void testHome() { diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementAddressActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementAddressActuatorApplicationTests.java index 3d2d33f1b964..8806ca311a81 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementAddressActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementAddressActuatorApplicationTests.java @@ -44,10 +44,10 @@ public class ManagementAddressActuatorApplicationTests { @LocalServerPort - private int port = 9010; + private int port; @LocalManagementPort - private int managementPort = 9011; + private int managementPort; @Test public void testHome() { diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortAndPathSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortAndPathSampleActuatorApplicationTests.java index 4d064a1f8db3..3acba427d154 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortAndPathSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortAndPathSampleActuatorApplicationTests.java @@ -46,10 +46,10 @@ public class ManagementPortAndPathSampleActuatorApplicationTests { @LocalServerPort - private int port = 9010; + private int port; @LocalManagementPort - private int managementPort = 9011; + private int managementPort; @Autowired private Environment environment; diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortSampleActuatorApplicationTests.java index 566e79c4b0d0..dcd2502a7147 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortSampleActuatorApplicationTests.java @@ -43,10 +43,10 @@ public class ManagementPortSampleActuatorApplicationTests { @LocalServerPort - private int port = 9010; + private int port; @LocalManagementPort - private int managementPort = 9011; + private int managementPort; @Test public void testHome() { diff --git a/spring-boot-samples/spring-boot-sample-custom-layout/src/it/custom/verify.groovy b/spring-boot-samples/spring-boot-sample-custom-layout/src/it/custom/verify.groovy index bcb4277c0e60..2b5aeae0a2fe 100644 --- a/spring-boot-samples/spring-boot-sample-custom-layout/src/it/custom/verify.groovy +++ b/spring-boot-samples/spring-boot-sample-custom-layout/src/it/custom/verify.groovy @@ -2,6 +2,5 @@ import java.io.*; import sample.layout.*; Verify.verify( - new File( basedir, "target/custom-0.0.1.BUILD-SNAPSHOT.jar" ), "custom" -); - + new File(basedir, "target/custom-0.0.1.BUILD-SNAPSHOT.jar"), "custom" +) diff --git a/spring-boot-samples/spring-boot-sample-custom-layout/src/it/default/verify.groovy b/spring-boot-samples/spring-boot-sample-custom-layout/src/it/default/verify.groovy index a9cd8afb07d2..6c956d1478fc 100644 --- a/spring-boot-samples/spring-boot-sample-custom-layout/src/it/default/verify.groovy +++ b/spring-boot-samples/spring-boot-sample-custom-layout/src/it/default/verify.groovy @@ -2,6 +2,5 @@ import java.io.*; import sample.layout.*; Verify.verify( - new File( basedir, "target/default-0.0.1.BUILD-SNAPSHOT.jar" ), "sample" -); - + new File(basedir, "target/default-0.0.1.BUILD-SNAPSHOT.jar"), "sample" +) diff --git a/spring-boot-samples/spring-boot-sample-jersey/src/test/java/sample/jersey/JerseyApplicationPathAndManagementPortTests.java b/spring-boot-samples/spring-boot-sample-jersey/src/test/java/sample/jersey/JerseyApplicationPathAndManagementPortTests.java index 4e96f4e50b5e..e81bd2f3d4b1 100644 --- a/spring-boot-samples/spring-boot-sample-jersey/src/test/java/sample/jersey/JerseyApplicationPathAndManagementPortTests.java +++ b/spring-boot-samples/spring-boot-sample-jersey/src/test/java/sample/jersey/JerseyApplicationPathAndManagementPortTests.java @@ -41,10 +41,10 @@ public class JerseyApplicationPathAndManagementPortTests { @LocalServerPort - private int port = 9010; + private int port; @LocalManagementPort - private int managementPort = 9011; + private int managementPort; @Autowired private TestRestTemplate testRestTemplate; diff --git a/spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/ManagementPortSampleSecureWebFluxTests.java b/spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/ManagementPortSampleSecureWebFluxTests.java index 7ac2d7024d26..0627af0f37fa 100644 --- a/spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/ManagementPortSampleSecureWebFluxTests.java +++ b/spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/ManagementPortSampleSecureWebFluxTests.java @@ -18,7 +18,6 @@ import java.util.Base64; -import org.assertj.core.api.Assertions; import org.junit.Test; import org.junit.runner.RunWith; @@ -37,6 +36,8 @@ import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; +import static org.assertj.core.api.Assertions.assertThat; + /** * Integration tests for separate management and main service ports. * @@ -50,10 +51,10 @@ public class ManagementPortSampleSecureWebFluxTests { @LocalServerPort - private int port = 9010; + private int port; @LocalManagementPort - private int managementPort = 9011; + private int managementPort; @Autowired private WebTestClient webClient; @@ -90,7 +91,7 @@ public void testInsecureActuator() { String.class) .exchange().expectStatus().isOk().expectBody(String.class).returnResult() .getResponseBody(); - Assertions.assertThat(responseBody).contains("\"status\":\"UP\""); + assertThat(responseBody).contains("\"status\":\"UP\""); } private String getBasicAuth() {