@@ -52,8 +52,10 @@ func TestDownloader_EmptyAccount(t *testing.T) {
52
52
client .EXPECT ().GetPolicies (gomock .Any (), accountUUID ).Return ([]accountmanagement.PolicyOverview {}, nil )
53
53
client .EXPECT ().GetGroups (gomock .Any (), accountUUID ).Return ([]accountmanagement.GetGroupDto {}, nil )
54
54
client .EXPECT ().GetUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.UsersDto {}, nil )
55
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
56
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
55
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
56
+ if featureflags .ServiceUsers .Enabled () {
57
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
58
+ }
57
59
58
60
result , err := downloader .DownloadResources (t .Context ())
59
61
assert .NoError (t , err )
@@ -88,8 +90,10 @@ func TestDownloader_AccountPolicy(t *testing.T) {
88
90
89
91
client .EXPECT ().GetGroups (gomock .Any (), accountUUID ).Return ([]accountmanagement.GetGroupDto {}, nil )
90
92
client .EXPECT ().GetUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.UsersDto {}, nil )
91
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
92
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
93
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
94
+ if featureflags .ServiceUsers .Enabled () {
95
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
96
+ }
93
97
94
98
result , err := downloader .DownloadResources (t .Context ())
95
99
assert .NoError (t , err )
@@ -137,8 +141,10 @@ func TestDownloader_EnvironmentPolicy(t *testing.T) {
137
141
138
142
client .EXPECT ().GetGroups (gomock .Any (), accountUUID ).Return ([]accountmanagement.GetGroupDto {}, nil )
139
143
client .EXPECT ().GetUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.UsersDto {}, nil )
140
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
141
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
144
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
145
+ if featureflags .ServiceUsers .Enabled () {
146
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
147
+ }
142
148
143
149
result , err := downloader .DownloadResources (t .Context ())
144
150
assert .NoError (t , err )
@@ -182,8 +188,10 @@ func TestDownloader_GlobalPolicy(t *testing.T) {
182
188
183
189
client .EXPECT ().GetGroups (gomock .Any (), accountUUID ).Return ([]accountmanagement.GetGroupDto {}, nil )
184
190
client .EXPECT ().GetUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.UsersDto {}, nil )
185
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
186
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
191
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
192
+ if featureflags .ServiceUsers .Enabled () {
193
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
194
+ }
187
195
188
196
result , err := downloader .DownloadResources (t .Context ())
189
197
assert .NoError (t , err )
@@ -233,8 +241,10 @@ func TestDownloader_OnlyUser(t *testing.T) {
233
241
client .EXPECT ().GetGroups (gomock .Any (), accountUUID ).Return ([]accountmanagement.GetGroupDto {}, nil )
234
242
client .EXPECT ().GetUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.UsersDto {{Email : "usert@some.org" }}, nil )
235
243
client .EXPECT ().GetGroupsForUser (gomock .Any (), "usert@some.org" , accountUUID ).Return (& accountmanagement.GroupUserDto {Email : "usert@some.org" }, nil )
236
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
237
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
244
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
245
+ if featureflags .ServiceUsers .Enabled () {
246
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
247
+ }
238
248
239
249
result , err := downloader .DownloadResources (t .Context ())
240
250
assert .NoError (t , err )
@@ -271,8 +281,10 @@ func TestDownloader_UserWithOneGroup(t *testing.T) {
271
281
Email : "usert@some.org" ,
272
282
Groups : []accountmanagement.AccountGroupDto {{Uuid : groupUUID1 }},
273
283
}, nil )
274
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
275
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
284
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
285
+ if featureflags .ServiceUsers .Enabled () {
286
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
287
+ }
276
288
277
289
result , err := downloader .DownloadResources (t .Context ())
278
290
assert .NoError (t , err )
@@ -332,8 +344,10 @@ func TestDownloader_EmptyGroup(t *testing.T) {
332
344
client .EXPECT ().GetPermissionFor (gomock .Any (), accountUUID , gomock .Any ()).Return (& accountmanagement.PermissionsGroupDto {}, nil )
333
345
334
346
client .EXPECT ().GetUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.UsersDto {}, nil )
335
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
336
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
347
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
348
+ if featureflags .ServiceUsers .Enabled () {
349
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
350
+ }
337
351
338
352
result , err := downloader .DownloadResources (t .Context ())
339
353
assert .NoError (t , err )
@@ -371,8 +385,10 @@ func TestDownloader_GroupWithFederatedAttributeValues(t *testing.T) {
371
385
client .EXPECT ().GetPermissionFor (gomock .Any (), accountUUID , gomock .Any ()).Return (& accountmanagement.PermissionsGroupDto {}, nil )
372
386
373
387
client .EXPECT ().GetUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.UsersDto {}, nil )
374
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
375
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
388
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
389
+ if featureflags .ServiceUsers .Enabled () {
390
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
391
+ }
376
392
377
393
result , err := downloader .DownloadResources (t .Context ())
378
394
assert .NoError (t , err )
@@ -459,8 +475,10 @@ func TestDownloader_GroupsWithPolicies(t *testing.T) {
459
475
}, nil )
460
476
461
477
client .EXPECT ().GetUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.UsersDto {}, nil )
462
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
463
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
478
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
479
+ if featureflags .ServiceUsers .Enabled () {
480
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
481
+ }
464
482
465
483
result , err := downloader .DownloadResources (t .Context ())
466
484
assert .NoError (t , err )
@@ -610,8 +628,10 @@ func TestDownloader_GroupsWithPermissions(t *testing.T) {
610
628
client .EXPECT ().GetPolicyGroupBindings (gomock .Any (), "environment" , "abc12345" ).Return (& accountmanagement.LevelPolicyBindingDto {}, nil )
611
629
612
630
client .EXPECT ().GetUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.UsersDto {}, nil )
613
- // Once temporary featureflags.ServiceUsers is removed, uncomment the following:
614
- //client.EXPECT().GetServiceUsers(gomock.Any(), accountUUID).Return([]accountmanagement.ExternalServiceUserDto{}, nil)
631
+ // Once temporary featureflags.ServiceUsers is removed, remove the following:
632
+ if featureflags .ServiceUsers .Enabled () {
633
+ client .EXPECT ().GetServiceUsers (gomock .Any (), accountUUID ).Return ([]accountmanagement.ExternalServiceUserDto {}, nil )
634
+ }
615
635
616
636
result , err := downloader .DownloadResources (t .Context ())
617
637
assert .NoError (t , err )
0 commit comments