forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_baggageclaim_client_factory.go
101 lines (90 loc) · 2.95 KB
/
fake_baggageclaim_client_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
// Code generated by counterfeiter. DO NOT EDIT.
package gcfakes
import (
"sync"
"github.com/concourse/atc/gc"
bclient "github.com/concourse/baggageclaim/client"
)
type FakeBaggageclaimClientFactory struct {
NewClientStub func(apiURL string, workerName string) bclient.Client
newClientMutex sync.RWMutex
newClientArgsForCall []struct {
apiURL string
workerName string
}
newClientReturns struct {
result1 bclient.Client
}
newClientReturnsOnCall map[int]struct {
result1 bclient.Client
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeBaggageclaimClientFactory) NewClient(apiURL string, workerName string) bclient.Client {
fake.newClientMutex.Lock()
ret, specificReturn := fake.newClientReturnsOnCall[len(fake.newClientArgsForCall)]
fake.newClientArgsForCall = append(fake.newClientArgsForCall, struct {
apiURL string
workerName string
}{apiURL, workerName})
fake.recordInvocation("NewClient", []interface{}{apiURL, workerName})
fake.newClientMutex.Unlock()
if fake.NewClientStub != nil {
return fake.NewClientStub(apiURL, workerName)
}
if specificReturn {
return ret.result1
}
return fake.newClientReturns.result1
}
func (fake *FakeBaggageclaimClientFactory) NewClientCallCount() int {
fake.newClientMutex.RLock()
defer fake.newClientMutex.RUnlock()
return len(fake.newClientArgsForCall)
}
func (fake *FakeBaggageclaimClientFactory) NewClientArgsForCall(i int) (string, string) {
fake.newClientMutex.RLock()
defer fake.newClientMutex.RUnlock()
return fake.newClientArgsForCall[i].apiURL, fake.newClientArgsForCall[i].workerName
}
func (fake *FakeBaggageclaimClientFactory) NewClientReturns(result1 bclient.Client) {
fake.NewClientStub = nil
fake.newClientReturns = struct {
result1 bclient.Client
}{result1}
}
func (fake *FakeBaggageclaimClientFactory) NewClientReturnsOnCall(i int, result1 bclient.Client) {
fake.NewClientStub = nil
if fake.newClientReturnsOnCall == nil {
fake.newClientReturnsOnCall = make(map[int]struct {
result1 bclient.Client
})
}
fake.newClientReturnsOnCall[i] = struct {
result1 bclient.Client
}{result1}
}
func (fake *FakeBaggageclaimClientFactory) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.newClientMutex.RLock()
defer fake.newClientMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeBaggageclaimClientFactory) 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 _ gc.BaggageclaimClientFactory = new(FakeBaggageclaimClientFactory)