Beispiel von der klassischen DSL auf die Lambda-DSL umgestellt
[demos/example-siren] / spring-consumer / target / pacts / SpringConsumer-Siren Order Provider.json
1 {
2   "consumer": {
3     "name": "SpringConsumer"
4   },
5   "interactions": [
6     {
7       "description": "get all orders",
8       "request": {
9         "method": "GET",
10         "path": "/orders"
11       },
12       "response": {
13         "body": {
14           "age": 100,
15           "happy": true,
16           "id": 1234567890,
17           "localAddress": "127.0.0.1",
18           "name": "string"
19         },
20         "generators": {
21           "body": {
22             "$.id": {
23               "max": 2147483647,
24               "min": 0,
25               "type": "RandomInt"
26             },
27             "$.name": {
28               "size": 20,
29               "type": "RandomString"
30             }
31           }
32         },
33         "headers": {
34           "Content-Type": "application/vnd.siren+json"
35         },
36         "matchingRules": {
37           "body": {
38             "$.happy": {
39               "combine": "AND",
40               "matchers": [
41                 {
42                   "match": "type"
43                 }
44               ]
45             },
46             "$.id": {
47               "combine": "AND",
48               "matchers": [
49                 {
50                   "match": "type"
51                 }
52               ]
53             },
54             "$.localAddress": {
55               "combine": "AND",
56               "matchers": [
57                 {
58                   "match": "regex",
59                   "regex": "(\\d{1,3}\\.)+\\d{1,3}"
60                 }
61               ]
62             },
63             "$.name": {
64               "combine": "AND",
65               "matchers": [
66                 {
67                   "match": "type"
68                 }
69               ]
70             }
71           }
72         },
73         "status": 200
74       }
75     },
76     {
77       "description": "get root",
78       "request": {
79         "method": "GET",
80         "path": "/"
81       },
82       "response": {
83         "headers": {
84           "Content-Type": "application/vnd.siren+json"
85         },
86         "status": 200
87       }
88     }
89   ],
90   "metadata": {
91     "pact-jvm": {
92       "version": "4.2.2"
93     },
94     "pactSpecification": {
95       "version": "3.0.0"
96     }
97   },
98   "provider": {
99     "name": "Siren Order Provider"
100   }
101 }