diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorIntegrationTests.java index 4cbef53e97e..33efcf2a2e4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelectorIntegrationTests.java @@ -51,14 +51,14 @@ public class AutoConfigurationImportSelectorIntegrationTests { } @Test - public void multipleSelectorShouldMergeAndSortCorrectly() { + public void multipleSelectorsShouldMergeAndSortCorrectly() { this.contextRunner.withUserConfiguration(Config.class, AnotherConfig.class) .run((context) -> assertThat(getImportedConfigBeans(context)) .containsExactly("ConfigA", "ConfigB", "ConfigC", "ConfigD")); } @Test - public void multipleSelectorWithRedundantImportsShouldMergeAndSortCorrectly() { + public void multipleSelectorsWithRedundantImportsShouldMergeAndSortCorrectly() { this.contextRunner .withUserConfiguration(SingleConfig.class, Config.class, AnotherConfig.class) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index ce103d95e0f..800c99a149c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -20,7 +20,7 @@ content into your application. Rather, pick only the properties that you need. # COMMON SPRING BOOT PROPERTIES # # This sample file is provided as a guideline. Do NOT copy it in its - # entirety to your own application. ^^^ + # entirety to your own application. ^^^ # =================================================================== @@ -1106,7 +1106,7 @@ content into your application. Rather, pick only the properties that you need. spring.rabbitmq.listener.simple.retry.enabled=false # Whether publishing retries are enabled. spring.rabbitmq.listener.simple.retry.initial-interval=1000ms # Duration between the first and second attempt to deliver a message. spring.rabbitmq.listener.simple.retry.max-attempts=3 # Maximum number of attempts to deliver a message. - spring.rabbitmq.listener.simple.retry.max-interval=10000ms # Maximum duration between attempts. + spring.rabbitmq.listener.simple.retry.max-interval=10000ms # Maximum duration between attempts. spring.rabbitmq.listener.simple.retry.multiplier=1 # Multiplier to apply to the previous retry interval. spring.rabbitmq.listener.simple.retry.stateless=true # Whether retries are stateless or stateful. spring.rabbitmq.listener.simple.transaction-size= # Number of messages to be processed in a transaction. That is, the number of messages between acks. For best results, it should be less than or equal to the prefetch count. diff --git a/spring-boot-project/spring-boot-starters/README.adoc b/spring-boot-project/spring-boot-starters/README.adoc index 0b3a9620e0c..2f6e2e7b35a 100644 --- a/spring-boot-project/spring-boot-starters/README.adoc +++ b/spring-boot-project/spring-boot-starters/README.adoc @@ -136,7 +136,7 @@ do as they were designed before this was clarified. | https://www.mulesoft.com/platform/soa/mule-esb-open-source-esb[Mule ESB] | https://github.com/denschu/mule-spring-boot-starter -| http://mybatis.org/mybatis-3/[Mybatis] +| http://mybatis.org/mybatis-3/[MyBatis] | https://github.com/mybatis/mybatis-spring-boot | https://github.com/facebook/nifty[Nifty] (Thrift on Netty) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java index 52ad367eddc..b8416d00880 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java @@ -289,9 +289,9 @@ public class RepackagerTests { public void libraries() throws Exception { TestJarFile libJar = new TestJarFile(this.temporaryFolder); libJar.addClass("a/b/C.class", ClassWithoutMainMethod.class, JAN_1_1985); - final File libJarFile = libJar.getFile(); - final File libJarFileToUnpack = libJar.getFile(); - final File libNonJarFile = this.temporaryFolder.newFile(); + File libJarFile = libJar.getFile(); + File libJarFileToUnpack = libJar.getFile(); + File libNonJarFile = this.temporaryFolder.newFile(); FileCopyUtils.copy(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }, libNonJarFile); this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class); this.testJarFile.addFile("BOOT-INF/lib/" + libJarFileToUnpack.getName(), @@ -319,7 +319,7 @@ public class RepackagerTests { public void duplicateLibraries() throws Exception { TestJarFile libJar = new TestJarFile(this.temporaryFolder); libJar.addClass("a/b/C.class", ClassWithoutMainMethod.class); - final File libJarFile = libJar.getFile(); + File libJarFile = libJar.getFile(); this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class); File file = this.testJarFile.getFile(); Repackager repackager = new Repackager(file); @@ -335,12 +335,12 @@ public class RepackagerTests { public void customLayout() throws Exception { TestJarFile libJar = new TestJarFile(this.temporaryFolder); libJar.addClass("a/b/C.class", ClassWithoutMainMethod.class); - final File libJarFile = libJar.getFile(); + File libJarFile = libJar.getFile(); this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class); File file = this.testJarFile.getFile(); Repackager repackager = new Repackager(file); Layout layout = mock(Layout.class); - final LibraryScope scope = mock(LibraryScope.class); + LibraryScope scope = mock(LibraryScope.class); given(layout.getLauncherClassName()).willReturn("testLauncher"); given(layout.getLibraryDestination(anyString(), eq(scope))).willReturn("test/"); given(layout.getLibraryDestination(anyString(), eq(LibraryScope.COMPILE))) @@ -359,12 +359,12 @@ public class RepackagerTests { public void customLayoutNoBootLib() throws Exception { TestJarFile libJar = new TestJarFile(this.temporaryFolder); libJar.addClass("a/b/C.class", ClassWithoutMainMethod.class); - final File libJarFile = libJar.getFile(); + File libJarFile = libJar.getFile(); this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class); File file = this.testJarFile.getFile(); Repackager repackager = new Repackager(file); Layout layout = mock(Layout.class); - final LibraryScope scope = mock(LibraryScope.class); + LibraryScope scope = mock(LibraryScope.class); given(layout.getLauncherClassName()).willReturn("testLauncher"); repackager.setLayout(layout); repackager.repackage( @@ -625,12 +625,12 @@ public class RepackagerTests { public void layoutCanOmitLibraries() throws IOException { TestJarFile libJar = new TestJarFile(this.temporaryFolder); libJar.addClass("a/b/C.class", ClassWithoutMainMethod.class); - final File libJarFile = libJar.getFile(); + File libJarFile = libJar.getFile(); this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class); File file = this.testJarFile.getFile(); Repackager repackager = new Repackager(file); Layout layout = mock(Layout.class); - final LibraryScope scope = mock(LibraryScope.class); + LibraryScope scope = mock(LibraryScope.class); repackager.setLayout(layout); repackager.repackage( (callback) -> callback.library(new Library(libJarFile, scope))); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java index bdc70e288f1..dc40aab9adf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java @@ -34,7 +34,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; -import org.mockito.MockitoAnnotations; import org.springframework.boot.loader.archive.Archive; import org.springframework.boot.loader.archive.ExplodedArchive; @@ -67,7 +66,6 @@ public class PropertiesLauncherTests { @Before public void setup() { this.contextClassLoader = Thread.currentThread().getContextClassLoader(); - MockitoAnnotations.initMocks(this); System.setProperty("loader.home", new File("src/test/resources").getAbsolutePath()); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java index a13c2bc2431..9ae91bfdebf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java @@ -33,7 +33,7 @@ class RunArguments { private static final String[] NO_ARGS = {}; - private final LinkedList args = new LinkedList<>(); + private final Deque args = new LinkedList<>(); RunArguments(String arguments) { this(parseArgs(arguments)); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySources.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySources.java index 31be48dc0b1..b73f010e624 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySources.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySources.java @@ -57,7 +57,7 @@ class SpringConfigurationPropertySources private ConfigurationPropertySource adapt(PropertySource source) { ConfigurationPropertySource result = this.cache.get(source); - // Most PropertySource test quality only using the source name, we need to + // Most PropertySources test equality only using the source name, so we need to // check the actual source hasn't also changed. if (result != null && result.getUnderlyingSource() == source) { return result; @@ -70,7 +70,7 @@ class SpringConfigurationPropertySources private static class SourcesIterator implements Iterator { - private Deque>> iterators; + private final Deque>> iterators; private ConfigurationPropertySource next; @@ -91,10 +91,10 @@ class SpringConfigurationPropertySources @Override public ConfigurationPropertySource next() { ConfigurationPropertySource next = fetchNext(); - this.next = null; if (next == null) { throw new NoSuchElementException(); } + this.next = null; return next; } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java index cc3d1fa612b..dc4d602196f 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java @@ -70,9 +70,8 @@ public class BindConverterTests { @Test public void createWhenPropertyEditorInitializerIsNullShouldCreate() { - BindConverter bindConverter = new BindConverter( + new BindConverter( ApplicationConversionService.getSharedInstance(), null); - assertThat(bindConverter).isNotNull(); } @Test @@ -142,7 +141,6 @@ public class BindConverterTests { Class converted = bindConverter.convert("java.lang.RuntimeException", ResolvableType.forClass(Class.class)); assertThat(converted).isEqualTo(RuntimeException.class); - } @Test @@ -168,7 +166,7 @@ public class BindConverterTests { this::registerSampleTypeEditor); List converted = bindConverter.convert("test", ResolvableType.forClassWithGenerics(List.class, SampleType.class)); - assertThat(converted).isNotEmpty(); + assertThat(converted).hasSize(1); assertThat(converted.get(0).getText()).isEqualTo("test"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/DelimitedStringToArrayConverterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/DelimitedStringToArrayConverterTests.java index 37f4f84b5d9..afbdaf7038d 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/DelimitedStringToArrayConverterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/DelimitedStringToArrayConverterTests.java @@ -94,7 +94,7 @@ public class DelimitedStringToArrayConverterTests { } @Test - public void convertWhenHasDelimiterOfNoneShouldReturnTrimmedStringElement() { + public void convertWhenHasDelimiterOfNoneShouldReturnWholeString() { TypeDescriptor sourceType = TypeDescriptor.valueOf(String.class); TypeDescriptor targetType = TypeDescriptor .nested(ReflectionUtils.findField(Values.class, "delimiterNone"), 0); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/DelimitedStringToCollectionConverterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/DelimitedStringToCollectionConverterTests.java index 4043ac99721..097bee0aaa7 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/DelimitedStringToCollectionConverterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/DelimitedStringToCollectionConverterTests.java @@ -117,7 +117,7 @@ public class DelimitedStringToCollectionConverterTests { @Test @SuppressWarnings("unchecked") - public void convertWhenHasDelimiterOfNoneShouldReturnTrimmedStringElement() { + public void convertWhenHasDelimiterOfNoneShouldReturnWholeString() { TypeDescriptor sourceType = TypeDescriptor.valueOf(String.class); TypeDescriptor targetType = TypeDescriptor .nested(ReflectionUtils.findField(Values.class, "delimiterNone"), 0); @@ -131,8 +131,8 @@ public class DelimitedStringToCollectionConverterTests { TypeDescriptor sourceType = TypeDescriptor.valueOf(String.class); TypeDescriptor targetType = TypeDescriptor .nested(ReflectionUtils.findField(Values.class, "specificType"), 0); - Object converted = this.conversionService.convert("a*b", sourceType, targetType); - assertThat(converted).isInstanceOf(MyCustomList.class); + MyCustomList converted = (MyCustomList) this.conversionService.convert("a*b", sourceType, targetType); + assertThat(converted).containsExactly("a", "b"); } @Parameters(name = "{0}")