Migrate Spring Boot 4 MongoDB modular packages and test starters#1079
Open
Kyran121 wants to merge 5 commits into
Open
Migrate Spring Boot 4 MongoDB modular packages and test starters#1079Kyran121 wants to merge 5 commits into
Kyran121 wants to merge 5 commits into
Conversation
Kyran121
force-pushed
the
migrate-mongodb-modular-starters
branch
from
July 18, 2026 13:35
889dd45 to
f4719c9
Compare
Kyran121
force-pushed
the
migrate-mongodb-modular-starters
branch
from
July 18, 2026 13:39
f4719c9 to
16ab35c
Compare
Kyran121
marked this pull request as ready for review
July 18, 2026 14:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the MongoDB-related auto-configuration packages and test starters to their Spring Boot 4.0 modular locations, and adds the dedicated MongoDB test starters conditionally based on which main starter and test-slice annotations are in use.
MongoDataAutoConfiguration→DataMongoAutoConfigurationMongoReactiveDataAutoConfiguration→DataMongoReactiveAutoConfigurationMongoRepositoriesAutoConfiguration→DataMongoRepositoriesAutoConfigurationMongoReactiveRepositoriesAutoConfiguration→DataMongoReactiveRepositoriesAutoConfigurationorg.springframework.boot.autoconfigure.data.mongo→org.springframework.boot.data.mongodb.autoconfigureorg.springframework.boot.test.autoconfigure.data.mongo(@DataMongoTest, etc.) →org.springframework.boot.data.mongodb.test.autoconfigureorg.springframework.boot.actuate.autoconfigure.data.mongo(health contributor autoconfig) →org.springframework.boot.mongodb.autoconfigure.healthorg.springframework.boot.actuate.autoconfigure.metrics.mongo→org.springframework.boot.mongodb.autoconfigure.metricsorg.springframework.boot.actuate.data.mongo(health indicators) →org.springframework.boot.mongodb.healthAddSpringBootStarterDataMongoDbTest/AddSpringBootStarterDataMongoDbReactiveTestaddspring-boot-starter-data-mongodb-testor-reactive-testbased on which main starter (spring-boot-starter-data-mongodbvs-reactive) is present. This precondition is needed because@DataMongoTestis a single shared annotation for both imperative and reactive slices, so usage alone can't tell you which starter to add. Each recipe checks the test-slice annotation in both its pre- and post-migration package location, since these two recipes are independently invocable outside the fullMigrateToModularStarterssequence — not just inline steps like the other technologies in this file.This PR covers the Spring Boot-owned modular package and starter changes for MongoDB; Spring Data MongoDB API-level changes (e.g. UUID/BigDecimal representation defaults) are out of scope and tracked separately.
Verified against
Spring Boot 4.0 is GA. Its migration guide gives the root package prefix for each module via its module table (e.g.
spring-boot-mongodb→org.springframework.boot.mongodb,spring-boot-data-mongodb→org.springframework.boot.data.mongodb) plus a generic "each module starts withorg.springframework.boot.<module>" rule, but it doesn't map the specific internal sub-packages or renamed classes. Those mappings were checked directly against the releasedv4.0.7source:module/spring-boot-data-mongodb/.../autoconfigure@DataMongoTestpackage:module/spring-boot-data-mongodb-test/.../autoconfiguremodule/spring-boot-mongodb/.../autoconfigure/healthmodule/spring-boot-mongodb/.../autoconfigure/metricsmodule/spring-boot-mongodb/.../healthrecipes.csv's count deltas (+9 onMigrateAutoconfigurePackages, +15 onMigrateToModularStarters) are the regenerated totals reflecting the new entries added here, not manual edits.Test plan
MigrateMongoDbModularStartersTest: imperative and reactive test-starter addition, negative cases for both (no starter added without matching test-slice usage), auto-configuration class renames, actuator package moves