diff --git a/controllers/uaa.go b/controllers/uaa.go index c3f2c5a2..bce8a752 100644 --- a/controllers/uaa.go +++ b/controllers/uaa.go @@ -251,6 +251,8 @@ func (c *UAAContext) InviteUserToOrg(rw web.ResponseWriter, req *web.Request) { err.writeTo(rw) return } + // Set the user info that get from the newly invited user. + getUserResp.ID = userInvite.UserID } rw.WriteHeader(http.StatusOK) diff --git a/controllers/uaa_test.go b/controllers/uaa_test.go index b0167b96..b0bcc93d 100644 --- a/controllers/uaa_test.go +++ b/controllers/uaa_test.go @@ -89,12 +89,6 @@ var inviteUsersTest = []BasicProxyTest{ ResponseCode: http.StatusOK, Response: "{\"resources\": [{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }]}", }, - { - RequestMethod: "GET", - ExpectedPath: "/Users/user-guid", - ResponseCode: http.StatusOK, - Response: "{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }", - }, { RequestMethod: "POST", ExpectedPath: "/v2/users", @@ -128,12 +122,6 @@ var inviteUsersTest = []BasicProxyTest{ ResponseCode: http.StatusOK, Response: "{\"resources\": [{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }]}", }, - { - RequestMethod: "GET", - ExpectedPath: "/Users/user-guid", - ResponseCode: http.StatusOK, - Response: "{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }", - }, { RequestMethod: "POST", ExpectedPath: "/v2/users", @@ -144,7 +132,7 @@ var inviteUsersTest = []BasicProxyTest{ { BasicSecureTest: BasicSecureTest{ BasicConsoleUnitTest: BasicConsoleUnitTest{ - TestName: "UAA Invite User with e-mail in body", + TestName: "UAA Invite User with e-mail in body (new user)", SessionData: ValidTokenData, EnvVars: GetMockCompleteEnvVars(), }, @@ -165,13 +153,7 @@ var inviteUsersTest = []BasicProxyTest{ RequestMethod: "GET", ExpectedPath: "/Users?filter=email+eq+%22test%40example.com%22", ResponseCode: http.StatusOK, - Response: "{\"resources\": [{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }]}", - }, - { - RequestMethod: "GET", - ExpectedPath: "/Users/user-guid", - ResponseCode: http.StatusOK, - Response: "{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }", + Response: "{\"resources\": []}", }, { RequestMethod: "POST",