Skip to content

Commit

Permalink
test(LH-70915): Fix broken unit tests (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhuwarrier authored Sep 22, 2023
1 parent ccfad85 commit a293f7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
9 changes: 5 additions & 4 deletions client/connector/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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),
)
},
Expand Down Expand Up @@ -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),
)
},
Expand Down
13 changes: 7 additions & 6 deletions client/connector/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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),
)
},
Expand All @@ -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),
)
},
Expand All @@ -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),
)
},
Expand Down

0 comments on commit a293f7b

Please sign in to comment.