[ANN] Joot — test data factory for jOOQ with automatic FK resolution

8 views
Skip to first unread message

Sergei Podkaminnyi

unread,
Feb 10, 2026, 4:47:14 AM (yesterday) Feb 10
to jOOQ User Group
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

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
Reply all
Reply to author
Forward
0 new messages