Hi everyone,
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.
The problem: setting up test data in jOOQ projects often requires creating
parent entities manually, populating every NOT NULL field, and resolving
foreign keys — all before you get to the actual test logic.
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
GitHub: https://github.com/jtestkit/joot
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
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/jooq-user/63006caf-e25d-4d15-a9f8-43b93cfe7763n%40googlegroups.com.