forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_radar_scheduler_factory.go
171 lines (155 loc) · 6.19 KB
/
fake_radar_scheduler_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
// Code generated by counterfeiter. DO NOT EDIT.
package pipelinesfakes
import (
"sync"
"github.com/concourse/atc/creds"
"github.com/concourse/atc/db"
"github.com/concourse/atc/pipelines"
"github.com/concourse/atc/radar"
"github.com/concourse/atc/scheduler"
)
type FakeRadarSchedulerFactory struct {
BuildScanRunnerFactoryStub func(dbPipeline db.Pipeline, externalURL string, variables creds.Variables) radar.ScanRunnerFactory
buildScanRunnerFactoryMutex sync.RWMutex
buildScanRunnerFactoryArgsForCall []struct {
dbPipeline db.Pipeline
externalURL string
variables creds.Variables
}
buildScanRunnerFactoryReturns struct {
result1 radar.ScanRunnerFactory
}
buildScanRunnerFactoryReturnsOnCall map[int]struct {
result1 radar.ScanRunnerFactory
}
BuildSchedulerStub func(pipeline db.Pipeline, externalURL string, variables creds.Variables) scheduler.BuildScheduler
buildSchedulerMutex sync.RWMutex
buildSchedulerArgsForCall []struct {
pipeline db.Pipeline
externalURL string
variables creds.Variables
}
buildSchedulerReturns struct {
result1 scheduler.BuildScheduler
}
buildSchedulerReturnsOnCall map[int]struct {
result1 scheduler.BuildScheduler
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeRadarSchedulerFactory) BuildScanRunnerFactory(dbPipeline db.Pipeline, externalURL string, variables creds.Variables) radar.ScanRunnerFactory {
fake.buildScanRunnerFactoryMutex.Lock()
ret, specificReturn := fake.buildScanRunnerFactoryReturnsOnCall[len(fake.buildScanRunnerFactoryArgsForCall)]
fake.buildScanRunnerFactoryArgsForCall = append(fake.buildScanRunnerFactoryArgsForCall, struct {
dbPipeline db.Pipeline
externalURL string
variables creds.Variables
}{dbPipeline, externalURL, variables})
fake.recordInvocation("BuildScanRunnerFactory", []interface{}{dbPipeline, externalURL, variables})
fake.buildScanRunnerFactoryMutex.Unlock()
if fake.BuildScanRunnerFactoryStub != nil {
return fake.BuildScanRunnerFactoryStub(dbPipeline, externalURL, variables)
}
if specificReturn {
return ret.result1
}
return fake.buildScanRunnerFactoryReturns.result1
}
func (fake *FakeRadarSchedulerFactory) BuildScanRunnerFactoryCallCount() int {
fake.buildScanRunnerFactoryMutex.RLock()
defer fake.buildScanRunnerFactoryMutex.RUnlock()
return len(fake.buildScanRunnerFactoryArgsForCall)
}
func (fake *FakeRadarSchedulerFactory) BuildScanRunnerFactoryArgsForCall(i int) (db.Pipeline, string, creds.Variables) {
fake.buildScanRunnerFactoryMutex.RLock()
defer fake.buildScanRunnerFactoryMutex.RUnlock()
return fake.buildScanRunnerFactoryArgsForCall[i].dbPipeline, fake.buildScanRunnerFactoryArgsForCall[i].externalURL, fake.buildScanRunnerFactoryArgsForCall[i].variables
}
func (fake *FakeRadarSchedulerFactory) BuildScanRunnerFactoryReturns(result1 radar.ScanRunnerFactory) {
fake.BuildScanRunnerFactoryStub = nil
fake.buildScanRunnerFactoryReturns = struct {
result1 radar.ScanRunnerFactory
}{result1}
}
func (fake *FakeRadarSchedulerFactory) BuildScanRunnerFactoryReturnsOnCall(i int, result1 radar.ScanRunnerFactory) {
fake.BuildScanRunnerFactoryStub = nil
if fake.buildScanRunnerFactoryReturnsOnCall == nil {
fake.buildScanRunnerFactoryReturnsOnCall = make(map[int]struct {
result1 radar.ScanRunnerFactory
})
}
fake.buildScanRunnerFactoryReturnsOnCall[i] = struct {
result1 radar.ScanRunnerFactory
}{result1}
}
func (fake *FakeRadarSchedulerFactory) BuildScheduler(pipeline db.Pipeline, externalURL string, variables creds.Variables) scheduler.BuildScheduler {
fake.buildSchedulerMutex.Lock()
ret, specificReturn := fake.buildSchedulerReturnsOnCall[len(fake.buildSchedulerArgsForCall)]
fake.buildSchedulerArgsForCall = append(fake.buildSchedulerArgsForCall, struct {
pipeline db.Pipeline
externalURL string
variables creds.Variables
}{pipeline, externalURL, variables})
fake.recordInvocation("BuildScheduler", []interface{}{pipeline, externalURL, variables})
fake.buildSchedulerMutex.Unlock()
if fake.BuildSchedulerStub != nil {
return fake.BuildSchedulerStub(pipeline, externalURL, variables)
}
if specificReturn {
return ret.result1
}
return fake.buildSchedulerReturns.result1
}
func (fake *FakeRadarSchedulerFactory) BuildSchedulerCallCount() int {
fake.buildSchedulerMutex.RLock()
defer fake.buildSchedulerMutex.RUnlock()
return len(fake.buildSchedulerArgsForCall)
}
func (fake *FakeRadarSchedulerFactory) BuildSchedulerArgsForCall(i int) (db.Pipeline, string, creds.Variables) {
fake.buildSchedulerMutex.RLock()
defer fake.buildSchedulerMutex.RUnlock()
return fake.buildSchedulerArgsForCall[i].pipeline, fake.buildSchedulerArgsForCall[i].externalURL, fake.buildSchedulerArgsForCall[i].variables
}
func (fake *FakeRadarSchedulerFactory) BuildSchedulerReturns(result1 scheduler.BuildScheduler) {
fake.BuildSchedulerStub = nil
fake.buildSchedulerReturns = struct {
result1 scheduler.BuildScheduler
}{result1}
}
func (fake *FakeRadarSchedulerFactory) BuildSchedulerReturnsOnCall(i int, result1 scheduler.BuildScheduler) {
fake.BuildSchedulerStub = nil
if fake.buildSchedulerReturnsOnCall == nil {
fake.buildSchedulerReturnsOnCall = make(map[int]struct {
result1 scheduler.BuildScheduler
})
}
fake.buildSchedulerReturnsOnCall[i] = struct {
result1 scheduler.BuildScheduler
}{result1}
}
func (fake *FakeRadarSchedulerFactory) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.buildScanRunnerFactoryMutex.RLock()
defer fake.buildScanRunnerFactoryMutex.RUnlock()
fake.buildSchedulerMutex.RLock()
defer fake.buildSchedulerMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeRadarSchedulerFactory) 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 _ pipelines.RadarSchedulerFactory = new(FakeRadarSchedulerFactory)