v3.4.0
Record a real test run as fixtures, seed whole aggregates from one code fixture, and test Mongo listeners with experimental change streams, plus an ecosystem probe lane and a public-API gate.
Highlights
- 01
Record-and-replay seeding
Run a suite once in passthrough against a real server with bonsai.record.output set, and Bonsai emits a ready-made @MongoSeed directory per class. It contains a baseline plus per-method deltas, canonical Extended JSON, a completeness manifest, and byte-level verification via BonsaiRecordings.verify.
Read the guide → - 02
Change streams (experimental)
collection.watch() and database.watch() are behind bonsai.experimental.change-streams, with every event shape pinned to ground truth captured from real mongod 7.0, 8.0 and 8.3 replica sets. This makes Spring Mongo listeners integration-testable with no Docker.
Read the guide → - 03
MultiSeedSource
One code fixture seeds several collections with correlated ids from a single deterministic randomSeed. It is the aggregate-spanning companion to 3.3.0's SeedSource.
Read the guide →
Full notes
Added
- MultiSeedSource and @MongoSeed(multiSources = …): map-keyed multi-collection code fixtures with full fail-fast validation (system databases, malformed keys, null maps all rejected by name), encode-all-before-any-write semantics, and honest non-atomicity documentation. The Spring entity insert paths now refuse a fixture object passed as data instead of silently writing it.
- Record-and-replay seeding for the Spring passthrough harness: class baselines plus per-method deltas as canonical Extended JSON, atomic publication, replacement-contract instructions including suite-seed properties, frozen-placeholder provenance, index specs, volume and remote-host guards, path-traversal-hardened output, and BonsaiRecordings.verify byte comparison. Recording is observationally inert. It can never fail a suite.
- Experimental change streams: the event shape, including updateDescription from an engine-owned effects journal, commit-time transaction publication, drop/invalidate delivery through harness cleanup, and resume tokens with history-lost semantics, is pinned against a 58-case catalogue captured from real replica sets. The differential corpus is green 174/174 across three server versions. Everything unsupported fails by name under changeStream.*; with the flag off the shim is byte-identical to 3.3.0.
- An ecosystem probe lane characterising Mongock, Micrometer's command listener, Boot's Mongo health indicator, Spring Session and GridFS against the shim, so integration gaps surface in Bonsai's CI before a customer finds them.
- A japicmp public-API gate comparing every published module against the newest Central release in every build and in CI, plus two new compatibility-matrix rows: driver.clientBulkWrite and driver.rawDocumentClass.
Fixed
- Spring's manual seeding entry points now resolve placeholders through the full chain including the Environment, matching the annotation path.