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

import (
	"sync"

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

type FakeProcessManager struct {
	GetProcessStub        func(lager.Logger, string, string) (runcontainerd.BackingProcess, error)
	getProcessMutex       sync.RWMutex
	getProcessArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
		arg3 string
	}
	getProcessReturns struct {
		result1 runcontainerd.BackingProcess
		result2 error
	}
	getProcessReturnsOnCall map[int]struct {
		result1 runcontainerd.BackingProcess
		result2 error
	}
	GetTaskStub        func(lager.Logger, string) (runcontainerd.BackingProcess, error)
	getTaskMutex       sync.RWMutex
	getTaskArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
	}
	getTaskReturns struct {
		result1 runcontainerd.BackingProcess
		result2 error
	}
	getTaskReturnsOnCall map[int]struct {
		result1 runcontainerd.BackingProcess
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeProcessManager) GetProcess(arg1 lager.Logger, arg2 string, arg3 string) (runcontainerd.BackingProcess, error) {
	fake.getProcessMutex.Lock()
	ret, specificReturn := fake.getProcessReturnsOnCall[len(fake.getProcessArgsForCall)]
	fake.getProcessArgsForCall = append(fake.getProcessArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetProcessStub
	fakeReturns := fake.getProcessReturns
	fake.recordInvocation("GetProcess", []interface{}{arg1, arg2, arg3})
	fake.getProcessMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeProcessManager) GetProcessCallCount() int {
	fake.getProcessMutex.RLock()
	defer fake.getProcessMutex.RUnlock()
	return len(fake.getProcessArgsForCall)
}

func (fake *FakeProcessManager) GetProcessCalls(stub func(lager.Logger, string, string) (runcontainerd.BackingProcess, error)) {
	fake.getProcessMutex.Lock()
	defer fake.getProcessMutex.Unlock()
	fake.GetProcessStub = stub
}

func (fake *FakeProcessManager) GetProcessArgsForCall(i int) (lager.Logger, string, string) {
	fake.getProcessMutex.RLock()
	defer fake.getProcessMutex.RUnlock()
	argsForCall := fake.getProcessArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeProcessManager) GetProcessReturns(result1 runcontainerd.BackingProcess, result2 error) {
	fake.getProcessMutex.Lock()
	defer fake.getProcessMutex.Unlock()
	fake.GetProcessStub = nil
	fake.getProcessReturns = struct {
		result1 runcontainerd.BackingProcess
		result2 error
	}{result1, result2}
}

func (fake *FakeProcessManager) GetProcessReturnsOnCall(i int, result1 runcontainerd.BackingProcess, result2 error) {
	fake.getProcessMutex.Lock()
	defer fake.getProcessMutex.Unlock()
	fake.GetProcessStub = nil
	if fake.getProcessReturnsOnCall == nil {
		fake.getProcessReturnsOnCall = make(map[int]struct {
			result1 runcontainerd.BackingProcess
			result2 error
		})
	}
	fake.getProcessReturnsOnCall[i] = struct {
		result1 runcontainerd.BackingProcess
		result2 error
	}{result1, result2}
}

func (fake *FakeProcessManager) GetTask(arg1 lager.Logger, arg2 string) (runcontainerd.BackingProcess, error) {
	fake.getTaskMutex.Lock()
	ret, specificReturn := fake.getTaskReturnsOnCall[len(fake.getTaskArgsForCall)]
	fake.getTaskArgsForCall = append(fake.getTaskArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
	}{arg1, arg2})
	stub := fake.GetTaskStub
	fakeReturns := fake.getTaskReturns
	fake.recordInvocation("GetTask", []interface{}{arg1, arg2})
	fake.getTaskMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeProcessManager) GetTaskCallCount() int {
	fake.getTaskMutex.RLock()
	defer fake.getTaskMutex.RUnlock()
	return len(fake.getTaskArgsForCall)
}

func (fake *FakeProcessManager) GetTaskCalls(stub func(lager.Logger, string) (runcontainerd.BackingProcess, error)) {
	fake.getTaskMutex.Lock()
	defer fake.getTaskMutex.Unlock()
	fake.GetTaskStub = stub
}

func (fake *FakeProcessManager) GetTaskArgsForCall(i int) (lager.Logger, string) {
	fake.getTaskMutex.RLock()
	defer fake.getTaskMutex.RUnlock()
	argsForCall := fake.getTaskArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeProcessManager) GetTaskReturns(result1 runcontainerd.BackingProcess, result2 error) {
	fake.getTaskMutex.Lock()
	defer fake.getTaskMutex.Unlock()
	fake.GetTaskStub = nil
	fake.getTaskReturns = struct {
		result1 runcontainerd.BackingProcess
		result2 error
	}{result1, result2}
}

func (fake *FakeProcessManager) GetTaskReturnsOnCall(i int, result1 runcontainerd.BackingProcess, result2 error) {
	fake.getTaskMutex.Lock()
	defer fake.getTaskMutex.Unlock()
	fake.GetTaskStub = nil
	if fake.getTaskReturnsOnCall == nil {
		fake.getTaskReturnsOnCall = make(map[int]struct {
			result1 runcontainerd.BackingProcess
			result2 error
		})
	}
	fake.getTaskReturnsOnCall[i] = struct {
		result1 runcontainerd.BackingProcess
		result2 error
	}{result1, result2}
}

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

func (fake *FakeProcessManager) 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.ProcessManager = new(FakeProcessManager)
