forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_container_provider_factory.go
98 lines (87 loc) · 3.19 KB
/
fake_container_provider_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
// Code generated by counterfeiter. DO NOT EDIT.
package workerfakes
import (
"sync"
"github.com/concourse/atc/worker"
)
type FakeContainerProviderFactory struct {
ContainerProviderForStub func(worker.Worker) worker.ContainerProvider
containerProviderForMutex sync.RWMutex
containerProviderForArgsForCall []struct {
arg1 worker.Worker
}
containerProviderForReturns struct {
result1 worker.ContainerProvider
}
containerProviderForReturnsOnCall map[int]struct {
result1 worker.ContainerProvider
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeContainerProviderFactory) ContainerProviderFor(arg1 worker.Worker) worker.ContainerProvider {
fake.containerProviderForMutex.Lock()
ret, specificReturn := fake.containerProviderForReturnsOnCall[len(fake.containerProviderForArgsForCall)]
fake.containerProviderForArgsForCall = append(fake.containerProviderForArgsForCall, struct {
arg1 worker.Worker
}{arg1})
fake.recordInvocation("ContainerProviderFor", []interface{}{arg1})
fake.containerProviderForMutex.Unlock()
if fake.ContainerProviderForStub != nil {
return fake.ContainerProviderForStub(arg1)
}
if specificReturn {
return ret.result1
}
return fake.containerProviderForReturns.result1
}
func (fake *FakeContainerProviderFactory) ContainerProviderForCallCount() int {
fake.containerProviderForMutex.RLock()
defer fake.containerProviderForMutex.RUnlock()
return len(fake.containerProviderForArgsForCall)
}
func (fake *FakeContainerProviderFactory) ContainerProviderForArgsForCall(i int) worker.Worker {
fake.containerProviderForMutex.RLock()
defer fake.containerProviderForMutex.RUnlock()
return fake.containerProviderForArgsForCall[i].arg1
}
func (fake *FakeContainerProviderFactory) ContainerProviderForReturns(result1 worker.ContainerProvider) {
fake.ContainerProviderForStub = nil
fake.containerProviderForReturns = struct {
result1 worker.ContainerProvider
}{result1}
}
func (fake *FakeContainerProviderFactory) ContainerProviderForReturnsOnCall(i int, result1 worker.ContainerProvider) {
fake.ContainerProviderForStub = nil
if fake.containerProviderForReturnsOnCall == nil {
fake.containerProviderForReturnsOnCall = make(map[int]struct {
result1 worker.ContainerProvider
})
}
fake.containerProviderForReturnsOnCall[i] = struct {
result1 worker.ContainerProvider
}{result1}
}
func (fake *FakeContainerProviderFactory) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.containerProviderForMutex.RLock()
defer fake.containerProviderForMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeContainerProviderFactory) 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.ContainerProviderFactory = new(FakeContainerProviderFactory)