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