I'd like to share a small open source library I've been working on that might be useful for jOOQ users who write integration tests.
Joot reads jOOQ's generated metadata (table structure, FKs, column types, constraints) and generates valid test entities automatically:
JootContext ctx = JootContext.create(dsl);
// Creates Author automatically, resolves FK, populates all required fieldsBook book = ctx.create(BOOK, Book.class).build();
The API is type-safe — it works with jOOQ's Field<T> and Table<R> directly. No reflection on your POJOs, no annotations, no configuration files.
Key features:
- Automatic FK resolution (recursive parent entity creation)
- Factory definitions with reusable defaults: ctx.define(AUTHOR, f -> { ... })
- Composable traits: .trait("european")
- Custom generators per field or per type
- Sequences: ctx.sequence(AUTHOR.EMAIL, n -> "author" + n + "@test.com")
- Batch creation: .times(10)
- Circular dependency handling
Works with any database supported by jOOQ
It's on Maven Central (io.github.jtestkit:joot:0.10.0),
MIT licensed
I'd appreciate any feedback from the jOOQ community — especially on API design choices and missing features. The goal is to complement jOOQ's type-safe approach rather than work around it.
Best regards,
Sergei