github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/actor/pluginaction/pluginactionfakes/fake_plugin_uninstaller.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package pluginactionfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/pluginaction" 8 ) 9 10 type FakePluginUninstaller struct { 11 RunStub func(string, string) error 12 runMutex sync.RWMutex 13 runArgsForCall []struct { 14 arg1 string 15 arg2 string 16 } 17 runReturns struct { 18 result1 error 19 } 20 runReturnsOnCall map[int]struct { 21 result1 error 22 } 23 invocations map[string][][]interface{} 24 invocationsMutex sync.RWMutex 25 } 26 27 func (fake *FakePluginUninstaller) Run(arg1 string, arg2 string) error { 28 fake.runMutex.Lock() 29 ret, specificReturn := fake.runReturnsOnCall[len(fake.runArgsForCall)] 30 fake.runArgsForCall = append(fake.runArgsForCall, struct { 31 arg1 string 32 arg2 string 33 }{arg1, arg2}) 34 fake.recordInvocation("Run", []interface{}{arg1, arg2}) 35 fake.runMutex.Unlock() 36 if fake.RunStub != nil { 37 return fake.RunStub(arg1, arg2) 38 } 39 if specificReturn { 40 return ret.result1 41 } 42 fakeReturns := fake.runReturns 43 return fakeReturns.result1 44 } 45 46 func (fake *FakePluginUninstaller) RunCallCount() int { 47 fake.runMutex.RLock() 48 defer fake.runMutex.RUnlock() 49 return len(fake.runArgsForCall) 50 } 51 52 func (fake *FakePluginUninstaller) RunCalls(stub func(string, string) error) { 53 fake.runMutex.Lock() 54 defer fake.runMutex.Unlock() 55 fake.RunStub = stub 56 } 57 58 func (fake *FakePluginUninstaller) RunArgsForCall(i int) (string, string) { 59 fake.runMutex.RLock() 60 defer fake.runMutex.RUnlock() 61 argsForCall := fake.runArgsForCall[i] 62 return argsForCall.arg1, argsForCall.arg2 63 } 64 65 func (fake *FakePluginUninstaller) RunReturns(result1 error) { 66 fake.runMutex.Lock() 67 defer fake.runMutex.Unlock() 68 fake.RunStub = nil 69 fake.runReturns = struct { 70 result1 error 71 }{result1} 72 } 73 74 func (fake *FakePluginUninstaller) RunReturnsOnCall(i int, result1 error) { 75 fake.runMutex.Lock() 76 defer fake.runMutex.Unlock() 77 fake.RunStub = nil 78 if fake.runReturnsOnCall == nil { 79 fake.runReturnsOnCall = make(map[int]struct { 80 result1 error 81 }) 82 } 83 fake.runReturnsOnCall[i] = struct { 84 result1 error 85 }{result1} 86 } 87 88 func (fake *FakePluginUninstaller) Invocations() map[string][][]interface{} { 89 fake.invocationsMutex.RLock() 90 defer fake.invocationsMutex.RUnlock() 91 fake.runMutex.RLock() 92 defer fake.runMutex.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 *FakePluginUninstaller) 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 _ pluginaction.PluginUninstaller = new(FakePluginUninstaller)