// Code generated by counterfeiter. DO NOT EDIT.
package runcontainerdfakes

import (
	"sync"

	"code.cloudfoundry.org/garden"
	"code.cloudfoundry.org/guardian/rundmc/goci"
	"code.cloudfoundry.org/guardian/rundmc/runcontainerd"
	lager "code.cloudfoundry.org/lager/v3"
)

type FakeExecer struct {
	AttachStub        func(lager.Logger, string, string, garden.ProcessIO) (garden.Process, error)
	attachMutex       sync.RWMutex
	attachArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
		arg3 string
		arg4 garden.ProcessIO
	}
	attachReturns struct {
		result1 garden.Process
		result2 error
	}
	attachReturnsOnCall map[int]struct {
		result1 garden.Process
		result2 error
	}
	ExecWithBndlStub        func(lager.Logger, string, goci.Bndl, garden.ProcessSpec, garden.ProcessIO) (garden.Process, error)
	execWithBndlMutex       sync.RWMutex
	execWithBndlArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
		arg3 goci.Bndl
		arg4 garden.ProcessSpec
		arg5 garden.ProcessIO
	}
	execWithBndlReturns struct {
		result1 garden.Process
		result2 error
	}
	execWithBndlReturnsOnCall map[int]struct {
		result1 garden.Process
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeExecer) Attach(arg1 lager.Logger, arg2 string, arg3 string, arg4 garden.ProcessIO) (garden.Process, error) {
	fake.attachMutex.Lock()
	ret, specificReturn := fake.attachReturnsOnCall[len(fake.attachArgsForCall)]
	fake.attachArgsForCall = append(fake.attachArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
		arg3 string
		arg4 garden.ProcessIO
	}{arg1, arg2, arg3, arg4})
	stub := fake.AttachStub
	fakeReturns := fake.attachReturns
	fake.recordInvocation("Attach", []interface{}{arg1, arg2, arg3, arg4})
	fake.attachMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeExecer) AttachCallCount() int {
	fake.attachMutex.RLock()
	defer fake.attachMutex.RUnlock()
	return len(fake.attachArgsForCall)
}

func (fake *FakeExecer) AttachCalls(stub func(lager.Logger, string, string, garden.ProcessIO) (garden.Process, error)) {
	fake.attachMutex.Lock()
	defer fake.attachMutex.Unlock()
	fake.AttachStub = stub
}

func (fake *FakeExecer) AttachArgsForCall(i int) (lager.Logger, string, string, garden.ProcessIO) {
	fake.attachMutex.RLock()
	defer fake.attachMutex.RUnlock()
	argsForCall := fake.attachArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}

func (fake *FakeExecer) AttachReturns(result1 garden.Process, result2 error) {
	fake.attachMutex.Lock()
	defer fake.attachMutex.Unlock()
	fake.AttachStub = nil
	fake.attachReturns = struct {
		result1 garden.Process
		result2 error
	}{result1, result2}
}

func (fake *FakeExecer) AttachReturnsOnCall(i int, result1 garden.Process, result2 error) {
	fake.attachMutex.Lock()
	defer fake.attachMutex.Unlock()
	fake.AttachStub = nil
	if fake.attachReturnsOnCall == nil {
		fake.attachReturnsOnCall = make(map[int]struct {
			result1 garden.Process
			result2 error
		})
	}
	fake.attachReturnsOnCall[i] = struct {
		result1 garden.Process
		result2 error
	}{result1, result2}
}

func (fake *FakeExecer) ExecWithBndl(arg1 lager.Logger, arg2 string, arg3 goci.Bndl, arg4 garden.ProcessSpec, arg5 garden.ProcessIO) (garden.Process, error) {
	fake.execWithBndlMutex.Lock()
	ret, specificReturn := fake.execWithBndlReturnsOnCall[len(fake.execWithBndlArgsForCall)]
	fake.execWithBndlArgsForCall = append(fake.execWithBndlArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
		arg3 goci.Bndl
		arg4 garden.ProcessSpec
		arg5 garden.ProcessIO
	}{arg1, arg2, arg3, arg4, arg5})
	stub := fake.ExecWithBndlStub
	fakeReturns := fake.execWithBndlReturns
	fake.recordInvocation("ExecWithBndl", []interface{}{arg1, arg2, arg3, arg4, arg5})
	fake.execWithBndlMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4, arg5)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeExecer) ExecWithBndlCallCount() int {
	fake.execWithBndlMutex.RLock()
	defer fake.execWithBndlMutex.RUnlock()
	return len(fake.execWithBndlArgsForCall)
}

func (fake *FakeExecer) ExecWithBndlCalls(stub func(lager.Logger, string, goci.Bndl, garden.ProcessSpec, garden.ProcessIO) (garden.Process, error)) {
	fake.execWithBndlMutex.Lock()
	defer fake.execWithBndlMutex.Unlock()
	fake.ExecWithBndlStub = stub
}

func (fake *FakeExecer) ExecWithBndlArgsForCall(i int) (lager.Logger, string, goci.Bndl, garden.ProcessSpec, garden.ProcessIO) {
	fake.execWithBndlMutex.RLock()
	defer fake.execWithBndlMutex.RUnlock()
	argsForCall := fake.execWithBndlArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
}

func (fake *FakeExecer) ExecWithBndlReturns(result1 garden.Process, result2 error) {
	fake.execWithBndlMutex.Lock()
	defer fake.execWithBndlMutex.Unlock()
	fake.ExecWithBndlStub = nil
	fake.execWithBndlReturns = struct {
		result1 garden.Process
		result2 error
	}{result1, result2}
}

func (fake *FakeExecer) ExecWithBndlReturnsOnCall(i int, result1 garden.Process, result2 error) {
	fake.execWithBndlMutex.Lock()
	defer fake.execWithBndlMutex.Unlock()
	fake.ExecWithBndlStub = nil
	if fake.execWithBndlReturnsOnCall == nil {
		fake.execWithBndlReturnsOnCall = make(map[int]struct {
			result1 garden.Process
			result2 error
		})
	}
	fake.execWithBndlReturnsOnCall[i] = struct {
		result1 garden.Process
		result2 error
	}{result1, result2}
}

func (fake *FakeExecer) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.attachMutex.RLock()
	defer fake.attachMutex.RUnlock()
	fake.execWithBndlMutex.RLock()
	defer fake.execWithBndlMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeExecer) 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 _ runcontainerd.Execer = new(FakeExecer)
