d666ddee52cb20c34be1c94ddd97767466fd9969
[demos/example-siren] / spring-consumer / target / pacts / SpringConsumer-SirenOrderProvider.json
1 {
2   "consumer": {
3     "name": "SpringConsumer"
4   },
5   "interactions": [
6     {
7       "description": "delete order",
8       "request": {
9         "matchingRules": {
10           "path": {
11             "combine": "AND",
12             "matchers": [
13               {
14                 "match": "regex",
15                 "regex": "/orders/\\d+"
16               }
17             ]
18           }
19         },
20         "method": "DELETE",
21         "path": "/orders/1234"
22       },
23       "response": {
24         "status": 200
25       }
26     },
27     {
28       "description": "get all orders",
29       "request": {
30         "method": "GET",
31         "path": "/orders"
32       },
33       "response": {
34         "body": {
35           "class": [
36             "entity"
37           ],
38           "entities": [
39             {
40               "actions": [
41                 {
42                   "href": "http://localhost:8080/orders/1234",
43                   "method": "PUT",
44                   "name": "update"
45                 },
46                 {
47                   "href": "http://localhost:8080/orders/1234",
48                   "method": "DELETE",
49                   "name": "delete"
50                 }
51               ],
52               "class": [
53                 "entity"
54               ],
55               "links": [
56                 {
57                   "href": "http://localhost:8080/orders/1234",
58                   "rel": [
59                     "self"
60                   ]
61                 }
62               ],
63               "properties": {
64                 "id": 1234
65               },
66               "rel": [
67                 "item"
68               ]
69             }
70           ],
71           "links": [
72             {
73               "href": "http://localhost:8080/orders",
74               "rel": [
75                 "self"
76               ]
77             }
78           ]
79         },
80         "generators": {
81           "body": {
82             "$.entities[*].links[0].href": {
83               "example": "http://localhost:8080/orders/1234",
84               "regex": ".*\\/(\\Qorders\\E\\/\\d+)$",
85               "type": "MockServerURL"
86             },
87             "$.entities[*][0].href": {
88               "example": "http://localhost:8080/orders/1234",
89               "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
90               "type": "MockServerURL"
91             },
92             "$.entities[*][1].href": {
93               "example": "http://localhost:8080/orders/1234",
94               "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
95               "type": "MockServerURL"
96             },
97             "$.links[0].href": {
98               "example": "http://localhost:8080/orders",
99               "regex": ".*\\/(\\Qorders\\E)$",
100               "type": "MockServerURL"
101             }
102           }
103         },
104         "headers": {
105           "Content-Type": "application/vnd.siren+json"
106         },
107         "matchingRules": {
108           "body": {
109             "$.entities": {
110               "combine": "AND",
111               "matchers": [
112                 {
113                   "match": "type"
114                 }
115               ]
116             },
117             "$.entities[*].actions": {
118               "combine": "AND",
119               "matchers": [
120                 {
121                   "match": "arrayContains",
122                   "variants": [
123                     {
124                       "generators": {
125                         "$.href": {
126                           "example": "http://localhost:8080/orders/1234",
127                           "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
128                           "type": "MockServerURL"
129                         }
130                       },
131                       "index": 0,
132                       "rules": {
133                         "$.href": {
134                           "combine": "AND",
135                           "matchers": [
136                             {
137                               "match": "regex",
138                               "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$"
139                             }
140                           ]
141                         },
142                         "$.method": {
143                           "combine": "AND",
144                           "matchers": [
145                             {
146                               "match": "type"
147                             }
148                           ]
149                         },
150                         "$.name": {
151                           "combine": "AND",
152                           "matchers": [
153                             {
154                               "match": "type"
155                             }
156                           ]
157                         }
158                       }
159                     },
160                     {
161                       "generators": {
162                         "$.href": {
163                           "example": "http://localhost:8080/orders/1234",
164                           "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
165                           "type": "MockServerURL"
166                         }
167                       },
168                       "index": 1,
169                       "rules": {
170                         "$.href": {
171                           "combine": "AND",
172                           "matchers": [
173                             {
174                               "match": "regex",
175                               "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$"
176                             }
177                           ]
178                         },
179                         "$.method": {
180                           "combine": "AND",
181                           "matchers": [
182                             {
183                               "match": "type"
184                             }
185                           ]
186                         },
187                         "$.name": {
188                           "combine": "AND",
189                           "matchers": [
190                             {
191                               "match": "type"
192                             }
193                           ]
194                         }
195                       }
196                     }
197                   ]
198                 }
199               ]
200             },
201             "$.entities[*].links[0].href": {
202               "combine": "AND",
203               "matchers": [
204                 {
205                   "match": "regex",
206                   "regex": ".*\\/(\\Qorders\\E\\/\\d+)$"
207                 }
208               ]
209             },
210             "$.entities[*].properties.id": {
211               "combine": "AND",
212               "matchers": [
213                 {
214                   "match": "integer"
215                 }
216               ]
217             },
218             "$.links[0].href": {
219               "combine": "AND",
220               "matchers": [
221                 {
222                   "match": "regex",
223                   "regex": ".*\\/(\\Qorders\\E)$"
224                 }
225               ]
226             }
227           }
228         },
229         "status": 200
230       }
231     },
232     {
233       "description": "get root",
234       "request": {
235         "method": "GET",
236         "path": "/"
237       },
238       "response": {
239         "body": {
240           "class": [
241             "representation"
242           ],
243           "links": [
244             {
245               "href": "http://localhost:8080/orders",
246               "rel": [
247                 "orders"
248               ]
249             }
250           ]
251         },
252         "generators": {
253           "body": {
254             "$.links[0].href": {
255               "example": "http://localhost:8080/orders",
256               "regex": ".*\\/(\\Qorders\\E)$",
257               "type": "MockServerURL"
258             }
259           }
260         },
261         "headers": {
262           "Content-Type": "application/vnd.siren+json"
263         },
264         "matchingRules": {
265           "body": {
266             "$.links[0].href": {
267               "combine": "AND",
268               "matchers": [
269                 {
270                   "match": "regex",
271                   "regex": ".*\\/(\\Qorders\\E)$"
272                 }
273               ]
274             }
275           }
276         },
277         "status": 200
278       }
279     }
280   ],
281   "metadata": {
282     "pact-jvm": {
283       "version": "4.2.2"
284     },
285     "pactSpecification": {
286       "version": "3.0.0"
287     }
288   },
289   "provider": {
290     "name": "SirenOrderProvider"
291   }
292 }