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