27ff9700f59917d18d4697e30018842031f3ca48
[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                       }
143                     },
144                     {
145                       "generators": {
146                         "$.href": {
147                           "example": "http://localhost:8080/orders/1234",
148                           "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
149                           "type": "MockServerURL"
150                         }
151                       },
152                       "index": 1,
153                       "rules": {
154                         "$.href": {
155                           "combine": "AND",
156                           "matchers": [
157                             {
158                               "match": "regex",
159                               "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$"
160                             }
161                           ]
162                         }
163                       }
164                     }
165                   ]
166                 }
167               ]
168             },
169             "$.entities[*].links[0].href": {
170               "combine": "AND",
171               "matchers": [
172                 {
173                   "match": "regex",
174                   "regex": ".*\\/(\\Qorders\\E\\/\\d+)$"
175                 }
176               ]
177             },
178             "$.entities[*].properties.id": {
179               "combine": "AND",
180               "matchers": [
181                 {
182                   "match": "integer"
183                 }
184               ]
185             },
186             "$.links[0].href": {
187               "combine": "AND",
188               "matchers": [
189                 {
190                   "match": "regex",
191                   "regex": ".*\\/(\\Qorders\\E)$"
192                 }
193               ]
194             }
195           }
196         },
197         "status": 200
198       }
199     },
200     {
201       "description": "get root",
202       "request": {
203         "method": "GET",
204         "path": "/"
205       },
206       "response": {
207         "body": {
208           "class": [
209             "representation"
210           ],
211           "links": [
212             {
213               "href": "http://localhost:8080/orders",
214               "rel": [
215                 "orders"
216               ]
217             }
218           ]
219         },
220         "generators": {
221           "body": {
222             "$.links[0].href": {
223               "example": "http://localhost:8080/orders",
224               "regex": ".*\\/(\\Qorders\\E)$",
225               "type": "MockServerURL"
226             }
227           }
228         },
229         "headers": {
230           "Content-Type": "application/vnd.siren+json"
231         },
232         "matchingRules": {
233           "body": {
234             "$.links[0].href": {
235               "combine": "AND",
236               "matchers": [
237                 {
238                   "match": "regex",
239                   "regex": ".*\\/(\\Qorders\\E)$"
240                 }
241               ]
242             }
243           }
244         },
245         "status": 200
246       }
247     }
248   ],
249   "metadata": {
250     "pact-jvm": {
251       "version": "4.2.2"
252     },
253     "pactSpecification": {
254       "version": "3.0.0"
255     }
256   },
257   "provider": {
258     "name": "SirenOrderProvider"
259   }
260 }