Closed lucasoares closed 2 weeks ago
Please share a minimal sample that fails with 3.3 and works with 2.7
Please share a minimal sample that fails with 3.3 and works with 2.7
I just notice that my application was using bootstrap configuration and not auto configuration. My bad haha
Thanks.
Thanks for letting us know
I'm upgrading Spring Boot from 2.7 and adapting the
META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
changes related to the Auto Configuration system.The behavior of the auto configuration system in integration tests using
@SpringBootTest
is inconsistent between usingspring.factories
and the new mode.Before this change all the auto configurations were started when testing with
@SpringBootTest
. Now, with theorg.springframework.boot.autoconfigure.AutoConfiguration.imports
file, all the auto configuration classes stopped working in the integration tests. I have thespring-boot-autoconfigure-processor
dependency and I can see all my auto configuration classes in the generatedspring-autoconfigure-metadata.properties
so I'm assuming the imports file is correct, but when running the test no auto configuration classes are called.The thing that made me realize that there is an inconsistent between the both uses is because if I use the
spring.factories
as before but keep the Spring Boot3.3
version, the auto configuration classes are loaded normally in the integration tests.The only way I find to make it work using the imports file is by adding the
@EnableAutoConfiguration
annotation in my test class, but I have a lot of projects and tests and since I can't find this documented in any releasing notes, I'm assuming this is a bug.ps.: Im using
@SpringBootTest
with theclasses
attribute to specify few classes in this specific test.