1// Code generated by counterfeiter. DO NOT EDIT.
2package dbfakes
3
4import (
5	"sync"
6	"time"
7
8	"github.com/concourse/concourse/atc/db"
9)
10
11type FakeUserFactory struct {
12	CreateOrUpdateUserStub        func(string, string, string) error
13	createOrUpdateUserMutex       sync.RWMutex
14	createOrUpdateUserArgsForCall []struct {
15		arg1 string
16		arg2 string
17		arg3 string
18	}
19	createOrUpdateUserReturns struct {
20		result1 error
21	}
22	createOrUpdateUserReturnsOnCall map[int]struct {
23		result1 error
24	}
25	GetAllUsersStub        func() ([]db.User, error)
26	getAllUsersMutex       sync.RWMutex
27	getAllUsersArgsForCall []struct {
28	}
29	getAllUsersReturns struct {
30		result1 []db.User
31		result2 error
32	}
33	getAllUsersReturnsOnCall map[int]struct {
34		result1 []db.User
35		result2 error
36	}
37	GetAllUsersByLoginDateStub        func(time.Time) ([]db.User, error)
38	getAllUsersByLoginDateMutex       sync.RWMutex
39	getAllUsersByLoginDateArgsForCall []struct {
40		arg1 time.Time
41	}
42	getAllUsersByLoginDateReturns struct {
43		result1 []db.User
44		result2 error
45	}
46	getAllUsersByLoginDateReturnsOnCall map[int]struct {
47		result1 []db.User
48		result2 error
49	}
50	invocations      map[string][][]interface{}
51	invocationsMutex sync.RWMutex
52}
53
54func (fake *FakeUserFactory) CreateOrUpdateUser(arg1 string, arg2 string, arg3 string) error {
55	fake.createOrUpdateUserMutex.Lock()
56	ret, specificReturn := fake.createOrUpdateUserReturnsOnCall[len(fake.createOrUpdateUserArgsForCall)]
57	fake.createOrUpdateUserArgsForCall = append(fake.createOrUpdateUserArgsForCall, struct {
58		arg1 string
59		arg2 string
60		arg3 string
61	}{arg1, arg2, arg3})
62	fake.recordInvocation("CreateOrUpdateUser", []interface{}{arg1, arg2, arg3})
63	fake.createOrUpdateUserMutex.Unlock()
64	if fake.CreateOrUpdateUserStub != nil {
65		return fake.CreateOrUpdateUserStub(arg1, arg2, arg3)
66	}
67	if specificReturn {
68		return ret.result1
69	}
70	fakeReturns := fake.createOrUpdateUserReturns
71	return fakeReturns.result1
72}
73
74func (fake *FakeUserFactory) CreateOrUpdateUserCallCount() int {
75	fake.createOrUpdateUserMutex.RLock()
76	defer fake.createOrUpdateUserMutex.RUnlock()
77	return len(fake.createOrUpdateUserArgsForCall)
78}
79
80func (fake *FakeUserFactory) CreateOrUpdateUserCalls(stub func(string, string, string) error) {
81	fake.createOrUpdateUserMutex.Lock()
82	defer fake.createOrUpdateUserMutex.Unlock()
83	fake.CreateOrUpdateUserStub = stub
84}
85
86func (fake *FakeUserFactory) CreateOrUpdateUserArgsForCall(i int) (string, string, string) {
87	fake.createOrUpdateUserMutex.RLock()
88	defer fake.createOrUpdateUserMutex.RUnlock()
89	argsForCall := fake.createOrUpdateUserArgsForCall[i]
90	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
91}
92
93func (fake *FakeUserFactory) CreateOrUpdateUserReturns(result1 error) {
94	fake.createOrUpdateUserMutex.Lock()
95	defer fake.createOrUpdateUserMutex.Unlock()
96	fake.CreateOrUpdateUserStub = nil
97	fake.createOrUpdateUserReturns = struct {
98		result1 error
99	}{result1}
100}
101
102func (fake *FakeUserFactory) CreateOrUpdateUserReturnsOnCall(i int, result1 error) {
103	fake.createOrUpdateUserMutex.Lock()
104	defer fake.createOrUpdateUserMutex.Unlock()
105	fake.CreateOrUpdateUserStub = nil
106	if fake.createOrUpdateUserReturnsOnCall == nil {
107		fake.createOrUpdateUserReturnsOnCall = make(map[int]struct {
108			result1 error
109		})
110	}
111	fake.createOrUpdateUserReturnsOnCall[i] = struct {
112		result1 error
113	}{result1}
114}
115
116func (fake *FakeUserFactory) GetAllUsers() ([]db.User, error) {
117	fake.getAllUsersMutex.Lock()
118	ret, specificReturn := fake.getAllUsersReturnsOnCall[len(fake.getAllUsersArgsForCall)]
119	fake.getAllUsersArgsForCall = append(fake.getAllUsersArgsForCall, struct {
120	}{})
121	fake.recordInvocation("GetAllUsers", []interface{}{})
122	fake.getAllUsersMutex.Unlock()
123	if fake.GetAllUsersStub != nil {
124		return fake.GetAllUsersStub()
125	}
126	if specificReturn {
127		return ret.result1, ret.result2
128	}
129	fakeReturns := fake.getAllUsersReturns
130	return fakeReturns.result1, fakeReturns.result2
131}
132
133func (fake *FakeUserFactory) GetAllUsersCallCount() int {
134	fake.getAllUsersMutex.RLock()
135	defer fake.getAllUsersMutex.RUnlock()
136	return len(fake.getAllUsersArgsForCall)
137}
138
139func (fake *FakeUserFactory) GetAllUsersCalls(stub func() ([]db.User, error)) {
140	fake.getAllUsersMutex.Lock()
141	defer fake.getAllUsersMutex.Unlock()
142	fake.GetAllUsersStub = stub
143}
144
145func (fake *FakeUserFactory) GetAllUsersReturns(result1 []db.User, result2 error) {
146	fake.getAllUsersMutex.Lock()
147	defer fake.getAllUsersMutex.Unlock()
148	fake.GetAllUsersStub = nil
149	fake.getAllUsersReturns = struct {
150		result1 []db.User
151		result2 error
152	}{result1, result2}
153}
154
155func (fake *FakeUserFactory) GetAllUsersReturnsOnCall(i int, result1 []db.User, result2 error) {
156	fake.getAllUsersMutex.Lock()
157	defer fake.getAllUsersMutex.Unlock()
158	fake.GetAllUsersStub = nil
159	if fake.getAllUsersReturnsOnCall == nil {
160		fake.getAllUsersReturnsOnCall = make(map[int]struct {
161			result1 []db.User
162			result2 error
163		})
164	}
165	fake.getAllUsersReturnsOnCall[i] = struct {
166		result1 []db.User
167		result2 error
168	}{result1, result2}
169}
170
171func (fake *FakeUserFactory) GetAllUsersByLoginDate(arg1 time.Time) ([]db.User, error) {
172	fake.getAllUsersByLoginDateMutex.Lock()
173	ret, specificReturn := fake.getAllUsersByLoginDateReturnsOnCall[len(fake.getAllUsersByLoginDateArgsForCall)]
174	fake.getAllUsersByLoginDateArgsForCall = append(fake.getAllUsersByLoginDateArgsForCall, struct {
175		arg1 time.Time
176	}{arg1})
177	fake.recordInvocation("GetAllUsersByLoginDate", []interface{}{arg1})
178	fake.getAllUsersByLoginDateMutex.Unlock()
179	if fake.GetAllUsersByLoginDateStub != nil {
180		return fake.GetAllUsersByLoginDateStub(arg1)
181	}
182	if specificReturn {
183		return ret.result1, ret.result2
184	}
185	fakeReturns := fake.getAllUsersByLoginDateReturns
186	return fakeReturns.result1, fakeReturns.result2
187}
188
189func (fake *FakeUserFactory) GetAllUsersByLoginDateCallCount() int {
190	fake.getAllUsersByLoginDateMutex.RLock()
191	defer fake.getAllUsersByLoginDateMutex.RUnlock()
192	return len(fake.getAllUsersByLoginDateArgsForCall)
193}
194
195func (fake *FakeUserFactory) GetAllUsersByLoginDateCalls(stub func(time.Time) ([]db.User, error)) {
196	fake.getAllUsersByLoginDateMutex.Lock()
197	defer fake.getAllUsersByLoginDateMutex.Unlock()
198	fake.GetAllUsersByLoginDateStub = stub
199}
200
201func (fake *FakeUserFactory) GetAllUsersByLoginDateArgsForCall(i int) time.Time {
202	fake.getAllUsersByLoginDateMutex.RLock()
203	defer fake.getAllUsersByLoginDateMutex.RUnlock()
204	argsForCall := fake.getAllUsersByLoginDateArgsForCall[i]
205	return argsForCall.arg1
206}
207
208func (fake *FakeUserFactory) GetAllUsersByLoginDateReturns(result1 []db.User, result2 error) {
209	fake.getAllUsersByLoginDateMutex.Lock()
210	defer fake.getAllUsersByLoginDateMutex.Unlock()
211	fake.GetAllUsersByLoginDateStub = nil
212	fake.getAllUsersByLoginDateReturns = struct {
213		result1 []db.User
214		result2 error
215	}{result1, result2}
216}
217
218func (fake *FakeUserFactory) GetAllUsersByLoginDateReturnsOnCall(i int, result1 []db.User, result2 error) {
219	fake.getAllUsersByLoginDateMutex.Lock()
220	defer fake.getAllUsersByLoginDateMutex.Unlock()
221	fake.GetAllUsersByLoginDateStub = nil
222	if fake.getAllUsersByLoginDateReturnsOnCall == nil {
223		fake.getAllUsersByLoginDateReturnsOnCall = make(map[int]struct {
224			result1 []db.User
225			result2 error
226		})
227	}
228	fake.getAllUsersByLoginDateReturnsOnCall[i] = struct {
229		result1 []db.User
230		result2 error
231	}{result1, result2}
232}
233
234func (fake *FakeUserFactory) Invocations() map[string][][]interface{} {
235	fake.invocationsMutex.RLock()
236	defer fake.invocationsMutex.RUnlock()
237	fake.createOrUpdateUserMutex.RLock()
238	defer fake.createOrUpdateUserMutex.RUnlock()
239	fake.getAllUsersMutex.RLock()
240	defer fake.getAllUsersMutex.RUnlock()
241	fake.getAllUsersByLoginDateMutex.RLock()
242	defer fake.getAllUsersByLoginDateMutex.RUnlock()
243	copiedInvocations := map[string][][]interface{}{}
244	for key, value := range fake.invocations {
245		copiedInvocations[key] = value
246	}
247	return copiedInvocations
248}
249
250func (fake *FakeUserFactory) recordInvocation(key string, args []interface{}) {
251	fake.invocationsMutex.Lock()
252	defer fake.invocationsMutex.Unlock()
253	if fake.invocations == nil {
254		fake.invocations = map[string][][]interface{}{}
255	}
256	if fake.invocations[key] == nil {
257		fake.invocations[key] = [][]interface{}{}
258	}
259	fake.invocations[key] = append(fake.invocations[key], args)
260}
261
262var _ db.UserFactory = new(FakeUserFactory)
263