diff --git a/broker/team.go b/broker/team.go index b486d1d1..e9ac335f 100644 --- a/broker/team.go +++ b/broker/team.go @@ -16,7 +16,7 @@ type TeamEmbeddedItems struct { } type TeamsResponse struct { - Teams []Team `json:"teams"` + Team HalDoc } diff --git a/client/client.go b/client/client.go index c2f596f0..d7166aef 100644 --- a/client/client.go +++ b/client/client.go @@ -157,15 +157,7 @@ func (c *Client) CreateTeam(t broker.TeamCreateOrUpdateRequest) (*broker.Team, e apiResponse := res.(*broker.TeamsResponse) - // TODO: why is this a collection not a single resource? - // check if it's consistent with the other APIs - for _, i := range apiResponse.Teams { - if i.Name == t.Name { - return &i, err - } - } - - return nil, err + return &apiResponse.Team, err } // ReadTeamAssignments finds all users currently in a team diff --git a/client/client_pact_test.go b/client/client_pact_test.go index 1d620bdd..13c323ae 100644 --- a/client/client_pact_test.go +++ b/client/client_pact_test.go @@ -222,11 +222,7 @@ func TestTerraformClientPact(t *testing.T) { WithJSONBody(Like(create)). WillRespondWith(200). WithHeader("Content-Type", S("application/hal+json")). - WithJSONBody(Like(broker.TeamsResponse{ - Teams: []broker.Team{ - created, - }, - })) + WithJSONBody(Like(created)) err = mockProvider.ExecuteTest(t, func(config MockServerConfig) error { client := clientForPact(config)