github.com/ewagmig/fabric@v2.1.1+incompatible/core/chaincode/mock/container_router.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric/core/container/ccintf" 8 ) 9 10 type ContainerRouter struct { 11 BuildStub func(string) error 12 buildMutex sync.RWMutex 13 buildArgsForCall []struct { 14 arg1 string 15 } 16 buildReturns struct { 17 result1 error 18 } 19 buildReturnsOnCall map[int]struct { 20 result1 error 21 } 22 ChaincodeServerInfoStub func(string) (*ccintf.ChaincodeServerInfo, error) 23 chaincodeServerInfoMutex sync.RWMutex 24 chaincodeServerInfoArgsForCall []struct { 25 arg1 string 26 } 27 chaincodeServerInfoReturns struct { 28 result1 *ccintf.ChaincodeServerInfo 29 result2 error 30 } 31 chaincodeServerInfoReturnsOnCall map[int]struct { 32 result1 *ccintf.ChaincodeServerInfo 33 result2 error 34 } 35 StartStub func(string, *ccintf.PeerConnection) error 36 startMutex sync.RWMutex 37 startArgsForCall []struct { 38 arg1 string 39 arg2 *ccintf.PeerConnection 40 } 41 startReturns struct { 42 result1 error 43 } 44 startReturnsOnCall map[int]struct { 45 result1 error 46 } 47 StopStub func(string) error 48 stopMutex sync.RWMutex 49 stopArgsForCall []struct { 50 arg1 string 51 } 52 stopReturns struct { 53 result1 error 54 } 55 stopReturnsOnCall map[int]struct { 56 result1 error 57 } 58 WaitStub func(string) (int, error) 59 waitMutex sync.RWMutex 60 waitArgsForCall []struct { 61 arg1 string 62 } 63 waitReturns struct { 64 result1 int 65 result2 error 66 } 67 waitReturnsOnCall map[int]struct { 68 result1 int 69 result2 error 70 } 71 invocations map[string][][]interface{} 72 invocationsMutex sync.RWMutex 73 } 74 75 func (fake *ContainerRouter) Build(arg1 string) error { 76 fake.buildMutex.Lock() 77 ret, specificReturn := fake.buildReturnsOnCall[len(fake.buildArgsForCall)] 78 fake.buildArgsForCall = append(fake.buildArgsForCall, struct { 79 arg1 string 80 }{arg1}) 81 fake.recordInvocation("Build", []interface{}{arg1}) 82 fake.buildMutex.Unlock() 83 if fake.BuildStub != nil { 84 return fake.BuildStub(arg1) 85 } 86 if specificReturn { 87 return ret.result1 88 } 89 fakeReturns := fake.buildReturns 90 return fakeReturns.result1 91 } 92 93 func (fake *ContainerRouter) BuildCallCount() int { 94 fake.buildMutex.RLock() 95 defer fake.buildMutex.RUnlock() 96 return len(fake.buildArgsForCall) 97 } 98 99 func (fake *ContainerRouter) BuildCalls(stub func(string) error) { 100 fake.buildMutex.Lock() 101 defer fake.buildMutex.Unlock() 102 fake.BuildStub = stub 103 } 104 105 func (fake *ContainerRouter) BuildArgsForCall(i int) string { 106 fake.buildMutex.RLock() 107 defer fake.buildMutex.RUnlock() 108 argsForCall := fake.buildArgsForCall[i] 109 return argsForCall.arg1 110 } 111 112 func (fake *ContainerRouter) BuildReturns(result1 error) { 113 fake.buildMutex.Lock() 114 defer fake.buildMutex.Unlock() 115 fake.BuildStub = nil 116 fake.buildReturns = struct { 117 result1 error 118 }{result1} 119 } 120 121 func (fake *ContainerRouter) BuildReturnsOnCall(i int, result1 error) { 122 fake.buildMutex.Lock() 123 defer fake.buildMutex.Unlock() 124 fake.BuildStub = nil 125 if fake.buildReturnsOnCall == nil { 126 fake.buildReturnsOnCall = make(map[int]struct { 127 result1 error 128 }) 129 } 130 fake.buildReturnsOnCall[i] = struct { 131 result1 error 132 }{result1} 133 } 134 135 func (fake *ContainerRouter) ChaincodeServerInfo(arg1 string) (*ccintf.ChaincodeServerInfo, error) { 136 fake.chaincodeServerInfoMutex.Lock() 137 ret, specificReturn := fake.chaincodeServerInfoReturnsOnCall[len(fake.chaincodeServerInfoArgsForCall)] 138 fake.chaincodeServerInfoArgsForCall = append(fake.chaincodeServerInfoArgsForCall, struct { 139 arg1 string 140 }{arg1}) 141 fake.recordInvocation("ChaincodeServerInfo", []interface{}{arg1}) 142 fake.chaincodeServerInfoMutex.Unlock() 143 if fake.ChaincodeServerInfoStub != nil { 144 return fake.ChaincodeServerInfoStub(arg1) 145 } 146 if specificReturn { 147 return ret.result1, ret.result2 148 } 149 fakeReturns := fake.chaincodeServerInfoReturns 150 return fakeReturns.result1, fakeReturns.result2 151 } 152 153 func (fake *ContainerRouter) ChaincodeServerInfoCallCount() int { 154 fake.chaincodeServerInfoMutex.RLock() 155 defer fake.chaincodeServerInfoMutex.RUnlock() 156 return len(fake.chaincodeServerInfoArgsForCall) 157 } 158 159 func (fake *ContainerRouter) ChaincodeServerInfoCalls(stub func(string) (*ccintf.ChaincodeServerInfo, error)) { 160 fake.chaincodeServerInfoMutex.Lock() 161 defer fake.chaincodeServerInfoMutex.Unlock() 162 fake.ChaincodeServerInfoStub = stub 163 } 164 165 func (fake *ContainerRouter) ChaincodeServerInfoArgsForCall(i int) string { 166 fake.chaincodeServerInfoMutex.RLock() 167 defer fake.chaincodeServerInfoMutex.RUnlock() 168 argsForCall := fake.chaincodeServerInfoArgsForCall[i] 169 return argsForCall.arg1 170 } 171 172 func (fake *ContainerRouter) ChaincodeServerInfoReturns(result1 *ccintf.ChaincodeServerInfo, result2 error) { 173 fake.chaincodeServerInfoMutex.Lock() 174 defer fake.chaincodeServerInfoMutex.Unlock() 175 fake.ChaincodeServerInfoStub = nil 176 fake.chaincodeServerInfoReturns = struct { 177 result1 *ccintf.ChaincodeServerInfo 178 result2 error 179 }{result1, result2} 180 } 181 182 func (fake *ContainerRouter) ChaincodeServerInfoReturnsOnCall(i int, result1 *ccintf.ChaincodeServerInfo, result2 error) { 183 fake.chaincodeServerInfoMutex.Lock() 184 defer fake.chaincodeServerInfoMutex.Unlock() 185 fake.ChaincodeServerInfoStub = nil 186 if fake.chaincodeServerInfoReturnsOnCall == nil { 187 fake.chaincodeServerInfoReturnsOnCall = make(map[int]struct { 188 result1 *ccintf.ChaincodeServerInfo 189 result2 error 190 }) 191 } 192 fake.chaincodeServerInfoReturnsOnCall[i] = struct { 193 result1 *ccintf.ChaincodeServerInfo 194 result2 error 195 }{result1, result2} 196 } 197 198 func (fake *ContainerRouter) Start(arg1 string, arg2 *ccintf.PeerConnection) error { 199 fake.startMutex.Lock() 200 ret, specificReturn := fake.startReturnsOnCall[len(fake.startArgsForCall)] 201 fake.startArgsForCall = append(fake.startArgsForCall, struct { 202 arg1 string 203 arg2 *ccintf.PeerConnection 204 }{arg1, arg2}) 205 fake.recordInvocation("Start", []interface{}{arg1, arg2}) 206 fake.startMutex.Unlock() 207 if fake.StartStub != nil { 208 return fake.StartStub(arg1, arg2) 209 } 210 if specificReturn { 211 return ret.result1 212 } 213 fakeReturns := fake.startReturns 214 return fakeReturns.result1 215 } 216 217 func (fake *ContainerRouter) StartCallCount() int { 218 fake.startMutex.RLock() 219 defer fake.startMutex.RUnlock() 220 return len(fake.startArgsForCall) 221 } 222 223 func (fake *ContainerRouter) StartCalls(stub func(string, *ccintf.PeerConnection) error) { 224 fake.startMutex.Lock() 225 defer fake.startMutex.Unlock() 226 fake.StartStub = stub 227 } 228 229 func (fake *ContainerRouter) StartArgsForCall(i int) (string, *ccintf.PeerConnection) { 230 fake.startMutex.RLock() 231 defer fake.startMutex.RUnlock() 232 argsForCall := fake.startArgsForCall[i] 233 return argsForCall.arg1, argsForCall.arg2 234 } 235 236 func (fake *ContainerRouter) StartReturns(result1 error) { 237 fake.startMutex.Lock() 238 defer fake.startMutex.Unlock() 239 fake.StartStub = nil 240 fake.startReturns = struct { 241 result1 error 242 }{result1} 243 } 244 245 func (fake *ContainerRouter) StartReturnsOnCall(i int, result1 error) { 246 fake.startMutex.Lock() 247 defer fake.startMutex.Unlock() 248 fake.StartStub = nil 249 if fake.startReturnsOnCall == nil { 250 fake.startReturnsOnCall = make(map[int]struct { 251 result1 error 252 }) 253 } 254 fake.startReturnsOnCall[i] = struct { 255 result1 error 256 }{result1} 257 } 258 259 func (fake *ContainerRouter) Stop(arg1 string) error { 260 fake.stopMutex.Lock() 261 ret, specificReturn := fake.stopReturnsOnCall[len(fake.stopArgsForCall)] 262 fake.stopArgsForCall = append(fake.stopArgsForCall, struct { 263 arg1 string 264 }{arg1}) 265 fake.recordInvocation("Stop", []interface{}{arg1}) 266 fake.stopMutex.Unlock() 267 if fake.StopStub != nil { 268 return fake.StopStub(arg1) 269 } 270 if specificReturn { 271 return ret.result1 272 } 273 fakeReturns := fake.stopReturns 274 return fakeReturns.result1 275 } 276 277 func (fake *ContainerRouter) StopCallCount() int { 278 fake.stopMutex.RLock() 279 defer fake.stopMutex.RUnlock() 280 return len(fake.stopArgsForCall) 281 } 282 283 func (fake *ContainerRouter) StopCalls(stub func(string) error) { 284 fake.stopMutex.Lock() 285 defer fake.stopMutex.Unlock() 286 fake.StopStub = stub 287 } 288 289 func (fake *ContainerRouter) StopArgsForCall(i int) string { 290 fake.stopMutex.RLock() 291 defer fake.stopMutex.RUnlock() 292 argsForCall := fake.stopArgsForCall[i] 293 return argsForCall.arg1 294 } 295 296 func (fake *ContainerRouter) StopReturns(result1 error) { 297 fake.stopMutex.Lock() 298 defer fake.stopMutex.Unlock() 299 fake.StopStub = nil 300 fake.stopReturns = struct { 301 result1 error 302 }{result1} 303 } 304 305 func (fake *ContainerRouter) StopReturnsOnCall(i int, result1 error) { 306 fake.stopMutex.Lock() 307 defer fake.stopMutex.Unlock() 308 fake.StopStub = nil 309 if fake.stopReturnsOnCall == nil { 310 fake.stopReturnsOnCall = make(map[int]struct { 311 result1 error 312 }) 313 } 314 fake.stopReturnsOnCall[i] = struct { 315 result1 error 316 }{result1} 317 } 318 319 func (fake *ContainerRouter) Wait(arg1 string) (int, error) { 320 fake.waitMutex.Lock() 321 ret, specificReturn := fake.waitReturnsOnCall[len(fake.waitArgsForCall)] 322 fake.waitArgsForCall = append(fake.waitArgsForCall, struct { 323 arg1 string 324 }{arg1}) 325 fake.recordInvocation("Wait", []interface{}{arg1}) 326 fake.waitMutex.Unlock() 327 if fake.WaitStub != nil { 328 return fake.WaitStub(arg1) 329 } 330 if specificReturn { 331 return ret.result1, ret.result2 332 } 333 fakeReturns := fake.waitReturns 334 return fakeReturns.result1, fakeReturns.result2 335 } 336 337 func (fake *ContainerRouter) WaitCallCount() int { 338 fake.waitMutex.RLock() 339 defer fake.waitMutex.RUnlock() 340 return len(fake.waitArgsForCall) 341 } 342 343 func (fake *ContainerRouter) WaitCalls(stub func(string) (int, error)) { 344 fake.waitMutex.Lock() 345 defer fake.waitMutex.Unlock() 346 fake.WaitStub = stub 347 } 348 349 func (fake *ContainerRouter) WaitArgsForCall(i int) string { 350 fake.waitMutex.RLock() 351 defer fake.waitMutex.RUnlock() 352 argsForCall := fake.waitArgsForCall[i] 353 return argsForCall.arg1 354 } 355 356 func (fake *ContainerRouter) WaitReturns(result1 int, result2 error) { 357 fake.waitMutex.Lock() 358 defer fake.waitMutex.Unlock() 359 fake.WaitStub = nil 360 fake.waitReturns = struct { 361 result1 int 362 result2 error 363 }{result1, result2} 364 } 365 366 func (fake *ContainerRouter) WaitReturnsOnCall(i int, result1 int, result2 error) { 367 fake.waitMutex.Lock() 368 defer fake.waitMutex.Unlock() 369 fake.WaitStub = nil 370 if fake.waitReturnsOnCall == nil { 371 fake.waitReturnsOnCall = make(map[int]struct { 372 result1 int 373 result2 error 374 }) 375 } 376 fake.waitReturnsOnCall[i] = struct { 377 result1 int 378 result2 error 379 }{result1, result2} 380 } 381 382 func (fake *ContainerRouter) Invocations() map[string][][]interface{} { 383 fake.invocationsMutex.RLock() 384 defer fake.invocationsMutex.RUnlock() 385 fake.buildMutex.RLock() 386 defer fake.buildMutex.RUnlock() 387 fake.chaincodeServerInfoMutex.RLock() 388 defer fake.chaincodeServerInfoMutex.RUnlock() 389 fake.startMutex.RLock() 390 defer fake.startMutex.RUnlock() 391 fake.stopMutex.RLock() 392 defer fake.stopMutex.RUnlock() 393 fake.waitMutex.RLock() 394 defer fake.waitMutex.RUnlock() 395 copiedInvocations := map[string][][]interface{}{} 396 for key, value := range fake.invocations { 397 copiedInvocations[key] = value 398 } 399 return copiedInvocations 400 } 401 402 func (fake *ContainerRouter) recordInvocation(key string, args []interface{}) { 403 fake.invocationsMutex.Lock() 404 defer fake.invocationsMutex.Unlock() 405 if fake.invocations == nil { 406 fake.invocations = map[string][][]interface{}{} 407 } 408 if fake.invocations[key] == nil { 409 fake.invocations[key] = [][]interface{}{} 410 } 411 fake.invocations[key] = append(fake.invocations[key], args) 412 }