]> juplo.de Git - demos/kafka/chat/commitdiff
refactor: Refined pact (wording, examples, states)
authorKai Moritz <kai@juplo.de>
Sat, 11 Oct 2025 18:30:08 +0000 (20:30 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 11 Oct 2025 19:15:49 +0000 (21:15 +0200)
frontend.ChatroomService-backend.json

index 6f643b314160883bf0432ad25633d7e954b81795..130e953a3cfc9ffa7f5f66b2c151227e7152748b 100644 (file)
@@ -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
       "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": {
       },
       "response": {
         "body": {
-          "content": [],
+          "content": [
+            {
+              "id": "5c73531c-6fc4-426c-adcb-afc5c140a0f7",
+              "name": "FOO",
+              "shard": 2
+            }
+          ],
           "contentType": "application/json",
           "encoded": false
         },
             "application/json"
           ]
         },
+        "matchingRules": {
+          "body": {
+            "$": {
+              "combine": "AND",
+              "matchers": [
+                {
+                  "match": "type",
+                  "min": 1
+                }
+              ]
+            }
+          }
+        },
         "status": 200
       },
       "type": "Synchronous/HTTP"
       "pending": false,
       "providerStates": [
         {
-          "name": "some chatrooms are known"
+          "name": "there are 10 shards"
+        },
+        {
+          "name": "there is no chatroom at all"
         }
       ],
       "request": {
       },
       "response": {
         "body": {
-          "content": [
-            {
-              "id": "1",
-              "name": "foo",
-              "shard": 7
-            }
-          ],
+          "content": [],
           "contentType": "application/json",
           "encoded": false
         },
             "application/json"
           ]
         },
-        "matchingRules": {
-          "body": {
-            "$": {
-              "combine": "AND",
-              "matchers": [
-                {
-                  "match": "type",
-                  "min": 1
-                }
-              ]
-            }
-          }
-        },
         "status": 200
       },
       "type": "Synchronous/HTTP"