Skip to main content
  1. Docs/
  2. Tutorials/

Try it in 5 minutes

·205 words·1 min

Clone the demo project and run the full test suite against a real stack — no configuration needed beyond Docker.

Requirements
#

  • Java 21+
  • Maven 3.8+
  • Docker

Run
#

git clone https://github.com/garlandframework/garland-demo
cd garland-demo
docker-compose up -d
mvn test -pl tests

docker-compose up -d starts PostgreSQL, Kafka, and MongoDB. Maven runs the full suite against two Spring Boot microservices — user-service and projection-service — that are bundled in the repo.

What runs
#

106 tests across four layers:

  • Endpoint tests — HTTP request, assert response status and body, verify entity persisted in Postgres
  • Component tests — assert Kafka events published after an HTTP call; assert MongoDB projections updated after a Kafka event
  • End-to-end tests — single pipeline verifying HTTP response, Postgres, Kafka, and MongoDB in one assertion using Verify.allOf
  • Example classesPostgresExamples, KafkaExamples, MongoExamples — one test per API method, annotated with explanations

Explore individual examples
#

Run a single example class to explore a specific client:

# all Postgres patterns
mvn test -pl tests -Dtest=PostgresExamples

# all Kafka patterns
mvn test -pl tests -Dtest=KafkaExamples

# all MongoDB patterns
mvn test -pl tests -Dtest=MongoExamples

Next step
#

Read the Quick Start to understand the setup and apply the same patterns to your own project.