-
provider.customer|CustomerServiceSpring Boot service available @ http://localhost:8080
Provides a list of customers via a REST API. The customer has the typical information like name, address, date of birth, email address, status, and more. Besides the basic information, the customer has a list of financial products. Every product has a name, balance, product code, and interest rate, among others. -
consumer.info|InfoServiceSpring Boot service available @ http://localhost:8090
Provides a modified list of customer via REST API. Returns a list of all customers with name, email, and status. -
consumer.aggregator|AggregatorServiceNode service available @ http://localhost:9000
Provides a modified list of customer via REST API. Returns a list of all customers with names and an aggregated balance (sum of all product balances).
-
Run tests & generate pact for
InfoServiceconsumer# On Unix: chmod +x ./consumer.info/gradlew ./consumer.info/gradlew -p "consumer.info" test
-
Run tests & generate pact for
AggregatorServiceconsumernpm --prefix ./consumer.aggregator/ install npm --prefix ./consumer.aggregator/ run test -
Verfiy pacts for
CustomerServiceprovider# On Unix: chmod +x ./provider.customer/gradlew ./provider.customer/gradlew -p "provider.customer" test
For example, if one were to remove the balance field from the API CustomerService, the contract check would fail and output the following error messages.
Pact & other consumer-driven testing frameworks help detect breaking service modifications to prevent such client defects.
-
CustomerService./provider.customer/gradlew -p "provider.customer" bootRunAPI
-
/customers- Query all customerscurl http://localhost:8080/customers
-
/customer/{customer-email}- Query specific customercurl http://localhost:8080/customer/[email protected]
-
-
InfoServiceRequires running
CustomerService../consumer.info/gradlew -p "consumer.info" bootRunAPI
-
/customers- Query all customer infocurl http://localhost:8090/customers
-
-
AggregatorServiceRequires running
CustomerService.npm --prefix ./consumer.aggregator/ run build npm --prefix ./consumer.aggregator/ run start
API
-
/customers- Query all customers with aggregated balancescurl http://localhost:9000/customers
-
Additionally, a postman collection can be found in the test.postman folder to manually interact with the services.

