v2.0.0
mongo-test-utils becomes Bonsai: new group, new artefacts, new packages, new annotation, new property namespace, and nothing else.
Highlights
- 01
The library is now Bonsai
Everything a consumer names changed, and nothing a consumer relies on behaves differently. Coordinates:
Read the guide →io.gitlab.guisseppe→io.typecheck;spring-mongo-test-utils→bonsai-spring-boot;mongo-test-utils→bonsai-junit;mongo-test-utils-core→bonsai-core;mongo-test-utils-bom→bonsai-bom. Packages:io.gitlab.guisseppe.mongo.test→io.typecheck.bonsai(assertions under.assertions, engine under.core),io.gitlab.guisseppe.mongo.test.junit→io.typecheck.bonsai.junit,io.gitlab.guisseppe.spring.mongo.test→io.typecheck.bonsai.spring. Annotation:@MongoTestServer→@EnableMongoEmulator, still in two variants: the Spring Boot one inio.typecheck.bonsai.springand the plain JUnit 5 one inio.typecheck.bonsai.junit.@MongoSeedand@MongoSeedskeep their names and move toio.typecheck.bonsai.junit. The 1.x artefacts stay on Maven Central; they simply stop receiving releases. - 02
Durability is an artefact, not a hand-picked dependency
The new
Read the guide →io.typecheck:bonsai-durabilitymodule is the supported way to turn on the file-backed debug store. Add it at test scope and it delivers Nitrite's MVStore persistence adapter transitively, at exactly the version the shim was built against. This replaces the old advice to addorg.dizitart:nitrite-mvstore-adapterby hand and keep its version in step yourself. It carries no code of its own, and the adapter stays optional insidebonsai-core, so the in-memory default still pulls nothing. - 03
The bonsai.* property namespace
Every property the library owns moved from
Read the guide →spring.mongodb.test.*tobonsai.*:bonsai.mode,bonsai.cleanup,bonsai.collections,bonsai.indexes-file,bonsai.seed.locations,bonsai.seed.mode,bonsai.bean-overrides.enabled,bonsai.neutralise-properties,bonsai.object-mapper-bean-name,bonsai.passthrough.uri,bonsai.passthrough.allow-remote,bonsai.durability.directory, and the publishedbonsai.active. Spring's own connection properties are untouched:spring.mongodb.uri,spring.mongodb.host,spring.mongodb.portandspring.mongodb.databasebelong to Spring, and the harness still publishes and neutralises those exact names.
Full notes
Breaking changes
- New coordinates. The publishing group is
io.typecheckand every artefact is renamed:spring-mongo-test-utils→bonsai-spring-boot,mongo-test-utils→bonsai-junit,mongo-test-utils-core→bonsai-core,mongo-test-utils-bom→bonsai-bom, withbonsai-parentas the reactor parent. All modules and the BOM release together on one version train, as before. The 1.x coordinates remain resolvable on Maven Central and receive no further releases. - New package roots.
io.gitlab.guisseppe.mongo.test→io.typecheck.bonsai,io.gitlab.guisseppe.mongo.test.assertions→io.typecheck.bonsai.assertions,io.gitlab.guisseppe.mongo.test.junit→io.typecheck.bonsai.junit,io.gitlab.guisseppe.mongo.test.core.*→io.typecheck.bonsai.core.*, andio.gitlab.guisseppe.spring.mongo.test→io.typecheck.bonsai.spring. No type was renamed, moved between modules, or changed signature:MongoTestSupport,MongoTestData,MongoTestAwait,MongoAssertions,MongoFieldMatchersand the rest are the same classes under new package names. - New annotation name.
@MongoTestServeris now@EnableMongoEmulator. The two-variant design is unchanged.io.typecheck.bonsai.spring.EnableMongoEmulatorboots the application context against the embedded store, whileio.typecheck.bonsai.junit.EnableMongoEmulatoris the framework-agnostic harness. The attributes (databases,collections,defaultDatabase) are identical.@MongoSeedand@MongoSeedskeep their names inio.typecheck.bonsai.junit. A test class cannot mix the 1.x and 2.0.0 generations: the annotation and its extension must come from the same one. - New property namespace. The
spring.mongodb.test.*prefix becamebonsai.*, key for key, with defaults unchanged.spring.mongodb.test.cleanupis nowbonsai.cleanup,spring.mongodb.test.seed.locationsis nowbonsai.seed.locations, and so on formode,collections,indexes-file,seed.mode,bean-overrides.enabled,neutralise-properties,object-mapper-bean-name,passthrough.uri,passthrough.allow-remoteanddurability.directory. The harness publishesbonsai.active=truein place of the old marker.spring.mongodb.uri,spring.mongodb.host,spring.mongodb.portandspring.mongodb.databaseare Spring's own properties and are not renamed. They are still published and neutralised under exactly those names. YAML users must re-nest: the block is now top-levelbonsai:, notspring: mongodb: test:. - New system property and environment variables. The plain-JUnit durability switch
mongo.test.durability.directoryis nowbonsai.durability.directory, matching the Spring property exactly, somvn test -Dbonsai.durability.directory=target/mongo-debugworks in both harnesses. The differential evaluation lane's overrides are likewiseBONSAI_REFERENCE_BACKEND,BONSAI_REFERENCE_IMAGE,BONSAI_REFERENCE_URI,BONSAI_REFERENCE_INIT_RSandBONSAI_SKIP_REFERENCE.
Added
io.typecheck:bonsai-durability, a new opt-in artefact for the file-backed debug store. Declaring it at test scope deliversorg.dizitart:nitrite-mvstore-adaptertransitively at the versionbonsai-corewas built against, so enablingbonsai.durability.directoryno longer means hand-pickingorg.dizitartcoordinates and keeping their version aligned with the embedded store. The artefact carries no code; the adapter staysoptionalinsidebonsai-coreso the in-memory default remains dependency-free, and it is managed bybonsai-bomalongside the other modules.
Changed
- The documentation site, the README and the bundled AI agent skill are rebranded throughout: coordinates, imports, annotations, properties and prose all describe Bonsai 2.0.0. The GitLab project is renamed to gitlab.com/guisseppe/bonsai and the documentation site to guisseppe.gitlab.io/bonsai. GitLab redirects from the old paths keep existing links working; the further move to the typecheck.io domain remains a separate infrastructure step. A
Migrating from mongo-test-utils 1.xsection on the Installation page carries the full old→new mapping. - No behavioural change. The driver shim, the aggregation, filter, update, codec, transaction and seeding engines, the cleanup model, the parallel-execution rules, the passthrough mode and the whole assertion vocabulary are exactly as they shipped in 1.3.0. The differential lane runs the same corpus against real MongoDB 7.x and 8.x, and the emulated surface, the fail-fast boundaries and the compatibility matrix are unchanged. A migration is a find-and-replace.
- The library's own test stack moved to JUnit Jupiter 6.1.3 (from 5.11.4), with a single
junit-bomgoverning every module in the reactor; Surefire and Failsafe moved to 3.5.6 to match. jqwik stays at 1.10.1 because it is the current release, there is no Platform 6 specific line, and the generative differential lane runs green with jqwik's Platform artefacts upgraded in place by the BOM. Spring Boot 4.1's BOM already managedjunit-jupiter6.0.3, sobonsai-spring-bootand the evaluation module were on the 6 line already; the reactor pin is now applied uniformly and sits one version ahead of Boot's. Nothing a consumer relies on changed: no type, annotation or signature moved, and the full gate passes unchanged. It covers 562 differential scenarios against a real Testcontainersmongo:8.0, the generative lane, and every module's suite. Consumers' own JUnit version is decided by their build.bonsai-junitcarriesjunit-jupiter-apiat compile scope, so a build that manages nothing now resolves 6.1.3 transitively, while a build that pins JUnit 5 keeps JUnit 5 if it is 5.13 or newer. 2.0.0 moved the extension's class-scoped teardown off the deprecatedCloseableResourceonto anAutoCloseablestore value, the mechanism JUnit introduced in 5.13, so that teardown does not run on an older Jupiter; per-method cleanup is unaffected on any 5.x. The minimum supported JUnit is therefore 5.13 (or any 6.x). Every other Jupiter API the extension touches is binary compatible across the 5.13+ and 6.x lines.