forked from vmware-archive/atc
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_input_source.go
139 lines (125 loc) · 3.84 KB
/
fake_input_source.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
// Code generated by counterfeiter. DO NOT EDIT.
package workerfakes
import (
"sync"
"github.com/concourse/atc/worker"
)
type FakeInputSource struct {
SourceStub func() worker.ArtifactSource
sourceMutex sync.RWMutex
sourceArgsForCall []struct{}
sourceReturns struct {
result1 worker.ArtifactSource
}
sourceReturnsOnCall map[int]struct {
result1 worker.ArtifactSource
}
DestinationPathStub func() string
destinationPathMutex sync.RWMutex
destinationPathArgsForCall []struct{}
destinationPathReturns struct {
result1 string
}
destinationPathReturnsOnCall map[int]struct {
result1 string
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeInputSource) Source() worker.ArtifactSource {
fake.sourceMutex.Lock()
ret, specificReturn := fake.sourceReturnsOnCall[len(fake.sourceArgsForCall)]
fake.sourceArgsForCall = append(fake.sourceArgsForCall, struct{}{})
fake.recordInvocation("Source", []interface{}{})
fake.sourceMutex.Unlock()
if fake.SourceStub != nil {
return fake.SourceStub()
}
if specificReturn {
return ret.result1
}
return fake.sourceReturns.result1
}
func (fake *FakeInputSource) SourceCallCount() int {
fake.sourceMutex.RLock()
defer fake.sourceMutex.RUnlock()
return len(fake.sourceArgsForCall)
}
func (fake *FakeInputSource) SourceReturns(result1 worker.ArtifactSource) {
fake.SourceStub = nil
fake.sourceReturns = struct {
result1 worker.ArtifactSource
}{result1}
}
func (fake *FakeInputSource) SourceReturnsOnCall(i int, result1 worker.ArtifactSource) {
fake.SourceStub = nil
if fake.sourceReturnsOnCall == nil {
fake.sourceReturnsOnCall = make(map[int]struct {
result1 worker.ArtifactSource
})
}
fake.sourceReturnsOnCall[i] = struct {
result1 worker.ArtifactSource
}{result1}
}
func (fake *FakeInputSource) DestinationPath() string {
fake.destinationPathMutex.Lock()
ret, specificReturn := fake.destinationPathReturnsOnCall[len(fake.destinationPathArgsForCall)]
fake.destinationPathArgsForCall = append(fake.destinationPathArgsForCall, struct{}{})
fake.recordInvocation("DestinationPath", []interface{}{})
fake.destinationPathMutex.Unlock()
if fake.DestinationPathStub != nil {
return fake.DestinationPathStub()
}
if specificReturn {
return ret.result1
}
return fake.destinationPathReturns.result1
}
func (fake *FakeInputSource) DestinationPathCallCount() int {
fake.destinationPathMutex.RLock()
defer fake.destinationPathMutex.RUnlock()
return len(fake.destinationPathArgsForCall)
}
func (fake *FakeInputSource) DestinationPathReturns(result1 string) {
fake.DestinationPathStub = nil
fake.destinationPathReturns = struct {
result1 string
}{result1}
}
func (fake *FakeInputSource) DestinationPathReturnsOnCall(i int, result1 string) {
fake.DestinationPathStub = nil
if fake.destinationPathReturnsOnCall == nil {
fake.destinationPathReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.destinationPathReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeInputSource) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.sourceMutex.RLock()
defer fake.sourceMutex.RUnlock()
fake.destinationPathMutex.RLock()
defer fake.destinationPathMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeInputSource) 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 _ worker.InputSource = new(FakeInputSource)