Skip to content

Commit

Permalink
Merge pull request #24 from rabobank/spn-users
Browse files Browse the repository at this point in the history
fix tests after syncUsers interface change
  • Loading branch information
nielsdt-rabobank authored Oct 4, 2023
2 parents e650dc2 + fc9442a commit 276b847
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions user/users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
}

Expand Down Expand Up @@ -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"))
Expand All @@ -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))
Expand All @@ -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"))
})
Expand All @@ -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))
Expand Down

0 comments on commit 276b847

Please sign in to comment.