This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 115
/
fake_emitter_factory.go
195 lines (177 loc) · 5.42 KB
/
fake_emitter_factory.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
// Code generated by counterfeiter. DO NOT EDIT.
package metricfakes
import (
"sync"
"github.com/concourse/atc/metric"
)
type FakeEmitterFactory struct {
DescriptionStub func() string
descriptionMutex sync.RWMutex
descriptionArgsForCall []struct{}
descriptionReturns struct {
result1 string
}
descriptionReturnsOnCall map[int]struct {
result1 string
}
IsConfiguredStub func() bool
isConfiguredMutex sync.RWMutex
isConfiguredArgsForCall []struct{}
isConfiguredReturns struct {
result1 bool
}
isConfiguredReturnsOnCall map[int]struct {
result1 bool
}
NewEmitterStub func() (metric.Emitter, error)
newEmitterMutex sync.RWMutex
newEmitterArgsForCall []struct{}
newEmitterReturns struct {
result1 metric.Emitter
result2 error
}
newEmitterReturnsOnCall map[int]struct {
result1 metric.Emitter
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeEmitterFactory) Description() string {
fake.descriptionMutex.Lock()
ret, specificReturn := fake.descriptionReturnsOnCall[len(fake.descriptionArgsForCall)]
fake.descriptionArgsForCall = append(fake.descriptionArgsForCall, struct{}{})
fake.recordInvocation("Description", []interface{}{})
fake.descriptionMutex.Unlock()
if fake.DescriptionStub != nil {
return fake.DescriptionStub()
}
if specificReturn {
return ret.result1
}
return fake.descriptionReturns.result1
}
func (fake *FakeEmitterFactory) DescriptionCallCount() int {
fake.descriptionMutex.RLock()
defer fake.descriptionMutex.RUnlock()
return len(fake.descriptionArgsForCall)
}
func (fake *FakeEmitterFactory) DescriptionReturns(result1 string) {
fake.DescriptionStub = nil
fake.descriptionReturns = struct {
result1 string
}{result1}
}
func (fake *FakeEmitterFactory) DescriptionReturnsOnCall(i int, result1 string) {
fake.DescriptionStub = nil
if fake.descriptionReturnsOnCall == nil {
fake.descriptionReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.descriptionReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeEmitterFactory) IsConfigured() bool {
fake.isConfiguredMutex.Lock()
ret, specificReturn := fake.isConfiguredReturnsOnCall[len(fake.isConfiguredArgsForCall)]
fake.isConfiguredArgsForCall = append(fake.isConfiguredArgsForCall, struct{}{})
fake.recordInvocation("IsConfigured", []interface{}{})
fake.isConfiguredMutex.Unlock()
if fake.IsConfiguredStub != nil {
return fake.IsConfiguredStub()
}
if specificReturn {
return ret.result1
}
return fake.isConfiguredReturns.result1
}
func (fake *FakeEmitterFactory) IsConfiguredCallCount() int {
fake.isConfiguredMutex.RLock()
defer fake.isConfiguredMutex.RUnlock()
return len(fake.isConfiguredArgsForCall)
}
func (fake *FakeEmitterFactory) IsConfiguredReturns(result1 bool) {
fake.IsConfiguredStub = nil
fake.isConfiguredReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeEmitterFactory) IsConfiguredReturnsOnCall(i int, result1 bool) {
fake.IsConfiguredStub = nil
if fake.isConfiguredReturnsOnCall == nil {
fake.isConfiguredReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isConfiguredReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeEmitterFactory) NewEmitter() (metric.Emitter, error) {
fake.newEmitterMutex.Lock()
ret, specificReturn := fake.newEmitterReturnsOnCall[len(fake.newEmitterArgsForCall)]
fake.newEmitterArgsForCall = append(fake.newEmitterArgsForCall, struct{}{})
fake.recordInvocation("NewEmitter", []interface{}{})
fake.newEmitterMutex.Unlock()
if fake.NewEmitterStub != nil {
return fake.NewEmitterStub()
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.newEmitterReturns.result1, fake.newEmitterReturns.result2
}
func (fake *FakeEmitterFactory) NewEmitterCallCount() int {
fake.newEmitterMutex.RLock()
defer fake.newEmitterMutex.RUnlock()
return len(fake.newEmitterArgsForCall)
}
func (fake *FakeEmitterFactory) NewEmitterReturns(result1 metric.Emitter, result2 error) {
fake.NewEmitterStub = nil
fake.newEmitterReturns = struct {
result1 metric.Emitter
result2 error
}{result1, result2}
}
func (fake *FakeEmitterFactory) NewEmitterReturnsOnCall(i int, result1 metric.Emitter, result2 error) {
fake.NewEmitterStub = nil
if fake.newEmitterReturnsOnCall == nil {
fake.newEmitterReturnsOnCall = make(map[int]struct {
result1 metric.Emitter
result2 error
})
}
fake.newEmitterReturnsOnCall[i] = struct {
result1 metric.Emitter
result2 error
}{result1, result2}
}
func (fake *FakeEmitterFactory) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.descriptionMutex.RLock()
defer fake.descriptionMutex.RUnlock()
fake.isConfiguredMutex.RLock()
defer fake.isConfiguredMutex.RUnlock()
fake.newEmitterMutex.RLock()
defer fake.newEmitterMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeEmitterFactory) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ metric.EmitterFactory = new(FakeEmitterFactory)