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

import (
	"os/exec"
	"sync"

	"code.cloudfoundry.org/guardian/gardener"
	"code.cloudfoundry.org/guardian/imageplugin"
	lager "code.cloudfoundry.org/lager/v3"
)

type FakeCommandCreator struct {
	CapacityCommandStub        func(lager.Logger) *exec.Cmd
	capacityCommandMutex       sync.RWMutex
	capacityCommandArgsForCall []struct {
		arg1 lager.Logger
	}
	capacityCommandReturns struct {
		result1 *exec.Cmd
	}
	capacityCommandReturnsOnCall map[int]struct {
		result1 *exec.Cmd
	}
	CreateCommandStub        func(lager.Logger, string, gardener.RootfsSpec) (*exec.Cmd, error)
	createCommandMutex       sync.RWMutex
	createCommandArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
		arg3 gardener.RootfsSpec
	}
	createCommandReturns struct {
		result1 *exec.Cmd
		result2 error
	}
	createCommandReturnsOnCall map[int]struct {
		result1 *exec.Cmd
		result2 error
	}
	DestroyCommandStub        func(lager.Logger, string) *exec.Cmd
	destroyCommandMutex       sync.RWMutex
	destroyCommandArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
	}
	destroyCommandReturns struct {
		result1 *exec.Cmd
	}
	destroyCommandReturnsOnCall map[int]struct {
		result1 *exec.Cmd
	}
	MetricsCommandStub        func(lager.Logger, string) *exec.Cmd
	metricsCommandMutex       sync.RWMutex
	metricsCommandArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
	}
	metricsCommandReturns struct {
		result1 *exec.Cmd
	}
	metricsCommandReturnsOnCall map[int]struct {
		result1 *exec.Cmd
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeCommandCreator) CapacityCommand(arg1 lager.Logger) *exec.Cmd {
	fake.capacityCommandMutex.Lock()
	ret, specificReturn := fake.capacityCommandReturnsOnCall[len(fake.capacityCommandArgsForCall)]
	fake.capacityCommandArgsForCall = append(fake.capacityCommandArgsForCall, struct {
		arg1 lager.Logger
	}{arg1})
	stub := fake.CapacityCommandStub
	fakeReturns := fake.capacityCommandReturns
	fake.recordInvocation("CapacityCommand", []interface{}{arg1})
	fake.capacityCommandMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeCommandCreator) CapacityCommandCallCount() int {
	fake.capacityCommandMutex.RLock()
	defer fake.capacityCommandMutex.RUnlock()
	return len(fake.capacityCommandArgsForCall)
}

func (fake *FakeCommandCreator) CapacityCommandCalls(stub func(lager.Logger) *exec.Cmd) {
	fake.capacityCommandMutex.Lock()
	defer fake.capacityCommandMutex.Unlock()
	fake.CapacityCommandStub = stub
}

func (fake *FakeCommandCreator) CapacityCommandArgsForCall(i int) lager.Logger {
	fake.capacityCommandMutex.RLock()
	defer fake.capacityCommandMutex.RUnlock()
	argsForCall := fake.capacityCommandArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeCommandCreator) CapacityCommandReturns(result1 *exec.Cmd) {
	fake.capacityCommandMutex.Lock()
	defer fake.capacityCommandMutex.Unlock()
	fake.CapacityCommandStub = nil
	fake.capacityCommandReturns = struct {
		result1 *exec.Cmd
	}{result1}
}

func (fake *FakeCommandCreator) CapacityCommandReturnsOnCall(i int, result1 *exec.Cmd) {
	fake.capacityCommandMutex.Lock()
	defer fake.capacityCommandMutex.Unlock()
	fake.CapacityCommandStub = nil
	if fake.capacityCommandReturnsOnCall == nil {
		fake.capacityCommandReturnsOnCall = make(map[int]struct {
			result1 *exec.Cmd
		})
	}
	fake.capacityCommandReturnsOnCall[i] = struct {
		result1 *exec.Cmd
	}{result1}
}

func (fake *FakeCommandCreator) CreateCommand(arg1 lager.Logger, arg2 string, arg3 gardener.RootfsSpec) (*exec.Cmd, error) {
	fake.createCommandMutex.Lock()
	ret, specificReturn := fake.createCommandReturnsOnCall[len(fake.createCommandArgsForCall)]
	fake.createCommandArgsForCall = append(fake.createCommandArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
		arg3 gardener.RootfsSpec
	}{arg1, arg2, arg3})
	stub := fake.CreateCommandStub
	fakeReturns := fake.createCommandReturns
	fake.recordInvocation("CreateCommand", []interface{}{arg1, arg2, arg3})
	fake.createCommandMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeCommandCreator) CreateCommandCallCount() int {
	fake.createCommandMutex.RLock()
	defer fake.createCommandMutex.RUnlock()
	return len(fake.createCommandArgsForCall)
}

func (fake *FakeCommandCreator) CreateCommandCalls(stub func(lager.Logger, string, gardener.RootfsSpec) (*exec.Cmd, error)) {
	fake.createCommandMutex.Lock()
	defer fake.createCommandMutex.Unlock()
	fake.CreateCommandStub = stub
}

func (fake *FakeCommandCreator) CreateCommandArgsForCall(i int) (lager.Logger, string, gardener.RootfsSpec) {
	fake.createCommandMutex.RLock()
	defer fake.createCommandMutex.RUnlock()
	argsForCall := fake.createCommandArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeCommandCreator) CreateCommandReturns(result1 *exec.Cmd, result2 error) {
	fake.createCommandMutex.Lock()
	defer fake.createCommandMutex.Unlock()
	fake.CreateCommandStub = nil
	fake.createCommandReturns = struct {
		result1 *exec.Cmd
		result2 error
	}{result1, result2}
}

func (fake *FakeCommandCreator) CreateCommandReturnsOnCall(i int, result1 *exec.Cmd, result2 error) {
	fake.createCommandMutex.Lock()
	defer fake.createCommandMutex.Unlock()
	fake.CreateCommandStub = nil
	if fake.createCommandReturnsOnCall == nil {
		fake.createCommandReturnsOnCall = make(map[int]struct {
			result1 *exec.Cmd
			result2 error
		})
	}
	fake.createCommandReturnsOnCall[i] = struct {
		result1 *exec.Cmd
		result2 error
	}{result1, result2}
}

func (fake *FakeCommandCreator) DestroyCommand(arg1 lager.Logger, arg2 string) *exec.Cmd {
	fake.destroyCommandMutex.Lock()
	ret, specificReturn := fake.destroyCommandReturnsOnCall[len(fake.destroyCommandArgsForCall)]
	fake.destroyCommandArgsForCall = append(fake.destroyCommandArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
	}{arg1, arg2})
	stub := fake.DestroyCommandStub
	fakeReturns := fake.destroyCommandReturns
	fake.recordInvocation("DestroyCommand", []interface{}{arg1, arg2})
	fake.destroyCommandMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeCommandCreator) DestroyCommandCallCount() int {
	fake.destroyCommandMutex.RLock()
	defer fake.destroyCommandMutex.RUnlock()
	return len(fake.destroyCommandArgsForCall)
}

func (fake *FakeCommandCreator) DestroyCommandCalls(stub func(lager.Logger, string) *exec.Cmd) {
	fake.destroyCommandMutex.Lock()
	defer fake.destroyCommandMutex.Unlock()
	fake.DestroyCommandStub = stub
}

func (fake *FakeCommandCreator) DestroyCommandArgsForCall(i int) (lager.Logger, string) {
	fake.destroyCommandMutex.RLock()
	defer fake.destroyCommandMutex.RUnlock()
	argsForCall := fake.destroyCommandArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeCommandCreator) DestroyCommandReturns(result1 *exec.Cmd) {
	fake.destroyCommandMutex.Lock()
	defer fake.destroyCommandMutex.Unlock()
	fake.DestroyCommandStub = nil
	fake.destroyCommandReturns = struct {
		result1 *exec.Cmd
	}{result1}
}

func (fake *FakeCommandCreator) DestroyCommandReturnsOnCall(i int, result1 *exec.Cmd) {
	fake.destroyCommandMutex.Lock()
	defer fake.destroyCommandMutex.Unlock()
	fake.DestroyCommandStub = nil
	if fake.destroyCommandReturnsOnCall == nil {
		fake.destroyCommandReturnsOnCall = make(map[int]struct {
			result1 *exec.Cmd
		})
	}
	fake.destroyCommandReturnsOnCall[i] = struct {
		result1 *exec.Cmd
	}{result1}
}

func (fake *FakeCommandCreator) MetricsCommand(arg1 lager.Logger, arg2 string) *exec.Cmd {
	fake.metricsCommandMutex.Lock()
	ret, specificReturn := fake.metricsCommandReturnsOnCall[len(fake.metricsCommandArgsForCall)]
	fake.metricsCommandArgsForCall = append(fake.metricsCommandArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
	}{arg1, arg2})
	stub := fake.MetricsCommandStub
	fakeReturns := fake.metricsCommandReturns
	fake.recordInvocation("MetricsCommand", []interface{}{arg1, arg2})
	fake.metricsCommandMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeCommandCreator) MetricsCommandCallCount() int {
	fake.metricsCommandMutex.RLock()
	defer fake.metricsCommandMutex.RUnlock()
	return len(fake.metricsCommandArgsForCall)
}

func (fake *FakeCommandCreator) MetricsCommandCalls(stub func(lager.Logger, string) *exec.Cmd) {
	fake.metricsCommandMutex.Lock()
	defer fake.metricsCommandMutex.Unlock()
	fake.MetricsCommandStub = stub
}

func (fake *FakeCommandCreator) MetricsCommandArgsForCall(i int) (lager.Logger, string) {
	fake.metricsCommandMutex.RLock()
	defer fake.metricsCommandMutex.RUnlock()
	argsForCall := fake.metricsCommandArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeCommandCreator) MetricsCommandReturns(result1 *exec.Cmd) {
	fake.metricsCommandMutex.Lock()
	defer fake.metricsCommandMutex.Unlock()
	fake.MetricsCommandStub = nil
	fake.metricsCommandReturns = struct {
		result1 *exec.Cmd
	}{result1}
}

func (fake *FakeCommandCreator) MetricsCommandReturnsOnCall(i int, result1 *exec.Cmd) {
	fake.metricsCommandMutex.Lock()
	defer fake.metricsCommandMutex.Unlock()
	fake.MetricsCommandStub = nil
	if fake.metricsCommandReturnsOnCall == nil {
		fake.metricsCommandReturnsOnCall = make(map[int]struct {
			result1 *exec.Cmd
		})
	}
	fake.metricsCommandReturnsOnCall[i] = struct {
		result1 *exec.Cmd
	}{result1}
}

func (fake *FakeCommandCreator) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.capacityCommandMutex.RLock()
	defer fake.capacityCommandMutex.RUnlock()
	fake.createCommandMutex.RLock()
	defer fake.createCommandMutex.RUnlock()
	fake.destroyCommandMutex.RLock()
	defer fake.destroyCommandMutex.RUnlock()
	fake.metricsCommandMutex.RLock()
	defer fake.metricsCommandMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeCommandCreator) 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 _ imageplugin.CommandCreator = new(FakeCommandCreator)
