Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
feat: refreshed recorded stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
demeyerthom committed Oct 24, 2024
1 parent 585d444 commit 12b79b3
Show file tree
Hide file tree
Showing 589 changed files with 10,649 additions and 12,363 deletions.
2 changes: 2 additions & 0 deletions commercelayer/resource_checkout_com_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func testAccCheckCheckoutComGatewayDestroy(s *terraform.State) error {
}

func (s *AcceptanceSuite) TestAccCheckoutComGateway_basic() {
s.T().Skip("Skipping test because we need a valid key")

resourceName := "commercelayer_checkout_com_gateway.incentro_checkout_com_gateway"

resource.Test(s.T(), resource.TestCase{
Expand Down
10 changes: 4 additions & 6 deletions commercelayer/resource_payment_method_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ func (s *AcceptanceSuite) TestAccPaymentMethod_basic() {
resource.TestCheckResourceAttr(resourceName, "attributes.0.metadata.foo", "bar"),
resource.TestCheckResourceAttr(resourceName, "attributes.0.currency_code", "EUR"),
resource.TestCheckResourceAttr(resourceName, "attributes.0.payment_source_type", "AdyenPayment"),
resource.TestCheckResourceAttr(resourceName, "attributes.0.price_amount_cents", "0"),
resource.TestCheckResourceAttr(resourceName, "attributes.0.price_amount_cents", "10"),
),
},
{
Config: strings.Join([]string{testAccAdyenGatewayCreate(resourceName), testAccPaymentMethodUpdate(resourceName)}, "\n"),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "attributes.0.metadata.bar", "foo"),
resource.TestCheckResourceAttr(resourceName, "attributes.0.currency_code", "EUR"),
resource.TestCheckResourceAttr(resourceName, "attributes.0.payment_source_type", "AdyenPayment"),
resource.TestCheckResourceAttr(resourceName, "attributes.0.price_amount_cents", "0"),
resource.TestCheckResourceAttr(resourceName, "attributes.0.price_amount_cents", "5"),
),
},
},
Expand All @@ -95,7 +93,7 @@ func testAccPaymentMethodCreate(testName string) string {
attributes {
payment_source_type = "AdyenPayment"
currency_code = "EUR"
price_amount_cents = 0
price_amount_cents = 10
metadata = {
foo : "bar"
testName: "{{.testName}}"
Expand All @@ -115,7 +113,7 @@ func testAccPaymentMethodUpdate(testName string) string {
attributes {
payment_source_type = "AdyenPayment"
currency_code = "EUR"
price_amount_cents = 0
price_amount_cents = 5
metadata = {
bar : "foo"
testName: "{{.testName}}"
Expand Down
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
version: "3.9"
services:
commercelayer-mock:
image: wiremock/wiremock:2.34.0
image: wiremock/wiremock:3.9.2
environment:
- UID=${UID}
- GID=${GID}
user: "${UID}:${GID}"
entrypoint: ["/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose"]
ports:
- "8080:8080"
volumes:
Expand Down
40 changes: 40 additions & 0 deletions mock/mappings/addresses-184cb485-be00-4590-af90-6524d31e6338.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id" : "184cb485-be00-4590-af90-6524d31e6338",
"name" : "addresses",
"request" : {
"url" : "/addresses",
"method" : "POST",
"bodyPatterns" : [ {
"equalToJson" : "{\"data\":{\"attributes\":{\"billing_info\":null,\"business\":true,\"city\":\"Rotterdam\",\"company\":\"Incentro\",\"country_code\":\"NL\",\"email\":null,\"first_name\":null,\"last_name\":null,\"lat\":null,\"line_1\":\"Van Nelleweg 1\",\"line_2\":null,\"lng\":null,\"metadata\":{\"foo\":\"bar\",\"testName\":\"commercelayer_address.incentro_address\"},\"notes\":null,\"phone\":\"+31(0)10 20 20 544\",\"reference\":null,\"reference_origin\":null,\"state_code\":\"ZH\",\"zip_code\":\"3044 BC\"},\"type\":\"addresses\"}}\n",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ]
},
"response" : {
"status" : 201,
"body" : "{\"data\":{\"id\":\"baZYuqxgqJ\",\"type\":\"addresses\",\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/baZYuqxgqJ\"},\"attributes\":{\"business\":true,\"first_name\":null,\"last_name\":null,\"company\":\"Incentro\",\"full_name\":\"Incentro\",\"line_1\":\"Van Nelleweg 1\",\"line_2\":null,\"city\":\"Rotterdam\",\"zip_code\":\"3044 BC\",\"state_code\":\"ZH\",\"country_code\":\"NL\",\"phone\":\"+31(0)10 20 20 544\",\"full_address\":\"Van Nelleweg 1, 3044 BC Rotterdam ZH (NL) +31(0)10 20 20 544\",\"name\":\"Incentro, Van Nelleweg 1, 3044 BC Rotterdam ZH (NL) +31(0)10 20 20 544\",\"email\":null,\"notes\":null,\"lat\":null,\"lng\":null,\"is_localized\":false,\"is_geocoded\":false,\"provider_name\":null,\"map_url\":null,\"static_map_url\":null,\"billing_info\":null,\"created_at\":\"2024-10-24T15:51:25.956Z\",\"updated_at\":\"2024-10-24T15:51:25.956Z\",\"reference\":null,\"reference_origin\":null,\"metadata\":{\"foo\":\"bar\",\"testName\":\"commercelayer_address.incentro_address\"}},\"relationships\":{\"geocoder\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/baZYuqxgqJ/relationships/geocoder\",\"related\":\"https://loucs.commercelayer.io/api/addresses/baZYuqxgqJ/geocoder\"}},\"events\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/baZYuqxgqJ/relationships/events\",\"related\":\"https://loucs.commercelayer.io/api/addresses/baZYuqxgqJ/events\"}},\"tags\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/baZYuqxgqJ/relationships/tags\",\"related\":\"https://loucs.commercelayer.io/api/addresses/baZYuqxgqJ/tags\"}},\"versions\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/baZYuqxgqJ/relationships/versions\",\"related\":\"https://loucs.commercelayer.io/api/addresses/baZYuqxgqJ/versions\"}}},\"meta\":{\"mode\":\"test\",\"organization_id\":\"WnZPoFZEKy\",\"trace_id\":\"6ab17a734ae8271d72c33a40c1d0f3bbd6bddfca8ea39278574e3f939d1097a7\"}}}",
"headers" : {
"x-request-id" : "4f82f8e1-42ef-4755-8476-f2f7d6e903bc",
"x-kong-upstream-latency" : "19",
"X-Ratelimit-Remaining" : "99",
"x-kong-request-id" : "2377f8606b06ec15611ccc0d05e1b36f",
"x-download-options" : "noopen",
"x-permitted-cross-domain-policies" : "none",
"x-kong-proxy-latency" : "0",
"Date" : "Thu, 24 Oct 2024 15:51:25 GMT",
"X-Ratelimit-Limit" : "100",
"X-Ratelimit-Interval" : "60",
"x-xss-protection" : "1; mode=block",
"x-content-type-options" : "nosniff",
"referrer-policy" : "strict-origin-when-cross-origin",
"Vary" : "Accept, Accept-Encoding, Origin",
"etag" : "W/\"8a1f13d5b0422907352e0511759ade05\"",
"content-type" : "application/vnd.api+json",
"accept-ranges" : "bytes",
"cache-control" : "max-age=0, private, must-revalidate"
}
},
"uuid" : "184cb485-be00-4590-af90-6524d31e6338",
"persistent" : true,
"insertionIndex" : 284
}
40 changes: 40 additions & 0 deletions mock/mappings/addresses-1cdf04a4-a664-428f-88bd-44d9991cd823.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id" : "1cdf04a4-a664-428f-88bd-44d9991cd823",
"name" : "addresses",
"request" : {
"url" : "/addresses",
"method" : "POST",
"bodyPatterns" : [ {
"equalToJson" : "{\"data\":{\"attributes\":{\"billing_info\":null,\"business\":true,\"city\":\"Rotterdam\",\"company\":\"Incentro\",\"country_code\":\"NL\",\"email\":null,\"first_name\":null,\"last_name\":null,\"lat\":null,\"line_1\":\"Van Nelleweg 1\",\"line_2\":null,\"lng\":null,\"metadata\":{\"foo\":\"bar\",\"testName\":\"commercelayer_stock_location.incentro_stock_location\"},\"notes\":null,\"phone\":\"+31(0)10 20 20 544\",\"reference\":null,\"reference_origin\":null,\"state_code\":\"ZH\",\"zip_code\":\"3044 BC\"},\"type\":\"addresses\"}}\n",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ]
},
"response" : {
"status" : 201,
"body" : "{\"data\":{\"id\":\"djekumgLNX\",\"type\":\"addresses\",\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/djekumgLNX\"},\"attributes\":{\"business\":true,\"first_name\":null,\"last_name\":null,\"company\":\"Incentro\",\"full_name\":\"Incentro\",\"line_1\":\"Van Nelleweg 1\",\"line_2\":null,\"city\":\"Rotterdam\",\"zip_code\":\"3044 BC\",\"state_code\":\"ZH\",\"country_code\":\"NL\",\"phone\":\"+31(0)10 20 20 544\",\"full_address\":\"Van Nelleweg 1, 3044 BC Rotterdam ZH (NL) +31(0)10 20 20 544\",\"name\":\"Incentro, Van Nelleweg 1, 3044 BC Rotterdam ZH (NL) +31(0)10 20 20 544\",\"email\":null,\"notes\":null,\"lat\":null,\"lng\":null,\"is_localized\":false,\"is_geocoded\":false,\"provider_name\":null,\"map_url\":null,\"static_map_url\":null,\"billing_info\":null,\"created_at\":\"2024-10-24T15:53:31.168Z\",\"updated_at\":\"2024-10-24T15:53:31.168Z\",\"reference\":null,\"reference_origin\":null,\"metadata\":{\"foo\":\"bar\",\"testName\":\"commercelayer_stock_location.incentro_stock_location\"}},\"relationships\":{\"geocoder\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/djekumgLNX/relationships/geocoder\",\"related\":\"https://loucs.commercelayer.io/api/addresses/djekumgLNX/geocoder\"}},\"events\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/djekumgLNX/relationships/events\",\"related\":\"https://loucs.commercelayer.io/api/addresses/djekumgLNX/events\"}},\"tags\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/djekumgLNX/relationships/tags\",\"related\":\"https://loucs.commercelayer.io/api/addresses/djekumgLNX/tags\"}},\"versions\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/djekumgLNX/relationships/versions\",\"related\":\"https://loucs.commercelayer.io/api/addresses/djekumgLNX/versions\"}}},\"meta\":{\"mode\":\"test\",\"organization_id\":\"WnZPoFZEKy\",\"trace_id\":\"c02c7d136456902b388510285841af16e8b28e50464cb8e4b4826530777fd325\"}}}",
"headers" : {
"x-request-id" : "b78ef572-a2a4-4782-b205-8b22cd5e66ba",
"x-kong-upstream-latency" : "19",
"X-Ratelimit-Remaining" : "95",
"x-kong-request-id" : "20ffa727b8db1b7f1b5faa18fbaf0804",
"x-download-options" : "noopen",
"x-permitted-cross-domain-policies" : "none",
"x-kong-proxy-latency" : "1",
"Date" : "Thu, 24 Oct 2024 15:53:31 GMT",
"X-Ratelimit-Limit" : "100",
"X-Ratelimit-Interval" : "60",
"x-xss-protection" : "1; mode=block",
"x-content-type-options" : "nosniff",
"referrer-policy" : "strict-origin-when-cross-origin",
"Vary" : "Accept, Accept-Encoding, Origin",
"etag" : "W/\"7aae03bedc64134fdbf9681676c11d84\"",
"content-type" : "application/vnd.api+json",
"accept-ranges" : "bytes",
"cache-control" : "max-age=0, private, must-revalidate"
}
},
"uuid" : "1cdf04a4-a664-428f-88bd-44d9991cd823",
"persistent" : true,
"insertionIndex" : 34
}
40 changes: 40 additions & 0 deletions mock/mappings/addresses-53509ebf-d9e3-479c-af99-5b8d7e0a0c27.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id" : "53509ebf-d9e3-479c-af99-5b8d7e0a0c27",
"name" : "addresses",
"request" : {
"url" : "/addresses",
"method" : "POST",
"bodyPatterns" : [ {
"equalToJson" : "{\"data\":{\"attributes\":{\"billing_info\":null,\"business\":true,\"city\":\"Rotterdam\",\"company\":\"Incentro\",\"country_code\":\"NL\",\"email\":null,\"first_name\":null,\"last_name\":null,\"lat\":null,\"line_1\":\"Van Nelleweg 1\",\"line_2\":null,\"lng\":null,\"metadata\":{\"foo\":\"bar\",\"testName\":\"commercelayer_inventory_return_location.incentro_inventory_return_location\"},\"notes\":null,\"phone\":\"+31(0)10 20 20 544\",\"reference\":null,\"reference_origin\":null,\"state_code\":\"ZH\",\"zip_code\":\"3044 BC\"},\"type\":\"addresses\"}}\n",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ]
},
"response" : {
"status" : 201,
"body" : "{\"data\":{\"id\":\"BKZQuEGLLe\",\"type\":\"addresses\",\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/BKZQuEGLLe\"},\"attributes\":{\"business\":true,\"first_name\":null,\"last_name\":null,\"company\":\"Incentro\",\"full_name\":\"Incentro\",\"line_1\":\"Van Nelleweg 1\",\"line_2\":null,\"city\":\"Rotterdam\",\"zip_code\":\"3044 BC\",\"state_code\":\"ZH\",\"country_code\":\"NL\",\"phone\":\"+31(0)10 20 20 544\",\"full_address\":\"Van Nelleweg 1, 3044 BC Rotterdam ZH (NL) +31(0)10 20 20 544\",\"name\":\"Incentro, Van Nelleweg 1, 3044 BC Rotterdam ZH (NL) +31(0)10 20 20 544\",\"email\":null,\"notes\":null,\"lat\":null,\"lng\":null,\"is_localized\":false,\"is_geocoded\":false,\"provider_name\":null,\"map_url\":null,\"static_map_url\":null,\"billing_info\":null,\"created_at\":\"2024-10-24T15:51:51.320Z\",\"updated_at\":\"2024-10-24T15:51:51.320Z\",\"reference\":null,\"reference_origin\":null,\"metadata\":{\"foo\":\"bar\",\"testName\":\"commercelayer_inventory_return_location.incentro_inventory_return_location\"}},\"relationships\":{\"geocoder\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/BKZQuEGLLe/relationships/geocoder\",\"related\":\"https://loucs.commercelayer.io/api/addresses/BKZQuEGLLe/geocoder\"}},\"events\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/BKZQuEGLLe/relationships/events\",\"related\":\"https://loucs.commercelayer.io/api/addresses/BKZQuEGLLe/events\"}},\"tags\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/BKZQuEGLLe/relationships/tags\",\"related\":\"https://loucs.commercelayer.io/api/addresses/BKZQuEGLLe/tags\"}},\"versions\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/BKZQuEGLLe/relationships/versions\",\"related\":\"https://loucs.commercelayer.io/api/addresses/BKZQuEGLLe/versions\"}}},\"meta\":{\"mode\":\"test\",\"organization_id\":\"WnZPoFZEKy\",\"trace_id\":\"2fa8bd236af7982af619bba3f83462c48f7c8f4a9ff06be2cf320e03883ed6f7\"}}}",
"headers" : {
"x-request-id" : "25a17ef8-3382-42b3-aff7-9994b1f3d133",
"x-kong-upstream-latency" : "27",
"X-Ratelimit-Remaining" : "85",
"x-kong-request-id" : "fbd456228d22bd197167e82d7b22723d",
"x-download-options" : "noopen",
"x-permitted-cross-domain-policies" : "none",
"x-kong-proxy-latency" : "0",
"Date" : "Thu, 24 Oct 2024 15:51:51 GMT",
"X-Ratelimit-Limit" : "100",
"X-Ratelimit-Interval" : "60",
"x-xss-protection" : "1; mode=block",
"x-content-type-options" : "nosniff",
"referrer-policy" : "strict-origin-when-cross-origin",
"Vary" : "Accept, Accept-Encoding, Origin",
"etag" : "W/\"a2d4ff8382f8ce6a2b783b690e6664f5\"",
"content-type" : "application/vnd.api+json",
"accept-ranges" : "bytes",
"cache-control" : "max-age=0, private, must-revalidate"
}
},
"uuid" : "53509ebf-d9e3-479c-af99-5b8d7e0a0c27",
"persistent" : true,
"insertionIndex" : 192
}
40 changes: 40 additions & 0 deletions mock/mappings/addresses-54f7dfed-4c7d-4d4a-995a-11a2408d2b0f.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id" : "54f7dfed-4c7d-4d4a-995a-11a2408d2b0f",
"name" : "addresses",
"request" : {
"url" : "/addresses",
"method" : "POST",
"bodyPatterns" : [ {
"equalToJson" : "{\"data\":{\"attributes\":{\"billing_info\":null,\"business\":true,\"city\":\"Rotterdam\",\"company\":\"Incentro\",\"country_code\":\"NL\",\"email\":null,\"first_name\":null,\"last_name\":null,\"lat\":null,\"line_1\":\"Van Nelleweg 1\",\"line_2\":null,\"lng\":null,\"metadata\":{\"foo\":\"bar\",\"testName\":\"commercelayer_delivery_lead_time.incentro_delivery_lead_time\"},\"notes\":null,\"phone\":\"+31(0)10 20 20 544\",\"reference\":null,\"reference_origin\":null,\"state_code\":\"ZH\",\"zip_code\":\"3044 BC\"},\"type\":\"addresses\"}}\n",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ]
},
"response" : {
"status" : 201,
"body" : "{\"data\":{\"id\":\"Boelupqapl\",\"type\":\"addresses\",\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/Boelupqapl\"},\"attributes\":{\"business\":true,\"first_name\":null,\"last_name\":null,\"company\":\"Incentro\",\"full_name\":\"Incentro\",\"line_1\":\"Van Nelleweg 1\",\"line_2\":null,\"city\":\"Rotterdam\",\"zip_code\":\"3044 BC\",\"state_code\":\"ZH\",\"country_code\":\"NL\",\"phone\":\"+31(0)10 20 20 544\",\"full_address\":\"Van Nelleweg 1, 3044 BC Rotterdam ZH (NL) +31(0)10 20 20 544\",\"name\":\"Incentro, Van Nelleweg 1, 3044 BC Rotterdam ZH (NL) +31(0)10 20 20 544\",\"email\":null,\"notes\":null,\"lat\":null,\"lng\":null,\"is_localized\":false,\"is_geocoded\":false,\"provider_name\":null,\"map_url\":null,\"static_map_url\":null,\"billing_info\":null,\"created_at\":\"2024-10-24T15:51:37.446Z\",\"updated_at\":\"2024-10-24T15:51:37.446Z\",\"reference\":null,\"reference_origin\":null,\"metadata\":{\"foo\":\"bar\",\"testName\":\"commercelayer_delivery_lead_time.incentro_delivery_lead_time\"}},\"relationships\":{\"geocoder\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/Boelupqapl/relationships/geocoder\",\"related\":\"https://loucs.commercelayer.io/api/addresses/Boelupqapl/geocoder\"}},\"events\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/Boelupqapl/relationships/events\",\"related\":\"https://loucs.commercelayer.io/api/addresses/Boelupqapl/events\"}},\"tags\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/Boelupqapl/relationships/tags\",\"related\":\"https://loucs.commercelayer.io/api/addresses/Boelupqapl/tags\"}},\"versions\":{\"links\":{\"self\":\"https://loucs.commercelayer.io/api/addresses/Boelupqapl/relationships/versions\",\"related\":\"https://loucs.commercelayer.io/api/addresses/Boelupqapl/versions\"}}},\"meta\":{\"mode\":\"test\",\"organization_id\":\"WnZPoFZEKy\",\"trace_id\":\"3998656388b620fa14ce5aa1f94f97c0a507a9c538af6e581c5f23619a91b123\"}}}",
"headers" : {
"x-request-id" : "51b1b0fb-9af9-46b7-a274-4ac606434fe6",
"x-kong-upstream-latency" : "15",
"X-Ratelimit-Remaining" : "94",
"x-kong-request-id" : "5aa29d0592ea116b9c625c2f81534b5e",
"x-download-options" : "noopen",
"x-permitted-cross-domain-policies" : "none",
"x-kong-proxy-latency" : "0",
"Date" : "Thu, 24 Oct 2024 15:51:37 GMT",
"X-Ratelimit-Limit" : "100",
"X-Ratelimit-Interval" : "60",
"x-xss-protection" : "1; mode=block",
"x-content-type-options" : "nosniff",
"referrer-policy" : "strict-origin-when-cross-origin",
"Vary" : "Accept, Accept-Encoding, Origin",
"etag" : "W/\"c66c0f245d67bc3586de8686a69e07ab\"",
"content-type" : "application/vnd.api+json",
"accept-ranges" : "bytes",
"cache-control" : "max-age=0, private, must-revalidate"
}
},
"uuid" : "54f7dfed-4c7d-4d4a-995a-11a2408d2b0f",
"persistent" : true,
"insertionIndex" : 249
}
Loading

0 comments on commit 12b79b3

Please sign in to comment.