github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/copyapplicationsource/copyapplicationsourcefakes/fake_repository.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package copyapplicationsourcefakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/api/copyapplicationsource" 8 ) 9 10 type FakeRepository struct { 11 CopyApplicationStub func(string, string) error 12 copyApplicationMutex sync.RWMutex 13 copyApplicationArgsForCall []struct { 14 arg1 string 15 arg2 string 16 } 17 copyApplicationReturns struct { 18 result1 error 19 } 20 copyApplicationReturnsOnCall map[int]struct { 21 result1 error 22 } 23 invocations map[string][][]interface{} 24 invocationsMutex sync.RWMutex 25 } 26 27 func (fake *FakeRepository) CopyApplication(arg1 string, arg2 string) error { 28 fake.copyApplicationMutex.Lock() 29 ret, specificReturn := fake.copyApplicationReturnsOnCall[len(fake.copyApplicationArgsForCall)] 30 fake.copyApplicationArgsForCall = append(fake.copyApplicationArgsForCall, struct { 31 arg1 string 32 arg2 string 33 }{arg1, arg2}) 34 fake.recordInvocation("CopyApplication", []interface{}{arg1, arg2}) 35 fake.copyApplicationMutex.Unlock() 36 if fake.CopyApplicationStub != nil { 37 return fake.CopyApplicationStub(arg1, arg2) 38 } 39 if specificReturn { 40 return ret.result1 41 } 42 fakeReturns := fake.copyApplicationReturns 43 return fakeReturns.result1 44 } 45 46 func (fake *FakeRepository) CopyApplicationCallCount() int { 47 fake.copyApplicationMutex.RLock() 48 defer fake.copyApplicationMutex.RUnlock() 49 return len(fake.copyApplicationArgsForCall) 50 } 51 52 func (fake *FakeRepository) CopyApplicationCalls(stub func(string, string) error) { 53 fake.copyApplicationMutex.Lock() 54 defer fake.copyApplicationMutex.Unlock() 55 fake.CopyApplicationStub = stub 56 } 57 58 func (fake *FakeRepository) CopyApplicationArgsForCall(i int) (string, string) { 59 fake.copyApplicationMutex.RLock() 60 defer fake.copyApplicationMutex.RUnlock() 61 argsForCall := fake.copyApplicationArgsForCall[i] 62 return argsForCall.arg1, argsForCall.arg2 63 } 64 65 func (fake *FakeRepository) CopyApplicationReturns(result1 error) { 66 fake.copyApplicationMutex.Lock() 67 defer fake.copyApplicationMutex.Unlock() 68 fake.CopyApplicationStub = nil 69 fake.copyApplicationReturns = struct { 70 result1 error 71 }{result1} 72 } 73 74 func (fake *FakeRepository) CopyApplicationReturnsOnCall(i int, result1 error) { 75 fake.copyApplicationMutex.Lock() 76 defer fake.copyApplicationMutex.Unlock() 77 fake.CopyApplicationStub = nil 78 if fake.copyApplicationReturnsOnCall == nil { 79 fake.copyApplicationReturnsOnCall = make(map[int]struct { 80 result1 error 81 }) 82 } 83 fake.copyApplicationReturnsOnCall[i] = struct { 84 result1 error 85 }{result1} 86 } 87 88 func (fake *FakeRepository) Invocations() map[string][][]interface{} { 89 fake.invocationsMutex.RLock() 90 defer fake.invocationsMutex.RUnlock() 91 fake.copyApplicationMutex.RLock() 92 defer fake.copyApplicationMutex.RUnlock() 93 copiedInvocations := map[string][][]interface{}{} 94 for key, value := range fake.invocations { 95 copiedInvocations[key] = value 96 } 97 return copiedInvocations 98 } 99 100 func (fake *FakeRepository) recordInvocation(key string, args []interface{}) { 101 fake.invocationsMutex.Lock() 102 defer fake.invocationsMutex.Unlock() 103 if fake.invocations == nil { 104 fake.invocations = map[string][][]interface{}{} 105 } 106 if fake.invocations[key] == nil { 107 fake.invocations[key] = [][]interface{}{} 108 } 109 fake.invocations[key] = append(fake.invocations[key], args) 110 } 111 112 var _ copyapplicationsource.Repository = new(FakeRepository)