Skip to content

Instantly share code, notes, and snippets.

@mikesol
Created February 10, 2020 08:28
Show Gist options
  • Save mikesol/bf737d15ad2e5dd4e2b76f1e1df37a9a to your computer and use it in GitHub Desktop.
Save mikesol/bf737d15ad2e5dd4e2b76f1e1df37a9a to your computer and use it in GitHub Desktop.
A hoverfly error with matcher suggestions
Hoverfly Error!
There was an error when matching
Got error: Could not find a match for request, create or record a valid matcher first!
The following request was made, but was not matched by Hoverfly:
{
"Path": "/v1/customers/foobar",
"Method": "GET",
"Destination": "localhost:8500",
"Scheme": "http",
"Query": {},
"Body": "",
"Headers": {
"Accept": [
"*/*"
],
"Authorization": [
"Basic c2tfdGVzdF9RUlVUVENtd1d1T3d6d1VJYmxUMUxkdDU6"
],
"User-Agent": [
"curl/7.66.0"
]
}
}
Whilst Hoverfly has the following state:
{}
The matcher which came closest was:
{
"path": [
{
"matcher": "exact",
"value": "/v1/customers/cus_GhmV4PbooARHhM"
}
],
"method": [
{
"matcher": "exact",
"value": "GET"
}
],
"destination": [
{
"matcher": "exact",
"value": "api.stripe.com"
}
],
"scheme": [
{
"matcher": "exact",
"value": "https"
}
],
"body": [
{
"matcher": "exact",
"value": ""
}
]
}
But it did not match on the following fields:
[path]
Which if hit would have given the following response:
{
"status": 200,
"body": "{\n \"id\": \"cus_GhmV4PbooARHhM\",\n \"object\": \"customer\",\n \"account_balance\": 0,\n \"address\": {\n \"city\": \"Melbourne\",\n \"country\": \"AU\",\n \"line1\": \"1 Batman Way\",\n \"line2\": \"\",\n \"postal_code\": \"3000\",\n \"state\":
\"NSW\"\n },\n \"balance\": 0,\n \"created\": 1581282230,\n \"currency\": \"aud\",\n \"default_source\": null,\n \"delinquent\": false,\n \"description\": \"A great test customer\",\n \"discount\": null,\n \"email\": \"[email protected]\",\n \"invoice_prefix\": \"4CAA31A9\",\n \"invoice_settings\": {\n \"custom_fields\": null,\n \"default_payment_method\": null,\n \"footer\": null\n },\n \"livemode\":
false,\n \"metadata\": {\n },\n \"name\": \"Jane Doe\",\n \"phone\": null,\n \"preferred_locales\": [\n\n ],\n \"shipping\": {\n \"address\": {\n \"city\": \"Melbourne\",\n \"country\": \"AU\",\n \"line1\": \"1 Batman Way\",\n \"line2\": \"\",\n \"postal_code\": \"3000\",\n \"state\": \"NSW\"\n },\n \"name\": \"Jane Doe\",\n \"phone\": \"\"\n },\n \"sources\": {\n \"object\": \"list\",\n \"data\": [\n\n ],\n \"has_more\": false,\n \"total_count\": 0,\n \"url\": \"/v1/customers/cus_GhmV4PbooARHhM/sources\"\n },\n \"subscriptions\": {\n \"object\": \"list\",\n
\"data\": [\n\n ],\n \"has_more\": false,\n \"total_count\": 0,\n \"url\": \"/v1/customers/cus_GhmV4PbooARHhM/subscriptions\"\n },\n \"tax_exempt\": \"none\",\n \"tax_ids\": {\n \"object\": \"list\",\n \"data\": [\n\n ],\n \"has_more\": false,\n \"total_count\": 0,\n \"url\": \"/v1/customers/cus_GhmV4PbooARHhM/tax_ids\"\n },\n \"tax_info\": null,\n \"tax_info_verification\": null\n}\n",
"encodedBody": false,
"headers": {
"Access-Control-Allow-Credentials": [
"true"
],
"Access-Control-Allow-Methods": [
"GET, POST, HEAD, OPTIONS, DELETE"
],
"Access-Control-Allow-Origin": [
"*"
],
"Access-Control-Expose-Headers": [
"Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required"
],
"Access-Control-Max-Age": [
"300"
],
"Cache-Control": [
"no-cache, no-store"
],
"Connection": [
"keep-alive"
],
"Content-Length": [
"1511"
],
"Content-Type": [
"application/json"
],
"Date": [
"Mon, 10 Feb 2020 07:58:56 GMT"
],
"Hoverfly": [
"Was-Here"
],
"Request-Id": [
"req_6QjKEDfOfS4oXw"
],
"Server": [
"nginx"
],
"Strict-Transport-Security": [
"max-age=31556926; includeSubDomains; preload"
],
"Stripe-Version": [
"2018-11-08"
]
},
"templated": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment