/
osd_keycloak_service_moq.go
860 lines (802 loc) · 35 KB
/
osd_keycloak_service_moq.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package sso
import (
"context"
"github.com/bf2fc6cc711aee1a0c2a/kas-fleet-manager/pkg/api"
"github.com/bf2fc6cc711aee1a0c2a/kas-fleet-manager/pkg/client/keycloak"
"github.com/bf2fc6cc711aee1a0c2a/kas-fleet-manager/pkg/errors"
"sync"
)
// Ensure, that OSDKeycloakServiceMock does implement OSDKeycloakService.
// If this is not the case, regenerate this file with moq.
var _ OSDKeycloakService = &OSDKeycloakServiceMock{}
// OSDKeycloakServiceMock is a mock implementation of OSDKeycloakService.
//
// func TestSomethingThatUsesOSDKeycloakService(t *testing.T) {
//
// // make and configure a mocked OSDKeycloakService
// mockedOSDKeycloakService := &OSDKeycloakServiceMock{
// CreateServiceAccountFunc: func(serviceAccountRequest *api.ServiceAccountRequest, ctx context.Context) (*api.ServiceAccount, *errors.ServiceError) {
// panic("mock out the CreateServiceAccount method")
// },
// CreateServiceAccountInternalFunc: func(request CompleteServiceAccountRequest) (*api.ServiceAccount, *errors.ServiceError) {
// panic("mock out the CreateServiceAccountInternal method")
// },
// DeRegisterClientInSSOFunc: func(kafkaNamespace string) *errors.ServiceError {
// panic("mock out the DeRegisterClientInSSO method")
// },
// DeRegisterConnectorFleetshardOperatorServiceAccountFunc: func(agentClusterId string) *errors.ServiceError {
// panic("mock out the DeRegisterConnectorFleetshardOperatorServiceAccount method")
// },
// DeRegisterKasFleetshardOperatorServiceAccountFunc: func(agentClusterId string) *errors.ServiceError {
// panic("mock out the DeRegisterKasFleetshardOperatorServiceAccount method")
// },
// DeleteServiceAccountFunc: func(ctx context.Context, clientId string) *errors.ServiceError {
// panic("mock out the DeleteServiceAccount method")
// },
// DeleteServiceAccountInternalFunc: func(clientId string) *errors.ServiceError {
// panic("mock out the DeleteServiceAccountInternal method")
// },
// GetConfigFunc: func() *keycloak.KeycloakConfig {
// panic("mock out the GetConfig method")
// },
// GetKafkaClientSecretFunc: func(clientId string) (string, *errors.ServiceError) {
// panic("mock out the GetKafkaClientSecret method")
// },
// GetRealmConfigFunc: func() *keycloak.KeycloakRealmConfig {
// panic("mock out the GetRealmConfig method")
// },
// GetServiceAccountByClientIdFunc: func(ctx context.Context, clientId string) (*api.ServiceAccount, *errors.ServiceError) {
// panic("mock out the GetServiceAccountByClientId method")
// },
// GetServiceAccountByIdFunc: func(ctx context.Context, id string) (*api.ServiceAccount, *errors.ServiceError) {
// panic("mock out the GetServiceAccountById method")
// },
// IsKafkaClientExistFunc: func(clientId string) *errors.ServiceError {
// panic("mock out the IsKafkaClientExist method")
// },
// ListServiceAccFunc: func(ctx context.Context, first int, max int) ([]api.ServiceAccount, *errors.ServiceError) {
// panic("mock out the ListServiceAcc method")
// },
// RegisterClientInSSOFunc: func(clusterId string, clusterOathCallbackURI string) (string, *errors.ServiceError) {
// panic("mock out the RegisterClientInSSO method")
// },
// RegisterConnectorFleetshardOperatorServiceAccountFunc: func(agentClusterId string) (*api.ServiceAccount, *errors.ServiceError) {
// panic("mock out the RegisterConnectorFleetshardOperatorServiceAccount method")
// },
// RegisterKasFleetshardOperatorServiceAccountFunc: func(agentClusterId string) (*api.ServiceAccount, *errors.ServiceError) {
// panic("mock out the RegisterKasFleetshardOperatorServiceAccount method")
// },
// ResetServiceAccountCredentialsFunc: func(ctx context.Context, clientId string) (*api.ServiceAccount, *errors.ServiceError) {
// panic("mock out the ResetServiceAccountCredentials method")
// },
// }
//
// // use mockedOSDKeycloakService in code that requires OSDKeycloakService
// // and then make assertions.
//
// }
type OSDKeycloakServiceMock struct {
// CreateServiceAccountFunc mocks the CreateServiceAccount method.
CreateServiceAccountFunc func(serviceAccountRequest *api.ServiceAccountRequest, ctx context.Context) (*api.ServiceAccount, *errors.ServiceError)
// CreateServiceAccountInternalFunc mocks the CreateServiceAccountInternal method.
CreateServiceAccountInternalFunc func(request CompleteServiceAccountRequest) (*api.ServiceAccount, *errors.ServiceError)
// DeRegisterClientInSSOFunc mocks the DeRegisterClientInSSO method.
DeRegisterClientInSSOFunc func(kafkaNamespace string) *errors.ServiceError
// DeRegisterConnectorFleetshardOperatorServiceAccountFunc mocks the DeRegisterConnectorFleetshardOperatorServiceAccount method.
DeRegisterConnectorFleetshardOperatorServiceAccountFunc func(agentClusterId string) *errors.ServiceError
// DeRegisterKasFleetshardOperatorServiceAccountFunc mocks the DeRegisterKasFleetshardOperatorServiceAccount method.
DeRegisterKasFleetshardOperatorServiceAccountFunc func(agentClusterId string) *errors.ServiceError
// DeleteServiceAccountFunc mocks the DeleteServiceAccount method.
DeleteServiceAccountFunc func(ctx context.Context, clientId string) *errors.ServiceError
// DeleteServiceAccountInternalFunc mocks the DeleteServiceAccountInternal method.
DeleteServiceAccountInternalFunc func(clientId string) *errors.ServiceError
// GetConfigFunc mocks the GetConfig method.
GetConfigFunc func() *keycloak.KeycloakConfig
// GetKafkaClientSecretFunc mocks the GetKafkaClientSecret method.
GetKafkaClientSecretFunc func(clientId string) (string, *errors.ServiceError)
// GetRealmConfigFunc mocks the GetRealmConfig method.
GetRealmConfigFunc func() *keycloak.KeycloakRealmConfig
// GetServiceAccountByClientIdFunc mocks the GetServiceAccountByClientId method.
GetServiceAccountByClientIdFunc func(ctx context.Context, clientId string) (*api.ServiceAccount, *errors.ServiceError)
// GetServiceAccountByIdFunc mocks the GetServiceAccountById method.
GetServiceAccountByIdFunc func(ctx context.Context, id string) (*api.ServiceAccount, *errors.ServiceError)
// IsKafkaClientExistFunc mocks the IsKafkaClientExist method.
IsKafkaClientExistFunc func(clientId string) *errors.ServiceError
// ListServiceAccFunc mocks the ListServiceAcc method.
ListServiceAccFunc func(ctx context.Context, first int, max int) ([]api.ServiceAccount, *errors.ServiceError)
// RegisterClientInSSOFunc mocks the RegisterClientInSSO method.
RegisterClientInSSOFunc func(clusterId string, clusterOathCallbackURI string) (string, *errors.ServiceError)
// RegisterConnectorFleetshardOperatorServiceAccountFunc mocks the RegisterConnectorFleetshardOperatorServiceAccount method.
RegisterConnectorFleetshardOperatorServiceAccountFunc func(agentClusterId string) (*api.ServiceAccount, *errors.ServiceError)
// RegisterKasFleetshardOperatorServiceAccountFunc mocks the RegisterKasFleetshardOperatorServiceAccount method.
RegisterKasFleetshardOperatorServiceAccountFunc func(agentClusterId string) (*api.ServiceAccount, *errors.ServiceError)
// ResetServiceAccountCredentialsFunc mocks the ResetServiceAccountCredentials method.
ResetServiceAccountCredentialsFunc func(ctx context.Context, clientId string) (*api.ServiceAccount, *errors.ServiceError)
// calls tracks calls to the methods.
calls struct {
// CreateServiceAccount holds details about calls to the CreateServiceAccount method.
CreateServiceAccount []struct {
// ServiceAccountRequest is the serviceAccountRequest argument value.
ServiceAccountRequest *api.ServiceAccountRequest
// Ctx is the ctx argument value.
Ctx context.Context
}
// CreateServiceAccountInternal holds details about calls to the CreateServiceAccountInternal method.
CreateServiceAccountInternal []struct {
// Request is the request argument value.
Request CompleteServiceAccountRequest
}
// DeRegisterClientInSSO holds details about calls to the DeRegisterClientInSSO method.
DeRegisterClientInSSO []struct {
// KafkaNamespace is the kafkaNamespace argument value.
KafkaNamespace string
}
// DeRegisterConnectorFleetshardOperatorServiceAccount holds details about calls to the DeRegisterConnectorFleetshardOperatorServiceAccount method.
DeRegisterConnectorFleetshardOperatorServiceAccount []struct {
// AgentClusterId is the agentClusterId argument value.
AgentClusterId string
}
// DeRegisterKasFleetshardOperatorServiceAccount holds details about calls to the DeRegisterKasFleetshardOperatorServiceAccount method.
DeRegisterKasFleetshardOperatorServiceAccount []struct {
// AgentClusterId is the agentClusterId argument value.
AgentClusterId string
}
// DeleteServiceAccount holds details about calls to the DeleteServiceAccount method.
DeleteServiceAccount []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ClientId is the clientId argument value.
ClientId string
}
// DeleteServiceAccountInternal holds details about calls to the DeleteServiceAccountInternal method.
DeleteServiceAccountInternal []struct {
// ClientId is the clientId argument value.
ClientId string
}
// GetConfig holds details about calls to the GetConfig method.
GetConfig []struct {
}
// GetKafkaClientSecret holds details about calls to the GetKafkaClientSecret method.
GetKafkaClientSecret []struct {
// ClientId is the clientId argument value.
ClientId string
}
// GetRealmConfig holds details about calls to the GetRealmConfig method.
GetRealmConfig []struct {
}
// GetServiceAccountByClientId holds details about calls to the GetServiceAccountByClientId method.
GetServiceAccountByClientId []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ClientId is the clientId argument value.
ClientId string
}
// GetServiceAccountById holds details about calls to the GetServiceAccountById method.
GetServiceAccountById []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ID is the id argument value.
ID string
}
// IsKafkaClientExist holds details about calls to the IsKafkaClientExist method.
IsKafkaClientExist []struct {
// ClientId is the clientId argument value.
ClientId string
}
// ListServiceAcc holds details about calls to the ListServiceAcc method.
ListServiceAcc []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// First is the first argument value.
First int
// Max is the max argument value.
Max int
}
// RegisterClientInSSO holds details about calls to the RegisterClientInSSO method.
RegisterClientInSSO []struct {
// ClusterId is the clusterId argument value.
ClusterId string
// ClusterOathCallbackURI is the clusterOathCallbackURI argument value.
ClusterOathCallbackURI string
}
// RegisterConnectorFleetshardOperatorServiceAccount holds details about calls to the RegisterConnectorFleetshardOperatorServiceAccount method.
RegisterConnectorFleetshardOperatorServiceAccount []struct {
// AgentClusterId is the agentClusterId argument value.
AgentClusterId string
}
// RegisterKasFleetshardOperatorServiceAccount holds details about calls to the RegisterKasFleetshardOperatorServiceAccount method.
RegisterKasFleetshardOperatorServiceAccount []struct {
// AgentClusterId is the agentClusterId argument value.
AgentClusterId string
}
// ResetServiceAccountCredentials holds details about calls to the ResetServiceAccountCredentials method.
ResetServiceAccountCredentials []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ClientId is the clientId argument value.
ClientId string
}
}
lockCreateServiceAccount sync.RWMutex
lockCreateServiceAccountInternal sync.RWMutex
lockDeRegisterClientInSSO sync.RWMutex
lockDeRegisterConnectorFleetshardOperatorServiceAccount sync.RWMutex
lockDeRegisterKasFleetshardOperatorServiceAccount sync.RWMutex
lockDeleteServiceAccount sync.RWMutex
lockDeleteServiceAccountInternal sync.RWMutex
lockGetConfig sync.RWMutex
lockGetKafkaClientSecret sync.RWMutex
lockGetRealmConfig sync.RWMutex
lockGetServiceAccountByClientId sync.RWMutex
lockGetServiceAccountById sync.RWMutex
lockIsKafkaClientExist sync.RWMutex
lockListServiceAcc sync.RWMutex
lockRegisterClientInSSO sync.RWMutex
lockRegisterConnectorFleetshardOperatorServiceAccount sync.RWMutex
lockRegisterKasFleetshardOperatorServiceAccount sync.RWMutex
lockResetServiceAccountCredentials sync.RWMutex
}
// CreateServiceAccount calls CreateServiceAccountFunc.
func (mock *OSDKeycloakServiceMock) CreateServiceAccount(serviceAccountRequest *api.ServiceAccountRequest, ctx context.Context) (*api.ServiceAccount, *errors.ServiceError) {
if mock.CreateServiceAccountFunc == nil {
panic("OSDKeycloakServiceMock.CreateServiceAccountFunc: method is nil but OSDKeycloakService.CreateServiceAccount was just called")
}
callInfo := struct {
ServiceAccountRequest *api.ServiceAccountRequest
Ctx context.Context
}{
ServiceAccountRequest: serviceAccountRequest,
Ctx: ctx,
}
mock.lockCreateServiceAccount.Lock()
mock.calls.CreateServiceAccount = append(mock.calls.CreateServiceAccount, callInfo)
mock.lockCreateServiceAccount.Unlock()
return mock.CreateServiceAccountFunc(serviceAccountRequest, ctx)
}
// CreateServiceAccountCalls gets all the calls that were made to CreateServiceAccount.
// Check the length with:
//
// len(mockedOSDKeycloakService.CreateServiceAccountCalls())
func (mock *OSDKeycloakServiceMock) CreateServiceAccountCalls() []struct {
ServiceAccountRequest *api.ServiceAccountRequest
Ctx context.Context
} {
var calls []struct {
ServiceAccountRequest *api.ServiceAccountRequest
Ctx context.Context
}
mock.lockCreateServiceAccount.RLock()
calls = mock.calls.CreateServiceAccount
mock.lockCreateServiceAccount.RUnlock()
return calls
}
// CreateServiceAccountInternal calls CreateServiceAccountInternalFunc.
func (mock *OSDKeycloakServiceMock) CreateServiceAccountInternal(request CompleteServiceAccountRequest) (*api.ServiceAccount, *errors.ServiceError) {
if mock.CreateServiceAccountInternalFunc == nil {
panic("OSDKeycloakServiceMock.CreateServiceAccountInternalFunc: method is nil but OSDKeycloakService.CreateServiceAccountInternal was just called")
}
callInfo := struct {
Request CompleteServiceAccountRequest
}{
Request: request,
}
mock.lockCreateServiceAccountInternal.Lock()
mock.calls.CreateServiceAccountInternal = append(mock.calls.CreateServiceAccountInternal, callInfo)
mock.lockCreateServiceAccountInternal.Unlock()
return mock.CreateServiceAccountInternalFunc(request)
}
// CreateServiceAccountInternalCalls gets all the calls that were made to CreateServiceAccountInternal.
// Check the length with:
//
// len(mockedOSDKeycloakService.CreateServiceAccountInternalCalls())
func (mock *OSDKeycloakServiceMock) CreateServiceAccountInternalCalls() []struct {
Request CompleteServiceAccountRequest
} {
var calls []struct {
Request CompleteServiceAccountRequest
}
mock.lockCreateServiceAccountInternal.RLock()
calls = mock.calls.CreateServiceAccountInternal
mock.lockCreateServiceAccountInternal.RUnlock()
return calls
}
// DeRegisterClientInSSO calls DeRegisterClientInSSOFunc.
func (mock *OSDKeycloakServiceMock) DeRegisterClientInSSO(kafkaNamespace string) *errors.ServiceError {
if mock.DeRegisterClientInSSOFunc == nil {
panic("OSDKeycloakServiceMock.DeRegisterClientInSSOFunc: method is nil but OSDKeycloakService.DeRegisterClientInSSO was just called")
}
callInfo := struct {
KafkaNamespace string
}{
KafkaNamespace: kafkaNamespace,
}
mock.lockDeRegisterClientInSSO.Lock()
mock.calls.DeRegisterClientInSSO = append(mock.calls.DeRegisterClientInSSO, callInfo)
mock.lockDeRegisterClientInSSO.Unlock()
return mock.DeRegisterClientInSSOFunc(kafkaNamespace)
}
// DeRegisterClientInSSOCalls gets all the calls that were made to DeRegisterClientInSSO.
// Check the length with:
//
// len(mockedOSDKeycloakService.DeRegisterClientInSSOCalls())
func (mock *OSDKeycloakServiceMock) DeRegisterClientInSSOCalls() []struct {
KafkaNamespace string
} {
var calls []struct {
KafkaNamespace string
}
mock.lockDeRegisterClientInSSO.RLock()
calls = mock.calls.DeRegisterClientInSSO
mock.lockDeRegisterClientInSSO.RUnlock()
return calls
}
// DeRegisterConnectorFleetshardOperatorServiceAccount calls DeRegisterConnectorFleetshardOperatorServiceAccountFunc.
func (mock *OSDKeycloakServiceMock) DeRegisterConnectorFleetshardOperatorServiceAccount(agentClusterId string) *errors.ServiceError {
if mock.DeRegisterConnectorFleetshardOperatorServiceAccountFunc == nil {
panic("OSDKeycloakServiceMock.DeRegisterConnectorFleetshardOperatorServiceAccountFunc: method is nil but OSDKeycloakService.DeRegisterConnectorFleetshardOperatorServiceAccount was just called")
}
callInfo := struct {
AgentClusterId string
}{
AgentClusterId: agentClusterId,
}
mock.lockDeRegisterConnectorFleetshardOperatorServiceAccount.Lock()
mock.calls.DeRegisterConnectorFleetshardOperatorServiceAccount = append(mock.calls.DeRegisterConnectorFleetshardOperatorServiceAccount, callInfo)
mock.lockDeRegisterConnectorFleetshardOperatorServiceAccount.Unlock()
return mock.DeRegisterConnectorFleetshardOperatorServiceAccountFunc(agentClusterId)
}
// DeRegisterConnectorFleetshardOperatorServiceAccountCalls gets all the calls that were made to DeRegisterConnectorFleetshardOperatorServiceAccount.
// Check the length with:
//
// len(mockedOSDKeycloakService.DeRegisterConnectorFleetshardOperatorServiceAccountCalls())
func (mock *OSDKeycloakServiceMock) DeRegisterConnectorFleetshardOperatorServiceAccountCalls() []struct {
AgentClusterId string
} {
var calls []struct {
AgentClusterId string
}
mock.lockDeRegisterConnectorFleetshardOperatorServiceAccount.RLock()
calls = mock.calls.DeRegisterConnectorFleetshardOperatorServiceAccount
mock.lockDeRegisterConnectorFleetshardOperatorServiceAccount.RUnlock()
return calls
}
// DeRegisterKasFleetshardOperatorServiceAccount calls DeRegisterKasFleetshardOperatorServiceAccountFunc.
func (mock *OSDKeycloakServiceMock) DeRegisterKasFleetshardOperatorServiceAccount(agentClusterId string) *errors.ServiceError {
if mock.DeRegisterKasFleetshardOperatorServiceAccountFunc == nil {
panic("OSDKeycloakServiceMock.DeRegisterKasFleetshardOperatorServiceAccountFunc: method is nil but OSDKeycloakService.DeRegisterKasFleetshardOperatorServiceAccount was just called")
}
callInfo := struct {
AgentClusterId string
}{
AgentClusterId: agentClusterId,
}
mock.lockDeRegisterKasFleetshardOperatorServiceAccount.Lock()
mock.calls.DeRegisterKasFleetshardOperatorServiceAccount = append(mock.calls.DeRegisterKasFleetshardOperatorServiceAccount, callInfo)
mock.lockDeRegisterKasFleetshardOperatorServiceAccount.Unlock()
return mock.DeRegisterKasFleetshardOperatorServiceAccountFunc(agentClusterId)
}
// DeRegisterKasFleetshardOperatorServiceAccountCalls gets all the calls that were made to DeRegisterKasFleetshardOperatorServiceAccount.
// Check the length with:
//
// len(mockedOSDKeycloakService.DeRegisterKasFleetshardOperatorServiceAccountCalls())
func (mock *OSDKeycloakServiceMock) DeRegisterKasFleetshardOperatorServiceAccountCalls() []struct {
AgentClusterId string
} {
var calls []struct {
AgentClusterId string
}
mock.lockDeRegisterKasFleetshardOperatorServiceAccount.RLock()
calls = mock.calls.DeRegisterKasFleetshardOperatorServiceAccount
mock.lockDeRegisterKasFleetshardOperatorServiceAccount.RUnlock()
return calls
}
// DeleteServiceAccount calls DeleteServiceAccountFunc.
func (mock *OSDKeycloakServiceMock) DeleteServiceAccount(ctx context.Context, clientId string) *errors.ServiceError {
if mock.DeleteServiceAccountFunc == nil {
panic("OSDKeycloakServiceMock.DeleteServiceAccountFunc: method is nil but OSDKeycloakService.DeleteServiceAccount was just called")
}
callInfo := struct {
Ctx context.Context
ClientId string
}{
Ctx: ctx,
ClientId: clientId,
}
mock.lockDeleteServiceAccount.Lock()
mock.calls.DeleteServiceAccount = append(mock.calls.DeleteServiceAccount, callInfo)
mock.lockDeleteServiceAccount.Unlock()
return mock.DeleteServiceAccountFunc(ctx, clientId)
}
// DeleteServiceAccountCalls gets all the calls that were made to DeleteServiceAccount.
// Check the length with:
//
// len(mockedOSDKeycloakService.DeleteServiceAccountCalls())
func (mock *OSDKeycloakServiceMock) DeleteServiceAccountCalls() []struct {
Ctx context.Context
ClientId string
} {
var calls []struct {
Ctx context.Context
ClientId string
}
mock.lockDeleteServiceAccount.RLock()
calls = mock.calls.DeleteServiceAccount
mock.lockDeleteServiceAccount.RUnlock()
return calls
}
// DeleteServiceAccountInternal calls DeleteServiceAccountInternalFunc.
func (mock *OSDKeycloakServiceMock) DeleteServiceAccountInternal(clientId string) *errors.ServiceError {
if mock.DeleteServiceAccountInternalFunc == nil {
panic("OSDKeycloakServiceMock.DeleteServiceAccountInternalFunc: method is nil but OSDKeycloakService.DeleteServiceAccountInternal was just called")
}
callInfo := struct {
ClientId string
}{
ClientId: clientId,
}
mock.lockDeleteServiceAccountInternal.Lock()
mock.calls.DeleteServiceAccountInternal = append(mock.calls.DeleteServiceAccountInternal, callInfo)
mock.lockDeleteServiceAccountInternal.Unlock()
return mock.DeleteServiceAccountInternalFunc(clientId)
}
// DeleteServiceAccountInternalCalls gets all the calls that were made to DeleteServiceAccountInternal.
// Check the length with:
//
// len(mockedOSDKeycloakService.DeleteServiceAccountInternalCalls())
func (mock *OSDKeycloakServiceMock) DeleteServiceAccountInternalCalls() []struct {
ClientId string
} {
var calls []struct {
ClientId string
}
mock.lockDeleteServiceAccountInternal.RLock()
calls = mock.calls.DeleteServiceAccountInternal
mock.lockDeleteServiceAccountInternal.RUnlock()
return calls
}
// GetConfig calls GetConfigFunc.
func (mock *OSDKeycloakServiceMock) GetConfig() *keycloak.KeycloakConfig {
if mock.GetConfigFunc == nil {
panic("OSDKeycloakServiceMock.GetConfigFunc: method is nil but OSDKeycloakService.GetConfig was just called")
}
callInfo := struct {
}{}
mock.lockGetConfig.Lock()
mock.calls.GetConfig = append(mock.calls.GetConfig, callInfo)
mock.lockGetConfig.Unlock()
return mock.GetConfigFunc()
}
// GetConfigCalls gets all the calls that were made to GetConfig.
// Check the length with:
//
// len(mockedOSDKeycloakService.GetConfigCalls())
func (mock *OSDKeycloakServiceMock) GetConfigCalls() []struct {
} {
var calls []struct {
}
mock.lockGetConfig.RLock()
calls = mock.calls.GetConfig
mock.lockGetConfig.RUnlock()
return calls
}
// GetKafkaClientSecret calls GetKafkaClientSecretFunc.
func (mock *OSDKeycloakServiceMock) GetKafkaClientSecret(clientId string) (string, *errors.ServiceError) {
if mock.GetKafkaClientSecretFunc == nil {
panic("OSDKeycloakServiceMock.GetKafkaClientSecretFunc: method is nil but OSDKeycloakService.GetKafkaClientSecret was just called")
}
callInfo := struct {
ClientId string
}{
ClientId: clientId,
}
mock.lockGetKafkaClientSecret.Lock()
mock.calls.GetKafkaClientSecret = append(mock.calls.GetKafkaClientSecret, callInfo)
mock.lockGetKafkaClientSecret.Unlock()
return mock.GetKafkaClientSecretFunc(clientId)
}
// GetKafkaClientSecretCalls gets all the calls that were made to GetKafkaClientSecret.
// Check the length with:
//
// len(mockedOSDKeycloakService.GetKafkaClientSecretCalls())
func (mock *OSDKeycloakServiceMock) GetKafkaClientSecretCalls() []struct {
ClientId string
} {
var calls []struct {
ClientId string
}
mock.lockGetKafkaClientSecret.RLock()
calls = mock.calls.GetKafkaClientSecret
mock.lockGetKafkaClientSecret.RUnlock()
return calls
}
// GetRealmConfig calls GetRealmConfigFunc.
func (mock *OSDKeycloakServiceMock) GetRealmConfig() *keycloak.KeycloakRealmConfig {
if mock.GetRealmConfigFunc == nil {
panic("OSDKeycloakServiceMock.GetRealmConfigFunc: method is nil but OSDKeycloakService.GetRealmConfig was just called")
}
callInfo := struct {
}{}
mock.lockGetRealmConfig.Lock()
mock.calls.GetRealmConfig = append(mock.calls.GetRealmConfig, callInfo)
mock.lockGetRealmConfig.Unlock()
return mock.GetRealmConfigFunc()
}
// GetRealmConfigCalls gets all the calls that were made to GetRealmConfig.
// Check the length with:
//
// len(mockedOSDKeycloakService.GetRealmConfigCalls())
func (mock *OSDKeycloakServiceMock) GetRealmConfigCalls() []struct {
} {
var calls []struct {
}
mock.lockGetRealmConfig.RLock()
calls = mock.calls.GetRealmConfig
mock.lockGetRealmConfig.RUnlock()
return calls
}
// GetServiceAccountByClientId calls GetServiceAccountByClientIdFunc.
func (mock *OSDKeycloakServiceMock) GetServiceAccountByClientId(ctx context.Context, clientId string) (*api.ServiceAccount, *errors.ServiceError) {
if mock.GetServiceAccountByClientIdFunc == nil {
panic("OSDKeycloakServiceMock.GetServiceAccountByClientIdFunc: method is nil but OSDKeycloakService.GetServiceAccountByClientId was just called")
}
callInfo := struct {
Ctx context.Context
ClientId string
}{
Ctx: ctx,
ClientId: clientId,
}
mock.lockGetServiceAccountByClientId.Lock()
mock.calls.GetServiceAccountByClientId = append(mock.calls.GetServiceAccountByClientId, callInfo)
mock.lockGetServiceAccountByClientId.Unlock()
return mock.GetServiceAccountByClientIdFunc(ctx, clientId)
}
// GetServiceAccountByClientIdCalls gets all the calls that were made to GetServiceAccountByClientId.
// Check the length with:
//
// len(mockedOSDKeycloakService.GetServiceAccountByClientIdCalls())
func (mock *OSDKeycloakServiceMock) GetServiceAccountByClientIdCalls() []struct {
Ctx context.Context
ClientId string
} {
var calls []struct {
Ctx context.Context
ClientId string
}
mock.lockGetServiceAccountByClientId.RLock()
calls = mock.calls.GetServiceAccountByClientId
mock.lockGetServiceAccountByClientId.RUnlock()
return calls
}
// GetServiceAccountById calls GetServiceAccountByIdFunc.
func (mock *OSDKeycloakServiceMock) GetServiceAccountById(ctx context.Context, id string) (*api.ServiceAccount, *errors.ServiceError) {
if mock.GetServiceAccountByIdFunc == nil {
panic("OSDKeycloakServiceMock.GetServiceAccountByIdFunc: method is nil but OSDKeycloakService.GetServiceAccountById was just called")
}
callInfo := struct {
Ctx context.Context
ID string
}{
Ctx: ctx,
ID: id,
}
mock.lockGetServiceAccountById.Lock()
mock.calls.GetServiceAccountById = append(mock.calls.GetServiceAccountById, callInfo)
mock.lockGetServiceAccountById.Unlock()
return mock.GetServiceAccountByIdFunc(ctx, id)
}
// GetServiceAccountByIdCalls gets all the calls that were made to GetServiceAccountById.
// Check the length with:
//
// len(mockedOSDKeycloakService.GetServiceAccountByIdCalls())
func (mock *OSDKeycloakServiceMock) GetServiceAccountByIdCalls() []struct {
Ctx context.Context
ID string
} {
var calls []struct {
Ctx context.Context
ID string
}
mock.lockGetServiceAccountById.RLock()
calls = mock.calls.GetServiceAccountById
mock.lockGetServiceAccountById.RUnlock()
return calls
}
// IsKafkaClientExist calls IsKafkaClientExistFunc.
func (mock *OSDKeycloakServiceMock) IsKafkaClientExist(clientId string) *errors.ServiceError {
if mock.IsKafkaClientExistFunc == nil {
panic("OSDKeycloakServiceMock.IsKafkaClientExistFunc: method is nil but OSDKeycloakService.IsKafkaClientExist was just called")
}
callInfo := struct {
ClientId string
}{
ClientId: clientId,
}
mock.lockIsKafkaClientExist.Lock()
mock.calls.IsKafkaClientExist = append(mock.calls.IsKafkaClientExist, callInfo)
mock.lockIsKafkaClientExist.Unlock()
return mock.IsKafkaClientExistFunc(clientId)
}
// IsKafkaClientExistCalls gets all the calls that were made to IsKafkaClientExist.
// Check the length with:
//
// len(mockedOSDKeycloakService.IsKafkaClientExistCalls())
func (mock *OSDKeycloakServiceMock) IsKafkaClientExistCalls() []struct {
ClientId string
} {
var calls []struct {
ClientId string
}
mock.lockIsKafkaClientExist.RLock()
calls = mock.calls.IsKafkaClientExist
mock.lockIsKafkaClientExist.RUnlock()
return calls
}
// ListServiceAcc calls ListServiceAccFunc.
func (mock *OSDKeycloakServiceMock) ListServiceAcc(ctx context.Context, first int, max int) ([]api.ServiceAccount, *errors.ServiceError) {
if mock.ListServiceAccFunc == nil {
panic("OSDKeycloakServiceMock.ListServiceAccFunc: method is nil but OSDKeycloakService.ListServiceAcc was just called")
}
callInfo := struct {
Ctx context.Context
First int
Max int
}{
Ctx: ctx,
First: first,
Max: max,
}
mock.lockListServiceAcc.Lock()
mock.calls.ListServiceAcc = append(mock.calls.ListServiceAcc, callInfo)
mock.lockListServiceAcc.Unlock()
return mock.ListServiceAccFunc(ctx, first, max)
}
// ListServiceAccCalls gets all the calls that were made to ListServiceAcc.
// Check the length with:
//
// len(mockedOSDKeycloakService.ListServiceAccCalls())
func (mock *OSDKeycloakServiceMock) ListServiceAccCalls() []struct {
Ctx context.Context
First int
Max int
} {
var calls []struct {
Ctx context.Context
First int
Max int
}
mock.lockListServiceAcc.RLock()
calls = mock.calls.ListServiceAcc
mock.lockListServiceAcc.RUnlock()
return calls
}
// RegisterClientInSSO calls RegisterClientInSSOFunc.
func (mock *OSDKeycloakServiceMock) RegisterClientInSSO(clusterId string, clusterOathCallbackURI string) (string, *errors.ServiceError) {
if mock.RegisterClientInSSOFunc == nil {
panic("OSDKeycloakServiceMock.RegisterClientInSSOFunc: method is nil but OSDKeycloakService.RegisterClientInSSO was just called")
}
callInfo := struct {
ClusterId string
ClusterOathCallbackURI string
}{
ClusterId: clusterId,
ClusterOathCallbackURI: clusterOathCallbackURI,
}
mock.lockRegisterClientInSSO.Lock()
mock.calls.RegisterClientInSSO = append(mock.calls.RegisterClientInSSO, callInfo)
mock.lockRegisterClientInSSO.Unlock()
return mock.RegisterClientInSSOFunc(clusterId, clusterOathCallbackURI)
}
// RegisterClientInSSOCalls gets all the calls that were made to RegisterClientInSSO.
// Check the length with:
//
// len(mockedOSDKeycloakService.RegisterClientInSSOCalls())
func (mock *OSDKeycloakServiceMock) RegisterClientInSSOCalls() []struct {
ClusterId string
ClusterOathCallbackURI string
} {
var calls []struct {
ClusterId string
ClusterOathCallbackURI string
}
mock.lockRegisterClientInSSO.RLock()
calls = mock.calls.RegisterClientInSSO
mock.lockRegisterClientInSSO.RUnlock()
return calls
}
// RegisterConnectorFleetshardOperatorServiceAccount calls RegisterConnectorFleetshardOperatorServiceAccountFunc.
func (mock *OSDKeycloakServiceMock) RegisterConnectorFleetshardOperatorServiceAccount(agentClusterId string) (*api.ServiceAccount, *errors.ServiceError) {
if mock.RegisterConnectorFleetshardOperatorServiceAccountFunc == nil {
panic("OSDKeycloakServiceMock.RegisterConnectorFleetshardOperatorServiceAccountFunc: method is nil but OSDKeycloakService.RegisterConnectorFleetshardOperatorServiceAccount was just called")
}
callInfo := struct {
AgentClusterId string
}{
AgentClusterId: agentClusterId,
}
mock.lockRegisterConnectorFleetshardOperatorServiceAccount.Lock()
mock.calls.RegisterConnectorFleetshardOperatorServiceAccount = append(mock.calls.RegisterConnectorFleetshardOperatorServiceAccount, callInfo)
mock.lockRegisterConnectorFleetshardOperatorServiceAccount.Unlock()
return mock.RegisterConnectorFleetshardOperatorServiceAccountFunc(agentClusterId)
}
// RegisterConnectorFleetshardOperatorServiceAccountCalls gets all the calls that were made to RegisterConnectorFleetshardOperatorServiceAccount.
// Check the length with:
//
// len(mockedOSDKeycloakService.RegisterConnectorFleetshardOperatorServiceAccountCalls())
func (mock *OSDKeycloakServiceMock) RegisterConnectorFleetshardOperatorServiceAccountCalls() []struct {
AgentClusterId string
} {
var calls []struct {
AgentClusterId string
}
mock.lockRegisterConnectorFleetshardOperatorServiceAccount.RLock()
calls = mock.calls.RegisterConnectorFleetshardOperatorServiceAccount
mock.lockRegisterConnectorFleetshardOperatorServiceAccount.RUnlock()
return calls
}
// RegisterKasFleetshardOperatorServiceAccount calls RegisterKasFleetshardOperatorServiceAccountFunc.
func (mock *OSDKeycloakServiceMock) RegisterKasFleetshardOperatorServiceAccount(agentClusterId string) (*api.ServiceAccount, *errors.ServiceError) {
if mock.RegisterKasFleetshardOperatorServiceAccountFunc == nil {
panic("OSDKeycloakServiceMock.RegisterKasFleetshardOperatorServiceAccountFunc: method is nil but OSDKeycloakService.RegisterKasFleetshardOperatorServiceAccount was just called")
}
callInfo := struct {
AgentClusterId string
}{
AgentClusterId: agentClusterId,
}
mock.lockRegisterKasFleetshardOperatorServiceAccount.Lock()
mock.calls.RegisterKasFleetshardOperatorServiceAccount = append(mock.calls.RegisterKasFleetshardOperatorServiceAccount, callInfo)
mock.lockRegisterKasFleetshardOperatorServiceAccount.Unlock()
return mock.RegisterKasFleetshardOperatorServiceAccountFunc(agentClusterId)
}
// RegisterKasFleetshardOperatorServiceAccountCalls gets all the calls that were made to RegisterKasFleetshardOperatorServiceAccount.
// Check the length with:
//
// len(mockedOSDKeycloakService.RegisterKasFleetshardOperatorServiceAccountCalls())
func (mock *OSDKeycloakServiceMock) RegisterKasFleetshardOperatorServiceAccountCalls() []struct {
AgentClusterId string
} {
var calls []struct {
AgentClusterId string
}
mock.lockRegisterKasFleetshardOperatorServiceAccount.RLock()
calls = mock.calls.RegisterKasFleetshardOperatorServiceAccount
mock.lockRegisterKasFleetshardOperatorServiceAccount.RUnlock()
return calls
}
// ResetServiceAccountCredentials calls ResetServiceAccountCredentialsFunc.
func (mock *OSDKeycloakServiceMock) ResetServiceAccountCredentials(ctx context.Context, clientId string) (*api.ServiceAccount, *errors.ServiceError) {
if mock.ResetServiceAccountCredentialsFunc == nil {
panic("OSDKeycloakServiceMock.ResetServiceAccountCredentialsFunc: method is nil but OSDKeycloakService.ResetServiceAccountCredentials was just called")
}
callInfo := struct {
Ctx context.Context
ClientId string
}{
Ctx: ctx,
ClientId: clientId,
}
mock.lockResetServiceAccountCredentials.Lock()
mock.calls.ResetServiceAccountCredentials = append(mock.calls.ResetServiceAccountCredentials, callInfo)
mock.lockResetServiceAccountCredentials.Unlock()
return mock.ResetServiceAccountCredentialsFunc(ctx, clientId)
}
// ResetServiceAccountCredentialsCalls gets all the calls that were made to ResetServiceAccountCredentials.
// Check the length with:
//
// len(mockedOSDKeycloakService.ResetServiceAccountCredentialsCalls())
func (mock *OSDKeycloakServiceMock) ResetServiceAccountCredentialsCalls() []struct {
Ctx context.Context
ClientId string
} {
var calls []struct {
Ctx context.Context
ClientId string
}
mock.lockResetServiceAccountCredentials.RLock()
calls = mock.calls.ResetServiceAccountCredentials
mock.lockResetServiceAccountCredentials.RUnlock()
return calls
}