Everything is working fine with spring boot version 3.1.6 but on 3.2.0 faced this issue while running the test cases

 initializationError FAILED
    java.lang.NoSuchMethodError: 'java.util.List org.springframework.test.context.MergedContextConfiguration.getPropertySourceDescriptors()'
        at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.createModifiedConfig(SpringBootTestContextBootstrapper.java:379)
        at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.processMergedContextConfiguration(SpringBootTestContextBootstrapper.java:152)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:375)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:268)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:107)
        at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:111)
        at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:129)
        at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:113)
        at org.springframework.test.context.junit.jupiter.SpringExtension.getTestContextManager(SpringExtension.java:294)
        at org.springframework.test.context.junit.jupiter.SpringExtension.beforeAll(SpringExtension.java:113)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

> initializationError FAILED
    java.lang.NoSuchMethodError: 'java.util.List org.springframework.test.context.MergedContextConfiguration.getPropertySourceDescriptors()'
        at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.createModifiedConfig(SpringBootTestContextBootstrapper.java:379)
        at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.processMergedContextConfiguration(SpringBootTestContextBootstrapper.java:152)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:375)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:268)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:107)
        at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.buildTestContext(SpringBootTestContextBootstrapper.java:111)
        at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:129)
        at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:113)
        at org.springframework.test.context.junit.jupiter.SpringExtension.getTestContextManager(SpringExtension.java:294)
        at org.springframework.test.context.junit.jupiter.SpringExtension.beforeAll(SpringExtension.java:113)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)


Comment From: bclozel

This point to a missing method at runtime. This method has been introduced in Spring Framework 6.1, see https://github.com/spring-projects/spring-framework/issues/30981.

This is most likely a problem in your application. Please make sure that the spring-test dependency has the correct version in your application.

Comment From: aldosilva6

Facing the same issue upgrading from 3.1.4 to 3.3.0. Does anybody know the solution?

Comment From: scottfrederick

@aldosilva6 This was the solution suggested above:

This is most likely a problem in your application. Please make sure that the spring-test dependency has the correct version in your application.

Are you explicitly providing any spring-test dependencies, or only letting Spring Boot's dependency management manage all the Spring library versions?

Comment From: aldosilva6

Only letting Spring Boot's dependency management:

<dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
</dependency>

Comment From: scottfrederick

@aldosilva6 We'll need more information to be able to figure out what's going on then. Please distill your case down to a minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it and attaching it to this issue.

Comment From: aldosilva6

I've upgraded all the libraries and removed some pinned versions on pom.xml and everything worked.