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

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.b means collection a.b in database billing.
  • 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.