github.com/loafoe/cli@v7.1.0+incompatible/cf/configuration/pluginconfig/pluginconfigfakes/fake_plugin_configuration.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package pluginconfigfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/configuration/pluginconfig" 8 ) 9 10 type FakePluginConfiguration struct { 11 GetPluginPathStub func() string 12 getPluginPathMutex sync.RWMutex 13 getPluginPathArgsForCall []struct { 14 } 15 getPluginPathReturns struct { 16 result1 string 17 } 18 getPluginPathReturnsOnCall map[int]struct { 19 result1 string 20 } 21 ListCommandsStub func() []string 22 listCommandsMutex sync.RWMutex 23 listCommandsArgsForCall []struct { 24 } 25 listCommandsReturns struct { 26 result1 []string 27 } 28 listCommandsReturnsOnCall map[int]struct { 29 result1 []string 30 } 31 PluginsStub func() map[string]pluginconfig.PluginMetadata 32 pluginsMutex sync.RWMutex 33 pluginsArgsForCall []struct { 34 } 35 pluginsReturns struct { 36 result1 map[string]pluginconfig.PluginMetadata 37 } 38 pluginsReturnsOnCall map[int]struct { 39 result1 map[string]pluginconfig.PluginMetadata 40 } 41 RemovePluginStub func(string) 42 removePluginMutex sync.RWMutex 43 removePluginArgsForCall []struct { 44 arg1 string 45 } 46 SetPluginStub func(string, pluginconfig.PluginMetadata) 47 setPluginMutex sync.RWMutex 48 setPluginArgsForCall []struct { 49 arg1 string 50 arg2 pluginconfig.PluginMetadata 51 } 52 invocations map[string][][]interface{} 53 invocationsMutex sync.RWMutex 54 } 55 56 func (fake *FakePluginConfiguration) GetPluginPath() string { 57 fake.getPluginPathMutex.Lock() 58 ret, specificReturn := fake.getPluginPathReturnsOnCall[len(fake.getPluginPathArgsForCall)] 59 fake.getPluginPathArgsForCall = append(fake.getPluginPathArgsForCall, struct { 60 }{}) 61 fake.recordInvocation("GetPluginPath", []interface{}{}) 62 fake.getPluginPathMutex.Unlock() 63 if fake.GetPluginPathStub != nil { 64 return fake.GetPluginPathStub() 65 } 66 if specificReturn { 67 return ret.result1 68 } 69 fakeReturns := fake.getPluginPathReturns 70 return fakeReturns.result1 71 } 72 73 func (fake *FakePluginConfiguration) GetPluginPathCallCount() int { 74 fake.getPluginPathMutex.RLock() 75 defer fake.getPluginPathMutex.RUnlock() 76 return len(fake.getPluginPathArgsForCall) 77 } 78 79 func (fake *FakePluginConfiguration) GetPluginPathCalls(stub func() string) { 80 fake.getPluginPathMutex.Lock() 81 defer fake.getPluginPathMutex.Unlock() 82 fake.GetPluginPathStub = stub 83 } 84 85 func (fake *FakePluginConfiguration) GetPluginPathReturns(result1 string) { 86 fake.getPluginPathMutex.Lock() 87 defer fake.getPluginPathMutex.Unlock() 88 fake.GetPluginPathStub = nil 89 fake.getPluginPathReturns = struct { 90 result1 string 91 }{result1} 92 } 93 94 func (fake *FakePluginConfiguration) GetPluginPathReturnsOnCall(i int, result1 string) { 95 fake.getPluginPathMutex.Lock() 96 defer fake.getPluginPathMutex.Unlock() 97 fake.GetPluginPathStub = nil 98 if fake.getPluginPathReturnsOnCall == nil { 99 fake.getPluginPathReturnsOnCall = make(map[int]struct { 100 result1 string 101 }) 102 } 103 fake.getPluginPathReturnsOnCall[i] = struct { 104 result1 string 105 }{result1} 106 } 107 108 func (fake *FakePluginConfiguration) ListCommands() []string { 109 fake.listCommandsMutex.Lock() 110 ret, specificReturn := fake.listCommandsReturnsOnCall[len(fake.listCommandsArgsForCall)] 111 fake.listCommandsArgsForCall = append(fake.listCommandsArgsForCall, struct { 112 }{}) 113 fake.recordInvocation("ListCommands", []interface{}{}) 114 fake.listCommandsMutex.Unlock() 115 if fake.ListCommandsStub != nil { 116 return fake.ListCommandsStub() 117 } 118 if specificReturn { 119 return ret.result1 120 } 121 fakeReturns := fake.listCommandsReturns 122 return fakeReturns.result1 123 } 124 125 func (fake *FakePluginConfiguration) ListCommandsCallCount() int { 126 fake.listCommandsMutex.RLock() 127 defer fake.listCommandsMutex.RUnlock() 128 return len(fake.listCommandsArgsForCall) 129 } 130 131 func (fake *FakePluginConfiguration) ListCommandsCalls(stub func() []string) { 132 fake.listCommandsMutex.Lock() 133 defer fake.listCommandsMutex.Unlock() 134 fake.ListCommandsStub = stub 135 } 136 137 func (fake *FakePluginConfiguration) ListCommandsReturns(result1 []string) { 138 fake.listCommandsMutex.Lock() 139 defer fake.listCommandsMutex.Unlock() 140 fake.ListCommandsStub = nil 141 fake.listCommandsReturns = struct { 142 result1 []string 143 }{result1} 144 } 145 146 func (fake *FakePluginConfiguration) ListCommandsReturnsOnCall(i int, result1 []string) { 147 fake.listCommandsMutex.Lock() 148 defer fake.listCommandsMutex.Unlock() 149 fake.ListCommandsStub = nil 150 if fake.listCommandsReturnsOnCall == nil { 151 fake.listCommandsReturnsOnCall = make(map[int]struct { 152 result1 []string 153 }) 154 } 155 fake.listCommandsReturnsOnCall[i] = struct { 156 result1 []string 157 }{result1} 158 } 159 160 func (fake *FakePluginConfiguration) Plugins() map[string]pluginconfig.PluginMetadata { 161 fake.pluginsMutex.Lock() 162 ret, specificReturn := fake.pluginsReturnsOnCall[len(fake.pluginsArgsForCall)] 163 fake.pluginsArgsForCall = append(fake.pluginsArgsForCall, struct { 164 }{}) 165 fake.recordInvocation("Plugins", []interface{}{}) 166 fake.pluginsMutex.Unlock() 167 if fake.PluginsStub != nil { 168 return fake.PluginsStub() 169 } 170 if specificReturn { 171 return ret.result1 172 } 173 fakeReturns := fake.pluginsReturns 174 return fakeReturns.result1 175 } 176 177 func (fake *FakePluginConfiguration) PluginsCallCount() int { 178 fake.pluginsMutex.RLock() 179 defer fake.pluginsMutex.RUnlock() 180 return len(fake.pluginsArgsForCall) 181 } 182 183 func (fake *FakePluginConfiguration) PluginsCalls(stub func() map[string]pluginconfig.PluginMetadata) { 184 fake.pluginsMutex.Lock() 185 defer fake.pluginsMutex.Unlock() 186 fake.PluginsStub = stub 187 } 188 189 func (fake *FakePluginConfiguration) PluginsReturns(result1 map[string]pluginconfig.PluginMetadata) { 190 fake.pluginsMutex.Lock() 191 defer fake.pluginsMutex.Unlock() 192 fake.PluginsStub = nil 193 fake.pluginsReturns = struct { 194 result1 map[string]pluginconfig.PluginMetadata 195 }{result1} 196 } 197 198 func (fake *FakePluginConfiguration) PluginsReturnsOnCall(i int, result1 map[string]pluginconfig.PluginMetadata) { 199 fake.pluginsMutex.Lock() 200 defer fake.pluginsMutex.Unlock() 201 fake.PluginsStub = nil 202 if fake.pluginsReturnsOnCall == nil { 203 fake.pluginsReturnsOnCall = make(map[int]struct { 204 result1 map[string]pluginconfig.PluginMetadata 205 }) 206 } 207 fake.pluginsReturnsOnCall[i] = struct { 208 result1 map[string]pluginconfig.PluginMetadata 209 }{result1} 210 } 211 212 func (fake *FakePluginConfiguration) RemovePlugin(arg1 string) { 213 fake.removePluginMutex.Lock() 214 fake.removePluginArgsForCall = append(fake.removePluginArgsForCall, struct { 215 arg1 string 216 }{arg1}) 217 fake.recordInvocation("RemovePlugin", []interface{}{arg1}) 218 fake.removePluginMutex.Unlock() 219 if fake.RemovePluginStub != nil { 220 fake.RemovePluginStub(arg1) 221 } 222 } 223 224 func (fake *FakePluginConfiguration) RemovePluginCallCount() int { 225 fake.removePluginMutex.RLock() 226 defer fake.removePluginMutex.RUnlock() 227 return len(fake.removePluginArgsForCall) 228 } 229 230 func (fake *FakePluginConfiguration) RemovePluginCalls(stub func(string)) { 231 fake.removePluginMutex.Lock() 232 defer fake.removePluginMutex.Unlock() 233 fake.RemovePluginStub = stub 234 } 235 236 func (fake *FakePluginConfiguration) RemovePluginArgsForCall(i int) string { 237 fake.removePluginMutex.RLock() 238 defer fake.removePluginMutex.RUnlock() 239 argsForCall := fake.removePluginArgsForCall[i] 240 return argsForCall.arg1 241 } 242 243 func (fake *FakePluginConfiguration) SetPlugin(arg1 string, arg2 pluginconfig.PluginMetadata) { 244 fake.setPluginMutex.Lock() 245 fake.setPluginArgsForCall = append(fake.setPluginArgsForCall, struct { 246 arg1 string 247 arg2 pluginconfig.PluginMetadata 248 }{arg1, arg2}) 249 fake.recordInvocation("SetPlugin", []interface{}{arg1, arg2}) 250 fake.setPluginMutex.Unlock() 251 if fake.SetPluginStub != nil { 252 fake.SetPluginStub(arg1, arg2) 253 } 254 } 255 256 func (fake *FakePluginConfiguration) SetPluginCallCount() int { 257 fake.setPluginMutex.RLock() 258 defer fake.setPluginMutex.RUnlock() 259 return len(fake.setPluginArgsForCall) 260 } 261 262 func (fake *FakePluginConfiguration) SetPluginCalls(stub func(string, pluginconfig.PluginMetadata)) { 263 fake.setPluginMutex.Lock() 264 defer fake.setPluginMutex.Unlock() 265 fake.SetPluginStub = stub 266 } 267 268 func (fake *FakePluginConfiguration) SetPluginArgsForCall(i int) (string, pluginconfig.PluginMetadata) { 269 fake.setPluginMutex.RLock() 270 defer fake.setPluginMutex.RUnlock() 271 argsForCall := fake.setPluginArgsForCall[i] 272 return argsForCall.arg1, argsForCall.arg2 273 } 274 275 func (fake *FakePluginConfiguration) Invocations() map[string][][]interface{} { 276 fake.invocationsMutex.RLock() 277 defer fake.invocationsMutex.RUnlock() 278 fake.getPluginPathMutex.RLock() 279 defer fake.getPluginPathMutex.RUnlock() 280 fake.listCommandsMutex.RLock() 281 defer fake.listCommandsMutex.RUnlock() 282 fake.pluginsMutex.RLock() 283 defer fake.pluginsMutex.RUnlock() 284 fake.removePluginMutex.RLock() 285 defer fake.removePluginMutex.RUnlock() 286 fake.setPluginMutex.RLock() 287 defer fake.setPluginMutex.RUnlock() 288 copiedInvocations := map[string][][]interface{}{} 289 for key, value := range fake.invocations { 290 copiedInvocations[key] = value 291 } 292 return copiedInvocations 293 } 294 295 func (fake *FakePluginConfiguration) recordInvocation(key string, args []interface{}) { 296 fake.invocationsMutex.Lock() 297 defer fake.invocationsMutex.Unlock() 298 if fake.invocations == nil { 299 fake.invocations = map[string][][]interface{}{} 300 } 301 if fake.invocations[key] == nil { 302 fake.invocations[key] = [][]interface{}{} 303 } 304 fake.invocations[key] = append(fake.invocations[key], args) 305 } 306 307 var _ pluginconfig.PluginConfiguration = new(FakePluginConfiguration)