forked from vmware-archive/atc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fake_garden_connection_factory.go
89 lines (79 loc) · 2.7 KB
/
fake_garden_connection_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
// Code generated by counterfeiter. DO NOT EDIT.
package workerfakes
import (
"sync"
gconn "code.cloudfoundry.org/garden/client/connection"
"github.com/concourse/atc/worker"
)
type FakeGardenConnectionFactory struct {
BuildConnectionStub func() gconn.Connection
buildConnectionMutex sync.RWMutex
buildConnectionArgsForCall []struct{}
buildConnectionReturns struct {
result1 gconn.Connection
}
buildConnectionReturnsOnCall map[int]struct {
result1 gconn.Connection
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeGardenConnectionFactory) BuildConnection() gconn.Connection {
fake.buildConnectionMutex.Lock()
ret, specificReturn := fake.buildConnectionReturnsOnCall[len(fake.buildConnectionArgsForCall)]
fake.buildConnectionArgsForCall = append(fake.buildConnectionArgsForCall, struct{}{})
fake.recordInvocation("BuildConnection", []interface{}{})
fake.buildConnectionMutex.Unlock()
if fake.BuildConnectionStub != nil {
return fake.BuildConnectionStub()
}
if specificReturn {
return ret.result1
}
return fake.buildConnectionReturns.result1
}
func (fake *FakeGardenConnectionFactory) BuildConnectionCallCount() int {
fake.buildConnectionMutex.RLock()
defer fake.buildConnectionMutex.RUnlock()
return len(fake.buildConnectionArgsForCall)
}
func (fake *FakeGardenConnectionFactory) BuildConnectionReturns(result1 gconn.Connection) {
fake.BuildConnectionStub = nil
fake.buildConnectionReturns = struct {
result1 gconn.Connection
}{result1}
}
func (fake *FakeGardenConnectionFactory) BuildConnectionReturnsOnCall(i int, result1 gconn.Connection) {
fake.BuildConnectionStub = nil
if fake.buildConnectionReturnsOnCall == nil {
fake.buildConnectionReturnsOnCall = make(map[int]struct {
result1 gconn.Connection
})
}
fake.buildConnectionReturnsOnCall[i] = struct {
result1 gconn.Connection
}{result1}
}
func (fake *FakeGardenConnectionFactory) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.buildConnectionMutex.RLock()
defer fake.buildConnectionMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeGardenConnectionFactory) 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.GardenConnectionFactory = new(FakeGardenConnectionFactory)