From 2a2b3e037de08f1930bc80b287f332849035fa6a Mon Sep 17 00:00:00 2001 From: Rui Yang Date: Tue, 18 Jun 2024 15:38:18 -0400 Subject: [PATCH] [fix]: acceptance tests Signed-off-by: Ryan Hall --- acceptance/download_product_pivnet_test.go | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/acceptance/download_product_pivnet_test.go b/acceptance/download_product_pivnet_test.go index cffa98c5..51aaad02 100644 --- a/acceptance/download_product_pivnet_test.go +++ b/acceptance/download_product_pivnet_test.go @@ -3,16 +3,8 @@ package acceptance import ( "archive/zip" "bytes" - "cloud.google.com/go/storage" "context" "fmt" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" - "github.com/onsi/gomega/gexec" - "github.com/onsi/gomega/ghttp" - "golang.org/x/oauth2/google" - "google.golang.org/api/option" "io" "io/ioutil" "net/http" @@ -21,6 +13,15 @@ import ( "path/filepath" "strings" "time" + + "cloud.google.com/go/storage" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + "github.com/onsi/gomega/gbytes" + "github.com/onsi/gomega/gexec" + "github.com/onsi/gomega/ghttp" + "golang.org/x/oauth2/google" + "google.golang.org/api/option" ) var _ = Describe("download-product command", func() { @@ -57,6 +58,9 @@ var _ = Describe("download-product command", func() { server.RouteToHandler("GET", "/api/v2/products/pivnet-product/releases/24", ghttp.RespondWith(http.StatusOK, `{"id":24}`), ) + server.RouteToHandler("POST", "/api/v2/products/pivnet-product/releases/24/pivnet_resource_eula_acceptance", + ghttp.RespondWith(http.StatusOK, nil), + ) server.RouteToHandler("GET", "/api/v2/products/pivnet-product/releases/24/product_files", ghttp.RespondWith(http.StatusOK, fmt.Sprintf(`{ "product_files": [ @@ -127,6 +131,9 @@ var _ = Describe("download-product command", func() { server.RouteToHandler("GET", "/api/v2/products/xenial-stemcells/releases/24", ghttp.RespondWith(http.StatusOK, `{"id":24}`), ) + server.RouteToHandler("POST", "/api/v2/products/xenial-stemcells/releases/24/pivnet_resource_eula_acceptance", + ghttp.RespondWith(http.StatusOK, nil), + ) server.RouteToHandler("GET", "/api/v2/products/xenial-stemcells/releases/24/product_files", ghttp.RespondWith(http.StatusOK, fmt.Sprintf(`{ "product_files": [