Skip to content

Commit 4cac320

Browse files
committed
fix tests
1 parent 0be9a64 commit 4cac320

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

pkg/connector/org_role_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ func TestOrgRole(t *testing.T) {
2424

2525
githubClient := github.NewClient(mgh.Server())
2626
cache := newOrgNameCache(githubClient)
27-
client := orgRoleBuilder(githubClient, cache)
27+
userCache := newUserDataCache(githubClient)
28+
client := orgRoleBuilder(githubClient, cache, userCache)
2829

2930
organization, _ := organizationResource(ctx, githubOrganization, nil, true)
3031
roleResource, _ := orgRoleResource(ctx, &OrganizationRole{
@@ -89,7 +90,8 @@ func TestOrgRole(t *testing.T) {
8990

9091
githubClient := github.NewClient(mockGithub.Server())
9192
cache := newOrgNameCache(githubClient)
92-
client := orgRoleBuilder(githubClient, cache)
93+
userCache := newUserDataCache(githubClient)
94+
client := orgRoleBuilder(githubClient, cache, userCache)
9395

9496
organization, _ := organizationResource(ctx, githubOrganization, nil, true)
9597

pkg/connector/org_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ func TestOrganization(t *testing.T) {
2323

2424
githubClient := github.NewClient(mgh.Server())
2525
cache := newOrgNameCache(githubClient)
26-
client := orgBuilder(githubClient, nil, cache, nil, false)
26+
userCache := newUserDataCache(githubClient)
27+
client := orgBuilder(githubClient, nil, cache, userCache, nil, false)
2728

2829
organization, _ := organizationResource(ctx, githubOrganization, nil, false)
2930
user, _ := userResource(ctx, githubUser, *githubUser.Email, nil)

pkg/connector/repository_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ func TestRepository(t *testing.T) {
2424

2525
githubClient := github.NewClient(mgh.Server())
2626
cache := newOrgNameCache(githubClient)
27-
client := repositoryBuilder(githubClient, cache)
27+
userCache := newUserDataCache(githubClient)
28+
teamCache := newTeamDataCache(githubClient)
29+
client := repositoryBuilder(githubClient, cache, userCache, teamCache)
2830

2931
organization, _ := organizationResource(ctx, githubOrganization, nil, false)
3032
repository, _ := repositoryResource(ctx, githubRepository, organization.Id)

pkg/connector/team_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ func TestTeam(t *testing.T) {
2424

2525
githubClient := github.NewClient(mgh.Server())
2626
cache := newOrgNameCache(githubClient)
27-
client := teamBuilder(githubClient, cache)
27+
userCache := newUserDataCache(githubClient)
28+
teamCache := newTeamDataCache(githubClient)
29+
client := teamBuilder(githubClient, cache, userCache, teamCache)
2830

2931
organization, _ := organizationResource(ctx, githubOrganization, nil, false)
3032
team, _ := teamResource(githubTeam, organization.Id)

pkg/connector/user_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ func TestUsersList(t *testing.T) {
4444
githubClient := github.NewClient(mgh.Server())
4545
graphQLClient := mocks.MockGraphQL()
4646
cache := newOrgNameCache(githubClient)
47+
userCache := newUserDataCache(githubClient)
4748
client := userBuilder(
4849
githubClient,
4950
testCase.hasSamlEnabled,
5051
graphQLClient,
5152
cache,
53+
userCache,
5254
[]string{organization.DisplayName},
5355
)
5456

0 commit comments

Comments
 (0)