How victorrentea/pact works
Project type and purpose
• This is a microservice-based demo application for a Consumer-Driven Contract Testing Workshop.
• It consists of three Spring-Boot microservices (catalog, order-history, product) that illustrate consumer-provider interactions using the Pact library.
• A Pact Broker (run in Docker via docker-compose.yaml) stores and shares contract definitions between services.
File structure
• Top-level modules (Maven multimodule project):
• catalog/ – a consumer service that calls the product API
• order-history/ – another consumer service calling the product API
• product/ – the provider service exposing the product API
• Each module has:
• src/main/java for application code (e.g. CatalogApp.java, OrderHistoryApp.java, ProductApp.java)
• src/test/java for Pact tests (consumer tests in catalog & order-history; provider verification tests in product)
• application.properties to configure base URLs, ports, and Pact settings
• Root docker-compose.yaml defines a Pact Broker service on port 9292
• run-all.bat orchestrates startup of all services and test execution
README
• Describes starting the Pact Broker via Docker Compose
• Instructs how to publish consumer pacts (mvn pact:publish)
• Shows how the provider verifies pacts from the broker (mvn verify -Dpact.verifier.publishResults=true ...)
• Emphasizes the broker UI at http://localhost:9292/
Elements
• Clear labels on each service/component (Catalog, Order-History, Product, Pact Broker, CI/CD)
• runtime data flow (consumer → provider)
• contract flow (consumer tests → broker → provider tests)
• Ports and endpoints (e.g., /products) to give context
• Annotations for “Maven multimodule project” and “Docker Compose”