Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Effective Testing — runnable examples

CI

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.

Running the tests

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.sql

Then run whichever you like:

cd java && ./gradlew test   # Java suite
cd go   && go test ./...    # Go suite

schema.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.

Layout

├── 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.

About

Samples for the Effective Testing Series

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages