github.com/orange-cloudfoundry/cli@v7.1.0+incompatible/command/v7/v7fakes/fake_manifest_locator.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v7fakes 3 4 import ( 5 "sync" 6 7 v7 "code.cloudfoundry.org/cli/command/v7" 8 ) 9 10 type FakeManifestLocator struct { 11 PathStub func(string) (string, bool, error) 12 pathMutex sync.RWMutex 13 pathArgsForCall []struct { 14 arg1 string 15 } 16 pathReturns struct { 17 result1 string 18 result2 bool 19 result3 error 20 } 21 pathReturnsOnCall map[int]struct { 22 result1 string 23 result2 bool 24 result3 error 25 } 26 invocations map[string][][]interface{} 27 invocationsMutex sync.RWMutex 28 } 29 30 func (fake *FakeManifestLocator) Path(arg1 string) (string, bool, error) { 31 fake.pathMutex.Lock() 32 ret, specificReturn := fake.pathReturnsOnCall[len(fake.pathArgsForCall)] 33 fake.pathArgsForCall = append(fake.pathArgsForCall, struct { 34 arg1 string 35 }{arg1}) 36 fake.recordInvocation("Path", []interface{}{arg1}) 37 fake.pathMutex.Unlock() 38 if fake.PathStub != nil { 39 return fake.PathStub(arg1) 40 } 41 if specificReturn { 42 return ret.result1, ret.result2, ret.result3 43 } 44 fakeReturns := fake.pathReturns 45 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 46 } 47 48 func (fake *FakeManifestLocator) PathCallCount() int { 49 fake.pathMutex.RLock() 50 defer fake.pathMutex.RUnlock() 51 return len(fake.pathArgsForCall) 52 } 53 54 func (fake *FakeManifestLocator) PathCalls(stub func(string) (string, bool, error)) { 55 fake.pathMutex.Lock() 56 defer fake.pathMutex.Unlock() 57 fake.PathStub = stub 58 } 59 60 func (fake *FakeManifestLocator) PathArgsForCall(i int) string { 61 fake.pathMutex.RLock() 62 defer fake.pathMutex.RUnlock() 63 argsForCall := fake.pathArgsForCall[i] 64 return argsForCall.arg1 65 } 66 67 func (fake *FakeManifestLocator) PathReturns(result1 string, result2 bool, result3 error) { 68 fake.pathMutex.Lock() 69 defer fake.pathMutex.Unlock() 70 fake.PathStub = nil 71 fake.pathReturns = struct { 72 result1 string 73 result2 bool 74 result3 error 75 }{result1, result2, result3} 76 } 77 78 func (fake *FakeManifestLocator) PathReturnsOnCall(i int, result1 string, result2 bool, result3 error) { 79 fake.pathMutex.Lock() 80 defer fake.pathMutex.Unlock() 81 fake.PathStub = nil 82 if fake.pathReturnsOnCall == nil { 83 fake.pathReturnsOnCall = make(map[int]struct { 84 result1 string 85 result2 bool 86 result3 error 87 }) 88 } 89 fake.pathReturnsOnCall[i] = struct { 90 result1 string 91 result2 bool 92 result3 error 93 }{result1, result2, result3} 94 } 95 96 func (fake *FakeManifestLocator) Invocations() map[string][][]interface{} { 97 fake.invocationsMutex.RLock() 98 defer fake.invocationsMutex.RUnlock() 99 fake.pathMutex.RLock() 100 defer fake.pathMutex.RUnlock() 101 copiedInvocations := map[string][][]interface{}{} 102 for key, value := range fake.invocations { 103 copiedInvocations[key] = value 104 } 105 return copiedInvocations 106 } 107 108 func (fake *FakeManifestLocator) recordInvocation(key string, args []interface{}) { 109 fake.invocationsMutex.Lock() 110 defer fake.invocationsMutex.Unlock() 111 if fake.invocations == nil { 112 fake.invocations = map[string][][]interface{}{} 113 } 114 if fake.invocations[key] == nil { 115 fake.invocations[key] = [][]interface{}{} 116 } 117 fake.invocations[key] = append(fake.invocations[key], args) 118 } 119 120 var _ v7.ManifestLocator = new(FakeManifestLocator)