]> juplo.de Git - demos/kafka/chat/commitdiff
feat: First version of a pact for the existing interaction
authorKai Moritz <kai@juplo.de>
Sat, 11 Oct 2025 13:26:49 +0000 (15:26 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 11 Oct 2025 13:55:33 +0000 (15:55 +0200)
frontend.ChatroomService-backend.json [new file with mode: 0644]

diff --git a/frontend.ChatroomService-backend.json b/frontend.ChatroomService-backend.json
new file mode 100644 (file)
index 0000000..6f643b3
--- /dev/null
@@ -0,0 +1,114 @@
+{
+  "consumer": {
+    "name": "frontend.ChatroomService"
+  },
+  "interactions": [
+    {
+      "description": "a request for /1",
+      "pending": false,
+      "providerStates": [
+        {
+          "name": "chatroom with ID \"1\" exists in shard \"7\""
+        }
+      ],
+      "request": {
+        "headers": {
+          "X-Shard": [
+            "6"
+          ]
+        },
+        "method": "GET",
+        "path": "/1"
+      },
+      "response": {
+        "status": 404
+      },
+      "type": "Synchronous/HTTP"
+    },
+    {
+      "description": "a request for /list",
+      "pending": false,
+      "providerStates": [
+        {
+          "name": "no chatrooms are known"
+        }
+      ],
+      "request": {
+        "method": "GET",
+        "path": "/list"
+      },
+      "response": {
+        "body": {
+          "content": [],
+          "contentType": "application/json",
+          "encoded": false
+        },
+        "headers": {
+          "Content-Type": [
+            "application/json"
+          ]
+        },
+        "status": 200
+      },
+      "type": "Synchronous/HTTP"
+    },
+    {
+      "description": "a request for /list",
+      "pending": false,
+      "providerStates": [
+        {
+          "name": "some chatrooms are known"
+        }
+      ],
+      "request": {
+        "method": "GET",
+        "path": "/list"
+      },
+      "response": {
+        "body": {
+          "content": [
+            {
+              "id": "1",
+              "name": "foo",
+              "shard": 7
+            }
+          ],
+          "contentType": "application/json",
+          "encoded": false
+        },
+        "headers": {
+          "Content-Type": [
+            "application/json"
+          ]
+        },
+        "matchingRules": {
+          "body": {
+            "$": {
+              "combine": "AND",
+              "matchers": [
+                {
+                  "match": "type",
+                  "min": 1
+                }
+              ]
+            }
+          }
+        },
+        "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