Skip to content

Commit

Permalink
Broker API response now returns "service_brokers" instead of "brokers" (
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilKabakchiev authored Feb 4, 2019
1 parent 67dcd67 commit 89b183d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pkg/types/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

// Brokers struct
type Brokers struct {
Brokers []*Broker `json:"brokers"`
Brokers []*Broker `json:"service_brokers"`
}

// Broker broker struct
Expand Down
2 changes: 1 addition & 1 deletion test/broker_test/broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ var _ = test.DescribeTestsFor(test.TestCase{
ctx.SMWithOAuth.GET("/v1/service_brokers").
Expect().
Status(http.StatusOK).
JSON().Object().Value("brokers").Array().First().Object().
JSON().Object().Value("service_brokers").Array().First().Object().
ContainsMap(expectedBrokerResponse)

assertInvocationCount(brokerServer.CatalogEndpointRequests, 1)
Expand Down
2 changes: 1 addition & 1 deletion test/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func MapContains(actual Object, expected Object) {
}

func RemoveAllBrokers(SM *httpexpect.Expect) {
removeAll(SM, "brokers", "/v1/service_brokers")
removeAll(SM, "service_brokers", "/v1/service_brokers")
}

func RemoveAllPlatforms(SM *httpexpect.Expect) {
Expand Down
5 changes: 0 additions & 5 deletions test/delete_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,7 @@ func DescribeDeleteListFor(ctx *common.TestContext, t TestCase) bool {
}

verifyDeleteListOpHelper := func(deleteListOpEntry deleteOpEntry, query string) {

// workaround for brokers api
jsonArrayKey := strings.Replace(t.API, "/v1/", "", 1)
if jsonArrayKey == "service_brokers" {
jsonArrayKey = "brokers"
}

expectedAfterOpIDs := make([]string, 0)
unexpectedAfterOpIDs := make([]string, 0)
Expand Down
4 changes: 0 additions & 4 deletions test/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,7 @@ func DescribeListTestsFor(ctx *common.TestContext, t TestCase) bool {
expectedAfterOpIDs = common.ExtractResourceIDs(listOpEntry.resourcesToExpectAfterOp)
unexpectedAfterOpIDs = common.ExtractResourceIDs(listOpEntry.resourcesNotToExpectAfterOp)

// workaround for brokers api
jsonArrayKey := strings.Replace(t.API, "/v1/", "", 1)
if jsonArrayKey == "service_brokers" {
jsonArrayKey = "brokers"
}

By(fmt.Sprintf("[TEST]: Verifying expected %s before operation after present", t.API))
beforeOpArray := ctx.SMWithOAuth.GET(t.API).
Expand Down

0 comments on commit 89b183d

Please sign in to comment.