From a66eed70035c1adf76d312ad78530b54893e7946 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 13 Oct 2025 21:07:06 +0200 Subject: [PATCH] feat: Refined pact between `UserService` and `ChatBackendController` * Added expectations, how an existing `User` can be fetched --- UserService-ChatBackendController.json | 102 ++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 3 deletions(-) diff --git a/UserService-ChatBackendController.json b/UserService-ChatBackendController.json index d9be1e70..f1bd4880 100644 --- a/UserService-ChatBackendController.json +++ b/UserService-ChatBackendController.json @@ -3,6 +3,105 @@ "name": "UserService" }, "interactions": [ + { + "description": "a request for /user/5c73531c-6fc4-426c-adcb-afc5c140a0f7", + "pending": false, + "providerStates": [ + { + "name": "there are 10 shards" + }, + { + "name": "the server is responsible for shard 2" + }, + { + "name": "user 5c73531c-6fc4-426c-adcb-afc5c140a0f7 exists in shard 2" + } + ], + "request": { + "headers": { + "Accept": [ + "application/json" + ] + }, + "matchingRules": { + "header": { + "Accept": { + "combine": "AND", + "matchers": [ + { + "match": "type" + } + ] + } + } + }, + "method": "GET", + "path": "/user/5c73531c-6fc4-426c-adcb-afc5c140a0f7" + }, + "response": { + "body": { + "content": { + "id": "5c73531c-6fc4-426c-adcb-afc5c140a0f7", + "shard": 2 + }, + "contentType": "application/json", + "encoded": false + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": 200 + }, + "type": "Synchronous/HTTP" + }, + { + "description": "a request to calculate the shard for a given id", + "pending": false, + "providerStates": [ + { + "name": "there are 10 shards" + } + ], + "request": { + "headers": { + "Accept": [ + "application/json" + ] + }, + "matchingRules": { + "header": { + "Accept": { + "combine": "AND", + "matchers": [ + { + "match": "type" + } + ] + } + } + }, + "method": "GET", + "path": "/shard/5c73531c-6fc4-426c-adcb-afc5c140a0f7" + }, + "response": { + "body": { + "content": { + "shard": 2 + }, + "contentType": "application/json", + "encoded": false + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": 200 + }, + "type": "Synchronous/HTTP" + }, { "description": "a request to create a user", "pending": false, @@ -55,9 +154,6 @@ } ], "metadata": { - "pact-js": { - "version": "16.0.0" - }, "pactRust": { "ffi": "0.4.28", "models": "1.3.5" -- 2.39.5