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

import (
	"sync"

	"code.cloudfoundry.org/policy-server/api"
)

type PolicyValidator struct {
	ValidatePoliciesStub        func([]api.Policy) error
	validatePoliciesMutex       sync.RWMutex
	validatePoliciesArgsForCall []struct {
		arg1 []api.Policy
	}
	validatePoliciesReturns struct {
		result1 error
	}
	validatePoliciesReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *PolicyValidator) ValidatePolicies(arg1 []api.Policy) error {
	var arg1Copy []api.Policy
	if arg1 != nil {
		arg1Copy = make([]api.Policy, len(arg1))
		copy(arg1Copy, arg1)
	}
	fake.validatePoliciesMutex.Lock()
	ret, specificReturn := fake.validatePoliciesReturnsOnCall[len(fake.validatePoliciesArgsForCall)]
	fake.validatePoliciesArgsForCall = append(fake.validatePoliciesArgsForCall, struct {
		arg1 []api.Policy
	}{arg1Copy})
	stub := fake.ValidatePoliciesStub
	fakeReturns := fake.validatePoliciesReturns
	fake.recordInvocation("ValidatePolicies", []interface{}{arg1Copy})
	fake.validatePoliciesMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *PolicyValidator) ValidatePoliciesCallCount() int {
	fake.validatePoliciesMutex.RLock()
	defer fake.validatePoliciesMutex.RUnlock()
	return len(fake.validatePoliciesArgsForCall)
}

func (fake *PolicyValidator) ValidatePoliciesCalls(stub func([]api.Policy) error) {
	fake.validatePoliciesMutex.Lock()
	defer fake.validatePoliciesMutex.Unlock()
	fake.ValidatePoliciesStub = stub
}

func (fake *PolicyValidator) ValidatePoliciesArgsForCall(i int) []api.Policy {
	fake.validatePoliciesMutex.RLock()
	defer fake.validatePoliciesMutex.RUnlock()
	argsForCall := fake.validatePoliciesArgsForCall[i]
	return argsForCall.arg1
}

func (fake *PolicyValidator) ValidatePoliciesReturns(result1 error) {
	fake.validatePoliciesMutex.Lock()
	defer fake.validatePoliciesMutex.Unlock()
	fake.ValidatePoliciesStub = nil
	fake.validatePoliciesReturns = struct {
		result1 error
	}{result1}
}

func (fake *PolicyValidator) ValidatePoliciesReturnsOnCall(i int, result1 error) {
	fake.validatePoliciesMutex.Lock()
	defer fake.validatePoliciesMutex.Unlock()
	fake.ValidatePoliciesStub = nil
	if fake.validatePoliciesReturnsOnCall == nil {
		fake.validatePoliciesReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.validatePoliciesReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

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

func (fake *PolicyValidator) 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)
}
