Reference
API overview
Three modules, one dependency. This reference lists the public surface of each. Every method here exists in the source.
Modules
bonsai-core: the engine and the driver shim. Almost entirely internal; a handful of types surface in user code, and they are listed on the Core API page. Has neither Spring nor JUnit on its classpath, and the build enforces that.bonsai-junit: the framework-agnostic harness, including the JUnit 5 extension and annotations, seeding, reading, waiting, and the entire assertions package.bonsai-spring-boot: the Spring Boot integration, including the annotation, the context initializer, bean overrides, the property set, and typed seeding and reading through the application's own converter.
Reference pages
Harness API
bonsai-junit
MongoTestSupport, MongoTestData, MongoCollectionReader, MongoTestAwait, and the JUnit annotations.
ReadAssertions API
bonsai-junit
MongoAssertions and every fluent assertion class, method by method, plus the field matchers.
ReadSpring API
bonsai-spring-boot
The Spring annotation, typed seeding and reading, and the context initializer.
ReadCore API
bonsai-core
The few core types that reach user code: the unsupported-feature exception, the seed SPI, and the fixture exceptions.
Read
Conventions
- Collection names. Unqualified names resolve against the default database; a dotted name targets a specific one. The split is at the first dot, so
billing.a.bmeans collectiona.bin databasebilling. - Filters are strings. Reader and assertion methods that take a filter take a MongoDB query document as JSON:
"{status: 'CONFIRMED'}", parsed and executed by the same engine the application uses. - Statics need an active context. Every helper resolves the harness context bound to the current thread. Outside a test annotated with either
@EnableMongoEmulator, they throw rather than returning something plausible. - Unsupported means an exception. Anything the shim does not emulate raises
MongoTestUnsupportedException, naming the feature and a compatibility-matrix key.