Build using Ktor, Arrow and exposed.
+-------------+ +-------------+ +--------------+
| | | | | |
| Consumer | | Broker | | Provider |
| | | | | |
+-----+-------+ +------+------+ +-------+------+
| | |
+-----------+ | |
| | | |
|create | | |
|test | | |
| | | |
+-----------> mock | |
| component | |
| | |
| create contract | |
+-----------------> |
| | |
| | |
| +----------------->
| | |
| | test fails +------------+
| <-----------------+ |
| | test fails | implement |
| <-----------------+ component |
| | | v1.0.0 |
| | <------------+
| | test passes |
| <-----------------+
| | |
| | |
+-------------+ +-------------+ +--------------+
| | | | | |
| Consumer | | Broker | | Provider |
| | | | | |
+-----+-------+ +------+------+ +-------+------+
| | |
| | test passes for |
| <-----------------+
| | version 1.0.0 |
| | |
| | test fails +------------+
| <-----------------+ |
| | test fails | implement |
| <-----------------+ component |
| | | v1.0.1 |
| | <------------+
| | test fails |
| <-----------------+
| go talk to the other team |
<-----------------+-----------------+
| | |
+-----------+ | |
| | | |
|create | | |
|test | | |
| | | |
+-----------> mock | |
| component | |
| | |
| update contract | |
+-----------------> |
| | test passes |
| <-----------------+
| | |
| | |
./gradlew test
./gradlew run
Starts with an inmem h2 that will be lost after teardown.
export ENV=prod
export database_url=jdbc:postgresql://localhost:12346/test
export database_user=admin
export database_password=secret
./gradlew runcurl http://localhost:8097/contracts
curl -X POST \
http://localhost:8097/contracts/ \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"provider": "home",
"consumer": "nav",
"element": "home",
"fileLines": ["the lines for the contract"]
}'
curl http://localhost:8097/contracts/1
curl -X PUT \
http://localhost:8097/contracts/1/testResults \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"date": [2021,4,20,15,57,45,434000000],
"result": "Success",
"version": "1"
}'
Result can be Success or Failure