func TestUpdateBuildpack(t *testing.T) { req := testapi.NewCloudControllerTestRequest(testnet.TestRequest{ Method: "PUT", Path: "/v2/buildpacks/my-cool-buildpack-guid", Matcher: testnet.RequestBodyMatcher(`{"name":"my-cool-buildpack","position":555,"enabled":false}`), Response: testnet.TestResponse{ Status: http.StatusCreated, Body: `{ "metadata": { "guid": "my-cool-buildpack-guid" }, "entity": { "name": "my-cool-buildpack", "position":555, "enabled":false } }`}, }) ts, handler, repo := createBuildpackRepo(t, req) defer ts.Close() position := 555 enabled := false buildpack := cf.Buildpack{} buildpack.Name = "my-cool-buildpack" buildpack.Guid = "my-cool-buildpack-guid" buildpack.Position = &position buildpack.Enabled = &enabled updated, apiResponse := repo.Update(buildpack) assert.True(t, handler.AllRequestsCalled()) assert.False(t, apiResponse.IsNotSuccessful()) assert.Equal(t, buildpack, updated) }