Test layers
·552 words·3 mins
garland-demo is a reference project that shows what a real Garland test suite looks like end-to-end. It is not a toy — it covers a realistic microservice architecture with authentication, async event propagation, and read-model projections.
Download Demo ┌─────────────────────────────┐
│ user-service :8080 │
│ │
HTTP client ─────► │ /api/users PostgreSQL │
│ /api/orders (userdb) │
│ /api/auth │
└─────────────┬────────────────┘
│
Kafka topics:
user.created / user.updated / user.deleted
order.placed / order.cancelled
│
┌─────────────▼──────────────────┐
│ projection-service :8081 │
│ │
│ /api/projections MongoDB │
│ (projectiondb) │
└─────────────────────────────────┘user-service owns the write side: it persists users and orders to PostgreSQL and publishes domain events to Kafka after every mutation.
projection-service owns the read side: it consumes those events and builds denormalized documents in MongoDB that the UI would query.
The test suite covers both services. Tests target the system from the outside — no mocks, no internal state, no direct database setup through the application layer.
PostgresExamples, KafkaExamples, MongoExamples, HttpExamples), each containing one test per API method with inline explanations.