From: Kai Moritz Date: Sat, 11 Oct 2025 18:30:08 +0000 (+0200) Subject: refactor: Refined pact (wording, examples, states) X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=9d3b95c268e7db8710f9b6bd5bd2690bac65a9ab;p=demos%2Fkafka%2Fchat refactor: Refined pact (wording, examples, states) --- diff --git a/frontend.ChatroomService-backend.json b/frontend.ChatroomService-backend.json index 6f643b31..130e953a 100644 --- a/frontend.ChatroomService-backend.json +++ b/frontend.ChatroomService-backend.json @@ -4,11 +4,14 @@ }, "interactions": [ { - "description": "a request for /1", + "description": "a request for /5c73531c-6fc4-426c-adcb-afc5c140a0f7", "pending": false, "providerStates": [ { - "name": "chatroom with ID \"1\" exists in shard \"7\"" + "name": "there are 10 shards" + }, + { + "name": "chatroom with ID \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\" exists in shard \"2\"" } ], "request": { @@ -18,7 +21,7 @@ ] }, "method": "GET", - "path": "/1" + "path": "/5c73531c-6fc4-426c-adcb-afc5c140a0f7" }, "response": { "status": 404 @@ -30,7 +33,10 @@ "pending": false, "providerStates": [ { - "name": "no chatrooms are known" + "name": "there are 10 shards" + }, + { + "name": "chatroom with ID \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\" exists in shard \"2\"" } ], "request": { @@ -39,7 +45,13 @@ }, "response": { "body": { - "content": [], + "content": [ + { + "id": "5c73531c-6fc4-426c-adcb-afc5c140a0f7", + "name": "FOO", + "shard": 2 + } + ], "contentType": "application/json", "encoded": false }, @@ -48,6 +60,19 @@ "application/json" ] }, + "matchingRules": { + "body": { + "$": { + "combine": "AND", + "matchers": [ + { + "match": "type", + "min": 1 + } + ] + } + } + }, "status": 200 }, "type": "Synchronous/HTTP" @@ -57,7 +82,10 @@ "pending": false, "providerStates": [ { - "name": "some chatrooms are known" + "name": "there are 10 shards" + }, + { + "name": "there is no chatroom at all" } ], "request": { @@ -66,13 +94,7 @@ }, "response": { "body": { - "content": [ - { - "id": "1", - "name": "foo", - "shard": 7 - } - ], + "content": [], "contentType": "application/json", "encoded": false }, @@ -81,19 +103,6 @@ "application/json" ] }, - "matchingRules": { - "body": { - "$": { - "combine": "AND", - "matchers": [ - { - "match": "type", - "min": 1 - } - ] - } - } - }, "status": 200 }, "type": "Synchronous/HTTP"