Skip to content

Commit

Permalink
fix client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Mar 30, 2022
1 parent 343f0e0 commit 280d56c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ func TestAdminPortalPathIsPreserved(t *testing.T) {
_, err = NewThreeScale(ap, "any", NewTestClient(func(req *http.Request) *http.Response {
verify(req, "/example/admin/api/services.xml")
return &http.Response{
Body: ioutil.NopCloser(bytes.NewBuffer([]byte(""))),
StatusCode: http.StatusOK,
Body: ioutil.NopCloser(bytes.NewBuffer([]byte(`<services></services>`))),
}
})).ListServices()
if err != nil {
Expand All @@ -170,7 +171,8 @@ func TestAdminPortalPathIsPreserved(t *testing.T) {
_, err = NewThreeScale(ap, "any", NewTestClient(func(req *http.Request) *http.Response {
verify(req, "/example/admin/api/services.xml")
return &http.Response{
Body: ioutil.NopCloser(bytes.NewBuffer([]byte(""))),
StatusCode: http.StatusCreated,
Body: ioutil.NopCloser(bytes.NewBuffer([]byte(`<service></service>`))),
}
})).CreateService("any")
if err != nil {
Expand All @@ -181,7 +183,8 @@ func TestAdminPortalPathIsPreserved(t *testing.T) {
err = NewThreeScale(ap, "any", NewTestClient(func(req *http.Request) *http.Response {
verify(req, "/example/admin/api/services/any.xml")
return &http.Response{
Body: ioutil.NopCloser(bytes.NewBuffer([]byte(""))),
StatusCode: http.StatusOK,
Body: ioutil.NopCloser(bytes.NewBuffer([]byte(""))),
}
})).DeleteService("any")
if err != nil {
Expand All @@ -192,7 +195,8 @@ func TestAdminPortalPathIsPreserved(t *testing.T) {
_, err = NewThreeScale(ap, "any", NewTestClient(func(req *http.Request) *http.Response {
verify(req, "/example/admin/api/services/any.xml")
return &http.Response{
Body: ioutil.NopCloser(bytes.NewBuffer([]byte(""))),
StatusCode: http.StatusOK,
Body: ioutil.NopCloser(bytes.NewBuffer([]byte(`<service></service>`))),
}
})).UpdateService("any", NewParams())
if err != nil {
Expand Down

0 comments on commit 280d56c

Please sign in to comment.