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

import (
	"sync"

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

type FakePeaUsernameResolver struct {
	ResolveUserStub        func(lager.Logger, string, garden.ImageRef, string) (int, int, error)
	resolveUserMutex       sync.RWMutex
	resolveUserArgsForCall []struct {
		arg1 lager.Logger
		arg2 string
		arg3 garden.ImageRef
		arg4 string
	}
	resolveUserReturns struct {
		result1 int
		result2 int
		result3 error
	}
	resolveUserReturnsOnCall map[int]struct {
		result1 int
		result2 int
		result3 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakePeaUsernameResolver) ResolveUser(arg1 lager.Logger, arg2 string, arg3 garden.ImageRef, arg4 string) (int, int, error) {
	fake.resolveUserMutex.Lock()
	ret, specificReturn := fake.resolveUserReturnsOnCall[len(fake.resolveUserArgsForCall)]
	fake.resolveUserArgsForCall = append(fake.resolveUserArgsForCall, struct {
		arg1 lager.Logger
		arg2 string
		arg3 garden.ImageRef
		arg4 string
	}{arg1, arg2, arg3, arg4})
	stub := fake.ResolveUserStub
	fakeReturns := fake.resolveUserReturns
	fake.recordInvocation("ResolveUser", []interface{}{arg1, arg2, arg3, arg4})
	fake.resolveUserMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3, arg4)
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3
	}
	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}

func (fake *FakePeaUsernameResolver) ResolveUserCallCount() int {
	fake.resolveUserMutex.RLock()
	defer fake.resolveUserMutex.RUnlock()
	return len(fake.resolveUserArgsForCall)
}

func (fake *FakePeaUsernameResolver) ResolveUserCalls(stub func(lager.Logger, string, garden.ImageRef, string) (int, int, error)) {
	fake.resolveUserMutex.Lock()
	defer fake.resolveUserMutex.Unlock()
	fake.ResolveUserStub = stub
}

func (fake *FakePeaUsernameResolver) ResolveUserArgsForCall(i int) (lager.Logger, string, garden.ImageRef, string) {
	fake.resolveUserMutex.RLock()
	defer fake.resolveUserMutex.RUnlock()
	argsForCall := fake.resolveUserArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}

func (fake *FakePeaUsernameResolver) ResolveUserReturns(result1 int, result2 int, result3 error) {
	fake.resolveUserMutex.Lock()
	defer fake.resolveUserMutex.Unlock()
	fake.ResolveUserStub = nil
	fake.resolveUserReturns = struct {
		result1 int
		result2 int
		result3 error
	}{result1, result2, result3}
}

func (fake *FakePeaUsernameResolver) ResolveUserReturnsOnCall(i int, result1 int, result2 int, result3 error) {
	fake.resolveUserMutex.Lock()
	defer fake.resolveUserMutex.Unlock()
	fake.ResolveUserStub = nil
	if fake.resolveUserReturnsOnCall == nil {
		fake.resolveUserReturnsOnCall = make(map[int]struct {
			result1 int
			result2 int
			result3 error
		})
	}
	fake.resolveUserReturnsOnCall[i] = struct {
		result1 int
		result2 int
		result3 error
	}{result1, result2, result3}
}

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

func (fake *FakePeaUsernameResolver) 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 _ rundmc.PeaUsernameResolver = new(FakePeaUsernameResolver)
