WIP
[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           "class": [
15             "entity"
16           ],
17           "entities": [
18                         [
19               {
20                 "action": [
21                   {
22                     "href": "http://localhost:8080/1234",
23                     "method": "PUT",
24                     "name": "update"
25                   },
26                   {
27                     "href": "http://localhost:8080/1234",
28                     "method": "DELETE",
29                     "name": "delete"
30                   }
31                 ],
32                 "class": [
33                   "entity"
34                 ],
35                 "links": [
36                   {
37                     "href": "http://localhost:8080/orders/RegexpMatcher(regex=\\d+, value=1234)",
38                     "rel": [
39                       "self"
40                     ]
41                   }
42                 ],
43                 "properties": {
44                   "id": "1234",
45                   "rel": [
46                     "item"
47                   ]
48                 }
49               }
50             ]
51           ],
52           "links": [
53             {
54               "href": "http://localhost:8080/orders",
55               "rel": [
56                 "self"
57               ]
58             }
59           ]
60         },
61         "generators": {
62           "body": {
63             "$.entities[0].entities[*].links[0].href": {
64               "example": "http://localhost:8080/orders/RegexpMatcher(regex=\\d+, value=1234)",
65               "regex": ".*\\/(\\Qorders\\E\\/\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$",
66               "type": "MockServerURL"
67             },
68             "$.entities[0].entities[*][0].href": {
69               "example": "http://localhost:8080/1234",
70               "regex": ".*\\/(\\Q1234\\E)$",
71               "type": "MockServerURL"
72             },
73             "$.entities[0].entities[*][1].href": {
74               "example": "http://localhost:8080/1234",
75               "regex": ".*\\/(\\Q1234\\E)$",
76               "type": "MockServerURL"
77             },
78             "$.links[0].href": {
79               "example": "http://localhost:8080/orders",
80               "regex": ".*\\/(\\Qorders\\E)$",
81               "type": "MockServerURL"
82             }
83           }
84         },
85         "headers": {
86           "Content-Type": "application/vnd.siren+json"
87         },
88         "matchingRules": {
89           "body": {
90             "$.entities[0]": {
91               "combine": "AND",
92               "matchers": [
93                 {
94                   "match": "type"
95                 }
96               ]
97             },
98             "$.entities[0].entities[*].action": {
99               "combine": "AND",
100               "matchers": [
101                 {
102                   "match": "arrayContains",
103                   "variants": [
104                     {
105                       "generators": {
106                         "$.href": {
107                           "example": "http://localhost:8080/1234",
108                           "regex": ".*\\/(\\Q1234\\E)$",
109                           "type": "MockServerURL"
110                         }
111                       },
112                       "index": 0,
113                       "rules": {
114                         "$.href": {
115                           "combine": "AND",
116                           "matchers": [
117                             {
118                               "match": "regex",
119                               "regex": ".*\\/(\\Q1234\\E)$"
120                             }
121                           ]
122                         },
123                         "$.method": {
124                           "combine": "AND",
125                           "matchers": [
126                             {
127                               "match": "type"
128                             }
129                           ]
130                         },
131                         "$.name": {
132                           "combine": "AND",
133                           "matchers": [
134                             {
135                               "match": "type"
136                             }
137                           ]
138                         }
139                       }
140                     },
141                     {
142                       "generators": {
143                         "$.href": {
144                           "example": "http://localhost:8080/1234",
145                           "regex": ".*\\/(\\Q1234\\E)$",
146                           "type": "MockServerURL"
147                         }
148                       },
149                       "index": 1,
150                       "rules": {
151                         "$.href": {
152                           "combine": "AND",
153                           "matchers": [
154                             {
155                               "match": "regex",
156                               "regex": ".*\\/(\\Q1234\\E)$"
157                             }
158                           ]
159                         },
160                         "$.method": {
161                           "combine": "AND",
162                           "matchers": [
163                             {
164                               "match": "type"
165                             }
166                           ]
167                         },
168                         "$.name": {
169                           "combine": "AND",
170                           "matchers": [
171                             {
172                               "match": "type"
173                             }
174                           ]
175                         }
176                       }
177                     }
178                   ]
179                 }
180               ]
181             },
182             "$.entities[0].entities[*].links[0].href": {
183               "combine": "AND",
184               "matchers": [
185                 {
186                   "match": "regex",
187                   "regex": ".*\\/(\\Qorders\\E\\/\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$"
188                 }
189               ]
190             },
191             "$.entities[0].entities[*].properties.id": {
192               "combine": "AND",
193               "matchers": [
194                 {
195                   "match": "type"
196                 }
197               ]
198             },
199             "$.links[0].href": {
200               "combine": "AND",
201               "matchers": [
202                 {
203                   "match": "regex",
204                   "regex": ".*\\/(\\Qorders\\E)$"
205                 }
206               ]
207             }
208           }
209         },
210         "status": 200
211       }
212     }
213   ],
214   "metadata": {
215     "pact-jvm": {
216       "version": "4.2.2"
217     },
218     "pactSpecification": {
219       "version": "3.0.0"
220     }
221   },
222   "provider": {
223     "name": "Siren Order Provider"
224   }
225 }