From c0582d6eafbb5ea238651f633cbbb74045b0d277 Mon Sep 17 00:00:00 2001 From: nikhilsbhat Date: Fri, 28 Apr 2023 18:41:25 +0530 Subject: [PATCH] Fix endpoint in UpdateRole --- roles.go | 2 +- roles_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles.go b/roles.go index 33d53f1..058943a 100644 --- a/roles.go +++ b/roles.go @@ -145,7 +145,7 @@ func (conf *client) UpdateRole(config Role) (Role, error) { "If-Match": config.ETAG, }). SetBody(config). - Put(RolesEndpoint) + Put(filepath.Join(RolesEndpoint, config.Name)) if err != nil { return roleCfg, &errors.APIError{Err: err, Message: fmt.Sprintf("update role '%s'", config.Name)} } diff --git a/roles_test.go b/roles_test.go index 16ebad4..3ba72f5 100644 --- a/roles_test.go +++ b/roles_test.go @@ -542,7 +542,7 @@ func Test_client_UpdateRole(t *testing.T) { actual, err := client.UpdateRole(role) assert.EqualError(t, err, "call made to update role 'blackbird' errored with: "+ - "Put \"http://localhost:8156/go/api/admin/security/roles\": dial tcp [::1]:8156: connect: connection refused") + "Put \"http://localhost:8156/go/api/admin/security/roles/blackbird\": dial tcp [::1]:8156: connect: connection refused") assert.Equal(t, expected, actual) }) }