From: Kai Moritz Date: Sat, 11 Oct 2025 19:18:59 +0000 (+0200) Subject: refactor: Clearer naming for the parties involved in the pact X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=aebebad7afa79a6854a25a45cc2b940224f0dad9;p=demos%2Fkafka%2Fchat refactor: Clearer naming for the parties involved in the pact --- diff --git a/ChatroomService-ChatBackendController.json b/ChatroomService-ChatBackendController.json new file mode 100644 index 00000000..e5f7dc40 --- /dev/null +++ b/ChatroomService-ChatBackendController.json @@ -0,0 +1,123 @@ +{ + "consumer": { + "name": "ChatroomService" + }, + "interactions": [ + { + "description": "a request for /5c73531c-6fc4-426c-adcb-afc5c140a0f7", + "pending": false, + "providerStates": [ + { + "name": "there are 10 shards" + }, + { + "name": "chatroom with ID \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\" exists in shard \"2\"" + } + ], + "request": { + "headers": { + "X-Shard": [ + "6" + ] + }, + "method": "GET", + "path": "/5c73531c-6fc4-426c-adcb-afc5c140a0f7" + }, + "response": { + "status": 404 + }, + "type": "Synchronous/HTTP" + }, + { + "description": "a request for /list", + "pending": false, + "providerStates": [ + { + "name": "there are 10 shards" + }, + { + "name": "chatroom with ID \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\" exists in shard \"2\"" + } + ], + "request": { + "method": "GET", + "path": "/list" + }, + "response": { + "body": { + "content": [ + { + "id": "5c73531c-6fc4-426c-adcb-afc5c140a0f7", + "name": "FOO", + "shard": 2 + } + ], + "contentType": "application/json", + "encoded": false + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "matchingRules": { + "body": { + "$": { + "combine": "AND", + "matchers": [ + { + "match": "type", + "min": 1 + } + ] + } + } + }, + "status": 200 + }, + "type": "Synchronous/HTTP" + }, + { + "description": "a request for /list", + "pending": false, + "providerStates": [ + { + "name": "there are 10 shards" + }, + { + "name": "there is no chatroom at all" + } + ], + "request": { + "method": "GET", + "path": "/list" + }, + "response": { + "body": { + "content": [], + "contentType": "application/json", + "encoded": false + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": 200 + }, + "type": "Synchronous/HTTP" + } + ], + "metadata": { + "pactRust": { + "ffi": "0.4.28", + "models": "1.3.5" + }, + "pactSpecification": { + "version": "4.0" + } + }, + "provider": { + "name": "ChatBackendController" + } +} \ No newline at end of file diff --git a/frontend.ChatroomService-backend.json b/frontend.ChatroomService-backend.json deleted file mode 100644 index 130e953a..00000000 --- a/frontend.ChatroomService-backend.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "consumer": { - "name": "frontend.ChatroomService" - }, - "interactions": [ - { - "description": "a request for /5c73531c-6fc4-426c-adcb-afc5c140a0f7", - "pending": false, - "providerStates": [ - { - "name": "there are 10 shards" - }, - { - "name": "chatroom with ID \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\" exists in shard \"2\"" - } - ], - "request": { - "headers": { - "X-Shard": [ - "6" - ] - }, - "method": "GET", - "path": "/5c73531c-6fc4-426c-adcb-afc5c140a0f7" - }, - "response": { - "status": 404 - }, - "type": "Synchronous/HTTP" - }, - { - "description": "a request for /list", - "pending": false, - "providerStates": [ - { - "name": "there are 10 shards" - }, - { - "name": "chatroom with ID \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\" exists in shard \"2\"" - } - ], - "request": { - "method": "GET", - "path": "/list" - }, - "response": { - "body": { - "content": [ - { - "id": "5c73531c-6fc4-426c-adcb-afc5c140a0f7", - "name": "FOO", - "shard": 2 - } - ], - "contentType": "application/json", - "encoded": false - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "matchingRules": { - "body": { - "$": { - "combine": "AND", - "matchers": [ - { - "match": "type", - "min": 1 - } - ] - } - } - }, - "status": 200 - }, - "type": "Synchronous/HTTP" - }, - { - "description": "a request for /list", - "pending": false, - "providerStates": [ - { - "name": "there are 10 shards" - }, - { - "name": "there is no chatroom at all" - } - ], - "request": { - "method": "GET", - "path": "/list" - }, - "response": { - "body": { - "content": [], - "contentType": "application/json", - "encoded": false - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "status": 200 - }, - "type": "Synchronous/HTTP" - } - ], - "metadata": { - "pactRust": { - "ffi": "0.4.28", - "models": "1.3.5" - }, - "pactSpecification": { - "version": "4.0" - } - }, - "provider": { - "name": "backend" - } -} \ No newline at end of file