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

import (
	"sync"

	"code.cloudfoundry.org/guardian/rundmc/runcontainerd/privchecker"
	"code.cloudfoundry.org/lager/v3"
	specs "github.com/opencontainers/runtime-spec/specs-go"
)

type FakeContainerManager struct {
	SpecStub        func(lager.Logger, string) (*specs.Spec, error)
	specMutex       sync.RWMutex
	specArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
	}
	specReturns struct {
		result1 *specs.Spec
		result2 error
	}
	specReturnsOnCall map[int]struct {
		result1 *specs.Spec
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeContainerManager) Spec(arg1 lager.Logger, arg2 string) (*specs.Spec, error) {
	fake.specMutex.Lock()
	ret, specificReturn := fake.specReturnsOnCall[len(fake.specArgsForCall)]
	fake.specArgsForCall = append(fake.specArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("Spec", []interface{}{arg1, arg2})
	fake.specMutex.Unlock()
	if fake.SpecStub != nil {
		return fake.SpecStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.specReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeContainerManager) SpecCallCount() int {
	fake.specMutex.RLock()
	defer fake.specMutex.RUnlock()
	return len(fake.specArgsForCall)
}

func (fake *FakeContainerManager) SpecCalls(stub func(lager.Logger, string) (*specs.Spec, error)) {
	fake.specMutex.Lock()
	defer fake.specMutex.Unlock()
	fake.SpecStub = stub
}

func (fake *FakeContainerManager) SpecArgsForCall(i int) (lager.Logger, string) {
	fake.specMutex.RLock()
	defer fake.specMutex.RUnlock()
	argsForCall := fake.specArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeContainerManager) SpecReturns(result1 *specs.Spec, result2 error) {
	fake.specMutex.Lock()
	defer fake.specMutex.Unlock()
	fake.SpecStub = nil
	fake.specReturns = struct {
		result1 *specs.Spec
		result2 error
	}{result1, result2}
}

func (fake *FakeContainerManager) SpecReturnsOnCall(i int, result1 *specs.Spec, result2 error) {
	fake.specMutex.Lock()
	defer fake.specMutex.Unlock()
	fake.SpecStub = nil
	if fake.specReturnsOnCall == nil {
		fake.specReturnsOnCall = make(map[int]struct {
			result1 *specs.Spec
			result2 error
		})
	}
	fake.specReturnsOnCall[i] = struct {
		result1 *specs.Spec
		result2 error
	}{result1, result2}
}

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

func (fake *FakeContainerManager) 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 _ privchecker.ContainerManager = new(FakeContainerManager)
