Migrating from Spring Boot 3.1.11 to 3.4.x causes test failures due to deprecated/removed classes – what’s the recommended approach? I’m upgrading a Spring Boot application from version 3.1.11 to 3.4.x. After upgrading, my build compiles successfully, but many JUnit tests fail due to deprecated or removed Spring classes/APIs. Examples of issues: Removed methods:
java.util.LinkedHashSet org.springframework.util.CollectionUtils.newLinkedHashSet(int)
Test context errors:
NoClassDefFoundError: Could not initialize class org.springframework.mock.web.MockServletContext
NoClassDefFoundError: org.springframework.test.context.TestContextManager
Find a safe and maintainable strategy to complete the Spring Boot upgrade without breaking existing test cases and ensure compatibility with newer Spring Framework APIs. What’s the recommended migration approach when upgrading to a newer Spring Boot minor version that removes/deprecates some utility methods and affects tests?