]> juplo.de Git - demos/kafka/chat/commitdiff
refactor: Refined pact (wording, examples, states)
authorKai Moritz <kai@juplo.de>
Sat, 11 Oct 2025 20:37:57 +0000 (22:37 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 11 Oct 2025 20:50:47 +0000 (22:50 +0200)
ChatroomService-ChatBackendController.json

index e5f7dc401c4ea9e2666668d38b2ee9f2f5b41883..97c6e3b54b3175a65d9bfe870465d82684ab2510 100644 (file)
           "name": "there are 10 shards"
         },
         {
-          "name": "chatroom with ID \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\" exists in shard \"2\""
+          "name": "the server is responsible for shard 2"
+        },
+        {
+          "name": "chatroom 5c73531c-6fc4-426c-adcb-afc5c140a0f7 exists in shard 2"
         }
       ],
       "request": {
         "headers": {
           "X-Shard": [
-            "6"
+            "2"
           ]
         },
         "method": "GET",
         "path": "/5c73531c-6fc4-426c-adcb-afc5c140a0f7"
       },
+      "response": {
+        "body": {
+          "content": {
+            "id": "5c73531c-6fc4-426c-adcb-afc5c140a0f7",
+            "name": "FOO",
+            "shard": 2
+          },
+          "contentType": "application/json",
+          "encoded": false
+        },
+        "headers": {
+          "Content-Type": [
+            "application/json"
+          ]
+        },
+        "status": 200
+      },
+      "type": "Synchronous/HTTP"
+    },
+    {
+      "description": "a request for /7f59ec77-832e-4a17-8d22-55ef46242c17",
+      "pending": false,
+      "providerStates": [
+        {
+          "name": "there are 10 shards"
+        },
+        {
+          "name": "the server is responsible for shard 2"
+        },
+        {
+          "name": "chatroom 7f59ec77-832e-4a17-8d22-55ef46242c17 does not exists in shard 2"
+        }
+      ],
+      "request": {
+        "headers": {
+          "X-Shard": [
+            "2"
+          ]
+        },
+        "method": "GET",
+        "path": "/7f59ec77-832e-4a17-8d22-55ef46242c17"
+      },
       "response": {
         "status": 404
       },
           "name": "there are 10 shards"
         },
         {
-          "name": "chatroom with ID \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\" exists in shard \"2\""
+          "name": "the server is responsible for shard 2"
+        },
+        {
+          "name": "chatroom 5c73531c-6fc4-426c-adcb-afc5c140a0f7 exists in shard 2"
         }
       ],
       "request": {
           "name": "there are 10 shards"
         },
         {
-          "name": "there is no chatroom at all"
+          "name": "the server is responsible for shard 2"
+        },
+        {
+          "name": "there are no chatrooms available at all in shard 2"
         }
       ],
       "request": {