From a293f7b1c170847addbc0a9ba975e13182ae969c Mon Sep 17 00:00:00 2001 From: Siddhu Warrier Date: Fri, 22 Sep 2023 16:30:42 +0100 Subject: [PATCH] test(LH-70915): Fix broken unit tests (#57) --- client/connector/create_test.go | 9 +++++---- client/connector/update_test.go | 13 +++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/connector/create_test.go b/client/connector/create_test.go index 1bd09b25..47ef2dc3 100644 --- a/client/connector/create_test.go +++ b/client/connector/create_test.go @@ -2,12 +2,13 @@ package connector_test import ( "context" + "testing" + "time" + "github.com/CiscoDevnet/terraform-provider-cdo/go-client/connector" "github.com/CiscoDevnet/terraform-provider-cdo/go-client/internal/http" "github.com/CiscoDevnet/terraform-provider-cdo/go-client/user" "github.com/stretchr/testify/assert" - "testing" - "time" "github.com/jarcoal/httpmock" ) @@ -57,7 +58,7 @@ func TestCreate(t *testing.T) { ) httpmock.RegisterResponder( "POST", - "/anubis/rest/v1/oauth/token", + "/anubis/rest/v1/oauth/token/external-compute", httpmock.NewJsonResponderOrPanic(200, validUserToken), ) }, @@ -102,7 +103,7 @@ func TestCreate(t *testing.T) { ) httpmock.RegisterResponder( "POST", - "/anubis/rest/v1/oauth/token", + "/anubis/rest/v1/oauth/token/external-compute", httpmock.NewJsonResponderOrPanic(500, nil), ) }, diff --git a/client/connector/update_test.go b/client/connector/update_test.go index ae9f4248..5fe53636 100644 --- a/client/connector/update_test.go +++ b/client/connector/update_test.go @@ -3,13 +3,14 @@ package connector_test import ( "context" "fmt" + "net/http" + "testing" + "time" + "github.com/CiscoDevnet/terraform-provider-cdo/go-client/connector" internalHttp "github.com/CiscoDevnet/terraform-provider-cdo/go-client/internal/http" "github.com/CiscoDevnet/terraform-provider-cdo/go-client/user" "github.com/stretchr/testify/assert" - "net/http" - "testing" - "time" "github.com/jarcoal/httpmock" ) @@ -57,7 +58,7 @@ func TestUpdate(t *testing.T) { ) httpmock.RegisterResponder( http.MethodPost, - "/anubis/rest/v1/oauth/token", + "/anubis/rest/v1/oauth/token/external-compute", httpmock.NewJsonResponderOrPanic(200, validUserToken), ) }, @@ -81,7 +82,7 @@ func TestUpdate(t *testing.T) { ) httpmock.RegisterResponder( http.MethodPost, - "/anubis/rest/v1/oauth/token", + "/anubis/rest/v1/oauth/token/external-compute", httpmock.NewJsonResponderOrPanic(200, validUserToken), ) }, @@ -104,7 +105,7 @@ func TestUpdate(t *testing.T) { ) httpmock.RegisterResponder( http.MethodPost, - "/anubis/rest/v1/oauth/token", + "/anubis/rest/v1/oauth/token/external-compute", httpmock.NewJsonResponderOrPanic(500, nil), ) },