github.com/yacovm/fabric@v2.0.0-alpha.0.20191128145320-c5d4087dc723+incompatible/common/policies/mocks/identity.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mocks 3 4 import ( 5 "sync" 6 "time" 7 8 mspa "github.com/hyperledger/fabric-protos-go/msp" 9 "github.com/hyperledger/fabric/msp" 10 ) 11 12 type Identity struct { 13 AnonymousStub func() bool 14 anonymousMutex sync.RWMutex 15 anonymousArgsForCall []struct { 16 } 17 anonymousReturns struct { 18 result1 bool 19 } 20 anonymousReturnsOnCall map[int]struct { 21 result1 bool 22 } 23 ExpiresAtStub func() time.Time 24 expiresAtMutex sync.RWMutex 25 expiresAtArgsForCall []struct { 26 } 27 expiresAtReturns struct { 28 result1 time.Time 29 } 30 expiresAtReturnsOnCall map[int]struct { 31 result1 time.Time 32 } 33 GetIdentifierStub func() *msp.IdentityIdentifier 34 getIdentifierMutex sync.RWMutex 35 getIdentifierArgsForCall []struct { 36 } 37 getIdentifierReturns struct { 38 result1 *msp.IdentityIdentifier 39 } 40 getIdentifierReturnsOnCall map[int]struct { 41 result1 *msp.IdentityIdentifier 42 } 43 GetMSPIdentifierStub func() string 44 getMSPIdentifierMutex sync.RWMutex 45 getMSPIdentifierArgsForCall []struct { 46 } 47 getMSPIdentifierReturns struct { 48 result1 string 49 } 50 getMSPIdentifierReturnsOnCall map[int]struct { 51 result1 string 52 } 53 GetOrganizationalUnitsStub func() []*msp.OUIdentifier 54 getOrganizationalUnitsMutex sync.RWMutex 55 getOrganizationalUnitsArgsForCall []struct { 56 } 57 getOrganizationalUnitsReturns struct { 58 result1 []*msp.OUIdentifier 59 } 60 getOrganizationalUnitsReturnsOnCall map[int]struct { 61 result1 []*msp.OUIdentifier 62 } 63 SatisfiesPrincipalStub func(*mspa.MSPPrincipal) error 64 satisfiesPrincipalMutex sync.RWMutex 65 satisfiesPrincipalArgsForCall []struct { 66 arg1 *mspa.MSPPrincipal 67 } 68 satisfiesPrincipalReturns struct { 69 result1 error 70 } 71 satisfiesPrincipalReturnsOnCall map[int]struct { 72 result1 error 73 } 74 SerializeStub func() ([]byte, error) 75 serializeMutex sync.RWMutex 76 serializeArgsForCall []struct { 77 } 78 serializeReturns struct { 79 result1 []byte 80 result2 error 81 } 82 serializeReturnsOnCall map[int]struct { 83 result1 []byte 84 result2 error 85 } 86 ValidateStub func() error 87 validateMutex sync.RWMutex 88 validateArgsForCall []struct { 89 } 90 validateReturns struct { 91 result1 error 92 } 93 validateReturnsOnCall map[int]struct { 94 result1 error 95 } 96 VerifyStub func([]byte, []byte) error 97 verifyMutex sync.RWMutex 98 verifyArgsForCall []struct { 99 arg1 []byte 100 arg2 []byte 101 } 102 verifyReturns struct { 103 result1 error 104 } 105 verifyReturnsOnCall map[int]struct { 106 result1 error 107 } 108 invocations map[string][][]interface{} 109 invocationsMutex sync.RWMutex 110 } 111 112 func (fake *Identity) Anonymous() bool { 113 fake.anonymousMutex.Lock() 114 ret, specificReturn := fake.anonymousReturnsOnCall[len(fake.anonymousArgsForCall)] 115 fake.anonymousArgsForCall = append(fake.anonymousArgsForCall, struct { 116 }{}) 117 fake.recordInvocation("Anonymous", []interface{}{}) 118 fake.anonymousMutex.Unlock() 119 if fake.AnonymousStub != nil { 120 return fake.AnonymousStub() 121 } 122 if specificReturn { 123 return ret.result1 124 } 125 fakeReturns := fake.anonymousReturns 126 return fakeReturns.result1 127 } 128 129 func (fake *Identity) AnonymousCallCount() int { 130 fake.anonymousMutex.RLock() 131 defer fake.anonymousMutex.RUnlock() 132 return len(fake.anonymousArgsForCall) 133 } 134 135 func (fake *Identity) AnonymousCalls(stub func() bool) { 136 fake.anonymousMutex.Lock() 137 defer fake.anonymousMutex.Unlock() 138 fake.AnonymousStub = stub 139 } 140 141 func (fake *Identity) AnonymousReturns(result1 bool) { 142 fake.anonymousMutex.Lock() 143 defer fake.anonymousMutex.Unlock() 144 fake.AnonymousStub = nil 145 fake.anonymousReturns = struct { 146 result1 bool 147 }{result1} 148 } 149 150 func (fake *Identity) AnonymousReturnsOnCall(i int, result1 bool) { 151 fake.anonymousMutex.Lock() 152 defer fake.anonymousMutex.Unlock() 153 fake.AnonymousStub = nil 154 if fake.anonymousReturnsOnCall == nil { 155 fake.anonymousReturnsOnCall = make(map[int]struct { 156 result1 bool 157 }) 158 } 159 fake.anonymousReturnsOnCall[i] = struct { 160 result1 bool 161 }{result1} 162 } 163 164 func (fake *Identity) ExpiresAt() time.Time { 165 fake.expiresAtMutex.Lock() 166 ret, specificReturn := fake.expiresAtReturnsOnCall[len(fake.expiresAtArgsForCall)] 167 fake.expiresAtArgsForCall = append(fake.expiresAtArgsForCall, struct { 168 }{}) 169 fake.recordInvocation("ExpiresAt", []interface{}{}) 170 fake.expiresAtMutex.Unlock() 171 if fake.ExpiresAtStub != nil { 172 return fake.ExpiresAtStub() 173 } 174 if specificReturn { 175 return ret.result1 176 } 177 fakeReturns := fake.expiresAtReturns 178 return fakeReturns.result1 179 } 180 181 func (fake *Identity) ExpiresAtCallCount() int { 182 fake.expiresAtMutex.RLock() 183 defer fake.expiresAtMutex.RUnlock() 184 return len(fake.expiresAtArgsForCall) 185 } 186 187 func (fake *Identity) ExpiresAtCalls(stub func() time.Time) { 188 fake.expiresAtMutex.Lock() 189 defer fake.expiresAtMutex.Unlock() 190 fake.ExpiresAtStub = stub 191 } 192 193 func (fake *Identity) ExpiresAtReturns(result1 time.Time) { 194 fake.expiresAtMutex.Lock() 195 defer fake.expiresAtMutex.Unlock() 196 fake.ExpiresAtStub = nil 197 fake.expiresAtReturns = struct { 198 result1 time.Time 199 }{result1} 200 } 201 202 func (fake *Identity) ExpiresAtReturnsOnCall(i int, result1 time.Time) { 203 fake.expiresAtMutex.Lock() 204 defer fake.expiresAtMutex.Unlock() 205 fake.ExpiresAtStub = nil 206 if fake.expiresAtReturnsOnCall == nil { 207 fake.expiresAtReturnsOnCall = make(map[int]struct { 208 result1 time.Time 209 }) 210 } 211 fake.expiresAtReturnsOnCall[i] = struct { 212 result1 time.Time 213 }{result1} 214 } 215 216 func (fake *Identity) GetIdentifier() *msp.IdentityIdentifier { 217 fake.getIdentifierMutex.Lock() 218 ret, specificReturn := fake.getIdentifierReturnsOnCall[len(fake.getIdentifierArgsForCall)] 219 fake.getIdentifierArgsForCall = append(fake.getIdentifierArgsForCall, struct { 220 }{}) 221 fake.recordInvocation("GetIdentifier", []interface{}{}) 222 fake.getIdentifierMutex.Unlock() 223 if fake.GetIdentifierStub != nil { 224 return fake.GetIdentifierStub() 225 } 226 if specificReturn { 227 return ret.result1 228 } 229 fakeReturns := fake.getIdentifierReturns 230 return fakeReturns.result1 231 } 232 233 func (fake *Identity) GetIdentifierCallCount() int { 234 fake.getIdentifierMutex.RLock() 235 defer fake.getIdentifierMutex.RUnlock() 236 return len(fake.getIdentifierArgsForCall) 237 } 238 239 func (fake *Identity) GetIdentifierCalls(stub func() *msp.IdentityIdentifier) { 240 fake.getIdentifierMutex.Lock() 241 defer fake.getIdentifierMutex.Unlock() 242 fake.GetIdentifierStub = stub 243 } 244 245 func (fake *Identity) GetIdentifierReturns(result1 *msp.IdentityIdentifier) { 246 fake.getIdentifierMutex.Lock() 247 defer fake.getIdentifierMutex.Unlock() 248 fake.GetIdentifierStub = nil 249 fake.getIdentifierReturns = struct { 250 result1 *msp.IdentityIdentifier 251 }{result1} 252 } 253 254 func (fake *Identity) GetIdentifierReturnsOnCall(i int, result1 *msp.IdentityIdentifier) { 255 fake.getIdentifierMutex.Lock() 256 defer fake.getIdentifierMutex.Unlock() 257 fake.GetIdentifierStub = nil 258 if fake.getIdentifierReturnsOnCall == nil { 259 fake.getIdentifierReturnsOnCall = make(map[int]struct { 260 result1 *msp.IdentityIdentifier 261 }) 262 } 263 fake.getIdentifierReturnsOnCall[i] = struct { 264 result1 *msp.IdentityIdentifier 265 }{result1} 266 } 267 268 func (fake *Identity) GetMSPIdentifier() string { 269 fake.getMSPIdentifierMutex.Lock() 270 ret, specificReturn := fake.getMSPIdentifierReturnsOnCall[len(fake.getMSPIdentifierArgsForCall)] 271 fake.getMSPIdentifierArgsForCall = append(fake.getMSPIdentifierArgsForCall, struct { 272 }{}) 273 fake.recordInvocation("GetMSPIdentifier", []interface{}{}) 274 fake.getMSPIdentifierMutex.Unlock() 275 if fake.GetMSPIdentifierStub != nil { 276 return fake.GetMSPIdentifierStub() 277 } 278 if specificReturn { 279 return ret.result1 280 } 281 fakeReturns := fake.getMSPIdentifierReturns 282 return fakeReturns.result1 283 } 284 285 func (fake *Identity) GetMSPIdentifierCallCount() int { 286 fake.getMSPIdentifierMutex.RLock() 287 defer fake.getMSPIdentifierMutex.RUnlock() 288 return len(fake.getMSPIdentifierArgsForCall) 289 } 290 291 func (fake *Identity) GetMSPIdentifierCalls(stub func() string) { 292 fake.getMSPIdentifierMutex.Lock() 293 defer fake.getMSPIdentifierMutex.Unlock() 294 fake.GetMSPIdentifierStub = stub 295 } 296 297 func (fake *Identity) GetMSPIdentifierReturns(result1 string) { 298 fake.getMSPIdentifierMutex.Lock() 299 defer fake.getMSPIdentifierMutex.Unlock() 300 fake.GetMSPIdentifierStub = nil 301 fake.getMSPIdentifierReturns = struct { 302 result1 string 303 }{result1} 304 } 305 306 func (fake *Identity) GetMSPIdentifierReturnsOnCall(i int, result1 string) { 307 fake.getMSPIdentifierMutex.Lock() 308 defer fake.getMSPIdentifierMutex.Unlock() 309 fake.GetMSPIdentifierStub = nil 310 if fake.getMSPIdentifierReturnsOnCall == nil { 311 fake.getMSPIdentifierReturnsOnCall = make(map[int]struct { 312 result1 string 313 }) 314 } 315 fake.getMSPIdentifierReturnsOnCall[i] = struct { 316 result1 string 317 }{result1} 318 } 319 320 func (fake *Identity) GetOrganizationalUnits() []*msp.OUIdentifier { 321 fake.getOrganizationalUnitsMutex.Lock() 322 ret, specificReturn := fake.getOrganizationalUnitsReturnsOnCall[len(fake.getOrganizationalUnitsArgsForCall)] 323 fake.getOrganizationalUnitsArgsForCall = append(fake.getOrganizationalUnitsArgsForCall, struct { 324 }{}) 325 fake.recordInvocation("GetOrganizationalUnits", []interface{}{}) 326 fake.getOrganizationalUnitsMutex.Unlock() 327 if fake.GetOrganizationalUnitsStub != nil { 328 return fake.GetOrganizationalUnitsStub() 329 } 330 if specificReturn { 331 return ret.result1 332 } 333 fakeReturns := fake.getOrganizationalUnitsReturns 334 return fakeReturns.result1 335 } 336 337 func (fake *Identity) GetOrganizationalUnitsCallCount() int { 338 fake.getOrganizationalUnitsMutex.RLock() 339 defer fake.getOrganizationalUnitsMutex.RUnlock() 340 return len(fake.getOrganizationalUnitsArgsForCall) 341 } 342 343 func (fake *Identity) GetOrganizationalUnitsCalls(stub func() []*msp.OUIdentifier) { 344 fake.getOrganizationalUnitsMutex.Lock() 345 defer fake.getOrganizationalUnitsMutex.Unlock() 346 fake.GetOrganizationalUnitsStub = stub 347 } 348 349 func (fake *Identity) GetOrganizationalUnitsReturns(result1 []*msp.OUIdentifier) { 350 fake.getOrganizationalUnitsMutex.Lock() 351 defer fake.getOrganizationalUnitsMutex.Unlock() 352 fake.GetOrganizationalUnitsStub = nil 353 fake.getOrganizationalUnitsReturns = struct { 354 result1 []*msp.OUIdentifier 355 }{result1} 356 } 357 358 func (fake *Identity) GetOrganizationalUnitsReturnsOnCall(i int, result1 []*msp.OUIdentifier) { 359 fake.getOrganizationalUnitsMutex.Lock() 360 defer fake.getOrganizationalUnitsMutex.Unlock() 361 fake.GetOrganizationalUnitsStub = nil 362 if fake.getOrganizationalUnitsReturnsOnCall == nil { 363 fake.getOrganizationalUnitsReturnsOnCall = make(map[int]struct { 364 result1 []*msp.OUIdentifier 365 }) 366 } 367 fake.getOrganizationalUnitsReturnsOnCall[i] = struct { 368 result1 []*msp.OUIdentifier 369 }{result1} 370 } 371 372 func (fake *Identity) SatisfiesPrincipal(arg1 *mspa.MSPPrincipal) error { 373 fake.satisfiesPrincipalMutex.Lock() 374 ret, specificReturn := fake.satisfiesPrincipalReturnsOnCall[len(fake.satisfiesPrincipalArgsForCall)] 375 fake.satisfiesPrincipalArgsForCall = append(fake.satisfiesPrincipalArgsForCall, struct { 376 arg1 *mspa.MSPPrincipal 377 }{arg1}) 378 fake.recordInvocation("SatisfiesPrincipal", []interface{}{arg1}) 379 fake.satisfiesPrincipalMutex.Unlock() 380 if fake.SatisfiesPrincipalStub != nil { 381 return fake.SatisfiesPrincipalStub(arg1) 382 } 383 if specificReturn { 384 return ret.result1 385 } 386 fakeReturns := fake.satisfiesPrincipalReturns 387 return fakeReturns.result1 388 } 389 390 func (fake *Identity) SatisfiesPrincipalCallCount() int { 391 fake.satisfiesPrincipalMutex.RLock() 392 defer fake.satisfiesPrincipalMutex.RUnlock() 393 return len(fake.satisfiesPrincipalArgsForCall) 394 } 395 396 func (fake *Identity) SatisfiesPrincipalCalls(stub func(*mspa.MSPPrincipal) error) { 397 fake.satisfiesPrincipalMutex.Lock() 398 defer fake.satisfiesPrincipalMutex.Unlock() 399 fake.SatisfiesPrincipalStub = stub 400 } 401 402 func (fake *Identity) SatisfiesPrincipalArgsForCall(i int) *mspa.MSPPrincipal { 403 fake.satisfiesPrincipalMutex.RLock() 404 defer fake.satisfiesPrincipalMutex.RUnlock() 405 argsForCall := fake.satisfiesPrincipalArgsForCall[i] 406 return argsForCall.arg1 407 } 408 409 func (fake *Identity) SatisfiesPrincipalReturns(result1 error) { 410 fake.satisfiesPrincipalMutex.Lock() 411 defer fake.satisfiesPrincipalMutex.Unlock() 412 fake.SatisfiesPrincipalStub = nil 413 fake.satisfiesPrincipalReturns = struct { 414 result1 error 415 }{result1} 416 } 417 418 func (fake *Identity) SatisfiesPrincipalReturnsOnCall(i int, result1 error) { 419 fake.satisfiesPrincipalMutex.Lock() 420 defer fake.satisfiesPrincipalMutex.Unlock() 421 fake.SatisfiesPrincipalStub = nil 422 if fake.satisfiesPrincipalReturnsOnCall == nil { 423 fake.satisfiesPrincipalReturnsOnCall = make(map[int]struct { 424 result1 error 425 }) 426 } 427 fake.satisfiesPrincipalReturnsOnCall[i] = struct { 428 result1 error 429 }{result1} 430 } 431 432 func (fake *Identity) Serialize() ([]byte, error) { 433 fake.serializeMutex.Lock() 434 ret, specificReturn := fake.serializeReturnsOnCall[len(fake.serializeArgsForCall)] 435 fake.serializeArgsForCall = append(fake.serializeArgsForCall, struct { 436 }{}) 437 fake.recordInvocation("Serialize", []interface{}{}) 438 fake.serializeMutex.Unlock() 439 if fake.SerializeStub != nil { 440 return fake.SerializeStub() 441 } 442 if specificReturn { 443 return ret.result1, ret.result2 444 } 445 fakeReturns := fake.serializeReturns 446 return fakeReturns.result1, fakeReturns.result2 447 } 448 449 func (fake *Identity) SerializeCallCount() int { 450 fake.serializeMutex.RLock() 451 defer fake.serializeMutex.RUnlock() 452 return len(fake.serializeArgsForCall) 453 } 454 455 func (fake *Identity) SerializeCalls(stub func() ([]byte, error)) { 456 fake.serializeMutex.Lock() 457 defer fake.serializeMutex.Unlock() 458 fake.SerializeStub = stub 459 } 460 461 func (fake *Identity) SerializeReturns(result1 []byte, result2 error) { 462 fake.serializeMutex.Lock() 463 defer fake.serializeMutex.Unlock() 464 fake.SerializeStub = nil 465 fake.serializeReturns = struct { 466 result1 []byte 467 result2 error 468 }{result1, result2} 469 } 470 471 func (fake *Identity) SerializeReturnsOnCall(i int, result1 []byte, result2 error) { 472 fake.serializeMutex.Lock() 473 defer fake.serializeMutex.Unlock() 474 fake.SerializeStub = nil 475 if fake.serializeReturnsOnCall == nil { 476 fake.serializeReturnsOnCall = make(map[int]struct { 477 result1 []byte 478 result2 error 479 }) 480 } 481 fake.serializeReturnsOnCall[i] = struct { 482 result1 []byte 483 result2 error 484 }{result1, result2} 485 } 486 487 func (fake *Identity) Validate() error { 488 fake.validateMutex.Lock() 489 ret, specificReturn := fake.validateReturnsOnCall[len(fake.validateArgsForCall)] 490 fake.validateArgsForCall = append(fake.validateArgsForCall, struct { 491 }{}) 492 fake.recordInvocation("Validate", []interface{}{}) 493 fake.validateMutex.Unlock() 494 if fake.ValidateStub != nil { 495 return fake.ValidateStub() 496 } 497 if specificReturn { 498 return ret.result1 499 } 500 fakeReturns := fake.validateReturns 501 return fakeReturns.result1 502 } 503 504 func (fake *Identity) ValidateCallCount() int { 505 fake.validateMutex.RLock() 506 defer fake.validateMutex.RUnlock() 507 return len(fake.validateArgsForCall) 508 } 509 510 func (fake *Identity) ValidateCalls(stub func() error) { 511 fake.validateMutex.Lock() 512 defer fake.validateMutex.Unlock() 513 fake.ValidateStub = stub 514 } 515 516 func (fake *Identity) ValidateReturns(result1 error) { 517 fake.validateMutex.Lock() 518 defer fake.validateMutex.Unlock() 519 fake.ValidateStub = nil 520 fake.validateReturns = struct { 521 result1 error 522 }{result1} 523 } 524 525 func (fake *Identity) ValidateReturnsOnCall(i int, result1 error) { 526 fake.validateMutex.Lock() 527 defer fake.validateMutex.Unlock() 528 fake.ValidateStub = nil 529 if fake.validateReturnsOnCall == nil { 530 fake.validateReturnsOnCall = make(map[int]struct { 531 result1 error 532 }) 533 } 534 fake.validateReturnsOnCall[i] = struct { 535 result1 error 536 }{result1} 537 } 538 539 func (fake *Identity) Verify(arg1 []byte, arg2 []byte) error { 540 var arg1Copy []byte 541 if arg1 != nil { 542 arg1Copy = make([]byte, len(arg1)) 543 copy(arg1Copy, arg1) 544 } 545 var arg2Copy []byte 546 if arg2 != nil { 547 arg2Copy = make([]byte, len(arg2)) 548 copy(arg2Copy, arg2) 549 } 550 fake.verifyMutex.Lock() 551 ret, specificReturn := fake.verifyReturnsOnCall[len(fake.verifyArgsForCall)] 552 fake.verifyArgsForCall = append(fake.verifyArgsForCall, struct { 553 arg1 []byte 554 arg2 []byte 555 }{arg1Copy, arg2Copy}) 556 fake.recordInvocation("Verify", []interface{}{arg1Copy, arg2Copy}) 557 fake.verifyMutex.Unlock() 558 if fake.VerifyStub != nil { 559 return fake.VerifyStub(arg1, arg2) 560 } 561 if specificReturn { 562 return ret.result1 563 } 564 fakeReturns := fake.verifyReturns 565 return fakeReturns.result1 566 } 567 568 func (fake *Identity) VerifyCallCount() int { 569 fake.verifyMutex.RLock() 570 defer fake.verifyMutex.RUnlock() 571 return len(fake.verifyArgsForCall) 572 } 573 574 func (fake *Identity) VerifyCalls(stub func([]byte, []byte) error) { 575 fake.verifyMutex.Lock() 576 defer fake.verifyMutex.Unlock() 577 fake.VerifyStub = stub 578 } 579 580 func (fake *Identity) VerifyArgsForCall(i int) ([]byte, []byte) { 581 fake.verifyMutex.RLock() 582 defer fake.verifyMutex.RUnlock() 583 argsForCall := fake.verifyArgsForCall[i] 584 return argsForCall.arg1, argsForCall.arg2 585 } 586 587 func (fake *Identity) VerifyReturns(result1 error) { 588 fake.verifyMutex.Lock() 589 defer fake.verifyMutex.Unlock() 590 fake.VerifyStub = nil 591 fake.verifyReturns = struct { 592 result1 error 593 }{result1} 594 } 595 596 func (fake *Identity) VerifyReturnsOnCall(i int, result1 error) { 597 fake.verifyMutex.Lock() 598 defer fake.verifyMutex.Unlock() 599 fake.VerifyStub = nil 600 if fake.verifyReturnsOnCall == nil { 601 fake.verifyReturnsOnCall = make(map[int]struct { 602 result1 error 603 }) 604 } 605 fake.verifyReturnsOnCall[i] = struct { 606 result1 error 607 }{result1} 608 } 609 610 func (fake *Identity) Invocations() map[string][][]interface{} { 611 fake.invocationsMutex.RLock() 612 defer fake.invocationsMutex.RUnlock() 613 fake.anonymousMutex.RLock() 614 defer fake.anonymousMutex.RUnlock() 615 fake.expiresAtMutex.RLock() 616 defer fake.expiresAtMutex.RUnlock() 617 fake.getIdentifierMutex.RLock() 618 defer fake.getIdentifierMutex.RUnlock() 619 fake.getMSPIdentifierMutex.RLock() 620 defer fake.getMSPIdentifierMutex.RUnlock() 621 fake.getOrganizationalUnitsMutex.RLock() 622 defer fake.getOrganizationalUnitsMutex.RUnlock() 623 fake.satisfiesPrincipalMutex.RLock() 624 defer fake.satisfiesPrincipalMutex.RUnlock() 625 fake.serializeMutex.RLock() 626 defer fake.serializeMutex.RUnlock() 627 fake.validateMutex.RLock() 628 defer fake.validateMutex.RUnlock() 629 fake.verifyMutex.RLock() 630 defer fake.verifyMutex.RUnlock() 631 copiedInvocations := map[string][][]interface{}{} 632 for key, value := range fake.invocations { 633 copiedInvocations[key] = value 634 } 635 return copiedInvocations 636 } 637 638 func (fake *Identity) recordInvocation(key string, args []interface{}) { 639 fake.invocationsMutex.Lock() 640 defer fake.invocationsMutex.Unlock() 641 if fake.invocations == nil { 642 fake.invocations = map[string][][]interface{}{} 643 } 644 if fake.invocations[key] == nil { 645 fake.invocations[key] = [][]interface{}{} 646 } 647 fake.invocations[key] = append(fake.invocations[key], args) 648 }