From fc9442a1ad969b7394869c0a14b83054dc87110b Mon Sep 17 00:00:00 2001 From: Niels de Troije Date: Wed, 4 Oct 2023 13:47:27 +0200 Subject: [PATCH] fix tests after syncUsers interface change --- user/users_test.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/user/users_test.go b/user/users_test.go index 770088b4..f7f27c7d 100644 --- a/user/users_test.go +++ b/user/users_test.go @@ -39,15 +39,15 @@ var _ = Describe("given UserSpaces", func() { Context("User Manager()", func() { BeforeEach(func() { userManager = &DefaultManager{ - Client: client, - Cfg: fakeReader, - UAAMgr: uaaFake, - LdapMgr: ldapFake, - AzureADMgr: azureADFake, - SpaceMgr: spaceFake, - OrgReader: orgFake, - Peek: false, - LdapConfig: &config.LdapConfig{Origin: "ldap"}, + Client: client, + Cfg: fakeReader, + UAAMgr: uaaFake, + LdapMgr: ldapFake, + AzureADMgr: azureADFake, + SpaceMgr: spaceFake, + OrgReader: orgFake, + Peek: false, + LdapConfig: &config.LdapConfig{Origin: "ldap"}, AzureADConfig: &config.AzureADConfig{}, } @@ -163,7 +163,7 @@ var _ = Describe("given UserSpaces", func() { AddUser: userManager.AssociateSpaceAuditor, RoleUsers: InitRoleUsers(), } - err := userManager.SyncInternalUsers(roleUsers, updateUsersInput) + err := userManager.SyncInternalUsers(roleUsers, updateUsersInput, false) Expect(err).ShouldNot(HaveOccurred()) orgGUID, userGUID, role := client.CreateV3OrganizationRoleArgsForCall(0) Expect(orgGUID).Should(Equal("org_guid")) @@ -185,7 +185,7 @@ var _ = Describe("given UserSpaces", func() { AddUser: userManager.AssociateSpaceAuditor, RoleUsers: InitRoleUsers(), } - err := userManager.SyncInternalUsers(roleUsers, updateUsersInput) + err := userManager.SyncInternalUsers(roleUsers, updateUsersInput, false) Expect(err).ShouldNot(HaveOccurred()) Expect(client.CreateV3OrganizationRoleCallCount()).Should(Equal(0)) Expect(client.CreateV3SpaceRoleCallCount()).Should(Equal(0)) @@ -198,7 +198,7 @@ var _ = Describe("given UserSpaces", func() { AddUser: userManager.AssociateSpaceAuditor, RoleUsers: InitRoleUsers(), } - err := userManager.SyncInternalUsers(roleUsers, updateUsersInput) + err := userManager.SyncInternalUsers(roleUsers, updateUsersInput, false) Expect(err).Should(HaveOccurred()) Expect(err.Error()).Should(Equal("user test2 doesn't exist in origin uaa, so must add internal user first")) }) @@ -212,7 +212,7 @@ var _ = Describe("given UserSpaces", func() { RoleUsers: InitRoleUsers(), } client.CreateV3OrganizationRoleReturns(&cfclient.V3Role{}, errors.New("error")) - err := userManager.SyncInternalUsers(roleUsers, updateUsersInput) + err := userManager.SyncInternalUsers(roleUsers, updateUsersInput, false) Expect(err).Should(HaveOccurred()) Expect(client.CreateV3OrganizationRoleCallCount()).Should(Equal(1)) Expect(client.CreateV3SpaceRoleCallCount()).Should(Equal(0))