1// Code generated by counterfeiter. DO NOT EDIT. 2package accessorfakes 3 4import ( 5 "net/http" 6 "sync" 7 8 "github.com/concourse/concourse/atc/api/accessor" 9) 10 11type FakeAccessFactory struct { 12 CreateStub func(*http.Request, string) (accessor.Access, error) 13 createMutex sync.RWMutex 14 createArgsForCall []struct { 15 arg1 *http.Request 16 arg2 string 17 } 18 createReturns struct { 19 result1 accessor.Access 20 result2 error 21 } 22 createReturnsOnCall map[int]struct { 23 result1 accessor.Access 24 result2 error 25 } 26 invocations map[string][][]interface{} 27 invocationsMutex sync.RWMutex 28} 29 30func (fake *FakeAccessFactory) Create(arg1 *http.Request, arg2 string) (accessor.Access, error) { 31 fake.createMutex.Lock() 32 ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)] 33 fake.createArgsForCall = append(fake.createArgsForCall, struct { 34 arg1 *http.Request 35 arg2 string 36 }{arg1, arg2}) 37 fake.recordInvocation("Create", []interface{}{arg1, arg2}) 38 fake.createMutex.Unlock() 39 if fake.CreateStub != nil { 40 return fake.CreateStub(arg1, arg2) 41 } 42 if specificReturn { 43 return ret.result1, ret.result2 44 } 45 fakeReturns := fake.createReturns 46 return fakeReturns.result1, fakeReturns.result2 47} 48 49func (fake *FakeAccessFactory) CreateCallCount() int { 50 fake.createMutex.RLock() 51 defer fake.createMutex.RUnlock() 52 return len(fake.createArgsForCall) 53} 54 55func (fake *FakeAccessFactory) CreateCalls(stub func(*http.Request, string) (accessor.Access, error)) { 56 fake.createMutex.Lock() 57 defer fake.createMutex.Unlock() 58 fake.CreateStub = stub 59} 60 61func (fake *FakeAccessFactory) CreateArgsForCall(i int) (*http.Request, string) { 62 fake.createMutex.RLock() 63 defer fake.createMutex.RUnlock() 64 argsForCall := fake.createArgsForCall[i] 65 return argsForCall.arg1, argsForCall.arg2 66} 67 68func (fake *FakeAccessFactory) CreateReturns(result1 accessor.Access, result2 error) { 69 fake.createMutex.Lock() 70 defer fake.createMutex.Unlock() 71 fake.CreateStub = nil 72 fake.createReturns = struct { 73 result1 accessor.Access 74 result2 error 75 }{result1, result2} 76} 77 78func (fake *FakeAccessFactory) CreateReturnsOnCall(i int, result1 accessor.Access, result2 error) { 79 fake.createMutex.Lock() 80 defer fake.createMutex.Unlock() 81 fake.CreateStub = nil 82 if fake.createReturnsOnCall == nil { 83 fake.createReturnsOnCall = make(map[int]struct { 84 result1 accessor.Access 85 result2 error 86 }) 87 } 88 fake.createReturnsOnCall[i] = struct { 89 result1 accessor.Access 90 result2 error 91 }{result1, result2} 92} 93 94func (fake *FakeAccessFactory) Invocations() map[string][][]interface{} { 95 fake.invocationsMutex.RLock() 96 defer fake.invocationsMutex.RUnlock() 97 fake.createMutex.RLock() 98 defer fake.createMutex.RUnlock() 99 copiedInvocations := map[string][][]interface{}{} 100 for key, value := range fake.invocations { 101 copiedInvocations[key] = value 102 } 103 return copiedInvocations 104} 105 106func (fake *FakeAccessFactory) recordInvocation(key string, args []interface{}) { 107 fake.invocationsMutex.Lock() 108 defer fake.invocationsMutex.Unlock() 109 if fake.invocations == nil { 110 fake.invocations = map[string][][]interface{}{} 111 } 112 if fake.invocations[key] == nil { 113 fake.invocations[key] = [][]interface{}{} 114 } 115 fake.invocations[key] = append(fake.invocations[key], args) 116} 117 118var _ accessor.AccessFactory = new(FakeAccessFactory) 119