-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoutput_patchable_values_collector_mock.go
More file actions
2872 lines (2322 loc) · 121 KB
/
output_patchable_values_collector_mock.go
File metadata and controls
2872 lines (2322 loc) · 121 KB
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
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by http://github.com/gojuno/minimock (v3.4.7). DO NOT EDIT.
package mock
//go:generate minimock -i github.com/deckhouse/module-sdk/pkg.OutputPatchableValuesCollector -o output_patchable_values_collector_mock.go -n OutputPatchableValuesCollectorMock -p mock
import (
"io"
"sync"
mm_atomic "sync/atomic"
mm_time "time"
"github.com/deckhouse/module-sdk/pkg/utils"
"github.com/gojuno/minimock/v3"
"github.com/tidwall/gjson"
)
// OutputPatchableValuesCollectorMock implements mm_pkg.OutputPatchableValuesCollector
type OutputPatchableValuesCollectorMock struct {
t minimock.Tester
finishOnce sync.Once
funcArrayCount func(path string) (i1 int, err error)
funcArrayCountOrigin string
inspectFuncArrayCount func(path string)
afterArrayCountCounter uint64
beforeArrayCountCounter uint64
ArrayCountMock mOutputPatchableValuesCollectorMockArrayCount
funcExists func(path string) (b1 bool)
funcExistsOrigin string
inspectFuncExists func(path string)
afterExistsCounter uint64
beforeExistsCounter uint64
ExistsMock mOutputPatchableValuesCollectorMockExists
funcGet func(path string) (r1 gjson.Result)
funcGetOrigin string
inspectFuncGet func(path string)
afterGetCounter uint64
beforeGetCounter uint64
GetMock mOutputPatchableValuesCollectorMockGet
funcGetOk func(path string) (r1 gjson.Result, b1 bool)
funcGetOkOrigin string
inspectFuncGetOk func(path string)
afterGetOkCounter uint64
beforeGetOkCounter uint64
GetOkMock mOutputPatchableValuesCollectorMockGetOk
funcGetPatches func() (vpa1 []*utils.ValuesPatchOperation)
funcGetPatchesOrigin string
inspectFuncGetPatches func()
afterGetPatchesCounter uint64
beforeGetPatchesCounter uint64
GetPatchesMock mOutputPatchableValuesCollectorMockGetPatches
funcGetRaw func(path string) (a1 any)
funcGetRawOrigin string
inspectFuncGetRaw func(path string)
afterGetRawCounter uint64
beforeGetRawCounter uint64
GetRawMock mOutputPatchableValuesCollectorMockGetRaw
funcRemove func(path string)
funcRemoveOrigin string
inspectFuncRemove func(path string)
afterRemoveCounter uint64
beforeRemoveCounter uint64
RemoveMock mOutputPatchableValuesCollectorMockRemove
funcSet func(path string, value any)
funcSetOrigin string
inspectFuncSet func(path string, value any)
afterSetCounter uint64
beforeSetCounter uint64
SetMock mOutputPatchableValuesCollectorMockSet
funcWriteOutput func(writer io.Writer) (err error)
funcWriteOutputOrigin string
inspectFuncWriteOutput func(writer io.Writer)
afterWriteOutputCounter uint64
beforeWriteOutputCounter uint64
WriteOutputMock mOutputPatchableValuesCollectorMockWriteOutput
}
// NewOutputPatchableValuesCollectorMock returns a mock for mm_pkg.OutputPatchableValuesCollector
func NewOutputPatchableValuesCollectorMock(t minimock.Tester) *OutputPatchableValuesCollectorMock {
m := &OutputPatchableValuesCollectorMock{t: t}
if controller, ok := t.(minimock.MockController); ok {
controller.RegisterMocker(m)
}
m.ArrayCountMock = mOutputPatchableValuesCollectorMockArrayCount{mock: m}
m.ArrayCountMock.callArgs = []*OutputPatchableValuesCollectorMockArrayCountParams{}
m.ExistsMock = mOutputPatchableValuesCollectorMockExists{mock: m}
m.ExistsMock.callArgs = []*OutputPatchableValuesCollectorMockExistsParams{}
m.GetMock = mOutputPatchableValuesCollectorMockGet{mock: m}
m.GetMock.callArgs = []*OutputPatchableValuesCollectorMockGetParams{}
m.GetOkMock = mOutputPatchableValuesCollectorMockGetOk{mock: m}
m.GetOkMock.callArgs = []*OutputPatchableValuesCollectorMockGetOkParams{}
m.GetPatchesMock = mOutputPatchableValuesCollectorMockGetPatches{mock: m}
m.GetRawMock = mOutputPatchableValuesCollectorMockGetRaw{mock: m}
m.GetRawMock.callArgs = []*OutputPatchableValuesCollectorMockGetRawParams{}
m.RemoveMock = mOutputPatchableValuesCollectorMockRemove{mock: m}
m.RemoveMock.callArgs = []*OutputPatchableValuesCollectorMockRemoveParams{}
m.SetMock = mOutputPatchableValuesCollectorMockSet{mock: m}
m.SetMock.callArgs = []*OutputPatchableValuesCollectorMockSetParams{}
m.WriteOutputMock = mOutputPatchableValuesCollectorMockWriteOutput{mock: m}
m.WriteOutputMock.callArgs = []*OutputPatchableValuesCollectorMockWriteOutputParams{}
t.Cleanup(m.MinimockFinish)
return m
}
type mOutputPatchableValuesCollectorMockArrayCount struct {
optional bool
mock *OutputPatchableValuesCollectorMock
defaultExpectation *OutputPatchableValuesCollectorMockArrayCountExpectation
expectations []*OutputPatchableValuesCollectorMockArrayCountExpectation
callArgs []*OutputPatchableValuesCollectorMockArrayCountParams
mutex sync.RWMutex
expectedInvocations uint64
expectedInvocationsOrigin string
}
// OutputPatchableValuesCollectorMockArrayCountExpectation specifies expectation struct of the OutputPatchableValuesCollector.ArrayCount
type OutputPatchableValuesCollectorMockArrayCountExpectation struct {
mock *OutputPatchableValuesCollectorMock
params *OutputPatchableValuesCollectorMockArrayCountParams
paramPtrs *OutputPatchableValuesCollectorMockArrayCountParamPtrs
expectationOrigins OutputPatchableValuesCollectorMockArrayCountExpectationOrigins
results *OutputPatchableValuesCollectorMockArrayCountResults
returnOrigin string
Counter uint64
}
// OutputPatchableValuesCollectorMockArrayCountParams contains parameters of the OutputPatchableValuesCollector.ArrayCount
type OutputPatchableValuesCollectorMockArrayCountParams struct {
path string
}
// OutputPatchableValuesCollectorMockArrayCountParamPtrs contains pointers to parameters of the OutputPatchableValuesCollector.ArrayCount
type OutputPatchableValuesCollectorMockArrayCountParamPtrs struct {
path *string
}
// OutputPatchableValuesCollectorMockArrayCountResults contains results of the OutputPatchableValuesCollector.ArrayCount
type OutputPatchableValuesCollectorMockArrayCountResults struct {
i1 int
err error
}
// OutputPatchableValuesCollectorMockArrayCountOrigins contains origins of expectations of the OutputPatchableValuesCollector.ArrayCount
type OutputPatchableValuesCollectorMockArrayCountExpectationOrigins struct {
origin string
originPath string
}
// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning
// the test will fail minimock's automatic final call check if the mocked method was not called at least once.
// Optional() makes method check to work in '0 or more' mode.
// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to
// catch the problems when the expected method call is totally skipped during test run.
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) Optional() *mOutputPatchableValuesCollectorMockArrayCount {
mmArrayCount.optional = true
return mmArrayCount
}
// Expect sets up expected params for OutputPatchableValuesCollector.ArrayCount
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) Expect(path string) *mOutputPatchableValuesCollectorMockArrayCount {
if mmArrayCount.mock.funcArrayCount != nil {
mmArrayCount.mock.t.Fatalf("OutputPatchableValuesCollectorMock.ArrayCount mock is already set by Set")
}
if mmArrayCount.defaultExpectation == nil {
mmArrayCount.defaultExpectation = &OutputPatchableValuesCollectorMockArrayCountExpectation{}
}
if mmArrayCount.defaultExpectation.paramPtrs != nil {
mmArrayCount.mock.t.Fatalf("OutputPatchableValuesCollectorMock.ArrayCount mock is already set by ExpectParams functions")
}
mmArrayCount.defaultExpectation.params = &OutputPatchableValuesCollectorMockArrayCountParams{path}
mmArrayCount.defaultExpectation.expectationOrigins.origin = minimock.CallerInfo(1)
for _, e := range mmArrayCount.expectations {
if minimock.Equal(e.params, mmArrayCount.defaultExpectation.params) {
mmArrayCount.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmArrayCount.defaultExpectation.params)
}
}
return mmArrayCount
}
// ExpectPathParam1 sets up expected param path for OutputPatchableValuesCollector.ArrayCount
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) ExpectPathParam1(path string) *mOutputPatchableValuesCollectorMockArrayCount {
if mmArrayCount.mock.funcArrayCount != nil {
mmArrayCount.mock.t.Fatalf("OutputPatchableValuesCollectorMock.ArrayCount mock is already set by Set")
}
if mmArrayCount.defaultExpectation == nil {
mmArrayCount.defaultExpectation = &OutputPatchableValuesCollectorMockArrayCountExpectation{}
}
if mmArrayCount.defaultExpectation.params != nil {
mmArrayCount.mock.t.Fatalf("OutputPatchableValuesCollectorMock.ArrayCount mock is already set by Expect")
}
if mmArrayCount.defaultExpectation.paramPtrs == nil {
mmArrayCount.defaultExpectation.paramPtrs = &OutputPatchableValuesCollectorMockArrayCountParamPtrs{}
}
mmArrayCount.defaultExpectation.paramPtrs.path = &path
mmArrayCount.defaultExpectation.expectationOrigins.originPath = minimock.CallerInfo(1)
return mmArrayCount
}
// Inspect accepts an inspector function that has same arguments as the OutputPatchableValuesCollector.ArrayCount
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) Inspect(f func(path string)) *mOutputPatchableValuesCollectorMockArrayCount {
if mmArrayCount.mock.inspectFuncArrayCount != nil {
mmArrayCount.mock.t.Fatalf("Inspect function is already set for OutputPatchableValuesCollectorMock.ArrayCount")
}
mmArrayCount.mock.inspectFuncArrayCount = f
return mmArrayCount
}
// Return sets up results that will be returned by OutputPatchableValuesCollector.ArrayCount
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) Return(i1 int, err error) *OutputPatchableValuesCollectorMock {
if mmArrayCount.mock.funcArrayCount != nil {
mmArrayCount.mock.t.Fatalf("OutputPatchableValuesCollectorMock.ArrayCount mock is already set by Set")
}
if mmArrayCount.defaultExpectation == nil {
mmArrayCount.defaultExpectation = &OutputPatchableValuesCollectorMockArrayCountExpectation{mock: mmArrayCount.mock}
}
mmArrayCount.defaultExpectation.results = &OutputPatchableValuesCollectorMockArrayCountResults{i1, err}
mmArrayCount.defaultExpectation.returnOrigin = minimock.CallerInfo(1)
return mmArrayCount.mock
}
// Set uses given function f to mock the OutputPatchableValuesCollector.ArrayCount method
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) Set(f func(path string) (i1 int, err error)) *OutputPatchableValuesCollectorMock {
if mmArrayCount.defaultExpectation != nil {
mmArrayCount.mock.t.Fatalf("Default expectation is already set for the OutputPatchableValuesCollector.ArrayCount method")
}
if len(mmArrayCount.expectations) > 0 {
mmArrayCount.mock.t.Fatalf("Some expectations are already set for the OutputPatchableValuesCollector.ArrayCount method")
}
mmArrayCount.mock.funcArrayCount = f
mmArrayCount.mock.funcArrayCountOrigin = minimock.CallerInfo(1)
return mmArrayCount.mock
}
// When sets expectation for the OutputPatchableValuesCollector.ArrayCount which will trigger the result defined by the following
// Then helper
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) When(path string) *OutputPatchableValuesCollectorMockArrayCountExpectation {
if mmArrayCount.mock.funcArrayCount != nil {
mmArrayCount.mock.t.Fatalf("OutputPatchableValuesCollectorMock.ArrayCount mock is already set by Set")
}
expectation := &OutputPatchableValuesCollectorMockArrayCountExpectation{
mock: mmArrayCount.mock,
params: &OutputPatchableValuesCollectorMockArrayCountParams{path},
expectationOrigins: OutputPatchableValuesCollectorMockArrayCountExpectationOrigins{origin: minimock.CallerInfo(1)},
}
mmArrayCount.expectations = append(mmArrayCount.expectations, expectation)
return expectation
}
// Then sets up OutputPatchableValuesCollector.ArrayCount return parameters for the expectation previously defined by the When method
func (e *OutputPatchableValuesCollectorMockArrayCountExpectation) Then(i1 int, err error) *OutputPatchableValuesCollectorMock {
e.results = &OutputPatchableValuesCollectorMockArrayCountResults{i1, err}
return e.mock
}
// Times sets number of times OutputPatchableValuesCollector.ArrayCount should be invoked
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) Times(n uint64) *mOutputPatchableValuesCollectorMockArrayCount {
if n == 0 {
mmArrayCount.mock.t.Fatalf("Times of OutputPatchableValuesCollectorMock.ArrayCount mock can not be zero")
}
mm_atomic.StoreUint64(&mmArrayCount.expectedInvocations, n)
mmArrayCount.expectedInvocationsOrigin = minimock.CallerInfo(1)
return mmArrayCount
}
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) invocationsDone() bool {
if len(mmArrayCount.expectations) == 0 && mmArrayCount.defaultExpectation == nil && mmArrayCount.mock.funcArrayCount == nil {
return true
}
totalInvocations := mm_atomic.LoadUint64(&mmArrayCount.mock.afterArrayCountCounter)
expectedInvocations := mm_atomic.LoadUint64(&mmArrayCount.expectedInvocations)
return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations)
}
// ArrayCount implements mm_pkg.OutputPatchableValuesCollector
func (mmArrayCount *OutputPatchableValuesCollectorMock) ArrayCount(path string) (i1 int, err error) {
mm_atomic.AddUint64(&mmArrayCount.beforeArrayCountCounter, 1)
defer mm_atomic.AddUint64(&mmArrayCount.afterArrayCountCounter, 1)
mmArrayCount.t.Helper()
if mmArrayCount.inspectFuncArrayCount != nil {
mmArrayCount.inspectFuncArrayCount(path)
}
mm_params := OutputPatchableValuesCollectorMockArrayCountParams{path}
// Record call args
mmArrayCount.ArrayCountMock.mutex.Lock()
mmArrayCount.ArrayCountMock.callArgs = append(mmArrayCount.ArrayCountMock.callArgs, &mm_params)
mmArrayCount.ArrayCountMock.mutex.Unlock()
for _, e := range mmArrayCount.ArrayCountMock.expectations {
if minimock.Equal(*e.params, mm_params) {
mm_atomic.AddUint64(&e.Counter, 1)
return e.results.i1, e.results.err
}
}
if mmArrayCount.ArrayCountMock.defaultExpectation != nil {
mm_atomic.AddUint64(&mmArrayCount.ArrayCountMock.defaultExpectation.Counter, 1)
mm_want := mmArrayCount.ArrayCountMock.defaultExpectation.params
mm_want_ptrs := mmArrayCount.ArrayCountMock.defaultExpectation.paramPtrs
mm_got := OutputPatchableValuesCollectorMockArrayCountParams{path}
if mm_want_ptrs != nil {
if mm_want_ptrs.path != nil && !minimock.Equal(*mm_want_ptrs.path, mm_got.path) {
mmArrayCount.t.Errorf("OutputPatchableValuesCollectorMock.ArrayCount got unexpected parameter path, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
mmArrayCount.ArrayCountMock.defaultExpectation.expectationOrigins.originPath, *mm_want_ptrs.path, mm_got.path, minimock.Diff(*mm_want_ptrs.path, mm_got.path))
}
} else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
mmArrayCount.t.Errorf("OutputPatchableValuesCollectorMock.ArrayCount got unexpected parameters, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
mmArrayCount.ArrayCountMock.defaultExpectation.expectationOrigins.origin, *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
}
mm_results := mmArrayCount.ArrayCountMock.defaultExpectation.results
if mm_results == nil {
mmArrayCount.t.Fatal("No results are set for the OutputPatchableValuesCollectorMock.ArrayCount")
}
return (*mm_results).i1, (*mm_results).err
}
if mmArrayCount.funcArrayCount != nil {
return mmArrayCount.funcArrayCount(path)
}
mmArrayCount.t.Fatalf("Unexpected call to OutputPatchableValuesCollectorMock.ArrayCount. %v", path)
return
}
// ArrayCountAfterCounter returns a count of finished OutputPatchableValuesCollectorMock.ArrayCount invocations
func (mmArrayCount *OutputPatchableValuesCollectorMock) ArrayCountAfterCounter() uint64 {
return mm_atomic.LoadUint64(&mmArrayCount.afterArrayCountCounter)
}
// ArrayCountBeforeCounter returns a count of OutputPatchableValuesCollectorMock.ArrayCount invocations
func (mmArrayCount *OutputPatchableValuesCollectorMock) ArrayCountBeforeCounter() uint64 {
return mm_atomic.LoadUint64(&mmArrayCount.beforeArrayCountCounter)
}
// Calls returns a list of arguments used in each call to OutputPatchableValuesCollectorMock.ArrayCount.
// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
func (mmArrayCount *mOutputPatchableValuesCollectorMockArrayCount) Calls() []*OutputPatchableValuesCollectorMockArrayCountParams {
mmArrayCount.mutex.RLock()
argCopy := make([]*OutputPatchableValuesCollectorMockArrayCountParams, len(mmArrayCount.callArgs))
copy(argCopy, mmArrayCount.callArgs)
mmArrayCount.mutex.RUnlock()
return argCopy
}
// MinimockArrayCountDone returns true if the count of the ArrayCount invocations corresponds
// the number of defined expectations
func (m *OutputPatchableValuesCollectorMock) MinimockArrayCountDone() bool {
if m.ArrayCountMock.optional {
// Optional methods provide '0 or more' call count restriction.
return true
}
for _, e := range m.ArrayCountMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
return false
}
}
return m.ArrayCountMock.invocationsDone()
}
// MinimockArrayCountInspect logs each unmet expectation
func (m *OutputPatchableValuesCollectorMock) MinimockArrayCountInspect() {
for _, e := range m.ArrayCountMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
m.t.Errorf("Expected call to OutputPatchableValuesCollectorMock.ArrayCount at\n%s with params: %#v", e.expectationOrigins.origin, *e.params)
}
}
afterArrayCountCounter := mm_atomic.LoadUint64(&m.afterArrayCountCounter)
// if default expectation was set then invocations count should be greater than zero
if m.ArrayCountMock.defaultExpectation != nil && afterArrayCountCounter < 1 {
if m.ArrayCountMock.defaultExpectation.params == nil {
m.t.Errorf("Expected call to OutputPatchableValuesCollectorMock.ArrayCount at\n%s", m.ArrayCountMock.defaultExpectation.returnOrigin)
} else {
m.t.Errorf("Expected call to OutputPatchableValuesCollectorMock.ArrayCount at\n%s with params: %#v", m.ArrayCountMock.defaultExpectation.expectationOrigins.origin, *m.ArrayCountMock.defaultExpectation.params)
}
}
// if func was set then invocations count should be greater than zero
if m.funcArrayCount != nil && afterArrayCountCounter < 1 {
m.t.Errorf("Expected call to OutputPatchableValuesCollectorMock.ArrayCount at\n%s", m.funcArrayCountOrigin)
}
if !m.ArrayCountMock.invocationsDone() && afterArrayCountCounter > 0 {
m.t.Errorf("Expected %d calls to OutputPatchableValuesCollectorMock.ArrayCount at\n%s but found %d calls",
mm_atomic.LoadUint64(&m.ArrayCountMock.expectedInvocations), m.ArrayCountMock.expectedInvocationsOrigin, afterArrayCountCounter)
}
}
type mOutputPatchableValuesCollectorMockExists struct {
optional bool
mock *OutputPatchableValuesCollectorMock
defaultExpectation *OutputPatchableValuesCollectorMockExistsExpectation
expectations []*OutputPatchableValuesCollectorMockExistsExpectation
callArgs []*OutputPatchableValuesCollectorMockExistsParams
mutex sync.RWMutex
expectedInvocations uint64
expectedInvocationsOrigin string
}
// OutputPatchableValuesCollectorMockExistsExpectation specifies expectation struct of the OutputPatchableValuesCollector.Exists
type OutputPatchableValuesCollectorMockExistsExpectation struct {
mock *OutputPatchableValuesCollectorMock
params *OutputPatchableValuesCollectorMockExistsParams
paramPtrs *OutputPatchableValuesCollectorMockExistsParamPtrs
expectationOrigins OutputPatchableValuesCollectorMockExistsExpectationOrigins
results *OutputPatchableValuesCollectorMockExistsResults
returnOrigin string
Counter uint64
}
// OutputPatchableValuesCollectorMockExistsParams contains parameters of the OutputPatchableValuesCollector.Exists
type OutputPatchableValuesCollectorMockExistsParams struct {
path string
}
// OutputPatchableValuesCollectorMockExistsParamPtrs contains pointers to parameters of the OutputPatchableValuesCollector.Exists
type OutputPatchableValuesCollectorMockExistsParamPtrs struct {
path *string
}
// OutputPatchableValuesCollectorMockExistsResults contains results of the OutputPatchableValuesCollector.Exists
type OutputPatchableValuesCollectorMockExistsResults struct {
b1 bool
}
// OutputPatchableValuesCollectorMockExistsOrigins contains origins of expectations of the OutputPatchableValuesCollector.Exists
type OutputPatchableValuesCollectorMockExistsExpectationOrigins struct {
origin string
originPath string
}
// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning
// the test will fail minimock's automatic final call check if the mocked method was not called at least once.
// Optional() makes method check to work in '0 or more' mode.
// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to
// catch the problems when the expected method call is totally skipped during test run.
func (mmExists *mOutputPatchableValuesCollectorMockExists) Optional() *mOutputPatchableValuesCollectorMockExists {
mmExists.optional = true
return mmExists
}
// Expect sets up expected params for OutputPatchableValuesCollector.Exists
func (mmExists *mOutputPatchableValuesCollectorMockExists) Expect(path string) *mOutputPatchableValuesCollectorMockExists {
if mmExists.mock.funcExists != nil {
mmExists.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Exists mock is already set by Set")
}
if mmExists.defaultExpectation == nil {
mmExists.defaultExpectation = &OutputPatchableValuesCollectorMockExistsExpectation{}
}
if mmExists.defaultExpectation.paramPtrs != nil {
mmExists.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Exists mock is already set by ExpectParams functions")
}
mmExists.defaultExpectation.params = &OutputPatchableValuesCollectorMockExistsParams{path}
mmExists.defaultExpectation.expectationOrigins.origin = minimock.CallerInfo(1)
for _, e := range mmExists.expectations {
if minimock.Equal(e.params, mmExists.defaultExpectation.params) {
mmExists.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmExists.defaultExpectation.params)
}
}
return mmExists
}
// ExpectPathParam1 sets up expected param path for OutputPatchableValuesCollector.Exists
func (mmExists *mOutputPatchableValuesCollectorMockExists) ExpectPathParam1(path string) *mOutputPatchableValuesCollectorMockExists {
if mmExists.mock.funcExists != nil {
mmExists.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Exists mock is already set by Set")
}
if mmExists.defaultExpectation == nil {
mmExists.defaultExpectation = &OutputPatchableValuesCollectorMockExistsExpectation{}
}
if mmExists.defaultExpectation.params != nil {
mmExists.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Exists mock is already set by Expect")
}
if mmExists.defaultExpectation.paramPtrs == nil {
mmExists.defaultExpectation.paramPtrs = &OutputPatchableValuesCollectorMockExistsParamPtrs{}
}
mmExists.defaultExpectation.paramPtrs.path = &path
mmExists.defaultExpectation.expectationOrigins.originPath = minimock.CallerInfo(1)
return mmExists
}
// Inspect accepts an inspector function that has same arguments as the OutputPatchableValuesCollector.Exists
func (mmExists *mOutputPatchableValuesCollectorMockExists) Inspect(f func(path string)) *mOutputPatchableValuesCollectorMockExists {
if mmExists.mock.inspectFuncExists != nil {
mmExists.mock.t.Fatalf("Inspect function is already set for OutputPatchableValuesCollectorMock.Exists")
}
mmExists.mock.inspectFuncExists = f
return mmExists
}
// Return sets up results that will be returned by OutputPatchableValuesCollector.Exists
func (mmExists *mOutputPatchableValuesCollectorMockExists) Return(b1 bool) *OutputPatchableValuesCollectorMock {
if mmExists.mock.funcExists != nil {
mmExists.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Exists mock is already set by Set")
}
if mmExists.defaultExpectation == nil {
mmExists.defaultExpectation = &OutputPatchableValuesCollectorMockExistsExpectation{mock: mmExists.mock}
}
mmExists.defaultExpectation.results = &OutputPatchableValuesCollectorMockExistsResults{b1}
mmExists.defaultExpectation.returnOrigin = minimock.CallerInfo(1)
return mmExists.mock
}
// Set uses given function f to mock the OutputPatchableValuesCollector.Exists method
func (mmExists *mOutputPatchableValuesCollectorMockExists) Set(f func(path string) (b1 bool)) *OutputPatchableValuesCollectorMock {
if mmExists.defaultExpectation != nil {
mmExists.mock.t.Fatalf("Default expectation is already set for the OutputPatchableValuesCollector.Exists method")
}
if len(mmExists.expectations) > 0 {
mmExists.mock.t.Fatalf("Some expectations are already set for the OutputPatchableValuesCollector.Exists method")
}
mmExists.mock.funcExists = f
mmExists.mock.funcExistsOrigin = minimock.CallerInfo(1)
return mmExists.mock
}
// When sets expectation for the OutputPatchableValuesCollector.Exists which will trigger the result defined by the following
// Then helper
func (mmExists *mOutputPatchableValuesCollectorMockExists) When(path string) *OutputPatchableValuesCollectorMockExistsExpectation {
if mmExists.mock.funcExists != nil {
mmExists.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Exists mock is already set by Set")
}
expectation := &OutputPatchableValuesCollectorMockExistsExpectation{
mock: mmExists.mock,
params: &OutputPatchableValuesCollectorMockExistsParams{path},
expectationOrigins: OutputPatchableValuesCollectorMockExistsExpectationOrigins{origin: minimock.CallerInfo(1)},
}
mmExists.expectations = append(mmExists.expectations, expectation)
return expectation
}
// Then sets up OutputPatchableValuesCollector.Exists return parameters for the expectation previously defined by the When method
func (e *OutputPatchableValuesCollectorMockExistsExpectation) Then(b1 bool) *OutputPatchableValuesCollectorMock {
e.results = &OutputPatchableValuesCollectorMockExistsResults{b1}
return e.mock
}
// Times sets number of times OutputPatchableValuesCollector.Exists should be invoked
func (mmExists *mOutputPatchableValuesCollectorMockExists) Times(n uint64) *mOutputPatchableValuesCollectorMockExists {
if n == 0 {
mmExists.mock.t.Fatalf("Times of OutputPatchableValuesCollectorMock.Exists mock can not be zero")
}
mm_atomic.StoreUint64(&mmExists.expectedInvocations, n)
mmExists.expectedInvocationsOrigin = minimock.CallerInfo(1)
return mmExists
}
func (mmExists *mOutputPatchableValuesCollectorMockExists) invocationsDone() bool {
if len(mmExists.expectations) == 0 && mmExists.defaultExpectation == nil && mmExists.mock.funcExists == nil {
return true
}
totalInvocations := mm_atomic.LoadUint64(&mmExists.mock.afterExistsCounter)
expectedInvocations := mm_atomic.LoadUint64(&mmExists.expectedInvocations)
return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations)
}
// Exists implements mm_pkg.OutputPatchableValuesCollector
func (mmExists *OutputPatchableValuesCollectorMock) Exists(path string) (b1 bool) {
mm_atomic.AddUint64(&mmExists.beforeExistsCounter, 1)
defer mm_atomic.AddUint64(&mmExists.afterExistsCounter, 1)
mmExists.t.Helper()
if mmExists.inspectFuncExists != nil {
mmExists.inspectFuncExists(path)
}
mm_params := OutputPatchableValuesCollectorMockExistsParams{path}
// Record call args
mmExists.ExistsMock.mutex.Lock()
mmExists.ExistsMock.callArgs = append(mmExists.ExistsMock.callArgs, &mm_params)
mmExists.ExistsMock.mutex.Unlock()
for _, e := range mmExists.ExistsMock.expectations {
if minimock.Equal(*e.params, mm_params) {
mm_atomic.AddUint64(&e.Counter, 1)
return e.results.b1
}
}
if mmExists.ExistsMock.defaultExpectation != nil {
mm_atomic.AddUint64(&mmExists.ExistsMock.defaultExpectation.Counter, 1)
mm_want := mmExists.ExistsMock.defaultExpectation.params
mm_want_ptrs := mmExists.ExistsMock.defaultExpectation.paramPtrs
mm_got := OutputPatchableValuesCollectorMockExistsParams{path}
if mm_want_ptrs != nil {
if mm_want_ptrs.path != nil && !minimock.Equal(*mm_want_ptrs.path, mm_got.path) {
mmExists.t.Errorf("OutputPatchableValuesCollectorMock.Exists got unexpected parameter path, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
mmExists.ExistsMock.defaultExpectation.expectationOrigins.originPath, *mm_want_ptrs.path, mm_got.path, minimock.Diff(*mm_want_ptrs.path, mm_got.path))
}
} else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
mmExists.t.Errorf("OutputPatchableValuesCollectorMock.Exists got unexpected parameters, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
mmExists.ExistsMock.defaultExpectation.expectationOrigins.origin, *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
}
mm_results := mmExists.ExistsMock.defaultExpectation.results
if mm_results == nil {
mmExists.t.Fatal("No results are set for the OutputPatchableValuesCollectorMock.Exists")
}
return (*mm_results).b1
}
if mmExists.funcExists != nil {
return mmExists.funcExists(path)
}
mmExists.t.Fatalf("Unexpected call to OutputPatchableValuesCollectorMock.Exists. %v", path)
return
}
// ExistsAfterCounter returns a count of finished OutputPatchableValuesCollectorMock.Exists invocations
func (mmExists *OutputPatchableValuesCollectorMock) ExistsAfterCounter() uint64 {
return mm_atomic.LoadUint64(&mmExists.afterExistsCounter)
}
// ExistsBeforeCounter returns a count of OutputPatchableValuesCollectorMock.Exists invocations
func (mmExists *OutputPatchableValuesCollectorMock) ExistsBeforeCounter() uint64 {
return mm_atomic.LoadUint64(&mmExists.beforeExistsCounter)
}
// Calls returns a list of arguments used in each call to OutputPatchableValuesCollectorMock.Exists.
// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
func (mmExists *mOutputPatchableValuesCollectorMockExists) Calls() []*OutputPatchableValuesCollectorMockExistsParams {
mmExists.mutex.RLock()
argCopy := make([]*OutputPatchableValuesCollectorMockExistsParams, len(mmExists.callArgs))
copy(argCopy, mmExists.callArgs)
mmExists.mutex.RUnlock()
return argCopy
}
// MinimockExistsDone returns true if the count of the Exists invocations corresponds
// the number of defined expectations
func (m *OutputPatchableValuesCollectorMock) MinimockExistsDone() bool {
if m.ExistsMock.optional {
// Optional methods provide '0 or more' call count restriction.
return true
}
for _, e := range m.ExistsMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
return false
}
}
return m.ExistsMock.invocationsDone()
}
// MinimockExistsInspect logs each unmet expectation
func (m *OutputPatchableValuesCollectorMock) MinimockExistsInspect() {
for _, e := range m.ExistsMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
m.t.Errorf("Expected call to OutputPatchableValuesCollectorMock.Exists at\n%s with params: %#v", e.expectationOrigins.origin, *e.params)
}
}
afterExistsCounter := mm_atomic.LoadUint64(&m.afterExistsCounter)
// if default expectation was set then invocations count should be greater than zero
if m.ExistsMock.defaultExpectation != nil && afterExistsCounter < 1 {
if m.ExistsMock.defaultExpectation.params == nil {
m.t.Errorf("Expected call to OutputPatchableValuesCollectorMock.Exists at\n%s", m.ExistsMock.defaultExpectation.returnOrigin)
} else {
m.t.Errorf("Expected call to OutputPatchableValuesCollectorMock.Exists at\n%s with params: %#v", m.ExistsMock.defaultExpectation.expectationOrigins.origin, *m.ExistsMock.defaultExpectation.params)
}
}
// if func was set then invocations count should be greater than zero
if m.funcExists != nil && afterExistsCounter < 1 {
m.t.Errorf("Expected call to OutputPatchableValuesCollectorMock.Exists at\n%s", m.funcExistsOrigin)
}
if !m.ExistsMock.invocationsDone() && afterExistsCounter > 0 {
m.t.Errorf("Expected %d calls to OutputPatchableValuesCollectorMock.Exists at\n%s but found %d calls",
mm_atomic.LoadUint64(&m.ExistsMock.expectedInvocations), m.ExistsMock.expectedInvocationsOrigin, afterExistsCounter)
}
}
type mOutputPatchableValuesCollectorMockGet struct {
optional bool
mock *OutputPatchableValuesCollectorMock
defaultExpectation *OutputPatchableValuesCollectorMockGetExpectation
expectations []*OutputPatchableValuesCollectorMockGetExpectation
callArgs []*OutputPatchableValuesCollectorMockGetParams
mutex sync.RWMutex
expectedInvocations uint64
expectedInvocationsOrigin string
}
// OutputPatchableValuesCollectorMockGetExpectation specifies expectation struct of the OutputPatchableValuesCollector.Get
type OutputPatchableValuesCollectorMockGetExpectation struct {
mock *OutputPatchableValuesCollectorMock
params *OutputPatchableValuesCollectorMockGetParams
paramPtrs *OutputPatchableValuesCollectorMockGetParamPtrs
expectationOrigins OutputPatchableValuesCollectorMockGetExpectationOrigins
results *OutputPatchableValuesCollectorMockGetResults
returnOrigin string
Counter uint64
}
// OutputPatchableValuesCollectorMockGetParams contains parameters of the OutputPatchableValuesCollector.Get
type OutputPatchableValuesCollectorMockGetParams struct {
path string
}
// OutputPatchableValuesCollectorMockGetParamPtrs contains pointers to parameters of the OutputPatchableValuesCollector.Get
type OutputPatchableValuesCollectorMockGetParamPtrs struct {
path *string
}
// OutputPatchableValuesCollectorMockGetResults contains results of the OutputPatchableValuesCollector.Get
type OutputPatchableValuesCollectorMockGetResults struct {
r1 gjson.Result
}
// OutputPatchableValuesCollectorMockGetOrigins contains origins of expectations of the OutputPatchableValuesCollector.Get
type OutputPatchableValuesCollectorMockGetExpectationOrigins struct {
origin string
originPath string
}
// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning
// the test will fail minimock's automatic final call check if the mocked method was not called at least once.
// Optional() makes method check to work in '0 or more' mode.
// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to
// catch the problems when the expected method call is totally skipped during test run.
func (mmGet *mOutputPatchableValuesCollectorMockGet) Optional() *mOutputPatchableValuesCollectorMockGet {
mmGet.optional = true
return mmGet
}
// Expect sets up expected params for OutputPatchableValuesCollector.Get
func (mmGet *mOutputPatchableValuesCollectorMockGet) Expect(path string) *mOutputPatchableValuesCollectorMockGet {
if mmGet.mock.funcGet != nil {
mmGet.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Get mock is already set by Set")
}
if mmGet.defaultExpectation == nil {
mmGet.defaultExpectation = &OutputPatchableValuesCollectorMockGetExpectation{}
}
if mmGet.defaultExpectation.paramPtrs != nil {
mmGet.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Get mock is already set by ExpectParams functions")
}
mmGet.defaultExpectation.params = &OutputPatchableValuesCollectorMockGetParams{path}
mmGet.defaultExpectation.expectationOrigins.origin = minimock.CallerInfo(1)
for _, e := range mmGet.expectations {
if minimock.Equal(e.params, mmGet.defaultExpectation.params) {
mmGet.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmGet.defaultExpectation.params)
}
}
return mmGet
}
// ExpectPathParam1 sets up expected param path for OutputPatchableValuesCollector.Get
func (mmGet *mOutputPatchableValuesCollectorMockGet) ExpectPathParam1(path string) *mOutputPatchableValuesCollectorMockGet {
if mmGet.mock.funcGet != nil {
mmGet.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Get mock is already set by Set")
}
if mmGet.defaultExpectation == nil {
mmGet.defaultExpectation = &OutputPatchableValuesCollectorMockGetExpectation{}
}
if mmGet.defaultExpectation.params != nil {
mmGet.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Get mock is already set by Expect")
}
if mmGet.defaultExpectation.paramPtrs == nil {
mmGet.defaultExpectation.paramPtrs = &OutputPatchableValuesCollectorMockGetParamPtrs{}
}
mmGet.defaultExpectation.paramPtrs.path = &path
mmGet.defaultExpectation.expectationOrigins.originPath = minimock.CallerInfo(1)
return mmGet
}
// Inspect accepts an inspector function that has same arguments as the OutputPatchableValuesCollector.Get
func (mmGet *mOutputPatchableValuesCollectorMockGet) Inspect(f func(path string)) *mOutputPatchableValuesCollectorMockGet {
if mmGet.mock.inspectFuncGet != nil {
mmGet.mock.t.Fatalf("Inspect function is already set for OutputPatchableValuesCollectorMock.Get")
}
mmGet.mock.inspectFuncGet = f
return mmGet
}
// Return sets up results that will be returned by OutputPatchableValuesCollector.Get
func (mmGet *mOutputPatchableValuesCollectorMockGet) Return(r1 gjson.Result) *OutputPatchableValuesCollectorMock {
if mmGet.mock.funcGet != nil {
mmGet.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Get mock is already set by Set")
}
if mmGet.defaultExpectation == nil {
mmGet.defaultExpectation = &OutputPatchableValuesCollectorMockGetExpectation{mock: mmGet.mock}
}
mmGet.defaultExpectation.results = &OutputPatchableValuesCollectorMockGetResults{r1}
mmGet.defaultExpectation.returnOrigin = minimock.CallerInfo(1)
return mmGet.mock
}
// Set uses given function f to mock the OutputPatchableValuesCollector.Get method
func (mmGet *mOutputPatchableValuesCollectorMockGet) Set(f func(path string) (r1 gjson.Result)) *OutputPatchableValuesCollectorMock {
if mmGet.defaultExpectation != nil {
mmGet.mock.t.Fatalf("Default expectation is already set for the OutputPatchableValuesCollector.Get method")
}
if len(mmGet.expectations) > 0 {
mmGet.mock.t.Fatalf("Some expectations are already set for the OutputPatchableValuesCollector.Get method")
}
mmGet.mock.funcGet = f
mmGet.mock.funcGetOrigin = minimock.CallerInfo(1)
return mmGet.mock
}
// When sets expectation for the OutputPatchableValuesCollector.Get which will trigger the result defined by the following
// Then helper
func (mmGet *mOutputPatchableValuesCollectorMockGet) When(path string) *OutputPatchableValuesCollectorMockGetExpectation {
if mmGet.mock.funcGet != nil {
mmGet.mock.t.Fatalf("OutputPatchableValuesCollectorMock.Get mock is already set by Set")
}
expectation := &OutputPatchableValuesCollectorMockGetExpectation{
mock: mmGet.mock,
params: &OutputPatchableValuesCollectorMockGetParams{path},
expectationOrigins: OutputPatchableValuesCollectorMockGetExpectationOrigins{origin: minimock.CallerInfo(1)},
}
mmGet.expectations = append(mmGet.expectations, expectation)
return expectation
}
// Then sets up OutputPatchableValuesCollector.Get return parameters for the expectation previously defined by the When method
func (e *OutputPatchableValuesCollectorMockGetExpectation) Then(r1 gjson.Result) *OutputPatchableValuesCollectorMock {
e.results = &OutputPatchableValuesCollectorMockGetResults{r1}
return e.mock
}
// Times sets number of times OutputPatchableValuesCollector.Get should be invoked
func (mmGet *mOutputPatchableValuesCollectorMockGet) Times(n uint64) *mOutputPatchableValuesCollectorMockGet {
if n == 0 {
mmGet.mock.t.Fatalf("Times of OutputPatchableValuesCollectorMock.Get mock can not be zero")
}
mm_atomic.StoreUint64(&mmGet.expectedInvocations, n)
mmGet.expectedInvocationsOrigin = minimock.CallerInfo(1)
return mmGet
}
func (mmGet *mOutputPatchableValuesCollectorMockGet) invocationsDone() bool {
if len(mmGet.expectations) == 0 && mmGet.defaultExpectation == nil && mmGet.mock.funcGet == nil {
return true
}
totalInvocations := mm_atomic.LoadUint64(&mmGet.mock.afterGetCounter)
expectedInvocations := mm_atomic.LoadUint64(&mmGet.expectedInvocations)
return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations)
}
// Get implements mm_pkg.OutputPatchableValuesCollector
func (mmGet *OutputPatchableValuesCollectorMock) Get(path string) (r1 gjson.Result) {
mm_atomic.AddUint64(&mmGet.beforeGetCounter, 1)
defer mm_atomic.AddUint64(&mmGet.afterGetCounter, 1)
mmGet.t.Helper()
if mmGet.inspectFuncGet != nil {
mmGet.inspectFuncGet(path)
}
mm_params := OutputPatchableValuesCollectorMockGetParams{path}
// Record call args
mmGet.GetMock.mutex.Lock()
mmGet.GetMock.callArgs = append(mmGet.GetMock.callArgs, &mm_params)
mmGet.GetMock.mutex.Unlock()
for _, e := range mmGet.GetMock.expectations {
if minimock.Equal(*e.params, mm_params) {
mm_atomic.AddUint64(&e.Counter, 1)
return e.results.r1
}
}
if mmGet.GetMock.defaultExpectation != nil {
mm_atomic.AddUint64(&mmGet.GetMock.defaultExpectation.Counter, 1)
mm_want := mmGet.GetMock.defaultExpectation.params
mm_want_ptrs := mmGet.GetMock.defaultExpectation.paramPtrs
mm_got := OutputPatchableValuesCollectorMockGetParams{path}
if mm_want_ptrs != nil {
if mm_want_ptrs.path != nil && !minimock.Equal(*mm_want_ptrs.path, mm_got.path) {
mmGet.t.Errorf("OutputPatchableValuesCollectorMock.Get got unexpected parameter path, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
mmGet.GetMock.defaultExpectation.expectationOrigins.originPath, *mm_want_ptrs.path, mm_got.path, minimock.Diff(*mm_want_ptrs.path, mm_got.path))
}
} else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
mmGet.t.Errorf("OutputPatchableValuesCollectorMock.Get got unexpected parameters, expected at\n%s:\nwant: %#v\n got: %#v%s\n",
mmGet.GetMock.defaultExpectation.expectationOrigins.origin, *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
}
mm_results := mmGet.GetMock.defaultExpectation.results
if mm_results == nil {
mmGet.t.Fatal("No results are set for the OutputPatchableValuesCollectorMock.Get")
}
return (*mm_results).r1
}
if mmGet.funcGet != nil {
return mmGet.funcGet(path)
}
mmGet.t.Fatalf("Unexpected call to OutputPatchableValuesCollectorMock.Get. %v", path)
return
}
// GetAfterCounter returns a count of finished OutputPatchableValuesCollectorMock.Get invocations
func (mmGet *OutputPatchableValuesCollectorMock) GetAfterCounter() uint64 {
return mm_atomic.LoadUint64(&mmGet.afterGetCounter)
}
// GetBeforeCounter returns a count of OutputPatchableValuesCollectorMock.Get invocations
func (mmGet *OutputPatchableValuesCollectorMock) GetBeforeCounter() uint64 {
return mm_atomic.LoadUint64(&mmGet.beforeGetCounter)
}