gitee.com/zhaochuninhefei/fabric-ca-gm@v0.0.2/lib/server/db/mocks/fabricCATX.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mocks 3 4 import ( 5 sql "database/sql" 6 sync "sync" 7 8 db "gitee.com/zhaochuninhefei/fabric-ca-gm/lib/server/db" 9 sqlx "github.com/jmoiron/sqlx" 10 ) 11 12 type FabricCATx struct { 13 CommitStub func(string) error 14 commitMutex sync.RWMutex 15 commitArgsForCall []struct { 16 arg1 string 17 } 18 commitReturns struct { 19 result1 error 20 } 21 commitReturnsOnCall map[int]struct { 22 result1 error 23 } 24 ExecStub func(string, string, ...interface{}) (sql.Result, error) 25 execMutex sync.RWMutex 26 execArgsForCall []struct { 27 arg1 string 28 arg2 string 29 arg3 []interface{} 30 } 31 execReturns struct { 32 result1 sql.Result 33 result2 error 34 } 35 execReturnsOnCall map[int]struct { 36 result1 sql.Result 37 result2 error 38 } 39 GetStub func(string, interface{}, string, ...interface{}) error 40 getMutex sync.RWMutex 41 getArgsForCall []struct { 42 arg1 string 43 arg2 interface{} 44 arg3 string 45 arg4 []interface{} 46 } 47 getReturns struct { 48 result1 error 49 } 50 getReturnsOnCall map[int]struct { 51 result1 error 52 } 53 QueryxStub func(string, string, ...interface{}) (*sqlx.Rows, error) 54 queryxMutex sync.RWMutex 55 queryxArgsForCall []struct { 56 arg1 string 57 arg2 string 58 arg3 []interface{} 59 } 60 queryxReturns struct { 61 result1 *sqlx.Rows 62 result2 error 63 } 64 queryxReturnsOnCall map[int]struct { 65 result1 *sqlx.Rows 66 result2 error 67 } 68 RebindStub func(string) string 69 rebindMutex sync.RWMutex 70 rebindArgsForCall []struct { 71 arg1 string 72 } 73 rebindReturns struct { 74 result1 string 75 } 76 rebindReturnsOnCall map[int]struct { 77 result1 string 78 } 79 RollbackStub func(string) error 80 rollbackMutex sync.RWMutex 81 rollbackArgsForCall []struct { 82 arg1 string 83 } 84 rollbackReturns struct { 85 result1 error 86 } 87 rollbackReturnsOnCall map[int]struct { 88 result1 error 89 } 90 SelectStub func(string, interface{}, string, ...interface{}) error 91 selectMutex sync.RWMutex 92 selectArgsForCall []struct { 93 arg1 string 94 arg2 interface{} 95 arg3 string 96 arg4 []interface{} 97 } 98 selectReturns struct { 99 result1 error 100 } 101 selectReturnsOnCall map[int]struct { 102 result1 error 103 } 104 invocations map[string][][]interface{} 105 invocationsMutex sync.RWMutex 106 } 107 108 func (fake *FabricCATx) Commit(arg1 string) error { 109 fake.commitMutex.Lock() 110 ret, specificReturn := fake.commitReturnsOnCall[len(fake.commitArgsForCall)] 111 fake.commitArgsForCall = append(fake.commitArgsForCall, struct { 112 arg1 string 113 }{arg1}) 114 fake.recordInvocation("Commit", []interface{}{arg1}) 115 fake.commitMutex.Unlock() 116 if fake.CommitStub != nil { 117 return fake.CommitStub(arg1) 118 } 119 if specificReturn { 120 return ret.result1 121 } 122 fakeReturns := fake.commitReturns 123 return fakeReturns.result1 124 } 125 126 func (fake *FabricCATx) CommitCallCount() int { 127 fake.commitMutex.RLock() 128 defer fake.commitMutex.RUnlock() 129 return len(fake.commitArgsForCall) 130 } 131 132 func (fake *FabricCATx) CommitCalls(stub func(string) error) { 133 fake.commitMutex.Lock() 134 defer fake.commitMutex.Unlock() 135 fake.CommitStub = stub 136 } 137 138 func (fake *FabricCATx) CommitArgsForCall(i int) string { 139 fake.commitMutex.RLock() 140 defer fake.commitMutex.RUnlock() 141 argsForCall := fake.commitArgsForCall[i] 142 return argsForCall.arg1 143 } 144 145 func (fake *FabricCATx) CommitReturns(result1 error) { 146 fake.commitMutex.Lock() 147 defer fake.commitMutex.Unlock() 148 fake.CommitStub = nil 149 fake.commitReturns = struct { 150 result1 error 151 }{result1} 152 } 153 154 func (fake *FabricCATx) CommitReturnsOnCall(i int, result1 error) { 155 fake.commitMutex.Lock() 156 defer fake.commitMutex.Unlock() 157 fake.CommitStub = nil 158 if fake.commitReturnsOnCall == nil { 159 fake.commitReturnsOnCall = make(map[int]struct { 160 result1 error 161 }) 162 } 163 fake.commitReturnsOnCall[i] = struct { 164 result1 error 165 }{result1} 166 } 167 168 func (fake *FabricCATx) Exec(arg1 string, arg2 string, arg3 ...interface{}) (sql.Result, error) { 169 fake.execMutex.Lock() 170 ret, specificReturn := fake.execReturnsOnCall[len(fake.execArgsForCall)] 171 fake.execArgsForCall = append(fake.execArgsForCall, struct { 172 arg1 string 173 arg2 string 174 arg3 []interface{} 175 }{arg1, arg2, arg3}) 176 fake.recordInvocation("Exec", []interface{}{arg1, arg2, arg3}) 177 fake.execMutex.Unlock() 178 if fake.ExecStub != nil { 179 return fake.ExecStub(arg1, arg2, arg3...) 180 } 181 if specificReturn { 182 return ret.result1, ret.result2 183 } 184 fakeReturns := fake.execReturns 185 return fakeReturns.result1, fakeReturns.result2 186 } 187 188 func (fake *FabricCATx) ExecCallCount() int { 189 fake.execMutex.RLock() 190 defer fake.execMutex.RUnlock() 191 return len(fake.execArgsForCall) 192 } 193 194 func (fake *FabricCATx) ExecCalls(stub func(string, string, ...interface{}) (sql.Result, error)) { 195 fake.execMutex.Lock() 196 defer fake.execMutex.Unlock() 197 fake.ExecStub = stub 198 } 199 200 func (fake *FabricCATx) ExecArgsForCall(i int) (string, string, []interface{}) { 201 fake.execMutex.RLock() 202 defer fake.execMutex.RUnlock() 203 argsForCall := fake.execArgsForCall[i] 204 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 205 } 206 207 func (fake *FabricCATx) ExecReturns(result1 sql.Result, result2 error) { 208 fake.execMutex.Lock() 209 defer fake.execMutex.Unlock() 210 fake.ExecStub = nil 211 fake.execReturns = struct { 212 result1 sql.Result 213 result2 error 214 }{result1, result2} 215 } 216 217 func (fake *FabricCATx) ExecReturnsOnCall(i int, result1 sql.Result, result2 error) { 218 fake.execMutex.Lock() 219 defer fake.execMutex.Unlock() 220 fake.ExecStub = nil 221 if fake.execReturnsOnCall == nil { 222 fake.execReturnsOnCall = make(map[int]struct { 223 result1 sql.Result 224 result2 error 225 }) 226 } 227 fake.execReturnsOnCall[i] = struct { 228 result1 sql.Result 229 result2 error 230 }{result1, result2} 231 } 232 233 func (fake *FabricCATx) Get(arg1 string, arg2 interface{}, arg3 string, arg4 ...interface{}) error { 234 fake.getMutex.Lock() 235 ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)] 236 fake.getArgsForCall = append(fake.getArgsForCall, struct { 237 arg1 string 238 arg2 interface{} 239 arg3 string 240 arg4 []interface{} 241 }{arg1, arg2, arg3, arg4}) 242 fake.recordInvocation("Get", []interface{}{arg1, arg2, arg3, arg4}) 243 fake.getMutex.Unlock() 244 if fake.GetStub != nil { 245 return fake.GetStub(arg1, arg2, arg3, arg4...) 246 } 247 if specificReturn { 248 return ret.result1 249 } 250 fakeReturns := fake.getReturns 251 return fakeReturns.result1 252 } 253 254 func (fake *FabricCATx) GetCallCount() int { 255 fake.getMutex.RLock() 256 defer fake.getMutex.RUnlock() 257 return len(fake.getArgsForCall) 258 } 259 260 func (fake *FabricCATx) GetCalls(stub func(string, interface{}, string, ...interface{}) error) { 261 fake.getMutex.Lock() 262 defer fake.getMutex.Unlock() 263 fake.GetStub = stub 264 } 265 266 func (fake *FabricCATx) GetArgsForCall(i int) (string, interface{}, string, []interface{}) { 267 fake.getMutex.RLock() 268 defer fake.getMutex.RUnlock() 269 argsForCall := fake.getArgsForCall[i] 270 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4 271 } 272 273 func (fake *FabricCATx) GetReturns(result1 error) { 274 fake.getMutex.Lock() 275 defer fake.getMutex.Unlock() 276 fake.GetStub = nil 277 fake.getReturns = struct { 278 result1 error 279 }{result1} 280 } 281 282 func (fake *FabricCATx) GetReturnsOnCall(i int, result1 error) { 283 fake.getMutex.Lock() 284 defer fake.getMutex.Unlock() 285 fake.GetStub = nil 286 if fake.getReturnsOnCall == nil { 287 fake.getReturnsOnCall = make(map[int]struct { 288 result1 error 289 }) 290 } 291 fake.getReturnsOnCall[i] = struct { 292 result1 error 293 }{result1} 294 } 295 296 func (fake *FabricCATx) Queryx(arg1 string, arg2 string, arg3 ...interface{}) (*sqlx.Rows, error) { 297 fake.queryxMutex.Lock() 298 ret, specificReturn := fake.queryxReturnsOnCall[len(fake.queryxArgsForCall)] 299 fake.queryxArgsForCall = append(fake.queryxArgsForCall, struct { 300 arg1 string 301 arg2 string 302 arg3 []interface{} 303 }{arg1, arg2, arg3}) 304 fake.recordInvocation("Queryx", []interface{}{arg1, arg2, arg3}) 305 fake.queryxMutex.Unlock() 306 if fake.QueryxStub != nil { 307 return fake.QueryxStub(arg1, arg2, arg3...) 308 } 309 if specificReturn { 310 return ret.result1, ret.result2 311 } 312 fakeReturns := fake.queryxReturns 313 return fakeReturns.result1, fakeReturns.result2 314 } 315 316 func (fake *FabricCATx) QueryxCallCount() int { 317 fake.queryxMutex.RLock() 318 defer fake.queryxMutex.RUnlock() 319 return len(fake.queryxArgsForCall) 320 } 321 322 func (fake *FabricCATx) QueryxCalls(stub func(string, string, ...interface{}) (*sqlx.Rows, error)) { 323 fake.queryxMutex.Lock() 324 defer fake.queryxMutex.Unlock() 325 fake.QueryxStub = stub 326 } 327 328 func (fake *FabricCATx) QueryxArgsForCall(i int) (string, string, []interface{}) { 329 fake.queryxMutex.RLock() 330 defer fake.queryxMutex.RUnlock() 331 argsForCall := fake.queryxArgsForCall[i] 332 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 333 } 334 335 func (fake *FabricCATx) QueryxReturns(result1 *sqlx.Rows, result2 error) { 336 fake.queryxMutex.Lock() 337 defer fake.queryxMutex.Unlock() 338 fake.QueryxStub = nil 339 fake.queryxReturns = struct { 340 result1 *sqlx.Rows 341 result2 error 342 }{result1, result2} 343 } 344 345 func (fake *FabricCATx) QueryxReturnsOnCall(i int, result1 *sqlx.Rows, result2 error) { 346 fake.queryxMutex.Lock() 347 defer fake.queryxMutex.Unlock() 348 fake.QueryxStub = nil 349 if fake.queryxReturnsOnCall == nil { 350 fake.queryxReturnsOnCall = make(map[int]struct { 351 result1 *sqlx.Rows 352 result2 error 353 }) 354 } 355 fake.queryxReturnsOnCall[i] = struct { 356 result1 *sqlx.Rows 357 result2 error 358 }{result1, result2} 359 } 360 361 func (fake *FabricCATx) Rebind(arg1 string) string { 362 fake.rebindMutex.Lock() 363 ret, specificReturn := fake.rebindReturnsOnCall[len(fake.rebindArgsForCall)] 364 fake.rebindArgsForCall = append(fake.rebindArgsForCall, struct { 365 arg1 string 366 }{arg1}) 367 fake.recordInvocation("Rebind", []interface{}{arg1}) 368 fake.rebindMutex.Unlock() 369 if fake.RebindStub != nil { 370 return fake.RebindStub(arg1) 371 } 372 if specificReturn { 373 return ret.result1 374 } 375 fakeReturns := fake.rebindReturns 376 return fakeReturns.result1 377 } 378 379 func (fake *FabricCATx) RebindCallCount() int { 380 fake.rebindMutex.RLock() 381 defer fake.rebindMutex.RUnlock() 382 return len(fake.rebindArgsForCall) 383 } 384 385 func (fake *FabricCATx) RebindCalls(stub func(string) string) { 386 fake.rebindMutex.Lock() 387 defer fake.rebindMutex.Unlock() 388 fake.RebindStub = stub 389 } 390 391 func (fake *FabricCATx) RebindArgsForCall(i int) string { 392 fake.rebindMutex.RLock() 393 defer fake.rebindMutex.RUnlock() 394 argsForCall := fake.rebindArgsForCall[i] 395 return argsForCall.arg1 396 } 397 398 func (fake *FabricCATx) RebindReturns(result1 string) { 399 fake.rebindMutex.Lock() 400 defer fake.rebindMutex.Unlock() 401 fake.RebindStub = nil 402 fake.rebindReturns = struct { 403 result1 string 404 }{result1} 405 } 406 407 func (fake *FabricCATx) RebindReturnsOnCall(i int, result1 string) { 408 fake.rebindMutex.Lock() 409 defer fake.rebindMutex.Unlock() 410 fake.RebindStub = nil 411 if fake.rebindReturnsOnCall == nil { 412 fake.rebindReturnsOnCall = make(map[int]struct { 413 result1 string 414 }) 415 } 416 fake.rebindReturnsOnCall[i] = struct { 417 result1 string 418 }{result1} 419 } 420 421 func (fake *FabricCATx) Rollback(arg1 string) error { 422 fake.rollbackMutex.Lock() 423 ret, specificReturn := fake.rollbackReturnsOnCall[len(fake.rollbackArgsForCall)] 424 fake.rollbackArgsForCall = append(fake.rollbackArgsForCall, struct { 425 arg1 string 426 }{arg1}) 427 fake.recordInvocation("Rollback", []interface{}{arg1}) 428 fake.rollbackMutex.Unlock() 429 if fake.RollbackStub != nil { 430 return fake.RollbackStub(arg1) 431 } 432 if specificReturn { 433 return ret.result1 434 } 435 fakeReturns := fake.rollbackReturns 436 return fakeReturns.result1 437 } 438 439 func (fake *FabricCATx) RollbackCallCount() int { 440 fake.rollbackMutex.RLock() 441 defer fake.rollbackMutex.RUnlock() 442 return len(fake.rollbackArgsForCall) 443 } 444 445 func (fake *FabricCATx) RollbackCalls(stub func(string) error) { 446 fake.rollbackMutex.Lock() 447 defer fake.rollbackMutex.Unlock() 448 fake.RollbackStub = stub 449 } 450 451 func (fake *FabricCATx) RollbackArgsForCall(i int) string { 452 fake.rollbackMutex.RLock() 453 defer fake.rollbackMutex.RUnlock() 454 argsForCall := fake.rollbackArgsForCall[i] 455 return argsForCall.arg1 456 } 457 458 func (fake *FabricCATx) RollbackReturns(result1 error) { 459 fake.rollbackMutex.Lock() 460 defer fake.rollbackMutex.Unlock() 461 fake.RollbackStub = nil 462 fake.rollbackReturns = struct { 463 result1 error 464 }{result1} 465 } 466 467 func (fake *FabricCATx) RollbackReturnsOnCall(i int, result1 error) { 468 fake.rollbackMutex.Lock() 469 defer fake.rollbackMutex.Unlock() 470 fake.RollbackStub = nil 471 if fake.rollbackReturnsOnCall == nil { 472 fake.rollbackReturnsOnCall = make(map[int]struct { 473 result1 error 474 }) 475 } 476 fake.rollbackReturnsOnCall[i] = struct { 477 result1 error 478 }{result1} 479 } 480 481 func (fake *FabricCATx) Select(arg1 string, arg2 interface{}, arg3 string, arg4 ...interface{}) error { 482 fake.selectMutex.Lock() 483 ret, specificReturn := fake.selectReturnsOnCall[len(fake.selectArgsForCall)] 484 fake.selectArgsForCall = append(fake.selectArgsForCall, struct { 485 arg1 string 486 arg2 interface{} 487 arg3 string 488 arg4 []interface{} 489 }{arg1, arg2, arg3, arg4}) 490 fake.recordInvocation("Select", []interface{}{arg1, arg2, arg3, arg4}) 491 fake.selectMutex.Unlock() 492 if fake.SelectStub != nil { 493 return fake.SelectStub(arg1, arg2, arg3, arg4...) 494 } 495 if specificReturn { 496 return ret.result1 497 } 498 fakeReturns := fake.selectReturns 499 return fakeReturns.result1 500 } 501 502 func (fake *FabricCATx) SelectCallCount() int { 503 fake.selectMutex.RLock() 504 defer fake.selectMutex.RUnlock() 505 return len(fake.selectArgsForCall) 506 } 507 508 func (fake *FabricCATx) SelectCalls(stub func(string, interface{}, string, ...interface{}) error) { 509 fake.selectMutex.Lock() 510 defer fake.selectMutex.Unlock() 511 fake.SelectStub = stub 512 } 513 514 func (fake *FabricCATx) SelectArgsForCall(i int) (string, interface{}, string, []interface{}) { 515 fake.selectMutex.RLock() 516 defer fake.selectMutex.RUnlock() 517 argsForCall := fake.selectArgsForCall[i] 518 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4 519 } 520 521 func (fake *FabricCATx) SelectReturns(result1 error) { 522 fake.selectMutex.Lock() 523 defer fake.selectMutex.Unlock() 524 fake.SelectStub = nil 525 fake.selectReturns = struct { 526 result1 error 527 }{result1} 528 } 529 530 func (fake *FabricCATx) SelectReturnsOnCall(i int, result1 error) { 531 fake.selectMutex.Lock() 532 defer fake.selectMutex.Unlock() 533 fake.SelectStub = nil 534 if fake.selectReturnsOnCall == nil { 535 fake.selectReturnsOnCall = make(map[int]struct { 536 result1 error 537 }) 538 } 539 fake.selectReturnsOnCall[i] = struct { 540 result1 error 541 }{result1} 542 } 543 544 func (fake *FabricCATx) Invocations() map[string][][]interface{} { 545 fake.invocationsMutex.RLock() 546 defer fake.invocationsMutex.RUnlock() 547 fake.commitMutex.RLock() 548 defer fake.commitMutex.RUnlock() 549 fake.execMutex.RLock() 550 defer fake.execMutex.RUnlock() 551 fake.getMutex.RLock() 552 defer fake.getMutex.RUnlock() 553 fake.queryxMutex.RLock() 554 defer fake.queryxMutex.RUnlock() 555 fake.rebindMutex.RLock() 556 defer fake.rebindMutex.RUnlock() 557 fake.rollbackMutex.RLock() 558 defer fake.rollbackMutex.RUnlock() 559 fake.selectMutex.RLock() 560 defer fake.selectMutex.RUnlock() 561 copiedInvocations := map[string][][]interface{}{} 562 for key, value := range fake.invocations { 563 copiedInvocations[key] = value 564 } 565 return copiedInvocations 566 } 567 568 func (fake *FabricCATx) recordInvocation(key string, args []interface{}) { 569 fake.invocationsMutex.Lock() 570 defer fake.invocationsMutex.Unlock() 571 if fake.invocations == nil { 572 fake.invocations = map[string][][]interface{}{} 573 } 574 if fake.invocations[key] == nil { 575 fake.invocations[key] = [][]interface{}{} 576 } 577 fake.invocations[key] = append(fake.invocations[key], args) 578 } 579 580 var _ db.FabricCATx = new(FabricCATx)