-
Notifications
You must be signed in to change notification settings - Fork 927
/
fake_security_groups_repo.go
155 lines (138 loc) · 4.61 KB
/
fake_security_groups_repo.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
// This file was generated by counterfeiter
package stagingfakes
import (
"sync"
"code.cloudfoundry.org/cli/cf/api/securitygroups/defaults/staging"
"code.cloudfoundry.org/cli/cf/models"
)
type FakeSecurityGroupsRepo struct {
BindToStagingSetStub func(string) error
bindToStagingSetMutex sync.RWMutex
bindToStagingSetArgsForCall []struct {
arg1 string
}
bindToStagingSetReturns struct {
result1 error
}
ListStub func() ([]models.SecurityGroupFields, error)
listMutex sync.RWMutex
listArgsForCall []struct{}
listReturns struct {
result1 []models.SecurityGroupFields
result2 error
}
UnbindFromStagingSetStub func(string) error
unbindFromStagingSetMutex sync.RWMutex
unbindFromStagingSetArgsForCall []struct {
arg1 string
}
unbindFromStagingSetReturns struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeSecurityGroupsRepo) BindToStagingSet(arg1 string) error {
fake.bindToStagingSetMutex.Lock()
fake.bindToStagingSetArgsForCall = append(fake.bindToStagingSetArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("BindToStagingSet", []interface{}{arg1})
fake.bindToStagingSetMutex.Unlock()
if fake.BindToStagingSetStub != nil {
return fake.BindToStagingSetStub(arg1)
} else {
return fake.bindToStagingSetReturns.result1
}
}
func (fake *FakeSecurityGroupsRepo) BindToStagingSetCallCount() int {
fake.bindToStagingSetMutex.RLock()
defer fake.bindToStagingSetMutex.RUnlock()
return len(fake.bindToStagingSetArgsForCall)
}
func (fake *FakeSecurityGroupsRepo) BindToStagingSetArgsForCall(i int) string {
fake.bindToStagingSetMutex.RLock()
defer fake.bindToStagingSetMutex.RUnlock()
return fake.bindToStagingSetArgsForCall[i].arg1
}
func (fake *FakeSecurityGroupsRepo) BindToStagingSetReturns(result1 error) {
fake.BindToStagingSetStub = nil
fake.bindToStagingSetReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSecurityGroupsRepo) List() ([]models.SecurityGroupFields, error) {
fake.listMutex.Lock()
fake.listArgsForCall = append(fake.listArgsForCall, struct{}{})
fake.recordInvocation("List", []interface{}{})
fake.listMutex.Unlock()
if fake.ListStub != nil {
return fake.ListStub()
} else {
return fake.listReturns.result1, fake.listReturns.result2
}
}
func (fake *FakeSecurityGroupsRepo) ListCallCount() int {
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
return len(fake.listArgsForCall)
}
func (fake *FakeSecurityGroupsRepo) ListReturns(result1 []models.SecurityGroupFields, result2 error) {
fake.ListStub = nil
fake.listReturns = struct {
result1 []models.SecurityGroupFields
result2 error
}{result1, result2}
}
func (fake *FakeSecurityGroupsRepo) UnbindFromStagingSet(arg1 string) error {
fake.unbindFromStagingSetMutex.Lock()
fake.unbindFromStagingSetArgsForCall = append(fake.unbindFromStagingSetArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("UnbindFromStagingSet", []interface{}{arg1})
fake.unbindFromStagingSetMutex.Unlock()
if fake.UnbindFromStagingSetStub != nil {
return fake.UnbindFromStagingSetStub(arg1)
} else {
return fake.unbindFromStagingSetReturns.result1
}
}
func (fake *FakeSecurityGroupsRepo) UnbindFromStagingSetCallCount() int {
fake.unbindFromStagingSetMutex.RLock()
defer fake.unbindFromStagingSetMutex.RUnlock()
return len(fake.unbindFromStagingSetArgsForCall)
}
func (fake *FakeSecurityGroupsRepo) UnbindFromStagingSetArgsForCall(i int) string {
fake.unbindFromStagingSetMutex.RLock()
defer fake.unbindFromStagingSetMutex.RUnlock()
return fake.unbindFromStagingSetArgsForCall[i].arg1
}
func (fake *FakeSecurityGroupsRepo) UnbindFromStagingSetReturns(result1 error) {
fake.UnbindFromStagingSetStub = nil
fake.unbindFromStagingSetReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSecurityGroupsRepo) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.bindToStagingSetMutex.RLock()
defer fake.bindToStagingSetMutex.RUnlock()
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
fake.unbindFromStagingSetMutex.RLock()
defer fake.unbindFromStagingSetMutex.RUnlock()
return fake.invocations
}
func (fake *FakeSecurityGroupsRepo) 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 _ staging.SecurityGroupsRepo = new(FakeSecurityGroupsRepo)