func TestUpdateUserProvidedServiceInstance(t *testing.T) { req := testapi.NewCloudControllerTestRequest(testnet.TestRequest{ Method: "PUT", Path: "/v2/user_provided_service_instances/my-instance-guid", Matcher: testnet.RequestBodyMatcher(`{"credentials":{"host":"example.com","password":"******","user":"******"},"syslog_drain_url":"syslog://example.com"}`), Response: testnet.TestResponse{Status: http.StatusCreated}, }) ts, handler, repo := createUserProvidedServiceInstanceRepo(t, req) defer ts.Close() params := map[string]string{ "host": "example.com", "user": "******", "password": "******", } serviceInstance := cf.ServiceInstanceFields{} serviceInstance.Guid = "my-instance-guid" serviceInstance.Params = params serviceInstance.SysLogDrainUrl = "syslog://example.com" apiResponse := repo.Update(serviceInstance) assert.True(t, handler.AllRequestsCalled()) assert.False(t, apiResponse.IsNotSuccessful()) }