diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java index 6ae982153a0..820d6eea7fd 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java @@ -191,14 +191,11 @@ public class LocalDevToolsAutoConfiguration { @Override public void onApplicationEvent(ApplicationEvent event) { - if (event instanceof ContextRefreshedEvent) { + if (event instanceof ContextRefreshedEvent + || (event instanceof ClassPathChangedEvent + && !((ClassPathChangedEvent) event).isRestartRequired())) { this.liveReloadServer.triggerReload(); } - if (event instanceof ClassPathChangedEvent) { - if (!((ClassPathChangedEvent) event).isRestartRequired()) { - this.liveReloadServer.triggerReload(); - } - } } @Override diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 820790838b0..51da89eaa9f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -1290,7 +1290,7 @@ To specify a session timeout of 30 seconds, `30`, `PT30S` and `30s` are all equi read timeout of 500ms can be specified in any of the following form: `500`, `PT0.5S` and `500ms`. -You can also use any of the supported unit. These are: +You can also use any of the supported units. These are: * `ns` for nanoseconds * `us` for microseconds @@ -1331,7 +1331,7 @@ include::{code-examples}/context/properties/bind/AppIoProperties.java[tag=exampl To specify a buffer size of 10 megabytes, `10` and `10MB` are equivalent. A size threshold of 256 bytes can be specified as `256` or `256B`. -You can also use any of the supported unit. These are: +You can also use any of the supported units. These are: * `B` for bytes * `KB` for kilobytes diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTestPropertiesIntegrationTests.java index df32e11429c..bfd985affc1 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTestPropertiesIntegrationTests.java @@ -40,8 +40,7 @@ public class DataLdapTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTestPropertiesIntegrationTests.java index c3f298993e0..905669003b4 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTestPropertiesIntegrationTests.java @@ -40,8 +40,7 @@ public class DataMongoTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java index 161f2dce538..cdd81f391ce 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java @@ -50,8 +50,7 @@ public class DataNeo4jTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } static class Initializer diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestPropertiesIntegrationTests.java index 467007f48f4..5d06605e558 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestPropertiesIntegrationTests.java @@ -50,8 +50,7 @@ public class DataRedisTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } static class Initializer diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestPropertiesIntegrationTests.java index c4cdfdd0b3f..8570e7cc023 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestPropertiesIntegrationTests.java @@ -40,8 +40,7 @@ public class JdbcTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestPropertiesIntegrationTests.java index 637998dc582..e471784e786 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestPropertiesIntegrationTests.java @@ -40,8 +40,7 @@ public class JooqTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/JsonTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/JsonTestPropertiesIntegrationTests.java index 10bc2ec20b2..1f9a161c4a2 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/JsonTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/JsonTestPropertiesIntegrationTests.java @@ -40,8 +40,7 @@ public class JsonTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTestPropertiesIntegrationTests.java index bf46e4ad2a1..9a03f688351 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTestPropertiesIntegrationTests.java @@ -40,8 +40,7 @@ public class DataJpaTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTestPropertiesIntegrationTests.java index 5eb857064fc..b8a3a6b0a9e 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTestPropertiesIntegrationTests.java @@ -40,8 +40,7 @@ public class RestClientTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTestPropertiesIntegrationTests.java index 330ac5562a6..e5550700dee 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTestPropertiesIntegrationTests.java @@ -40,8 +40,7 @@ public class WebFluxTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTestPropertiesIntegrationTests.java index eef8fbdc7ab..3da589ee5f3 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTestPropertiesIntegrationTests.java @@ -40,8 +40,7 @@ public class WebMvcTestPropertiesIntegrationTests { @Test public void environmentWithNewProfile() { - String profile = this.environment.getActiveProfiles()[0]; - assertThat(profile).isEqualTo("test"); + assertThat(this.environment.getActiveProfiles()).containsExactly("test"); } } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzer.java index 3ab1d65511c..7475e11a3e2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzer.java @@ -86,9 +86,9 @@ class NoSuchMethodFailureAnalyzer extends AbstractFailureAnalyzer findCandidates(String className) { try { - return Collections.list((NoSuchMethodFailureAnalyzer.class.getClassLoader() + return Collections.list(NoSuchMethodFailureAnalyzer.class.getClassLoader() .getResources(ClassUtils.convertClassNameToResourcePath(className) - + ".class"))); + + ".class")); } catch (Throwable ex) { return null; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDataSizeTypeDescriptor.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDataSizeTypeDescriptor.java index 97c64a56378..c1422befc49 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDataSizeTypeDescriptor.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/MockDataSizeTypeDescriptor.java @@ -27,7 +27,7 @@ import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; /** - * Create a mock {@link TypeDescriptor} with optional {@link DataUnit} annotation. + * Create a mock {@link TypeDescriptor} with optional {@link DataSizeUnit} annotation. * * @author Stephane Nicoll */ diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java index e1453474e77..a13bcfe66e0 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java @@ -30,7 +30,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; /** - * @author awilkinson + * Tests for {@link NoSuchMethodFailureAnalyzer}. + * + * @author Andy Wilkinson */ @RunWith(ModifiedClassPathRunner.class) @ClassPathOverrides("javax.servlet:servlet-api:2.5")