-
provider.customer
|CustomerService
Spring 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
|InfoService
Spring 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
|AggregatorService
Node 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
InfoService
consumer# On Unix: chmod +x ./consumer.info/gradlew ./consumer.info/gradlew -p "consumer.info" test
-
Run tests & generate pact for
AggregatorService
consumernpm --prefix ./consumer.aggregator/ install npm --prefix ./consumer.aggregator/ run test
-
Verfiy pacts for
CustomerService
provider# 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" bootRun
API
-
/customers
- Query all customerscurl http://localhost:8080/customers
-
/customer/{customer-email}
- Query specific customercurl http://localhost:8080/customer/customer.c@gmail.com
-
-
InfoService
Requires running
CustomerService
../consumer.info/gradlew -p "consumer.info" bootRun
API
-
/customers
- Query all customer infocurl http://localhost:8090/customers
-
-
AggregatorService
Requires 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.