120 lines
2.9 KiB
Go
120 lines
2.9 KiB
Go
// Code generated by counterfeiter. DO NOT EDIT.
|
|
package execfakes
|
|
|
|
import (
|
|
"context"
|
|
"sync"
|
|
|
|
"github.com/concourse/concourse/atc/exec"
|
|
)
|
|
|
|
type FakeStep struct {
|
|
RunStub func(context.Context, exec.RunState) (bool, error)
|
|
runMutex sync.RWMutex
|
|
runArgsForCall []struct {
|
|
arg1 context.Context
|
|
arg2 exec.RunState
|
|
}
|
|
runReturns struct {
|
|
result1 bool
|
|
result2 error
|
|
}
|
|
runReturnsOnCall map[int]struct {
|
|
result1 bool
|
|
result2 error
|
|
}
|
|
invocations map[string][][]interface{}
|
|
invocationsMutex sync.RWMutex
|
|
}
|
|
|
|
func (fake *FakeStep) Run(arg1 context.Context, arg2 exec.RunState) (bool, error) {
|
|
fake.runMutex.Lock()
|
|
ret, specificReturn := fake.runReturnsOnCall[len(fake.runArgsForCall)]
|
|
fake.runArgsForCall = append(fake.runArgsForCall, struct {
|
|
arg1 context.Context
|
|
arg2 exec.RunState
|
|
}{arg1, arg2})
|
|
stub := fake.RunStub
|
|
fakeReturns := fake.runReturns
|
|
fake.recordInvocation("Run", []interface{}{arg1, arg2})
|
|
fake.runMutex.Unlock()
|
|
if stub != nil {
|
|
return stub(arg1, arg2)
|
|
}
|
|
if specificReturn {
|
|
return ret.result1, ret.result2
|
|
}
|
|
return fakeReturns.result1, fakeReturns.result2
|
|
}
|
|
|
|
func (fake *FakeStep) RunCallCount() int {
|
|
fake.runMutex.RLock()
|
|
defer fake.runMutex.RUnlock()
|
|
return len(fake.runArgsForCall)
|
|
}
|
|
|
|
func (fake *FakeStep) RunCalls(stub func(context.Context, exec.RunState) (bool, error)) {
|
|
fake.runMutex.Lock()
|
|
defer fake.runMutex.Unlock()
|
|
fake.RunStub = stub
|
|
}
|
|
|
|
func (fake *FakeStep) RunArgsForCall(i int) (context.Context, exec.RunState) {
|
|
fake.runMutex.RLock()
|
|
defer fake.runMutex.RUnlock()
|
|
argsForCall := fake.runArgsForCall[i]
|
|
return argsForCall.arg1, argsForCall.arg2
|
|
}
|
|
|
|
func (fake *FakeStep) RunReturns(result1 bool, result2 error) {
|
|
fake.runMutex.Lock()
|
|
defer fake.runMutex.Unlock()
|
|
fake.RunStub = nil
|
|
fake.runReturns = struct {
|
|
result1 bool
|
|
result2 error
|
|
}{result1, result2}
|
|
}
|
|
|
|
func (fake *FakeStep) RunReturnsOnCall(i int, result1 bool, result2 error) {
|
|
fake.runMutex.Lock()
|
|
defer fake.runMutex.Unlock()
|
|
fake.RunStub = nil
|
|
if fake.runReturnsOnCall == nil {
|
|
fake.runReturnsOnCall = make(map[int]struct {
|
|
result1 bool
|
|
result2 error
|
|
})
|
|
}
|
|
fake.runReturnsOnCall[i] = struct {
|
|
result1 bool
|
|
result2 error
|
|
}{result1, result2}
|
|
}
|
|
|
|
func (fake *FakeStep) Invocations() map[string][][]interface{} {
|
|
fake.invocationsMutex.RLock()
|
|
defer fake.invocationsMutex.RUnlock()
|
|
fake.runMutex.RLock()
|
|
defer fake.runMutex.RUnlock()
|
|
copiedInvocations := map[string][][]interface{}{}
|
|
for key, value := range fake.invocations {
|
|
copiedInvocations[key] = value
|
|
}
|
|
return copiedInvocations
|
|
}
|
|
|
|
func (fake *FakeStep) 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 _ exec.Step = new(FakeStep)
|