Companion code for the Effective Testing blog series (Parts III & IV, Testing With DSLs). The posts are the main reference; this repo exists so you can actually run the ideas and poke at them.
It's one scenario — a small university-registration domain, set up for tests through an internal test-fixture DSL — implemented twice against the same Postgres schema:
java/— the primary implementation (Hibernate, JUnit 5, AssertJ).go/— a parallel port (sqlx,go test) that shows which parts of the approach are essential and which were just Java accommodation.
Each directory is self-contained and has its own README, including that language's DSL conventions. Pick whichever you care about — you don't need to read both.
Both suites are integration tests against a real Postgres. Start it once from the repo root:
docker compose up -d # Postgres 17 on localhost:5432, seeded from schema.sqlThen run whichever you like:
cd java && ./gradlew test # Java suite
cd go && go test ./... # Go suiteschema.sql at the root is the authoritative schema — both implementations
validate against it, neither creates it. Tear the database down with
docker compose down -v.
├── schema.sql authoritative Postgres schema
├── docker-compose.yml the Postgres both suites hit
├── java/ Java implementation (+ its own README)
└── go/ Go implementation (+ its own README)
The code in this repository was generated by Claude (Anthropic) working with the author. The blog series is the human-written reference.