forked from cloudfoundry-community/cloudfoundry-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_service_plan_repository.go
176 lines (158 loc) · 5.65 KB
/
fake_service_plan_repository.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
172
173
174
175
176
// This file was generated by counterfeiter
package apifakes
import (
"sync"
"code.cloudfoundry.org/cli/cf/api"
"code.cloudfoundry.org/cli/cf/models"
)
type FakeServicePlanRepository struct {
SearchStub func(searchParameters map[string]string) ([]models.ServicePlanFields, error)
searchMutex sync.RWMutex
searchArgsForCall []struct {
searchParameters map[string]string
}
searchReturns struct {
result1 []models.ServicePlanFields
result2 error
}
UpdateStub func(models.ServicePlanFields, string, bool) error
updateMutex sync.RWMutex
updateArgsForCall []struct {
arg1 models.ServicePlanFields
arg2 string
arg3 bool
}
updateReturns struct {
result1 error
}
ListPlansFromManyServicesStub func(serviceGUIDs []string) ([]models.ServicePlanFields, error)
listPlansFromManyServicesMutex sync.RWMutex
listPlansFromManyServicesArgsForCall []struct {
serviceGUIDs []string
}
listPlansFromManyServicesReturns struct {
result1 []models.ServicePlanFields
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeServicePlanRepository) Search(searchParameters map[string]string) ([]models.ServicePlanFields, error) {
fake.searchMutex.Lock()
fake.searchArgsForCall = append(fake.searchArgsForCall, struct {
searchParameters map[string]string
}{searchParameters})
fake.recordInvocation("Search", []interface{}{searchParameters})
fake.searchMutex.Unlock()
if fake.SearchStub != nil {
return fake.SearchStub(searchParameters)
} else {
return fake.searchReturns.result1, fake.searchReturns.result2
}
}
func (fake *FakeServicePlanRepository) SearchCallCount() int {
fake.searchMutex.RLock()
defer fake.searchMutex.RUnlock()
return len(fake.searchArgsForCall)
}
func (fake *FakeServicePlanRepository) SearchArgsForCall(i int) map[string]string {
fake.searchMutex.RLock()
defer fake.searchMutex.RUnlock()
return fake.searchArgsForCall[i].searchParameters
}
func (fake *FakeServicePlanRepository) SearchReturns(result1 []models.ServicePlanFields, result2 error) {
fake.SearchStub = nil
fake.searchReturns = struct {
result1 []models.ServicePlanFields
result2 error
}{result1, result2}
}
func (fake *FakeServicePlanRepository) Update(arg1 models.ServicePlanFields, arg2 string, arg3 bool) error {
fake.updateMutex.Lock()
fake.updateArgsForCall = append(fake.updateArgsForCall, struct {
arg1 models.ServicePlanFields
arg2 string
arg3 bool
}{arg1, arg2, arg3})
fake.recordInvocation("Update", []interface{}{arg1, arg2, arg3})
fake.updateMutex.Unlock()
if fake.UpdateStub != nil {
return fake.UpdateStub(arg1, arg2, arg3)
} else {
return fake.updateReturns.result1
}
}
func (fake *FakeServicePlanRepository) UpdateCallCount() int {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return len(fake.updateArgsForCall)
}
func (fake *FakeServicePlanRepository) UpdateArgsForCall(i int) (models.ServicePlanFields, string, bool) {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return fake.updateArgsForCall[i].arg1, fake.updateArgsForCall[i].arg2, fake.updateArgsForCall[i].arg3
}
func (fake *FakeServicePlanRepository) UpdateReturns(result1 error) {
fake.UpdateStub = nil
fake.updateReturns = struct {
result1 error
}{result1}
}
func (fake *FakeServicePlanRepository) ListPlansFromManyServices(serviceGUIDs []string) ([]models.ServicePlanFields, error) {
var serviceGUIDsCopy []string
if serviceGUIDs != nil {
serviceGUIDsCopy = make([]string, len(serviceGUIDs))
copy(serviceGUIDsCopy, serviceGUIDs)
}
fake.listPlansFromManyServicesMutex.Lock()
fake.listPlansFromManyServicesArgsForCall = append(fake.listPlansFromManyServicesArgsForCall, struct {
serviceGUIDs []string
}{serviceGUIDsCopy})
fake.recordInvocation("ListPlansFromManyServices", []interface{}{serviceGUIDsCopy})
fake.listPlansFromManyServicesMutex.Unlock()
if fake.ListPlansFromManyServicesStub != nil {
return fake.ListPlansFromManyServicesStub(serviceGUIDs)
} else {
return fake.listPlansFromManyServicesReturns.result1, fake.listPlansFromManyServicesReturns.result2
}
}
func (fake *FakeServicePlanRepository) ListPlansFromManyServicesCallCount() int {
fake.listPlansFromManyServicesMutex.RLock()
defer fake.listPlansFromManyServicesMutex.RUnlock()
return len(fake.listPlansFromManyServicesArgsForCall)
}
func (fake *FakeServicePlanRepository) ListPlansFromManyServicesArgsForCall(i int) []string {
fake.listPlansFromManyServicesMutex.RLock()
defer fake.listPlansFromManyServicesMutex.RUnlock()
return fake.listPlansFromManyServicesArgsForCall[i].serviceGUIDs
}
func (fake *FakeServicePlanRepository) ListPlansFromManyServicesReturns(result1 []models.ServicePlanFields, result2 error) {
fake.ListPlansFromManyServicesStub = nil
fake.listPlansFromManyServicesReturns = struct {
result1 []models.ServicePlanFields
result2 error
}{result1, result2}
}
func (fake *FakeServicePlanRepository) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.searchMutex.RLock()
defer fake.searchMutex.RUnlock()
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
fake.listPlansFromManyServicesMutex.RLock()
defer fake.listPlansFromManyServicesMutex.RUnlock()
return fake.invocations
}
func (fake *FakeServicePlanRepository) 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 _ api.ServicePlanRepository = new(FakeServicePlanRepository)