From f8d21a0d8b05cedefcab07c2938df6f29c36d325 Mon Sep 17 00:00:00 2001 From: Steve Ramage Date: Mon, 18 Jul 2022 12:30:48 -0700 Subject: [PATCH 1/2] Checkpoint #157 --- cmd/make-tests.go | 71 +++++++++++++++++++ cmd/root.go | 1 + external/resources/resources.go | 3 + tests/resources/account-addresses.bats | 6 ++ .../account-authentication-settings.bats | 6 ++ ...ount-management-authentication-tokens.bats | 2 + tests/resources/account-members.bats | 6 ++ tests/resources/account-memberships.bats | 6 ++ tests/resources/accounts.bats | 6 ++ tests/resources/authentication-realms.bats | 6 ++ tests/resources/cart-checkout.bats | 2 + tests/resources/cart-items.bats | 6 ++ tests/resources/cart-product-items.bats | 2 + tests/resources/carts.bats | 6 ++ tests/resources/catalog-products.bats | 6 ++ tests/resources/currencies.bats | 6 ++ tests/resources/customer-addresses.bats | 6 ++ .../customer-authentication-settings.bats | 6 ++ tests/resources/customers.bats | 6 ++ tests/resources/fields.bats | 6 ++ tests/resources/files.bats | 6 ++ tests/resources/flows.bats | 6 ++ tests/resources/integration-job-log.bats | 6 ++ tests/resources/integration-jobs.bats | 6 ++ tests/resources/integration-logs.bats | 6 ++ tests/resources/integrations.bats | 6 ++ tests/resources/merchant-realm-mappings.bats | 6 ++ tests/resources/oidc-profiles.bats | 6 ++ tests/resources/order-items.bats | 6 ++ .../resources/order-transaction-capture.bats | 2 + tests/resources/order-transaction-refund.bats | 2 + tests/resources/order-transactions.bats | 6 ++ tests/resources/orders.bats | 6 ++ tests/resources/password-profiles.bats | 6 ++ tests/resources/payment-gateways-adyen.bats | 2 + .../payment-gateways-authorize-net.bats | 2 + .../resources/payment-gateways-braintree.bats | 2 + .../payment-gateways-cardconnect.bats | 2 + .../payment-gateways-cybersource.bats | 2 + ...gateways-elastic-path-payments-stripe.bats | 2 + tests/resources/payment-gateways-manual.bats | 2 + ...ment-gateways-paypal-express-checkout.bats | 2 + .../payment-gateways-paypal-express.bats | 2 + .../payment-gateways-paypal-payflow-pro.bats | 2 + .../payment-gateways-stripe-connect.bats | 2 + ...yment-gateways-stripe-payment-intents.bats | 2 + tests/resources/payment-gateways-stripe.bats | 2 + tests/resources/payment-gateways.bats | 6 ++ tests/resources/pcm-catalog-releases.bats | 6 ++ tests/resources/pcm-catalogs.bats | 6 ++ tests/resources/pcm-hierarchies.bats | 6 ++ tests/resources/pcm-node-children.bats | 6 ++ tests/resources/pcm-node-products.bats | 6 ++ tests/resources/pcm-nodes.bats | 2 + tests/resources/pcm-pricebooks.bats | 6 ++ tests/resources/pcm-product-main-image.bats | 6 ++ tests/resources/pcm-product-prices.bats | 6 ++ tests/resources/pcm-products.bats | 6 ++ tests/resources/pcm-variation-options.bats | 6 ++ tests/resources/pcm-variations.bats | 6 ++ tests/resources/promotion-codes.bats | 6 ++ tests/resources/promotions.bats | 6 ++ tests/resources/settings.bats | 6 ++ .../resources/user-authentication-infos.bats | 6 ++ ...ser-authentication-oidc-profile-infos.bats | 6 ++ ...authentication-password-profile-infos.bats | 6 ++ tests/resources/v2-products.bats | 6 ++ 67 files changed, 383 insertions(+) create mode 100644 cmd/make-tests.go create mode 100755 tests/resources/account-addresses.bats create mode 100755 tests/resources/account-authentication-settings.bats create mode 100755 tests/resources/account-management-authentication-tokens.bats create mode 100755 tests/resources/account-members.bats create mode 100755 tests/resources/account-memberships.bats create mode 100755 tests/resources/accounts.bats create mode 100755 tests/resources/authentication-realms.bats create mode 100755 tests/resources/cart-checkout.bats create mode 100755 tests/resources/cart-items.bats create mode 100755 tests/resources/cart-product-items.bats create mode 100755 tests/resources/carts.bats create mode 100755 tests/resources/catalog-products.bats create mode 100755 tests/resources/currencies.bats create mode 100755 tests/resources/customer-addresses.bats create mode 100755 tests/resources/customer-authentication-settings.bats create mode 100755 tests/resources/customers.bats create mode 100755 tests/resources/fields.bats create mode 100755 tests/resources/files.bats create mode 100755 tests/resources/flows.bats create mode 100755 tests/resources/integration-job-log.bats create mode 100755 tests/resources/integration-jobs.bats create mode 100755 tests/resources/integration-logs.bats create mode 100755 tests/resources/integrations.bats create mode 100755 tests/resources/merchant-realm-mappings.bats create mode 100755 tests/resources/oidc-profiles.bats create mode 100755 tests/resources/order-items.bats create mode 100755 tests/resources/order-transaction-capture.bats create mode 100755 tests/resources/order-transaction-refund.bats create mode 100755 tests/resources/order-transactions.bats create mode 100755 tests/resources/orders.bats create mode 100755 tests/resources/password-profiles.bats create mode 100755 tests/resources/payment-gateways-adyen.bats create mode 100755 tests/resources/payment-gateways-authorize-net.bats create mode 100755 tests/resources/payment-gateways-braintree.bats create mode 100755 tests/resources/payment-gateways-cardconnect.bats create mode 100755 tests/resources/payment-gateways-cybersource.bats create mode 100755 tests/resources/payment-gateways-elastic-path-payments-stripe.bats create mode 100755 tests/resources/payment-gateways-manual.bats create mode 100755 tests/resources/payment-gateways-paypal-express-checkout.bats create mode 100755 tests/resources/payment-gateways-paypal-express.bats create mode 100755 tests/resources/payment-gateways-paypal-payflow-pro.bats create mode 100755 tests/resources/payment-gateways-stripe-connect.bats create mode 100755 tests/resources/payment-gateways-stripe-payment-intents.bats create mode 100755 tests/resources/payment-gateways-stripe.bats create mode 100755 tests/resources/payment-gateways.bats create mode 100755 tests/resources/pcm-catalog-releases.bats create mode 100755 tests/resources/pcm-catalogs.bats create mode 100755 tests/resources/pcm-hierarchies.bats create mode 100755 tests/resources/pcm-node-children.bats create mode 100755 tests/resources/pcm-node-products.bats create mode 100755 tests/resources/pcm-nodes.bats create mode 100755 tests/resources/pcm-pricebooks.bats create mode 100755 tests/resources/pcm-product-main-image.bats create mode 100755 tests/resources/pcm-product-prices.bats create mode 100755 tests/resources/pcm-products.bats create mode 100755 tests/resources/pcm-variation-options.bats create mode 100755 tests/resources/pcm-variations.bats create mode 100755 tests/resources/promotion-codes.bats create mode 100755 tests/resources/promotions.bats create mode 100755 tests/resources/settings.bats create mode 100755 tests/resources/user-authentication-infos.bats create mode 100755 tests/resources/user-authentication-oidc-profile-infos.bats create mode 100755 tests/resources/user-authentication-password-profile-infos.bats create mode 100755 tests/resources/v2-products.bats diff --git a/cmd/make-tests.go b/cmd/make-tests.go new file mode 100644 index 0000000..0e5d353 --- /dev/null +++ b/cmd/make-tests.go @@ -0,0 +1,71 @@ +package cmd + +import ( + "fmt" + "github.com/elasticpath/epcc-cli/external/resources" + log "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "html/template" + "os" +) + +const testTemplate = `#!/usr/bin/env bats +{{if .GetCollectionInfo -}} +@test "{{ .PluralName }} empty get collection" { + run epcc get {{ .PluralName }} + [ $status -eq 0 ] +} +{{end}} +` + +var MakeTests = &cobra.Command{ + Use: "make-tests", + Short: "Make a bunch of BATS tests", + Hidden: true, + + RunE: func(cmd *cobra.Command, args []string) error { + err := os.MkdirAll("tests/resources", 0755) + if err != nil { + return err + } + + for _, resourceName := range resources.GetPluralResourceNames() { + testFilename := fmt.Sprintf("./tests/resources/%s.bats", resourceName) + _, err := os.Stat(testFilename) + + if os.IsNotExist(err) { + log.Infof("Tests for %s do not exist", testFilename) + } else { + log.Infof("Tests for %s exist already", testFilename) + } + + tmpl, err := template.New("test").Parse(testTemplate) + + if err != nil { + return err + } + + resource, ok := resources.GetResourceByName(resourceName) + + if !ok { + panic("Could not find resource for " + resourceName) + } + + f, err := os.OpenFile(testFilename, os.O_CREATE+os.O_TRUNC+os.O_WRONLY, 0755) + + defer f.Close() + if err != nil { + return err + } + + err = tmpl.Execute(f, resource) + + if err != nil { + return err + } + + } + + return nil + }, +} diff --git a/cmd/root.go b/cmd/root.go index 6e942c1..21f8f85 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -43,6 +43,7 @@ func init() { login, logout, ResetStore, + MakeTests, ) Logs.AddCommand(LogsList, LogsShow, LogsClear) diff --git a/external/resources/resources.go b/external/resources/resources.go index 460cf0f..c116961 100644 --- a/external/resources/resources.go +++ b/external/resources/resources.go @@ -4,6 +4,7 @@ import ( _ "embed" log "github.com/sirupsen/logrus" "gopkg.in/yaml.v3" + "sort" ) //go:embed resources.yaml @@ -93,6 +94,7 @@ func GetPluralResourceNames() []string { keys = append(keys, key) } + sort.Strings(keys) return keys } @@ -107,6 +109,7 @@ func GetSingularResourceNames() []string { keys = append(keys, key) } + sort.Strings(keys) return keys } diff --git a/tests/resources/account-addresses.bats b/tests/resources/account-addresses.bats new file mode 100755 index 0000000..efebf46 --- /dev/null +++ b/tests/resources/account-addresses.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "account-addresses empty get collection" { + run epcc get account-addresses + [ $status -eq 0 ] +} + diff --git a/tests/resources/account-authentication-settings.bats b/tests/resources/account-authentication-settings.bats new file mode 100755 index 0000000..ac28c61 --- /dev/null +++ b/tests/resources/account-authentication-settings.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "account-authentication-settings empty get collection" { + run epcc get account-authentication-settings + [ $status -eq 0 ] +} + diff --git a/tests/resources/account-management-authentication-tokens.bats b/tests/resources/account-management-authentication-tokens.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/account-management-authentication-tokens.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/account-members.bats b/tests/resources/account-members.bats new file mode 100755 index 0000000..86395dd --- /dev/null +++ b/tests/resources/account-members.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "account-members empty get collection" { + run epcc get account-members + [ $status -eq 0 ] +} + diff --git a/tests/resources/account-memberships.bats b/tests/resources/account-memberships.bats new file mode 100755 index 0000000..40e25c0 --- /dev/null +++ b/tests/resources/account-memberships.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "account-memberships empty get collection" { + run epcc get account-memberships + [ $status -eq 0 ] +} + diff --git a/tests/resources/accounts.bats b/tests/resources/accounts.bats new file mode 100755 index 0000000..7073631 --- /dev/null +++ b/tests/resources/accounts.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "accounts empty get collection" { + run epcc get accounts + [ $status -eq 0 ] +} + diff --git a/tests/resources/authentication-realms.bats b/tests/resources/authentication-realms.bats new file mode 100755 index 0000000..1276223 --- /dev/null +++ b/tests/resources/authentication-realms.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "authentication-realms empty get collection" { + run epcc get authentication-realms + [ $status -eq 0 ] +} + diff --git a/tests/resources/cart-checkout.bats b/tests/resources/cart-checkout.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/cart-checkout.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/cart-items.bats b/tests/resources/cart-items.bats new file mode 100755 index 0000000..4e52a12 --- /dev/null +++ b/tests/resources/cart-items.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "cart-items empty get collection" { + run epcc get cart-items + [ $status -eq 0 ] +} + diff --git a/tests/resources/cart-product-items.bats b/tests/resources/cart-product-items.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/cart-product-items.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/carts.bats b/tests/resources/carts.bats new file mode 100755 index 0000000..35f25fa --- /dev/null +++ b/tests/resources/carts.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "carts empty get collection" { + run epcc get carts + [ $status -eq 0 ] +} + diff --git a/tests/resources/catalog-products.bats b/tests/resources/catalog-products.bats new file mode 100755 index 0000000..1fe2c04 --- /dev/null +++ b/tests/resources/catalog-products.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "catalog-products empty get collection" { + run epcc get catalog-products + [ $status -eq 0 ] +} + diff --git a/tests/resources/currencies.bats b/tests/resources/currencies.bats new file mode 100755 index 0000000..e5a12fb --- /dev/null +++ b/tests/resources/currencies.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "currencies empty get collection" { + run epcc get currencies + [ $status -eq 0 ] +} + diff --git a/tests/resources/customer-addresses.bats b/tests/resources/customer-addresses.bats new file mode 100755 index 0000000..6215f03 --- /dev/null +++ b/tests/resources/customer-addresses.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "customer-addresses empty get collection" { + run epcc get customer-addresses + [ $status -eq 0 ] +} + diff --git a/tests/resources/customer-authentication-settings.bats b/tests/resources/customer-authentication-settings.bats new file mode 100755 index 0000000..4791344 --- /dev/null +++ b/tests/resources/customer-authentication-settings.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "customer-authentication-settings empty get collection" { + run epcc get customer-authentication-settings + [ $status -eq 0 ] +} + diff --git a/tests/resources/customers.bats b/tests/resources/customers.bats new file mode 100755 index 0000000..b48fbbb --- /dev/null +++ b/tests/resources/customers.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "customers empty get collection" { + run epcc get customers + [ $status -eq 0 ] +} + diff --git a/tests/resources/fields.bats b/tests/resources/fields.bats new file mode 100755 index 0000000..881624b --- /dev/null +++ b/tests/resources/fields.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "fields empty get collection" { + run epcc get fields + [ $status -eq 0 ] +} + diff --git a/tests/resources/files.bats b/tests/resources/files.bats new file mode 100755 index 0000000..cdb40ce --- /dev/null +++ b/tests/resources/files.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "files empty get collection" { + run epcc get files + [ $status -eq 0 ] +} + diff --git a/tests/resources/flows.bats b/tests/resources/flows.bats new file mode 100755 index 0000000..705fa05 --- /dev/null +++ b/tests/resources/flows.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "flows empty get collection" { + run epcc get flows + [ $status -eq 0 ] +} + diff --git a/tests/resources/integration-job-log.bats b/tests/resources/integration-job-log.bats new file mode 100755 index 0000000..688ef1c --- /dev/null +++ b/tests/resources/integration-job-log.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "integration-job-log empty get collection" { + run epcc get integration-job-log + [ $status -eq 0 ] +} + diff --git a/tests/resources/integration-jobs.bats b/tests/resources/integration-jobs.bats new file mode 100755 index 0000000..e234282 --- /dev/null +++ b/tests/resources/integration-jobs.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "integration-jobs empty get collection" { + run epcc get integration-jobs + [ $status -eq 0 ] +} + diff --git a/tests/resources/integration-logs.bats b/tests/resources/integration-logs.bats new file mode 100755 index 0000000..eb523af --- /dev/null +++ b/tests/resources/integration-logs.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "integration-logs empty get collection" { + run epcc get integration-logs + [ $status -eq 0 ] +} + diff --git a/tests/resources/integrations.bats b/tests/resources/integrations.bats new file mode 100755 index 0000000..7ff9726 --- /dev/null +++ b/tests/resources/integrations.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "integrations empty get collection" { + run epcc get integrations + [ $status -eq 0 ] +} + diff --git a/tests/resources/merchant-realm-mappings.bats b/tests/resources/merchant-realm-mappings.bats new file mode 100755 index 0000000..c92ce81 --- /dev/null +++ b/tests/resources/merchant-realm-mappings.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "merchant-realm-mappings empty get collection" { + run epcc get merchant-realm-mappings + [ $status -eq 0 ] +} + diff --git a/tests/resources/oidc-profiles.bats b/tests/resources/oidc-profiles.bats new file mode 100755 index 0000000..cff57cb --- /dev/null +++ b/tests/resources/oidc-profiles.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "oidc-profiles empty get collection" { + run epcc get oidc-profiles + [ $status -eq 0 ] +} + diff --git a/tests/resources/order-items.bats b/tests/resources/order-items.bats new file mode 100755 index 0000000..705264a --- /dev/null +++ b/tests/resources/order-items.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "order-items empty get collection" { + run epcc get order-items + [ $status -eq 0 ] +} + diff --git a/tests/resources/order-transaction-capture.bats b/tests/resources/order-transaction-capture.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/order-transaction-capture.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/order-transaction-refund.bats b/tests/resources/order-transaction-refund.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/order-transaction-refund.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/order-transactions.bats b/tests/resources/order-transactions.bats new file mode 100755 index 0000000..1f1bb3b --- /dev/null +++ b/tests/resources/order-transactions.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "order-transactions empty get collection" { + run epcc get order-transactions + [ $status -eq 0 ] +} + diff --git a/tests/resources/orders.bats b/tests/resources/orders.bats new file mode 100755 index 0000000..1d09a7b --- /dev/null +++ b/tests/resources/orders.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "orders empty get collection" { + run epcc get orders + [ $status -eq 0 ] +} + diff --git a/tests/resources/password-profiles.bats b/tests/resources/password-profiles.bats new file mode 100755 index 0000000..fe9116f --- /dev/null +++ b/tests/resources/password-profiles.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "password-profiles empty get collection" { + run epcc get password-profiles + [ $status -eq 0 ] +} + diff --git a/tests/resources/payment-gateways-adyen.bats b/tests/resources/payment-gateways-adyen.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-adyen.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-authorize-net.bats b/tests/resources/payment-gateways-authorize-net.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-authorize-net.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-braintree.bats b/tests/resources/payment-gateways-braintree.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-braintree.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-cardconnect.bats b/tests/resources/payment-gateways-cardconnect.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-cardconnect.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-cybersource.bats b/tests/resources/payment-gateways-cybersource.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-cybersource.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-elastic-path-payments-stripe.bats b/tests/resources/payment-gateways-elastic-path-payments-stripe.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-elastic-path-payments-stripe.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-manual.bats b/tests/resources/payment-gateways-manual.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-manual.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-paypal-express-checkout.bats b/tests/resources/payment-gateways-paypal-express-checkout.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-paypal-express-checkout.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-paypal-express.bats b/tests/resources/payment-gateways-paypal-express.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-paypal-express.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-paypal-payflow-pro.bats b/tests/resources/payment-gateways-paypal-payflow-pro.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-paypal-payflow-pro.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-stripe-connect.bats b/tests/resources/payment-gateways-stripe-connect.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-stripe-connect.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-stripe-payment-intents.bats b/tests/resources/payment-gateways-stripe-payment-intents.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-stripe-payment-intents.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways-stripe.bats b/tests/resources/payment-gateways-stripe.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/payment-gateways-stripe.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/payment-gateways.bats b/tests/resources/payment-gateways.bats new file mode 100755 index 0000000..03b0523 --- /dev/null +++ b/tests/resources/payment-gateways.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "payment-gateways empty get collection" { + run epcc get payment-gateways + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-catalog-releases.bats b/tests/resources/pcm-catalog-releases.bats new file mode 100755 index 0000000..2b31277 --- /dev/null +++ b/tests/resources/pcm-catalog-releases.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-catalog-releases empty get collection" { + run epcc get pcm-catalog-releases + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-catalogs.bats b/tests/resources/pcm-catalogs.bats new file mode 100755 index 0000000..efb09b5 --- /dev/null +++ b/tests/resources/pcm-catalogs.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-catalogs empty get collection" { + run epcc get pcm-catalogs + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-hierarchies.bats b/tests/resources/pcm-hierarchies.bats new file mode 100755 index 0000000..bce9418 --- /dev/null +++ b/tests/resources/pcm-hierarchies.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-hierarchies empty get collection" { + run epcc get pcm-hierarchies + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-node-children.bats b/tests/resources/pcm-node-children.bats new file mode 100755 index 0000000..9baed2a --- /dev/null +++ b/tests/resources/pcm-node-children.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-node-children empty get collection" { + run epcc get pcm-node-children + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-node-products.bats b/tests/resources/pcm-node-products.bats new file mode 100755 index 0000000..88d4797 --- /dev/null +++ b/tests/resources/pcm-node-products.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-node-products empty get collection" { + run epcc get pcm-node-products + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-nodes.bats b/tests/resources/pcm-nodes.bats new file mode 100755 index 0000000..df62c4e --- /dev/null +++ b/tests/resources/pcm-nodes.bats @@ -0,0 +1,2 @@ +#!/usr/bin/env bats + diff --git a/tests/resources/pcm-pricebooks.bats b/tests/resources/pcm-pricebooks.bats new file mode 100755 index 0000000..fa2443a --- /dev/null +++ b/tests/resources/pcm-pricebooks.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-pricebooks empty get collection" { + run epcc get pcm-pricebooks + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-product-main-image.bats b/tests/resources/pcm-product-main-image.bats new file mode 100755 index 0000000..1eff0be --- /dev/null +++ b/tests/resources/pcm-product-main-image.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-product-main-image empty get collection" { + run epcc get pcm-product-main-image + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-product-prices.bats b/tests/resources/pcm-product-prices.bats new file mode 100755 index 0000000..640b0a6 --- /dev/null +++ b/tests/resources/pcm-product-prices.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-product-prices empty get collection" { + run epcc get pcm-product-prices + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-products.bats b/tests/resources/pcm-products.bats new file mode 100755 index 0000000..a078b7e --- /dev/null +++ b/tests/resources/pcm-products.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-products empty get collection" { + run epcc get pcm-products + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-variation-options.bats b/tests/resources/pcm-variation-options.bats new file mode 100755 index 0000000..33b1928 --- /dev/null +++ b/tests/resources/pcm-variation-options.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-variation-options empty get collection" { + run epcc get pcm-variation-options + [ $status -eq 0 ] +} + diff --git a/tests/resources/pcm-variations.bats b/tests/resources/pcm-variations.bats new file mode 100755 index 0000000..b70da8b --- /dev/null +++ b/tests/resources/pcm-variations.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "pcm-variations empty get collection" { + run epcc get pcm-variations + [ $status -eq 0 ] +} + diff --git a/tests/resources/promotion-codes.bats b/tests/resources/promotion-codes.bats new file mode 100755 index 0000000..6b39d84 --- /dev/null +++ b/tests/resources/promotion-codes.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "promotion-codes empty get collection" { + run epcc get promotion-codes + [ $status -eq 0 ] +} + diff --git a/tests/resources/promotions.bats b/tests/resources/promotions.bats new file mode 100755 index 0000000..174203f --- /dev/null +++ b/tests/resources/promotions.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "promotions empty get collection" { + run epcc get promotions + [ $status -eq 0 ] +} + diff --git a/tests/resources/settings.bats b/tests/resources/settings.bats new file mode 100755 index 0000000..1b73e00 --- /dev/null +++ b/tests/resources/settings.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "settings empty get collection" { + run epcc get settings + [ $status -eq 0 ] +} + diff --git a/tests/resources/user-authentication-infos.bats b/tests/resources/user-authentication-infos.bats new file mode 100755 index 0000000..eb7d2b5 --- /dev/null +++ b/tests/resources/user-authentication-infos.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "user-authentication-infos empty get collection" { + run epcc get user-authentication-infos + [ $status -eq 0 ] +} + diff --git a/tests/resources/user-authentication-oidc-profile-infos.bats b/tests/resources/user-authentication-oidc-profile-infos.bats new file mode 100755 index 0000000..d49e3fe --- /dev/null +++ b/tests/resources/user-authentication-oidc-profile-infos.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "user-authentication-oidc-profile-infos empty get collection" { + run epcc get user-authentication-oidc-profile-infos + [ $status -eq 0 ] +} + diff --git a/tests/resources/user-authentication-password-profile-infos.bats b/tests/resources/user-authentication-password-profile-infos.bats new file mode 100755 index 0000000..d9abcf4 --- /dev/null +++ b/tests/resources/user-authentication-password-profile-infos.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "user-authentication-password-profile-infos empty get collection" { + run epcc get user-authentication-password-profile-infos + [ $status -eq 0 ] +} + diff --git a/tests/resources/v2-products.bats b/tests/resources/v2-products.bats new file mode 100755 index 0000000..cbca419 --- /dev/null +++ b/tests/resources/v2-products.bats @@ -0,0 +1,6 @@ +#!/usr/bin/env bats +@test "v2-products empty get collection" { + run epcc get v2-products + [ $status -eq 0 ] +} + From 09014ea86881514d475ac43cdc723f5c1788f51c Mon Sep 17 00:00:00 2001 From: Steve Ramage Date: Sun, 24 Jul 2022 20:53:18 -0700 Subject: [PATCH 2/2] Checkpoint #157 - Trying to create one main file, maybe fake data will make it easier to write tests --- cmd/make-tests.go | 50 ++++++++++++++-- external/httpclient/httpclient.go | 3 +- tests/resource_smoke_test.bats | 60 +++++++++++++++++++ tests/resources/account-addresses.bats | 6 ++ .../account-authentication-settings.bats | 1 - ...ount-management-authentication-tokens.bats | 2 + tests/resources/account-members.bats | 2 + tests/resources/account-memberships.bats | 6 ++ tests/resources/accounts.bats | 6 -- tests/resources/authentication-realms.bats | 2 + tests/resources/cart-checkout.bats | 2 + tests/resources/cart-items.bats | 6 ++ tests/resources/cart-product-items.bats | 2 + tests/resources/carts.bats | 6 ++ tests/resources/catalog-products.bats | 2 + tests/resources/currencies.bats | 6 ++ tests/resources/customer-addresses.bats | 6 ++ .../customer-authentication-settings.bats | 2 + tests/resources/customers.bats | 6 ++ tests/resources/fields.bats | 6 ++ tests/resources/files.bats | 6 ++ tests/resources/flows.bats | 6 ++ tests/resources/integration-job-log.bats | 2 + tests/resources/integration-jobs.bats | 2 + tests/resources/integration-logs.bats | 2 + tests/resources/integrations.bats | 6 ++ tests/resources/merchant-realm-mappings.bats | 2 + tests/resources/oidc-profiles.bats | 6 ++ tests/resources/order-items.bats | 2 + .../resources/order-transaction-capture.bats | 2 + tests/resources/order-transaction-refund.bats | 2 + tests/resources/order-transactions.bats | 2 + tests/resources/orders.bats | 2 + tests/resources/password-profiles.bats | 6 ++ tests/resources/payment-gateways-adyen.bats | 2 + .../payment-gateways-authorize-net.bats | 2 + .../resources/payment-gateways-braintree.bats | 2 + .../payment-gateways-cardconnect.bats | 2 + .../payment-gateways-cybersource.bats | 2 + ...gateways-elastic-path-payments-stripe.bats | 2 + tests/resources/payment-gateways-manual.bats | 2 + ...ment-gateways-paypal-express-checkout.bats | 2 + .../payment-gateways-paypal-express.bats | 2 + .../payment-gateways-paypal-payflow-pro.bats | 2 + .../payment-gateways-stripe-connect.bats | 2 + ...yment-gateways-stripe-payment-intents.bats | 2 + tests/resources/payment-gateways-stripe.bats | 2 + tests/resources/payment-gateways.bats | 2 + tests/resources/pcm-catalog-releases.bats | 6 ++ tests/resources/pcm-catalogs.bats | 6 ++ tests/resources/pcm-hierarchies.bats | 6 ++ tests/resources/pcm-node-children.bats | 2 + tests/resources/pcm-node-products.bats | 2 + tests/resources/pcm-nodes.bats | 2 + tests/resources/pcm-pricebooks.bats | 6 ++ tests/resources/pcm-product-main-image.bats | 6 ++ tests/resources/pcm-product-prices.bats | 6 ++ tests/resources/pcm-products.bats | 6 ++ tests/resources/pcm-variation-options.bats | 6 ++ tests/resources/pcm-variations.bats | 6 ++ tests/resources/promotion-codes.bats | 6 ++ tests/resources/promotions.bats | 6 ++ tests/resources/settings.bats | 2 + .../resources/user-authentication-infos.bats | 6 ++ ...ser-authentication-oidc-profile-infos.bats | 6 ++ ...authentication-password-profile-infos.bats | 6 ++ tests/resources/v2-products.bats | 6 ++ 67 files changed, 344 insertions(+), 12 deletions(-) create mode 100644 tests/resource_smoke_test.bats diff --git a/cmd/make-tests.go b/cmd/make-tests.go index 0e5d353..5657236 100644 --- a/cmd/make-tests.go +++ b/cmd/make-tests.go @@ -10,12 +10,19 @@ import ( ) const testTemplate = `#!/usr/bin/env bats -{{if .GetCollectionInfo -}} -@test "{{ .PluralName }} empty get collection" { - run epcc get {{ .PluralName }} +{{if .resource.GetCollectionInfo -}} +@test "{{ .resource.PluralName }} empty get collection" { + run epcc get {{ .resource.PluralName }} [ $status -eq 0 ] } {{end}} +{{if and .resource.GetCollectionInfo .resource.DeleteEntityInfo -}} +@test "{{ .resource.PluralName }} delete-all support" { + run epcc delete-all {{ .resource.PluralName }} + [ $status -eq 0 ] +} +{{end}} + ` var MakeTests = &cobra.Command{ @@ -24,11 +31,42 @@ var MakeTests = &cobra.Command{ Hidden: true, RunE: func(cmd *cobra.Command, args []string) error { + err := os.MkdirAll("tests/resources", 0755) if err != nil { return err } + createResourceString := map[string]string{} + + for resourceName, resource := range resources.GetPluralResources() { + + createString := fmt.Sprintf("epcc create %s ", resource.PluralName) + + if resource.CreateEntityInfo != nil { + for attrName, attrVal := range resource.Attributes { + + createString += attrName + " " + + switch attrVal.Type { + case "FILE": + case "BOOLEAN": + createString += "true" + case "INT": + createString += "%(date +%s)" + case "STRING": + createString += "string" + default: + createString += "unsupported" + } + + } + + createResourceString[resourceName] = createString + } + + } + for _, resourceName := range resources.GetPluralResourceNames() { testFilename := fmt.Sprintf("./tests/resources/%s.bats", resourceName) _, err := os.Stat(testFilename) @@ -37,6 +75,7 @@ var MakeTests = &cobra.Command{ log.Infof("Tests for %s do not exist", testFilename) } else { log.Infof("Tests for %s exist already", testFilename) + } tmpl, err := template.New("test").Parse(testTemplate) @@ -58,7 +97,10 @@ var MakeTests = &cobra.Command{ return err } - err = tmpl.Execute(f, resource) + err = tmpl.Execute(f, map[string]interface{}{ + "resource": resource, + "create_map": createResourceString, + }) if err != nil { return err diff --git a/external/httpclient/httpclient.go b/external/httpclient/httpclient.go index b4d9a26..041c7ce 100644 --- a/external/httpclient/httpclient.go +++ b/external/httpclient/httpclient.go @@ -178,7 +178,8 @@ func doRequestInternal(ctx context.Context, method string, contentType string, p log.Debugf("%s %s", method, reqURL.String()) // TODO maybe check if it's json and if not do something else. - json.PrintJson(string(body)) + // Log to standard error because the body should always be jqable + json.PrintJsonToStderr(string(body)) log.Debugf("%s %s", resp.Proto, resp.Status) } else { log.Debugf("%s %s ==> %s %s", method, reqURL.String(), resp.Proto, resp.Status) diff --git a/tests/resource_smoke_test.bats b/tests/resource_smoke_test.bats new file mode 100644 index 0000000..f0b7c8a --- /dev/null +++ b/tests/resource_smoke_test.bats @@ -0,0 +1,60 @@ +#!/usr/bin/env bats + +#setup_file() { +# #run epcc reset-store .+ +# #[ $status -eq 0 ] +#} +setup() { + load 'test_helper/bats-support/load' # this is required by bats-assert! + load 'test_helper/bats-assert/load' + +} + +@test "account-addresses crud smoke test" { + + # Fixture Setup + run epcc delete-all accounts + [ $status -eq 0 ] + run epcc delete-all account-addresses + [ $status -eq 0 ] + run epcc create account name account-addresses-test legal_name my_legal_name + [ $status -eq 0 ] + + # Execute SUT + [ $status -eq 0 ] + run epcc get account-addresses name=account-addresses-test + [ $status -eq 0 ] + run epcc create account-addresses name=account-addresses-test name test legal_name my_legal_name + [ $status -eq 0 ] + run epcc update account-addresses name=account-addresses-test name=test name test2 + [ $status -eq 0 ] + run epcc get account-addresses name=account-addresses-test + [ $status -eq 0 ] + assert_output --partial '"name": "test2",' + run epcc get account-addresses name=test2 + assert_output --partial '"legal_name": "my_legal_name",' + + # Verification + + + +} + + +@test "accounts crud smoke test" { + run epcc delete-all accounts + [ $status -eq 0 ] + run epcc get accounts + [ $status -eq 0 ] + run epcc create account name test legal_name my_legal_name + [ $status -eq 0 ] + run epcc update account name=test name test2 + [ $status -eq 0 ] + run epcc get accounts + [ $status -eq 0 ] + assert_output --partial '"name": "test2",' + run epcc get account name=test2 + assert_output --partial '"legal_name": "my_legal_name",' +} + + diff --git a/tests/resources/account-addresses.bats b/tests/resources/account-addresses.bats index efebf46..d02dfe4 100755 --- a/tests/resources/account-addresses.bats +++ b/tests/resources/account-addresses.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "account-addresses delete-all support" { + run epcc delete-all account-addresses + [ $status -eq 0 ] +} + + diff --git a/tests/resources/account-authentication-settings.bats b/tests/resources/account-authentication-settings.bats index ac28c61..53b3d1f 100755 --- a/tests/resources/account-authentication-settings.bats +++ b/tests/resources/account-authentication-settings.bats @@ -3,4 +3,3 @@ run epcc get account-authentication-settings [ $status -eq 0 ] } - diff --git a/tests/resources/account-management-authentication-tokens.bats b/tests/resources/account-management-authentication-tokens.bats index df62c4e..443520d 100755 --- a/tests/resources/account-management-authentication-tokens.bats +++ b/tests/resources/account-management-authentication-tokens.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/account-members.bats b/tests/resources/account-members.bats index 86395dd..9b98020 100755 --- a/tests/resources/account-members.bats +++ b/tests/resources/account-members.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/account-memberships.bats b/tests/resources/account-memberships.bats index 40e25c0..c7fd938 100755 --- a/tests/resources/account-memberships.bats +++ b/tests/resources/account-memberships.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "account-memberships delete-all support" { + run epcc delete-all account-memberships + [ $status -eq 0 ] +} + + diff --git a/tests/resources/accounts.bats b/tests/resources/accounts.bats index 7073631..e69de29 100755 --- a/tests/resources/accounts.bats +++ b/tests/resources/accounts.bats @@ -1,6 +0,0 @@ -#!/usr/bin/env bats -@test "accounts empty get collection" { - run epcc get accounts - [ $status -eq 0 ] -} - diff --git a/tests/resources/authentication-realms.bats b/tests/resources/authentication-realms.bats index 1276223..462de8c 100755 --- a/tests/resources/authentication-realms.bats +++ b/tests/resources/authentication-realms.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/cart-checkout.bats b/tests/resources/cart-checkout.bats index df62c4e..443520d 100755 --- a/tests/resources/cart-checkout.bats +++ b/tests/resources/cart-checkout.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/cart-items.bats b/tests/resources/cart-items.bats index 4e52a12..99e322d 100755 --- a/tests/resources/cart-items.bats +++ b/tests/resources/cart-items.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "cart-items delete-all support" { + run epcc delete-all cart-items + [ $status -eq 0 ] +} + + diff --git a/tests/resources/cart-product-items.bats b/tests/resources/cart-product-items.bats index df62c4e..443520d 100755 --- a/tests/resources/cart-product-items.bats +++ b/tests/resources/cart-product-items.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/carts.bats b/tests/resources/carts.bats index 35f25fa..901c2c8 100755 --- a/tests/resources/carts.bats +++ b/tests/resources/carts.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "carts delete-all support" { + run epcc delete-all carts + [ $status -eq 0 ] +} + + diff --git a/tests/resources/catalog-products.bats b/tests/resources/catalog-products.bats index 1fe2c04..6ca9e85 100755 --- a/tests/resources/catalog-products.bats +++ b/tests/resources/catalog-products.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/currencies.bats b/tests/resources/currencies.bats index e5a12fb..51256b9 100755 --- a/tests/resources/currencies.bats +++ b/tests/resources/currencies.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "currencies delete-all support" { + run epcc delete-all currencies + [ $status -eq 0 ] +} + + diff --git a/tests/resources/customer-addresses.bats b/tests/resources/customer-addresses.bats index 6215f03..e51eb4f 100755 --- a/tests/resources/customer-addresses.bats +++ b/tests/resources/customer-addresses.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "customer-addresses delete-all support" { + run epcc delete-all customer-addresses + [ $status -eq 0 ] +} + + diff --git a/tests/resources/customer-authentication-settings.bats b/tests/resources/customer-authentication-settings.bats index 4791344..9d72b35 100755 --- a/tests/resources/customer-authentication-settings.bats +++ b/tests/resources/customer-authentication-settings.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/customers.bats b/tests/resources/customers.bats index b48fbbb..e789dba 100755 --- a/tests/resources/customers.bats +++ b/tests/resources/customers.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "customers delete-all support" { + run epcc delete-all customers + [ $status -eq 0 ] +} + + diff --git a/tests/resources/fields.bats b/tests/resources/fields.bats index 881624b..0c06c2a 100755 --- a/tests/resources/fields.bats +++ b/tests/resources/fields.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "fields delete-all support" { + run epcc delete-all fields + [ $status -eq 0 ] +} + + diff --git a/tests/resources/files.bats b/tests/resources/files.bats index cdb40ce..e5a63c7 100755 --- a/tests/resources/files.bats +++ b/tests/resources/files.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "files delete-all support" { + run epcc delete-all files + [ $status -eq 0 ] +} + + diff --git a/tests/resources/flows.bats b/tests/resources/flows.bats index 705fa05..23975d8 100755 --- a/tests/resources/flows.bats +++ b/tests/resources/flows.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "flows delete-all support" { + run epcc delete-all flows + [ $status -eq 0 ] +} + + diff --git a/tests/resources/integration-job-log.bats b/tests/resources/integration-job-log.bats index 688ef1c..151332f 100755 --- a/tests/resources/integration-job-log.bats +++ b/tests/resources/integration-job-log.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/integration-jobs.bats b/tests/resources/integration-jobs.bats index e234282..5954c62 100755 --- a/tests/resources/integration-jobs.bats +++ b/tests/resources/integration-jobs.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/integration-logs.bats b/tests/resources/integration-logs.bats index eb523af..0973079 100755 --- a/tests/resources/integration-logs.bats +++ b/tests/resources/integration-logs.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/integrations.bats b/tests/resources/integrations.bats index 7ff9726..559c91a 100755 --- a/tests/resources/integrations.bats +++ b/tests/resources/integrations.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "integrations delete-all support" { + run epcc delete-all integrations + [ $status -eq 0 ] +} + + diff --git a/tests/resources/merchant-realm-mappings.bats b/tests/resources/merchant-realm-mappings.bats index c92ce81..40740b0 100755 --- a/tests/resources/merchant-realm-mappings.bats +++ b/tests/resources/merchant-realm-mappings.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/oidc-profiles.bats b/tests/resources/oidc-profiles.bats index cff57cb..ec450ed 100755 --- a/tests/resources/oidc-profiles.bats +++ b/tests/resources/oidc-profiles.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "oidc-profiles delete-all support" { + run epcc delete-all oidc-profiles + [ $status -eq 0 ] +} + + diff --git a/tests/resources/order-items.bats b/tests/resources/order-items.bats index 705264a..43bde37 100755 --- a/tests/resources/order-items.bats +++ b/tests/resources/order-items.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/order-transaction-capture.bats b/tests/resources/order-transaction-capture.bats index df62c4e..443520d 100755 --- a/tests/resources/order-transaction-capture.bats +++ b/tests/resources/order-transaction-capture.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/order-transaction-refund.bats b/tests/resources/order-transaction-refund.bats index df62c4e..443520d 100755 --- a/tests/resources/order-transaction-refund.bats +++ b/tests/resources/order-transaction-refund.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/order-transactions.bats b/tests/resources/order-transactions.bats index 1f1bb3b..67ea629 100755 --- a/tests/resources/order-transactions.bats +++ b/tests/resources/order-transactions.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/orders.bats b/tests/resources/orders.bats index 1d09a7b..ecbe266 100755 --- a/tests/resources/orders.bats +++ b/tests/resources/orders.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/password-profiles.bats b/tests/resources/password-profiles.bats index fe9116f..f49aea4 100755 --- a/tests/resources/password-profiles.bats +++ b/tests/resources/password-profiles.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "password-profiles delete-all support" { + run epcc delete-all password-profiles + [ $status -eq 0 ] +} + + diff --git a/tests/resources/payment-gateways-adyen.bats b/tests/resources/payment-gateways-adyen.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-adyen.bats +++ b/tests/resources/payment-gateways-adyen.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-authorize-net.bats b/tests/resources/payment-gateways-authorize-net.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-authorize-net.bats +++ b/tests/resources/payment-gateways-authorize-net.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-braintree.bats b/tests/resources/payment-gateways-braintree.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-braintree.bats +++ b/tests/resources/payment-gateways-braintree.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-cardconnect.bats b/tests/resources/payment-gateways-cardconnect.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-cardconnect.bats +++ b/tests/resources/payment-gateways-cardconnect.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-cybersource.bats b/tests/resources/payment-gateways-cybersource.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-cybersource.bats +++ b/tests/resources/payment-gateways-cybersource.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-elastic-path-payments-stripe.bats b/tests/resources/payment-gateways-elastic-path-payments-stripe.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-elastic-path-payments-stripe.bats +++ b/tests/resources/payment-gateways-elastic-path-payments-stripe.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-manual.bats b/tests/resources/payment-gateways-manual.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-manual.bats +++ b/tests/resources/payment-gateways-manual.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-paypal-express-checkout.bats b/tests/resources/payment-gateways-paypal-express-checkout.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-paypal-express-checkout.bats +++ b/tests/resources/payment-gateways-paypal-express-checkout.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-paypal-express.bats b/tests/resources/payment-gateways-paypal-express.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-paypal-express.bats +++ b/tests/resources/payment-gateways-paypal-express.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-paypal-payflow-pro.bats b/tests/resources/payment-gateways-paypal-payflow-pro.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-paypal-payflow-pro.bats +++ b/tests/resources/payment-gateways-paypal-payflow-pro.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-stripe-connect.bats b/tests/resources/payment-gateways-stripe-connect.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-stripe-connect.bats +++ b/tests/resources/payment-gateways-stripe-connect.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-stripe-payment-intents.bats b/tests/resources/payment-gateways-stripe-payment-intents.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-stripe-payment-intents.bats +++ b/tests/resources/payment-gateways-stripe-payment-intents.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways-stripe.bats b/tests/resources/payment-gateways-stripe.bats index df62c4e..443520d 100755 --- a/tests/resources/payment-gateways-stripe.bats +++ b/tests/resources/payment-gateways-stripe.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/payment-gateways.bats b/tests/resources/payment-gateways.bats index 03b0523..9716abf 100755 --- a/tests/resources/payment-gateways.bats +++ b/tests/resources/payment-gateways.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/pcm-catalog-releases.bats b/tests/resources/pcm-catalog-releases.bats index 2b31277..e37966a 100755 --- a/tests/resources/pcm-catalog-releases.bats +++ b/tests/resources/pcm-catalog-releases.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "pcm-catalog-releases delete-all support" { + run epcc delete-all pcm-catalog-releases + [ $status -eq 0 ] +} + + diff --git a/tests/resources/pcm-catalogs.bats b/tests/resources/pcm-catalogs.bats index efb09b5..d9f2cda 100755 --- a/tests/resources/pcm-catalogs.bats +++ b/tests/resources/pcm-catalogs.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "pcm-catalogs delete-all support" { + run epcc delete-all pcm-catalogs + [ $status -eq 0 ] +} + + diff --git a/tests/resources/pcm-hierarchies.bats b/tests/resources/pcm-hierarchies.bats index bce9418..52c3bb5 100755 --- a/tests/resources/pcm-hierarchies.bats +++ b/tests/resources/pcm-hierarchies.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "pcm-hierarchies delete-all support" { + run epcc delete-all pcm-hierarchies + [ $status -eq 0 ] +} + + diff --git a/tests/resources/pcm-node-children.bats b/tests/resources/pcm-node-children.bats index 9baed2a..6ae888f 100755 --- a/tests/resources/pcm-node-children.bats +++ b/tests/resources/pcm-node-children.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/pcm-node-products.bats b/tests/resources/pcm-node-products.bats index 88d4797..e747755 100755 --- a/tests/resources/pcm-node-products.bats +++ b/tests/resources/pcm-node-products.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/pcm-nodes.bats b/tests/resources/pcm-nodes.bats index df62c4e..443520d 100755 --- a/tests/resources/pcm-nodes.bats +++ b/tests/resources/pcm-nodes.bats @@ -1,2 +1,4 @@ #!/usr/bin/env bats + + diff --git a/tests/resources/pcm-pricebooks.bats b/tests/resources/pcm-pricebooks.bats index fa2443a..0a15ba1 100755 --- a/tests/resources/pcm-pricebooks.bats +++ b/tests/resources/pcm-pricebooks.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "pcm-pricebooks delete-all support" { + run epcc delete-all pcm-pricebooks + [ $status -eq 0 ] +} + + diff --git a/tests/resources/pcm-product-main-image.bats b/tests/resources/pcm-product-main-image.bats index 1eff0be..5700fb1 100755 --- a/tests/resources/pcm-product-main-image.bats +++ b/tests/resources/pcm-product-main-image.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "pcm-product-main-image delete-all support" { + run epcc delete-all pcm-product-main-image + [ $status -eq 0 ] +} + + diff --git a/tests/resources/pcm-product-prices.bats b/tests/resources/pcm-product-prices.bats index 640b0a6..3a48b03 100755 --- a/tests/resources/pcm-product-prices.bats +++ b/tests/resources/pcm-product-prices.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "pcm-product-prices delete-all support" { + run epcc delete-all pcm-product-prices + [ $status -eq 0 ] +} + + diff --git a/tests/resources/pcm-products.bats b/tests/resources/pcm-products.bats index a078b7e..5398c7f 100755 --- a/tests/resources/pcm-products.bats +++ b/tests/resources/pcm-products.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "pcm-products delete-all support" { + run epcc delete-all pcm-products + [ $status -eq 0 ] +} + + diff --git a/tests/resources/pcm-variation-options.bats b/tests/resources/pcm-variation-options.bats index 33b1928..462b75b 100755 --- a/tests/resources/pcm-variation-options.bats +++ b/tests/resources/pcm-variation-options.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "pcm-variation-options delete-all support" { + run epcc delete-all pcm-variation-options + [ $status -eq 0 ] +} + + diff --git a/tests/resources/pcm-variations.bats b/tests/resources/pcm-variations.bats index b70da8b..ddac6d0 100755 --- a/tests/resources/pcm-variations.bats +++ b/tests/resources/pcm-variations.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "pcm-variations delete-all support" { + run epcc delete-all pcm-variations + [ $status -eq 0 ] +} + + diff --git a/tests/resources/promotion-codes.bats b/tests/resources/promotion-codes.bats index 6b39d84..ada8460 100755 --- a/tests/resources/promotion-codes.bats +++ b/tests/resources/promotion-codes.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "promotion-codes delete-all support" { + run epcc delete-all promotion-codes + [ $status -eq 0 ] +} + + diff --git a/tests/resources/promotions.bats b/tests/resources/promotions.bats index 174203f..dbde30f 100755 --- a/tests/resources/promotions.bats +++ b/tests/resources/promotions.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "promotions delete-all support" { + run epcc delete-all promotions + [ $status -eq 0 ] +} + + diff --git a/tests/resources/settings.bats b/tests/resources/settings.bats index 1b73e00..0165bfb 100755 --- a/tests/resources/settings.bats +++ b/tests/resources/settings.bats @@ -4,3 +4,5 @@ [ $status -eq 0 ] } + + diff --git a/tests/resources/user-authentication-infos.bats b/tests/resources/user-authentication-infos.bats index eb7d2b5..38591bf 100755 --- a/tests/resources/user-authentication-infos.bats +++ b/tests/resources/user-authentication-infos.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "user-authentication-infos delete-all support" { + run epcc delete-all user-authentication-infos + [ $status -eq 0 ] +} + + diff --git a/tests/resources/user-authentication-oidc-profile-infos.bats b/tests/resources/user-authentication-oidc-profile-infos.bats index d49e3fe..e3a957f 100755 --- a/tests/resources/user-authentication-oidc-profile-infos.bats +++ b/tests/resources/user-authentication-oidc-profile-infos.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "user-authentication-oidc-profile-infos delete-all support" { + run epcc delete-all user-authentication-oidc-profile-infos + [ $status -eq 0 ] +} + + diff --git a/tests/resources/user-authentication-password-profile-infos.bats b/tests/resources/user-authentication-password-profile-infos.bats index d9abcf4..83e7d52 100755 --- a/tests/resources/user-authentication-password-profile-infos.bats +++ b/tests/resources/user-authentication-password-profile-infos.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "user-authentication-password-profile-infos delete-all support" { + run epcc delete-all user-authentication-password-profile-infos + [ $status -eq 0 ] +} + + diff --git a/tests/resources/v2-products.bats b/tests/resources/v2-products.bats index cbca419..0158d8a 100755 --- a/tests/resources/v2-products.bats +++ b/tests/resources/v2-products.bats @@ -4,3 +4,9 @@ [ $status -eq 0 ] } +@test "v2-products delete-all support" { + run epcc delete-all v2-products + [ $status -eq 0 ] +} + +