We have two classes with which we start Spring Boot, one for default (GrafioschtraderApplication) and tests (GTforTest). Default:

...
@SpringBootApplication()
@EnableAsync
@EnableConfigurationProperties
@Configuration
@ComponentScan(basePackages = { "grafioschtrader" }, excludeFilters = {
    @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = GTforTest.class) })
public class GrafioschtraderApplication {
...

Test:

...
@SpringBootApplication()
@EnableAsync
@EntityScan(basePackages = { "grafioschtrader.entities" })
@ComponentScan(basePackages = { "grafioschtrader" }, excludeFilters = {
    @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = GrafioschtraderApplication.class) })
@PropertySource("classpath:application-test.properties")
@EnableConfigurationProperties
public class GTforTest {
...

Reading the other configuration should be excluded in these classes with @ComponentScan and excludeFiltes. This worked before Spring Boot 3.2. However, since version 3.2, application-test.properties had to be moved from src/test/resources to src/main/resources, and application-test.properties is read from the default configuration during execution. Has this behavior changed in Spring Boot 3.2 or is this a bug?

Comment From: philwebb

Nothing immediately comes to mind for changes in that area. Are you able to share a sample project that reproduces the problem you're seeing?

Comment From: hugograf

I have created a simple example at demo.

Comment From: scottfrederick

Thanks for the reproducer. I haven't gotten to the bottom of this yet, but it appears that the problem is fixed in the latest snapshots for Spring Boot 3.2.1. Can you try to build your real project against 3.2.1-SNAPSHOT and see if the problem still happens for you?

Comment From: snicoll

I believe this is a duplicate of https://github.com/spring-projects/spring-framework/issues/31704

Comment From: bclozel

I think that's right, I'll close this issue then as a duplicate. Thanks Scott for investigating here.