github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/configuration/pluginconfig/pluginconfigfakes/fake_plugin_configuration.go (about) 1 // This file was generated by counterfeiter 2 package pluginconfigfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/configuration/pluginconfig" 8 ) 9 10 type FakePluginConfiguration struct { 11 PluginsStub func() map[string]pluginconfig.PluginMetadata 12 pluginsMutex sync.RWMutex 13 pluginsArgsForCall []struct{} 14 pluginsReturns struct { 15 result1 map[string]pluginconfig.PluginMetadata 16 } 17 SetPluginStub func(string, pluginconfig.PluginMetadata) 18 setPluginMutex sync.RWMutex 19 setPluginArgsForCall []struct { 20 arg1 string 21 arg2 pluginconfig.PluginMetadata 22 } 23 GetPluginPathStub func() string 24 getPluginPathMutex sync.RWMutex 25 getPluginPathArgsForCall []struct{} 26 getPluginPathReturns struct { 27 result1 string 28 } 29 RemovePluginStub func(string) 30 removePluginMutex sync.RWMutex 31 removePluginArgsForCall []struct { 32 arg1 string 33 } 34 ListCommandsStub func() []string 35 listCommandsMutex sync.RWMutex 36 listCommandsArgsForCall []struct{} 37 listCommandsReturns struct { 38 result1 []string 39 } 40 invocations map[string][][]interface{} 41 invocationsMutex sync.RWMutex 42 } 43 44 func (fake *FakePluginConfiguration) Plugins() map[string]pluginconfig.PluginMetadata { 45 fake.pluginsMutex.Lock() 46 fake.pluginsArgsForCall = append(fake.pluginsArgsForCall, struct{}{}) 47 fake.recordInvocation("Plugins", []interface{}{}) 48 fake.pluginsMutex.Unlock() 49 if fake.PluginsStub != nil { 50 return fake.PluginsStub() 51 } else { 52 return fake.pluginsReturns.result1 53 } 54 } 55 56 func (fake *FakePluginConfiguration) PluginsCallCount() int { 57 fake.pluginsMutex.RLock() 58 defer fake.pluginsMutex.RUnlock() 59 return len(fake.pluginsArgsForCall) 60 } 61 62 func (fake *FakePluginConfiguration) PluginsReturns(result1 map[string]pluginconfig.PluginMetadata) { 63 fake.PluginsStub = nil 64 fake.pluginsReturns = struct { 65 result1 map[string]pluginconfig.PluginMetadata 66 }{result1} 67 } 68 69 func (fake *FakePluginConfiguration) SetPlugin(arg1 string, arg2 pluginconfig.PluginMetadata) { 70 fake.setPluginMutex.Lock() 71 fake.setPluginArgsForCall = append(fake.setPluginArgsForCall, struct { 72 arg1 string 73 arg2 pluginconfig.PluginMetadata 74 }{arg1, arg2}) 75 fake.recordInvocation("SetPlugin", []interface{}{arg1, arg2}) 76 fake.setPluginMutex.Unlock() 77 if fake.SetPluginStub != nil { 78 fake.SetPluginStub(arg1, arg2) 79 } 80 } 81 82 func (fake *FakePluginConfiguration) SetPluginCallCount() int { 83 fake.setPluginMutex.RLock() 84 defer fake.setPluginMutex.RUnlock() 85 return len(fake.setPluginArgsForCall) 86 } 87 88 func (fake *FakePluginConfiguration) SetPluginArgsForCall(i int) (string, pluginconfig.PluginMetadata) { 89 fake.setPluginMutex.RLock() 90 defer fake.setPluginMutex.RUnlock() 91 return fake.setPluginArgsForCall[i].arg1, fake.setPluginArgsForCall[i].arg2 92 } 93 94 func (fake *FakePluginConfiguration) GetPluginPath() string { 95 fake.getPluginPathMutex.Lock() 96 fake.getPluginPathArgsForCall = append(fake.getPluginPathArgsForCall, struct{}{}) 97 fake.recordInvocation("GetPluginPath", []interface{}{}) 98 fake.getPluginPathMutex.Unlock() 99 if fake.GetPluginPathStub != nil { 100 return fake.GetPluginPathStub() 101 } else { 102 return fake.getPluginPathReturns.result1 103 } 104 } 105 106 func (fake *FakePluginConfiguration) GetPluginPathCallCount() int { 107 fake.getPluginPathMutex.RLock() 108 defer fake.getPluginPathMutex.RUnlock() 109 return len(fake.getPluginPathArgsForCall) 110 } 111 112 func (fake *FakePluginConfiguration) GetPluginPathReturns(result1 string) { 113 fake.GetPluginPathStub = nil 114 fake.getPluginPathReturns = struct { 115 result1 string 116 }{result1} 117 } 118 119 func (fake *FakePluginConfiguration) RemovePlugin(arg1 string) { 120 fake.removePluginMutex.Lock() 121 fake.removePluginArgsForCall = append(fake.removePluginArgsForCall, struct { 122 arg1 string 123 }{arg1}) 124 fake.recordInvocation("RemovePlugin", []interface{}{arg1}) 125 fake.removePluginMutex.Unlock() 126 if fake.RemovePluginStub != nil { 127 fake.RemovePluginStub(arg1) 128 } 129 } 130 131 func (fake *FakePluginConfiguration) RemovePluginCallCount() int { 132 fake.removePluginMutex.RLock() 133 defer fake.removePluginMutex.RUnlock() 134 return len(fake.removePluginArgsForCall) 135 } 136 137 func (fake *FakePluginConfiguration) RemovePluginArgsForCall(i int) string { 138 fake.removePluginMutex.RLock() 139 defer fake.removePluginMutex.RUnlock() 140 return fake.removePluginArgsForCall[i].arg1 141 } 142 143 func (fake *FakePluginConfiguration) ListCommands() []string { 144 fake.listCommandsMutex.Lock() 145 fake.listCommandsArgsForCall = append(fake.listCommandsArgsForCall, struct{}{}) 146 fake.recordInvocation("ListCommands", []interface{}{}) 147 fake.listCommandsMutex.Unlock() 148 if fake.ListCommandsStub != nil { 149 return fake.ListCommandsStub() 150 } else { 151 return fake.listCommandsReturns.result1 152 } 153 } 154 155 func (fake *FakePluginConfiguration) ListCommandsCallCount() int { 156 fake.listCommandsMutex.RLock() 157 defer fake.listCommandsMutex.RUnlock() 158 return len(fake.listCommandsArgsForCall) 159 } 160 161 func (fake *FakePluginConfiguration) ListCommandsReturns(result1 []string) { 162 fake.ListCommandsStub = nil 163 fake.listCommandsReturns = struct { 164 result1 []string 165 }{result1} 166 } 167 168 func (fake *FakePluginConfiguration) Invocations() map[string][][]interface{} { 169 fake.invocationsMutex.RLock() 170 defer fake.invocationsMutex.RUnlock() 171 fake.pluginsMutex.RLock() 172 defer fake.pluginsMutex.RUnlock() 173 fake.setPluginMutex.RLock() 174 defer fake.setPluginMutex.RUnlock() 175 fake.getPluginPathMutex.RLock() 176 defer fake.getPluginPathMutex.RUnlock() 177 fake.removePluginMutex.RLock() 178 defer fake.removePluginMutex.RUnlock() 179 fake.listCommandsMutex.RLock() 180 defer fake.listCommandsMutex.RUnlock() 181 return fake.invocations 182 } 183 184 func (fake *FakePluginConfiguration) recordInvocation(key string, args []interface{}) { 185 fake.invocationsMutex.Lock() 186 defer fake.invocationsMutex.Unlock() 187 if fake.invocations == nil { 188 fake.invocations = map[string][][]interface{}{} 189 } 190 if fake.invocations[key] == nil { 191 fake.invocations[key] = [][]interface{}{} 192 } 193 fake.invocations[key] = append(fake.invocations[key], args) 194 } 195 196 var _ pluginconfig.PluginConfiguration = new(FakePluginConfiguration)