285 lines
6.6 KiB
JSON
285 lines
6.6 KiB
JSON
{
|
|
"protocol": "http",
|
|
"port": 4546,
|
|
"name": "ServiceB",
|
|
"recordRequests": false,
|
|
"defaultResponse": {
|
|
"statusCode": 404
|
|
},
|
|
"stubs": [
|
|
{
|
|
"predicates": [
|
|
{
|
|
"endsWith": {
|
|
"path": "/test"
|
|
}
|
|
},
|
|
{
|
|
"equals": {
|
|
"method": "POST"
|
|
}
|
|
},
|
|
{
|
|
"or": [
|
|
{
|
|
"contains": {
|
|
"headers": {
|
|
"cookie": "edi_session"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"startsWith": {
|
|
"headers": {
|
|
"authorization": "bearer"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matches": {
|
|
"body": ".*"
|
|
}
|
|
}
|
|
],
|
|
"responses": [
|
|
{
|
|
"is": {
|
|
"statusCode": 201,
|
|
"body": {
|
|
"status": "Success",
|
|
"message": "POST request received for sample payload"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"predicates": [
|
|
{
|
|
"endsWith": {
|
|
"path": "/test"
|
|
}
|
|
},
|
|
{
|
|
"equals": {
|
|
"method": "GET"
|
|
}
|
|
},
|
|
{
|
|
"or": [
|
|
{
|
|
"contains": {
|
|
"headers": {
|
|
"cookie": "edi_session"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"startsWith": {
|
|
"headers": {
|
|
"authorization": "bearer"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"responses": [
|
|
{
|
|
"is": {
|
|
"statusCode": 200,
|
|
"body": {
|
|
"status": "Success",
|
|
"SamplePayload": {
|
|
"PickupTruckA": {
|
|
"options": [
|
|
"manual transmission",
|
|
"sunroof",
|
|
"premium stereo"
|
|
],
|
|
"manufactureDate": "2019-01-15",
|
|
"current_location": {
|
|
"lat": 37.773972,
|
|
"lon": -122.431297
|
|
},
|
|
"fullLength": 230.25,
|
|
"used": true,
|
|
"price": 35000,
|
|
"previousOwner": {
|
|
"firstName": "John",
|
|
"lastName": "Smith"
|
|
}
|
|
},
|
|
"PickupTruckB": {
|
|
"options": [
|
|
"automatic transmission",
|
|
"keyless entry"
|
|
],
|
|
"manufactureDate": "2018-06-12",
|
|
"current_location": {
|
|
"lat": 39.742043,
|
|
"lon": -104.991531
|
|
},
|
|
"fullLength": 215.75,
|
|
"used": true,
|
|
"price": 29500,
|
|
"previousOwner": {
|
|
"firstName": "Jane",
|
|
"lastName": "Jones"
|
|
}
|
|
},
|
|
"PickupTruckC": {
|
|
"options": [
|
|
"automatic transmission",
|
|
"keyless entry"
|
|
],
|
|
"manufactureDate": "2018-06-12",
|
|
"current_location": {
|
|
"lat": 39.742043,
|
|
"lon": -104.991531
|
|
},
|
|
"fullLength": 215.75,
|
|
"used": true,
|
|
"price": 29500,
|
|
"previousOwner": {
|
|
"firstName": "Jane",
|
|
"lastName": "Jones"
|
|
}
|
|
},
|
|
"PickupTruckD": {
|
|
"options": [
|
|
"automatic transmission",
|
|
"keyless entry"
|
|
],
|
|
"manufactureDate": "2018-06-12",
|
|
"current_location": {
|
|
"lat": 39.742043,
|
|
"lon": -104.991531
|
|
},
|
|
"fullLength": 215.75,
|
|
"used": true,
|
|
"price": 29500,
|
|
"previousOwner": {
|
|
"firstName": "Jane",
|
|
"lastName": "Jones"
|
|
}
|
|
},
|
|
"PickupTruckE": {
|
|
"options": [
|
|
"automatic transmission",
|
|
"keyless entry"
|
|
],
|
|
"manufactureDate": "2018-06-12",
|
|
"current_location": {
|
|
"lat": 39.742043,
|
|
"lon": -104.991531
|
|
},
|
|
"fullLength": 215.75,
|
|
"used": true,
|
|
"price": 29500,
|
|
"previousOwner": {
|
|
"firstName": "Jane",
|
|
"lastName": "Jones"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"predicates": [
|
|
{
|
|
"endsWith": {
|
|
"path": "/test"
|
|
}
|
|
},
|
|
{
|
|
"equals": {
|
|
"method": "PUT"
|
|
}
|
|
},
|
|
{
|
|
"or": [
|
|
{
|
|
"contains": {
|
|
"headers": {
|
|
"cookie": "edi_session"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"startsWith": {
|
|
"headers": {
|
|
"authorization": "bearer"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matches": {
|
|
"body": ".*"
|
|
}
|
|
}
|
|
],
|
|
"responses": [
|
|
{
|
|
"is": {
|
|
"statusCode": 201,
|
|
"body": {
|
|
"status": "Success",
|
|
"message": "PUT request received for sample payload"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"predicates": [
|
|
{
|
|
"endsWith": {
|
|
"path": "/test"
|
|
}
|
|
},
|
|
{
|
|
"equals": {
|
|
"method": "DELETE"
|
|
}
|
|
},
|
|
{
|
|
"or": [
|
|
{
|
|
"contains": {
|
|
"headers": {
|
|
"cookie": "edi_session"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"startsWith": {
|
|
"headers": {
|
|
"authorization": "bearer"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"responses": [
|
|
{
|
|
"is": {
|
|
"statusCode": 201,
|
|
"body": {
|
|
"status": "Success",
|
|
"message": "DELETE request received"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |