Skip to content

Commit f1786c3

Browse files
committed
Revert "Disable ConfigurationProperties scanning for slice tests"
This reverts commit 3b4ff7d. The commit caused the build to fail because it disabled `@ConfigurationPropertiesScan` completely in slice tests. It did not take into account components that were explicitly included in slice tests using the `components` attribute. Since `@ConfigurationPropertiesScan` replaces `@Component` and `@EnableConfigurationProperties`, these components are no longer registered even though explicitly included.
1 parent 3b4ff7d commit f1786c3

File tree

48 files changed

+3
-1454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3
-1454
lines changed

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideConfigurationPropertiesScan.java

-48
This file was deleted.

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/OverrideConfigurationPropertiesScanContextCustomizerFactory.java

-76
This file was deleted.

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
@@ -56,7 +55,6 @@
5655
@BootstrapWith(DataJdbcTestContextBootstrapper.class)
5756
@ExtendWith(SpringExtension.class)
5857
@OverrideAutoConfiguration(enabled = false)
59-
@OverrideConfigurationPropertiesScan(enabled = false)
6058
@TypeExcludeFilters(DataJdbcTypeExcludeFilter.class)
6159
@AutoConfigureCache
6260
@AutoConfigureDataJdbc

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.context.annotation.ComponentScan.Filter;
@@ -59,7 +58,6 @@
5958
@BootstrapWith(DataLdapTestContextBootstrapper.class)
6059
@ExtendWith(SpringExtension.class)
6160
@OverrideAutoConfiguration(enabled = false)
62-
@OverrideConfigurationPropertiesScan(enabled = false)
6361
@TypeExcludeFilters(DataLdapTypeExcludeFilter.class)
6462
@AutoConfigureCache
6563
@AutoConfigureDataLdap

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.context.annotation.ComponentScan.Filter;
@@ -60,7 +59,6 @@
6059
@BootstrapWith(DataMongoTestContextBootstrapper.class)
6160
@ExtendWith(SpringExtension.class)
6261
@OverrideAutoConfiguration(enabled = false)
63-
@OverrideConfigurationPropertiesScan(enabled = false)
6462
@TypeExcludeFilters(DataMongoTypeExcludeFilter.class)
6563
@AutoConfigureCache
6664
@AutoConfigureDataMongo

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.context.annotation.ComponentScan.Filter;
@@ -62,7 +61,6 @@
6261
@BootstrapWith(DataNeo4jTestContextBootstrapper.class)
6362
@ExtendWith(SpringExtension.class)
6463
@OverrideAutoConfiguration(enabled = false)
65-
@OverrideConfigurationPropertiesScan(enabled = false)
6664
@TypeExcludeFilters(DataNeo4jTypeExcludeFilter.class)
6765
@Transactional
6866
@AutoConfigureCache

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.context.annotation.ComponentScan.Filter;
@@ -56,7 +55,6 @@
5655
@BootstrapWith(DataRedisTestContextBootstrapper.class)
5756
@ExtendWith(SpringExtension.class)
5857
@OverrideAutoConfiguration(enabled = false)
59-
@OverrideConfigurationPropertiesScan(enabled = false)
6058
@TypeExcludeFilters(DataRedisTypeExcludeFilter.class)
6159
@AutoConfigureCache
6260
@AutoConfigureDataRedis

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.boot.test.context.SpringBootTest;
@@ -70,7 +69,6 @@
7069
@BootstrapWith(JdbcTestContextBootstrapper.class)
7170
@ExtendWith(SpringExtension.class)
7271
@OverrideAutoConfiguration(enabled = false)
73-
@OverrideConfigurationPropertiesScan(enabled = false)
7472
@TypeExcludeFilters(JdbcTypeExcludeFilter.class)
7573
@Transactional
7674
@AutoConfigureCache

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jooq/JooqTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3332
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
3433
import org.springframework.context.annotation.ComponentScan.Filter;
@@ -63,7 +62,6 @@
6362
@BootstrapWith(JooqTestContextBootstrapper.class)
6463
@ExtendWith(SpringExtension.class)
6564
@OverrideAutoConfiguration(enabled = false)
66-
@OverrideConfigurationPropertiesScan(enabled = false)
6765
@TypeExcludeFilters(JooqTypeExcludeFilter.class)
6866
@Transactional
6967
@AutoConfigureJooq

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.boot.test.json.GsonTester;
@@ -68,7 +67,6 @@
6867
@BootstrapWith(JsonTestContextBootstrapper.class)
6968
@ExtendWith(SpringExtension.class)
7069
@OverrideAutoConfiguration(enabled = false)
71-
@OverrideConfigurationPropertiesScan(enabled = false)
7270
@TypeExcludeFilters(JsonExcludeFilter.class)
7371
@AutoConfigureCache
7472
@AutoConfigureJson

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
@@ -73,7 +72,6 @@
7372
@BootstrapWith(DataJpaTestContextBootstrapper.class)
7473
@ExtendWith(SpringExtension.class)
7574
@OverrideAutoConfiguration(enabled = false)
76-
@OverrideConfigurationPropertiesScan(enabled = false)
7775
@TypeExcludeFilters(DataJpaTypeExcludeFilter.class)
7876
@Transactional
7977
@AutoConfigureCache

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.boot.web.client.RestTemplateBuilder;
@@ -71,7 +70,6 @@
7170
@BootstrapWith(RestClientTestContextBootstrapper.class)
7271
@ExtendWith(SpringExtension.class)
7372
@OverrideAutoConfiguration(enabled = false)
74-
@OverrideConfigurationPropertiesScan(enabled = false)
7573
@TypeExcludeFilters(RestClientExcludeFilter.class)
7674
@AutoConfigureCache
7775
@AutoConfigureWebClient

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.boot.test.autoconfigure.json.AutoConfigureJson;
@@ -79,7 +78,6 @@
7978
@BootstrapWith(WebFluxTestContextBootstrapper.class)
8079
@ExtendWith(SpringExtension.class)
8180
@OverrideAutoConfiguration(enabled = false)
82-
@OverrideConfigurationPropertiesScan(enabled = false)
8381
@TypeExcludeFilters(WebFluxTypeExcludeFilter.class)
8482
@AutoConfigureCache
8583
@AutoConfigureJson

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
2929
import org.springframework.boot.autoconfigure.SpringBootApplication;
3030
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
31-
import org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScan;
3231
import org.springframework.boot.test.autoconfigure.core.AutoConfigureCache;
3332
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
3433
import org.springframework.boot.test.context.SpringBootTest;
@@ -80,7 +79,6 @@
8079
@BootstrapWith(WebMvcTestContextBootstrapper.class)
8180
@ExtendWith(SpringExtension.class)
8281
@OverrideAutoConfiguration(enabled = false)
83-
@OverrideConfigurationPropertiesScan(enabled = false)
8482
@TypeExcludeFilters(WebMvcTypeExcludeFilter.class)
8583
@AutoConfigureCache
8684
@AutoConfigureWebMvc

spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring.factories

-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExe
160160
# Spring Test ContextCustomizerFactories
161161
org.springframework.test.context.ContextCustomizerFactory=\
162162
org.springframework.boot.test.autoconfigure.OverrideAutoConfigurationContextCustomizerFactory,\
163-
org.springframework.boot.test.autoconfigure.OverrideConfigurationPropertiesScanContextCustomizerFactory,\
164163
org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizerFactory,\
165164
org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizerFactory,\
166165
org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory

0 commit comments

Comments
 (0)