kubectl/pkg/framework/test/testfakes/fake_apiserver_start_stoppe...

120 lines
3.0 KiB
Go

// Code generated by counterfeiter. DO NOT EDIT.
package testfakes
import (
"sync"
"k8s.io/kubectl/pkg/framework/test"
)
type FakeAPIServerStartStopper struct {
StartStub func(etcdURL string) error
startMutex sync.RWMutex
startArgsForCall []struct {
etcdURL string
}
startReturns struct {
result1 error
}
startReturnsOnCall map[int]struct {
result1 error
}
StopStub func()
stopMutex sync.RWMutex
stopArgsForCall []struct{}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeAPIServerStartStopper) Start(etcdURL string) error {
fake.startMutex.Lock()
ret, specificReturn := fake.startReturnsOnCall[len(fake.startArgsForCall)]
fake.startArgsForCall = append(fake.startArgsForCall, struct {
etcdURL string
}{etcdURL})
fake.recordInvocation("Start", []interface{}{etcdURL})
fake.startMutex.Unlock()
if fake.StartStub != nil {
return fake.StartStub(etcdURL)
}
if specificReturn {
return ret.result1
}
return fake.startReturns.result1
}
func (fake *FakeAPIServerStartStopper) StartCallCount() int {
fake.startMutex.RLock()
defer fake.startMutex.RUnlock()
return len(fake.startArgsForCall)
}
func (fake *FakeAPIServerStartStopper) StartArgsForCall(i int) string {
fake.startMutex.RLock()
defer fake.startMutex.RUnlock()
return fake.startArgsForCall[i].etcdURL
}
func (fake *FakeAPIServerStartStopper) StartReturns(result1 error) {
fake.StartStub = nil
fake.startReturns = struct {
result1 error
}{result1}
}
func (fake *FakeAPIServerStartStopper) StartReturnsOnCall(i int, result1 error) {
fake.StartStub = nil
if fake.startReturnsOnCall == nil {
fake.startReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.startReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeAPIServerStartStopper) Stop() {
fake.stopMutex.Lock()
fake.stopArgsForCall = append(fake.stopArgsForCall, struct{}{})
fake.recordInvocation("Stop", []interface{}{})
fake.stopMutex.Unlock()
if fake.StopStub != nil {
fake.StopStub()
}
}
func (fake *FakeAPIServerStartStopper) StopCallCount() int {
fake.stopMutex.RLock()
defer fake.stopMutex.RUnlock()
return len(fake.stopArgsForCall)
}
func (fake *FakeAPIServerStartStopper) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.startMutex.RLock()
defer fake.startMutex.RUnlock()
fake.stopMutex.RLock()
defer fake.stopMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeAPIServerStartStopper) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ test.APIServerStartStopper = new(FakeAPIServerStartStopper)