diff --git a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnPropertyTests.java b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnPropertyTests.java index 9ddd887959b..ccf6f84a1b2 100644 --- a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnPropertyTests.java +++ b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnPropertyTests.java @@ -174,7 +174,7 @@ class ConditionalOnPropertyTests { @Test void relaxedEnabledByDefault() { - load(PrefixValueConfig.class, "simple.myProperty:bar"); + load(PrefixValueConfig.class, "simple.my-property:bar"); assertThat(containsBean()).isTrue(); } diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundExceptionTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundExceptionTests.java index 38cec27e507..2dc61f88e8f 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundExceptionTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundExceptionTests.java @@ -81,12 +81,6 @@ class ConfigDataResourceNotFoundExceptionTests { assertThat(exception.getCause()).isSameAs(this.cause); } - @Test - void getResourceReturnsResource() { - ConfigDataResourceNotFoundException exception = new ConfigDataResourceNotFoundException(this.resource); - assertThat(exception.getResource()).isSameAs(this.resource); - } - @Test void getLocationWhenHasNoLocationReturnsNull() { ConfigDataResourceNotFoundException exception = new ConfigDataResourceNotFoundException(this.resource); diff --git a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/env/EnvironmentEndpointTests.java b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/env/EnvironmentEndpointTests.java index 3ad0fa40c45..43e1d9aff66 100644 --- a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/env/EnvironmentEndpointTests.java +++ b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/env/EnvironmentEndpointTests.java @@ -294,16 +294,15 @@ class EnvironmentEndpointTests { @Test void propertyEntryWhenShowWhenAuthorized() { - testPropertyEntry(Show.ALWAYS, "bar", "another"); + testPropertyEntry(Show.WHEN_AUTHORIZED, "bar", "another"); } - private void testPropertyEntry(Show always, String bar, String another) { + private void testPropertyEntry(Show show, String bar, String another) { TestPropertyValues.of("my.foo=another").applyToSystemProperties(() -> { StandardEnvironment environment = new StandardEnvironment(); TestPropertyValues.of("my.foo=bar", "my.foo2=bar2") .applyTo(environment, TestPropertyValues.Type.MAP, "test"); - EnvironmentEntryDescriptor descriptor = new EnvironmentEndpoint(environment, Collections.emptyList(), - always) + EnvironmentEntryDescriptor descriptor = new EnvironmentEndpoint(environment, Collections.emptyList(), show) .environmentEntry("my.foo"); assertThat(descriptor).isNotNull(); assertThat(descriptor.getProperty()).isNotNull(); diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java index e52ab7513fd..f6c9b39f24d 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java @@ -60,13 +60,7 @@ class ChangeableUrlsTests { } @Test - void httpUrl() throws Exception { - URL url = new URL("https://spring.io"); - assertThat(ChangeableUrls.fromUrls(url)).isEmpty(); - } - - @Test - void httpsUrl() throws Exception { + void nonFileUrl() throws Exception { URL url = new URL("https://spring.io"); assertThat(ChangeableUrls.fromUrls(url)).isEmpty(); } diff --git a/module/spring-boot-jpa/src/test/java/org/springframework/boot/jpa/EntityManagerFactoryBuilderTests.java b/module/spring-boot-jpa/src/test/java/org/springframework/boot/jpa/EntityManagerFactoryBuilderTests.java index 33bcd614190..2172e00c110 100644 --- a/module/spring-boot-jpa/src/test/java/org/springframework/boot/jpa/EntityManagerFactoryBuilderTests.java +++ b/module/spring-boot-jpa/src/test/java/org/springframework/boot/jpa/EntityManagerFactoryBuilderTests.java @@ -102,9 +102,16 @@ class EntityManagerFactoryBuilderTests { assertThatNoException().isThrownBy(builder.dataSource(dataSource)::build); } + /** + * @deprecated since 4.1.1 for removal in 4.3.0 + */ @Test + @Deprecated(since = "4.1.1", forRemoval = true) + @SuppressWarnings("removal") void requireBootstrapExecutorWhenFallbackExecutorProvidesExecutorDoesNotThrow() { - EntityManagerFactoryBuilder builder = createEmptyBuilder(SimpleAsyncTaskExecutor::new); + Function> jpaPropertiesFactory = (dataSource) -> Collections.emptyMap(); + EntityManagerFactoryBuilder builder = new EntityManagerFactoryBuilder(new TestJpaVendorAdapter(), + jpaPropertiesFactory, null, null, new SimpleAsyncTaskExecutor()); builder.requireBootstrapExecutor(() -> new IllegalStateException("BAD")); DataSource dataSource = mock(); assertThatNoException().isThrownBy(builder.dataSource(dataSource)::build); diff --git a/module/spring-boot-mongodb/src/test/java/org/springframework/boot/mongodb/autoconfigure/MongoAutoConfigurationTests.java b/module/spring-boot-mongodb/src/test/java/org/springframework/boot/mongodb/autoconfigure/MongoAutoConfigurationTests.java index 75712074fc0..152a82824d1 100644 --- a/module/spring-boot-mongodb/src/test/java/org/springframework/boot/mongodb/autoconfigure/MongoAutoConfigurationTests.java +++ b/module/spring-boot-mongodb/src/test/java/org/springframework/boot/mongodb/autoconfigure/MongoAutoConfigurationTests.java @@ -58,7 +58,8 @@ class MongoAutoConfigurationTests { @Test void settingsAdded() { - this.contextRunner.withUserConfiguration(SettingsConfig.class) + this.contextRunner.withPropertyValues("spring.mongodb.host:localhost") + .withUserConfiguration(SettingsConfig.class) .run((context) -> assertThat( getSettings(context).getSocketSettings().getConnectTimeout(TimeUnit.MILLISECONDS)) .isEqualTo(300)); @@ -66,7 +67,8 @@ class MongoAutoConfigurationTests { @Test void settingsAddedButNoHost() { - this.contextRunner.withUserConfiguration(SettingsConfig.class) + this.contextRunner.withPropertyValues("spring.mongodb.uri:mongodb://localhost/test") + .withUserConfiguration(SettingsConfig.class) .run((context) -> assertThat( getSettings(context).getSocketSettings().getConnectTimeout(TimeUnit.MILLISECONDS)) .isEqualTo(300)); diff --git a/module/spring-boot-neo4j/src/test/java/org/springframework/boot/neo4j/autoconfigure/Neo4jAutoConfigurationTests.java b/module/spring-boot-neo4j/src/test/java/org/springframework/boot/neo4j/autoconfigure/Neo4jAutoConfigurationTests.java index 756e28234c1..d19ff007dcf 100644 --- a/module/spring-boot-neo4j/src/test/java/org/springframework/boot/neo4j/autoconfigure/Neo4jAutoConfigurationTests.java +++ b/module/spring-boot-neo4j/src/test/java/org/springframework/boot/neo4j/autoconfigure/Neo4jAutoConfigurationTests.java @@ -259,14 +259,6 @@ class Neo4jAutoConfigurationTests { assertThat(mapDriverConfig(properties).encrypted()).isTrue(); } - @Test - void securityWithTrustSignedCertificates() { - Neo4jProperties properties = new Neo4jProperties(); - properties.getSecurity().setTrustStrategy(TrustStrategy.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES); - assertThat(mapDriverConfig(properties).trustStrategy().strategy()) - .isEqualTo(Config.TrustStrategy.Strategy.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES); - } - @Test void securityWithTrustAllCertificates() { Neo4jProperties properties = new Neo4jProperties(); diff --git a/module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatServerPropertiesTests.java b/module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatServerPropertiesTests.java index 692655c878e..7bd2ff4f47b 100644 --- a/module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatServerPropertiesTests.java +++ b/module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatServerPropertiesTests.java @@ -172,12 +172,6 @@ class TomcatServerPropertiesTests { assertThat(this.properties.getThreads().getMinSpare()).isEqualTo(getDefaultProtocol().getMinSpareThreads()); } - @Test - void tomcatMaxHttpPostSizeMatchesConnectorDefault() { - assertThat(this.properties.getMaxHttpFormPostSize().toBytes()) - .isEqualTo(getDefaultConnector().getMaxPostSize()); - } - @Test void tomcatMaxParameterCountMatchesConnectorDefault() { assertThat(this.properties.getMaxParameterCount()).isEqualTo(getDefaultConnector().getMaxParameterCount());