-
Notifications
You must be signed in to change notification settings - Fork 3
/
clients_mock.go
759 lines (713 loc) · 25.7 KB
/
clients_mock.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
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package handlers
import (
"context"
zebedeeCli "github.com/ONSdigital/dp-api-clients-go/v2/zebedee"
coreModel "github.com/ONSdigital/dp-renderer/v2/model"
searchModels "github.com/ONSdigital/dp-search-api/models"
searchSDK "github.com/ONSdigital/dp-search-api/sdk"
apiError "github.com/ONSdigital/dp-search-api/sdk/errors"
topicModels "github.com/ONSdigital/dp-topic-api/models"
topic "github.com/ONSdigital/dp-topic-api/sdk"
topicError "github.com/ONSdigital/dp-topic-api/sdk/errors"
"io"
"sync"
)
// Ensure, that RenderClientMock does implement RenderClient.
// If this is not the case, regenerate this file with moq.
var _ RenderClient = &RenderClientMock{}
// RenderClientMock is a mock implementation of RenderClient.
//
// func TestSomethingThatUsesRenderClient(t *testing.T) {
//
// // make and configure a mocked RenderClient
// mockedRenderClient := &RenderClientMock{
// BuildPageFunc: func(w io.Writer, pageModel interface{}, templateName string) {
// panic("mock out the BuildPage method")
// },
// NewBasePageModelFunc: func() coreModel.Page {
// panic("mock out the NewBasePageModel method")
// },
// }
//
// // use mockedRenderClient in code that requires RenderClient
// // and then make assertions.
//
// }
type RenderClientMock struct {
// BuildPageFunc mocks the BuildPage method.
BuildPageFunc func(w io.Writer, pageModel interface{}, templateName string)
// NewBasePageModelFunc mocks the NewBasePageModel method.
NewBasePageModelFunc func() coreModel.Page
// calls tracks calls to the methods.
calls struct {
// BuildPage holds details about calls to the BuildPage method.
BuildPage []struct {
// W is the w argument value.
W io.Writer
// PageModel is the pageModel argument value.
PageModel interface{}
// TemplateName is the templateName argument value.
TemplateName string
}
// NewBasePageModel holds details about calls to the NewBasePageModel method.
NewBasePageModel []struct {
}
}
lockBuildPage sync.RWMutex
lockNewBasePageModel sync.RWMutex
}
// BuildPage calls BuildPageFunc.
func (mock *RenderClientMock) BuildPage(w io.Writer, pageModel interface{}, templateName string) {
if mock.BuildPageFunc == nil {
panic("RenderClientMock.BuildPageFunc: method is nil but RenderClient.BuildPage was just called")
}
callInfo := struct {
W io.Writer
PageModel interface{}
TemplateName string
}{
W: w,
PageModel: pageModel,
TemplateName: templateName,
}
mock.lockBuildPage.Lock()
mock.calls.BuildPage = append(mock.calls.BuildPage, callInfo)
mock.lockBuildPage.Unlock()
mock.BuildPageFunc(w, pageModel, templateName)
}
// BuildPageCalls gets all the calls that were made to BuildPage.
// Check the length with:
//
// len(mockedRenderClient.BuildPageCalls())
func (mock *RenderClientMock) BuildPageCalls() []struct {
W io.Writer
PageModel interface{}
TemplateName string
} {
var calls []struct {
W io.Writer
PageModel interface{}
TemplateName string
}
mock.lockBuildPage.RLock()
calls = mock.calls.BuildPage
mock.lockBuildPage.RUnlock()
return calls
}
// NewBasePageModel calls NewBasePageModelFunc.
func (mock *RenderClientMock) NewBasePageModel() coreModel.Page {
if mock.NewBasePageModelFunc == nil {
panic("RenderClientMock.NewBasePageModelFunc: method is nil but RenderClient.NewBasePageModel was just called")
}
callInfo := struct {
}{}
mock.lockNewBasePageModel.Lock()
mock.calls.NewBasePageModel = append(mock.calls.NewBasePageModel, callInfo)
mock.lockNewBasePageModel.Unlock()
return mock.NewBasePageModelFunc()
}
// NewBasePageModelCalls gets all the calls that were made to NewBasePageModel.
// Check the length with:
//
// len(mockedRenderClient.NewBasePageModelCalls())
func (mock *RenderClientMock) NewBasePageModelCalls() []struct {
} {
var calls []struct {
}
mock.lockNewBasePageModel.RLock()
calls = mock.calls.NewBasePageModel
mock.lockNewBasePageModel.RUnlock()
return calls
}
// Ensure, that SearchClientMock does implement SearchClient.
// If this is not the case, regenerate this file with moq.
var _ SearchClient = &SearchClientMock{}
// SearchClientMock is a mock implementation of SearchClient.
//
// func TestSomethingThatUsesSearchClient(t *testing.T) {
//
// // make and configure a mocked SearchClient
// mockedSearchClient := &SearchClientMock{
// GetSearchFunc: func(ctx context.Context, options searchSDK.Options) (*searchModels.SearchResponse, apiError.Error) {
// panic("mock out the GetSearch method")
// },
// }
//
// // use mockedSearchClient in code that requires SearchClient
// // and then make assertions.
//
// }
type SearchClientMock struct {
// GetSearchFunc mocks the GetSearch method.
GetSearchFunc func(ctx context.Context, options searchSDK.Options) (*searchModels.SearchResponse, apiError.Error)
// calls tracks calls to the methods.
calls struct {
// GetSearch holds details about calls to the GetSearch method.
GetSearch []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Options is the options argument value.
Options searchSDK.Options
}
}
lockGetSearch sync.RWMutex
}
// GetSearch calls GetSearchFunc.
func (mock *SearchClientMock) GetSearch(ctx context.Context, options searchSDK.Options) (*searchModels.SearchResponse, apiError.Error) {
if mock.GetSearchFunc == nil {
panic("SearchClientMock.GetSearchFunc: method is nil but SearchClient.GetSearch was just called")
}
callInfo := struct {
Ctx context.Context
Options searchSDK.Options
}{
Ctx: ctx,
Options: options,
}
mock.lockGetSearch.Lock()
mock.calls.GetSearch = append(mock.calls.GetSearch, callInfo)
mock.lockGetSearch.Unlock()
return mock.GetSearchFunc(ctx, options)
}
// GetSearchCalls gets all the calls that were made to GetSearch.
// Check the length with:
//
// len(mockedSearchClient.GetSearchCalls())
func (mock *SearchClientMock) GetSearchCalls() []struct {
Ctx context.Context
Options searchSDK.Options
} {
var calls []struct {
Ctx context.Context
Options searchSDK.Options
}
mock.lockGetSearch.RLock()
calls = mock.calls.GetSearch
mock.lockGetSearch.RUnlock()
return calls
}
// Ensure, that ZebedeeClientMock does implement ZebedeeClient.
// If this is not the case, regenerate this file with moq.
var _ ZebedeeClient = &ZebedeeClientMock{}
// ZebedeeClientMock is a mock implementation of ZebedeeClient.
//
// func TestSomethingThatUsesZebedeeClient(t *testing.T) {
//
// // make and configure a mocked ZebedeeClient
// mockedZebedeeClient := &ZebedeeClientMock{
// GetHomepageContentFunc: func(ctx context.Context, userAuthToken string, collectionID string, lang string, path string) (zebedeeCli.HomepageContent, error) {
// panic("mock out the GetHomepageContent method")
// },
// }
//
// // use mockedZebedeeClient in code that requires ZebedeeClient
// // and then make assertions.
//
// }
type ZebedeeClientMock struct {
// GetHomepageContentFunc mocks the GetHomepageContent method.
GetHomepageContentFunc func(ctx context.Context, userAuthToken string, collectionID string, lang string, path string) (zebedeeCli.HomepageContent, error)
// calls tracks calls to the methods.
calls struct {
// GetHomepageContent holds details about calls to the GetHomepageContent method.
GetHomepageContent []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// UserAuthToken is the userAuthToken argument value.
UserAuthToken string
// CollectionID is the collectionID argument value.
CollectionID string
// Lang is the lang argument value.
Lang string
// Path is the path argument value.
Path string
}
}
lockGetHomepageContent sync.RWMutex
}
// GetHomepageContent calls GetHomepageContentFunc.
func (mock *ZebedeeClientMock) GetHomepageContent(ctx context.Context, userAuthToken string, collectionID string, lang string, path string) (zebedeeCli.HomepageContent, error) {
if mock.GetHomepageContentFunc == nil {
panic("ZebedeeClientMock.GetHomepageContentFunc: method is nil but ZebedeeClient.GetHomepageContent was just called")
}
callInfo := struct {
Ctx context.Context
UserAuthToken string
CollectionID string
Lang string
Path string
}{
Ctx: ctx,
UserAuthToken: userAuthToken,
CollectionID: collectionID,
Lang: lang,
Path: path,
}
mock.lockGetHomepageContent.Lock()
mock.calls.GetHomepageContent = append(mock.calls.GetHomepageContent, callInfo)
mock.lockGetHomepageContent.Unlock()
return mock.GetHomepageContentFunc(ctx, userAuthToken, collectionID, lang, path)
}
// GetHomepageContentCalls gets all the calls that were made to GetHomepageContent.
// Check the length with:
//
// len(mockedZebedeeClient.GetHomepageContentCalls())
func (mock *ZebedeeClientMock) GetHomepageContentCalls() []struct {
Ctx context.Context
UserAuthToken string
CollectionID string
Lang string
Path string
} {
var calls []struct {
Ctx context.Context
UserAuthToken string
CollectionID string
Lang string
Path string
}
mock.lockGetHomepageContent.RLock()
calls = mock.calls.GetHomepageContent
mock.lockGetHomepageContent.RUnlock()
return calls
}
// Ensure, that TopicClientMock does implement TopicClient.
// If this is not the case, regenerate this file with moq.
var _ TopicClient = &TopicClientMock{}
// TopicClientMock is a mock implementation of TopicClient.
//
// func TestSomethingThatUsesTopicClient(t *testing.T) {
//
// // make and configure a mocked TopicClient
// mockedTopicClient := &TopicClientMock{
// GetNavigationPublicFunc: func(ctx context.Context, reqHeaders topic.Headers, options topic.Options) (*topicModels.Navigation, topicError.Error) {
// panic("mock out the GetNavigationPublic method")
// },
// GetRootTopicsPrivateFunc: func(ctx context.Context, reqHeaders topic.Headers) (*topicModels.PrivateSubtopics, topicError.Error) {
// panic("mock out the GetRootTopicsPrivate method")
// },
// GetRootTopicsPublicFunc: func(ctx context.Context, reqHeaders topic.Headers) (*topicModels.PublicSubtopics, topicError.Error) {
// panic("mock out the GetRootTopicsPublic method")
// },
// GetSubtopicsPrivateFunc: func(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.PrivateSubtopics, topicError.Error) {
// panic("mock out the GetSubtopicsPrivate method")
// },
// GetSubtopicsPublicFunc: func(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.PublicSubtopics, topicError.Error) {
// panic("mock out the GetSubtopicsPublic method")
// },
// GetTopicPrivateFunc: func(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.TopicResponse, topicError.Error) {
// panic("mock out the GetTopicPrivate method")
// },
// GetTopicPublicFunc: func(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.Topic, topicError.Error) {
// panic("mock out the GetTopicPublic method")
// },
// PutTopicReleasePrivateFunc: func(ctx context.Context, reqHeaders topic.Headers, id string, topicRelease []byte) (*topic.ResponseInfo, topicError.Error) {
// panic("mock out the PutTopicReleasePrivate method")
// },
// }
//
// // use mockedTopicClient in code that requires TopicClient
// // and then make assertions.
//
// }
type TopicClientMock struct {
// GetNavigationPublicFunc mocks the GetNavigationPublic method.
GetNavigationPublicFunc func(ctx context.Context, reqHeaders topic.Headers, options topic.Options) (*topicModels.Navigation, topicError.Error)
// GetRootTopicsPrivateFunc mocks the GetRootTopicsPrivate method.
GetRootTopicsPrivateFunc func(ctx context.Context, reqHeaders topic.Headers) (*topicModels.PrivateSubtopics, topicError.Error)
// GetRootTopicsPublicFunc mocks the GetRootTopicsPublic method.
GetRootTopicsPublicFunc func(ctx context.Context, reqHeaders topic.Headers) (*topicModels.PublicSubtopics, topicError.Error)
// GetSubtopicsPrivateFunc mocks the GetSubtopicsPrivate method.
GetSubtopicsPrivateFunc func(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.PrivateSubtopics, topicError.Error)
// GetSubtopicsPublicFunc mocks the GetSubtopicsPublic method.
GetSubtopicsPublicFunc func(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.PublicSubtopics, topicError.Error)
// GetTopicPrivateFunc mocks the GetTopicPrivate method.
GetTopicPrivateFunc func(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.TopicResponse, topicError.Error)
// GetTopicPublicFunc mocks the GetTopicPublic method.
GetTopicPublicFunc func(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.Topic, topicError.Error)
// PutTopicReleasePrivateFunc mocks the PutTopicReleasePrivate method.
PutTopicReleasePrivateFunc func(ctx context.Context, reqHeaders topic.Headers, id string, topicRelease []byte) (*topic.ResponseInfo, topicError.Error)
// calls tracks calls to the methods.
calls struct {
// GetNavigationPublic holds details about calls to the GetNavigationPublic method.
GetNavigationPublic []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ReqHeaders is the reqHeaders argument value.
ReqHeaders topic.Headers
// Options is the options argument value.
Options topic.Options
}
// GetRootTopicsPrivate holds details about calls to the GetRootTopicsPrivate method.
GetRootTopicsPrivate []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ReqHeaders is the reqHeaders argument value.
ReqHeaders topic.Headers
}
// GetRootTopicsPublic holds details about calls to the GetRootTopicsPublic method.
GetRootTopicsPublic []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ReqHeaders is the reqHeaders argument value.
ReqHeaders topic.Headers
}
// GetSubtopicsPrivate holds details about calls to the GetSubtopicsPrivate method.
GetSubtopicsPrivate []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ReqHeaders is the reqHeaders argument value.
ReqHeaders topic.Headers
// ID is the id argument value.
ID string
}
// GetSubtopicsPublic holds details about calls to the GetSubtopicsPublic method.
GetSubtopicsPublic []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ReqHeaders is the reqHeaders argument value.
ReqHeaders topic.Headers
// ID is the id argument value.
ID string
}
// GetTopicPrivate holds details about calls to the GetTopicPrivate method.
GetTopicPrivate []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ReqHeaders is the reqHeaders argument value.
ReqHeaders topic.Headers
// ID is the id argument value.
ID string
}
// GetTopicPublic holds details about calls to the GetTopicPublic method.
GetTopicPublic []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ReqHeaders is the reqHeaders argument value.
ReqHeaders topic.Headers
// ID is the id argument value.
ID string
}
// PutTopicReleasePrivate holds details about calls to the PutTopicReleasePrivate method.
PutTopicReleasePrivate []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// ReqHeaders is the reqHeaders argument value.
ReqHeaders topic.Headers
// ID is the id argument value.
ID string
// TopicRelease is the topicRelease argument value.
TopicRelease []byte
}
}
lockGetNavigationPublic sync.RWMutex
lockGetRootTopicsPrivate sync.RWMutex
lockGetRootTopicsPublic sync.RWMutex
lockGetSubtopicsPrivate sync.RWMutex
lockGetSubtopicsPublic sync.RWMutex
lockGetTopicPrivate sync.RWMutex
lockGetTopicPublic sync.RWMutex
lockPutTopicReleasePrivate sync.RWMutex
}
// GetNavigationPublic calls GetNavigationPublicFunc.
func (mock *TopicClientMock) GetNavigationPublic(ctx context.Context, reqHeaders topic.Headers, options topic.Options) (*topicModels.Navigation, topicError.Error) {
if mock.GetNavigationPublicFunc == nil {
panic("TopicClientMock.GetNavigationPublicFunc: method is nil but TopicClient.GetNavigationPublic was just called")
}
callInfo := struct {
Ctx context.Context
ReqHeaders topic.Headers
Options topic.Options
}{
Ctx: ctx,
ReqHeaders: reqHeaders,
Options: options,
}
mock.lockGetNavigationPublic.Lock()
mock.calls.GetNavigationPublic = append(mock.calls.GetNavigationPublic, callInfo)
mock.lockGetNavigationPublic.Unlock()
return mock.GetNavigationPublicFunc(ctx, reqHeaders, options)
}
// GetNavigationPublicCalls gets all the calls that were made to GetNavigationPublic.
// Check the length with:
//
// len(mockedTopicClient.GetNavigationPublicCalls())
func (mock *TopicClientMock) GetNavigationPublicCalls() []struct {
Ctx context.Context
ReqHeaders topic.Headers
Options topic.Options
} {
var calls []struct {
Ctx context.Context
ReqHeaders topic.Headers
Options topic.Options
}
mock.lockGetNavigationPublic.RLock()
calls = mock.calls.GetNavigationPublic
mock.lockGetNavigationPublic.RUnlock()
return calls
}
// GetRootTopicsPrivate calls GetRootTopicsPrivateFunc.
func (mock *TopicClientMock) GetRootTopicsPrivate(ctx context.Context, reqHeaders topic.Headers) (*topicModels.PrivateSubtopics, topicError.Error) {
if mock.GetRootTopicsPrivateFunc == nil {
panic("TopicClientMock.GetRootTopicsPrivateFunc: method is nil but TopicClient.GetRootTopicsPrivate was just called")
}
callInfo := struct {
Ctx context.Context
ReqHeaders topic.Headers
}{
Ctx: ctx,
ReqHeaders: reqHeaders,
}
mock.lockGetRootTopicsPrivate.Lock()
mock.calls.GetRootTopicsPrivate = append(mock.calls.GetRootTopicsPrivate, callInfo)
mock.lockGetRootTopicsPrivate.Unlock()
return mock.GetRootTopicsPrivateFunc(ctx, reqHeaders)
}
// GetRootTopicsPrivateCalls gets all the calls that were made to GetRootTopicsPrivate.
// Check the length with:
//
// len(mockedTopicClient.GetRootTopicsPrivateCalls())
func (mock *TopicClientMock) GetRootTopicsPrivateCalls() []struct {
Ctx context.Context
ReqHeaders topic.Headers
} {
var calls []struct {
Ctx context.Context
ReqHeaders topic.Headers
}
mock.lockGetRootTopicsPrivate.RLock()
calls = mock.calls.GetRootTopicsPrivate
mock.lockGetRootTopicsPrivate.RUnlock()
return calls
}
// GetRootTopicsPublic calls GetRootTopicsPublicFunc.
func (mock *TopicClientMock) GetRootTopicsPublic(ctx context.Context, reqHeaders topic.Headers) (*topicModels.PublicSubtopics, topicError.Error) {
if mock.GetRootTopicsPublicFunc == nil {
panic("TopicClientMock.GetRootTopicsPublicFunc: method is nil but TopicClient.GetRootTopicsPublic was just called")
}
callInfo := struct {
Ctx context.Context
ReqHeaders topic.Headers
}{
Ctx: ctx,
ReqHeaders: reqHeaders,
}
mock.lockGetRootTopicsPublic.Lock()
mock.calls.GetRootTopicsPublic = append(mock.calls.GetRootTopicsPublic, callInfo)
mock.lockGetRootTopicsPublic.Unlock()
return mock.GetRootTopicsPublicFunc(ctx, reqHeaders)
}
// GetRootTopicsPublicCalls gets all the calls that were made to GetRootTopicsPublic.
// Check the length with:
//
// len(mockedTopicClient.GetRootTopicsPublicCalls())
func (mock *TopicClientMock) GetRootTopicsPublicCalls() []struct {
Ctx context.Context
ReqHeaders topic.Headers
} {
var calls []struct {
Ctx context.Context
ReqHeaders topic.Headers
}
mock.lockGetRootTopicsPublic.RLock()
calls = mock.calls.GetRootTopicsPublic
mock.lockGetRootTopicsPublic.RUnlock()
return calls
}
// GetSubtopicsPrivate calls GetSubtopicsPrivateFunc.
func (mock *TopicClientMock) GetSubtopicsPrivate(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.PrivateSubtopics, topicError.Error) {
if mock.GetSubtopicsPrivateFunc == nil {
panic("TopicClientMock.GetSubtopicsPrivateFunc: method is nil but TopicClient.GetSubtopicsPrivate was just called")
}
callInfo := struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
}{
Ctx: ctx,
ReqHeaders: reqHeaders,
ID: id,
}
mock.lockGetSubtopicsPrivate.Lock()
mock.calls.GetSubtopicsPrivate = append(mock.calls.GetSubtopicsPrivate, callInfo)
mock.lockGetSubtopicsPrivate.Unlock()
return mock.GetSubtopicsPrivateFunc(ctx, reqHeaders, id)
}
// GetSubtopicsPrivateCalls gets all the calls that were made to GetSubtopicsPrivate.
// Check the length with:
//
// len(mockedTopicClient.GetSubtopicsPrivateCalls())
func (mock *TopicClientMock) GetSubtopicsPrivateCalls() []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
} {
var calls []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
}
mock.lockGetSubtopicsPrivate.RLock()
calls = mock.calls.GetSubtopicsPrivate
mock.lockGetSubtopicsPrivate.RUnlock()
return calls
}
// GetSubtopicsPublic calls GetSubtopicsPublicFunc.
func (mock *TopicClientMock) GetSubtopicsPublic(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.PublicSubtopics, topicError.Error) {
if mock.GetSubtopicsPublicFunc == nil {
panic("TopicClientMock.GetSubtopicsPublicFunc: method is nil but TopicClient.GetSubtopicsPublic was just called")
}
callInfo := struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
}{
Ctx: ctx,
ReqHeaders: reqHeaders,
ID: id,
}
mock.lockGetSubtopicsPublic.Lock()
mock.calls.GetSubtopicsPublic = append(mock.calls.GetSubtopicsPublic, callInfo)
mock.lockGetSubtopicsPublic.Unlock()
return mock.GetSubtopicsPublicFunc(ctx, reqHeaders, id)
}
// GetSubtopicsPublicCalls gets all the calls that were made to GetSubtopicsPublic.
// Check the length with:
//
// len(mockedTopicClient.GetSubtopicsPublicCalls())
func (mock *TopicClientMock) GetSubtopicsPublicCalls() []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
} {
var calls []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
}
mock.lockGetSubtopicsPublic.RLock()
calls = mock.calls.GetSubtopicsPublic
mock.lockGetSubtopicsPublic.RUnlock()
return calls
}
// GetTopicPrivate calls GetTopicPrivateFunc.
func (mock *TopicClientMock) GetTopicPrivate(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.TopicResponse, topicError.Error) {
if mock.GetTopicPrivateFunc == nil {
panic("TopicClientMock.GetTopicPrivateFunc: method is nil but TopicClient.GetTopicPrivate was just called")
}
callInfo := struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
}{
Ctx: ctx,
ReqHeaders: reqHeaders,
ID: id,
}
mock.lockGetTopicPrivate.Lock()
mock.calls.GetTopicPrivate = append(mock.calls.GetTopicPrivate, callInfo)
mock.lockGetTopicPrivate.Unlock()
return mock.GetTopicPrivateFunc(ctx, reqHeaders, id)
}
// GetTopicPrivateCalls gets all the calls that were made to GetTopicPrivate.
// Check the length with:
//
// len(mockedTopicClient.GetTopicPrivateCalls())
func (mock *TopicClientMock) GetTopicPrivateCalls() []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
} {
var calls []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
}
mock.lockGetTopicPrivate.RLock()
calls = mock.calls.GetTopicPrivate
mock.lockGetTopicPrivate.RUnlock()
return calls
}
// GetTopicPublic calls GetTopicPublicFunc.
func (mock *TopicClientMock) GetTopicPublic(ctx context.Context, reqHeaders topic.Headers, id string) (*topicModels.Topic, topicError.Error) {
if mock.GetTopicPublicFunc == nil {
panic("TopicClientMock.GetTopicPublicFunc: method is nil but TopicClient.GetTopicPublic was just called")
}
callInfo := struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
}{
Ctx: ctx,
ReqHeaders: reqHeaders,
ID: id,
}
mock.lockGetTopicPublic.Lock()
mock.calls.GetTopicPublic = append(mock.calls.GetTopicPublic, callInfo)
mock.lockGetTopicPublic.Unlock()
return mock.GetTopicPublicFunc(ctx, reqHeaders, id)
}
// GetTopicPublicCalls gets all the calls that were made to GetTopicPublic.
// Check the length with:
//
// len(mockedTopicClient.GetTopicPublicCalls())
func (mock *TopicClientMock) GetTopicPublicCalls() []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
} {
var calls []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
}
mock.lockGetTopicPublic.RLock()
calls = mock.calls.GetTopicPublic
mock.lockGetTopicPublic.RUnlock()
return calls
}
// PutTopicReleasePrivate calls PutTopicReleasePrivateFunc.
func (mock *TopicClientMock) PutTopicReleasePrivate(ctx context.Context, reqHeaders topic.Headers, id string, topicRelease []byte) (*topic.ResponseInfo, topicError.Error) {
if mock.PutTopicReleasePrivateFunc == nil {
panic("TopicClientMock.PutTopicReleasePrivateFunc: method is nil but TopicClient.PutTopicReleasePrivate was just called")
}
callInfo := struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
TopicRelease []byte
}{
Ctx: ctx,
ReqHeaders: reqHeaders,
ID: id,
TopicRelease: topicRelease,
}
mock.lockPutTopicReleasePrivate.Lock()
mock.calls.PutTopicReleasePrivate = append(mock.calls.PutTopicReleasePrivate, callInfo)
mock.lockPutTopicReleasePrivate.Unlock()
return mock.PutTopicReleasePrivateFunc(ctx, reqHeaders, id, topicRelease)
}
// PutTopicReleasePrivateCalls gets all the calls that were made to PutTopicReleasePrivate.
// Check the length with:
//
// len(mockedTopicClient.PutTopicReleasePrivateCalls())
func (mock *TopicClientMock) PutTopicReleasePrivateCalls() []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
TopicRelease []byte
} {
var calls []struct {
Ctx context.Context
ReqHeaders topic.Headers
ID string
TopicRelease []byte
}
mock.lockPutTopicReleasePrivate.RLock()
calls = mock.calls.PutTopicReleasePrivate
mock.lockPutTopicReleasePrivate.RUnlock()
return calls
}