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

import (
	"policy-server/store"
	"policy-server/uaa_client"
	"sync"
)

type PolicyFilter struct {
	FilterPoliciesStub        func(policies []store.Policy, userToken uaa_client.CheckTokenResponse) ([]store.Policy, error)
	filterPoliciesMutex       sync.RWMutex
	filterPoliciesArgsForCall []struct {
		policies  []store.Policy
		userToken uaa_client.CheckTokenResponse
	}
	filterPoliciesReturns struct {
		result1 []store.Policy
		result2 error
	}
	filterPoliciesReturnsOnCall map[int]struct {
		result1 []store.Policy
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *PolicyFilter) FilterPolicies(policies []store.Policy, userToken uaa_client.CheckTokenResponse) ([]store.Policy, error) {
	var policiesCopy []store.Policy
	if policies != nil {
		policiesCopy = make([]store.Policy, len(policies))
		copy(policiesCopy, policies)
	}
	fake.filterPoliciesMutex.Lock()
	ret, specificReturn := fake.filterPoliciesReturnsOnCall[len(fake.filterPoliciesArgsForCall)]
	fake.filterPoliciesArgsForCall = append(fake.filterPoliciesArgsForCall, struct {
		policies  []store.Policy
		userToken uaa_client.CheckTokenResponse
	}{policiesCopy, userToken})
	fake.recordInvocation("FilterPolicies", []interface{}{policiesCopy, userToken})
	fake.filterPoliciesMutex.Unlock()
	if fake.FilterPoliciesStub != nil {
		return fake.FilterPoliciesStub(policies, userToken)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fake.filterPoliciesReturns.result1, fake.filterPoliciesReturns.result2
}

func (fake *PolicyFilter) FilterPoliciesCallCount() int {
	fake.filterPoliciesMutex.RLock()
	defer fake.filterPoliciesMutex.RUnlock()
	return len(fake.filterPoliciesArgsForCall)
}

func (fake *PolicyFilter) FilterPoliciesArgsForCall(i int) ([]store.Policy, uaa_client.CheckTokenResponse) {
	fake.filterPoliciesMutex.RLock()
	defer fake.filterPoliciesMutex.RUnlock()
	return fake.filterPoliciesArgsForCall[i].policies, fake.filterPoliciesArgsForCall[i].userToken
}

func (fake *PolicyFilter) FilterPoliciesReturns(result1 []store.Policy, result2 error) {
	fake.FilterPoliciesStub = nil
	fake.filterPoliciesReturns = struct {
		result1 []store.Policy
		result2 error
	}{result1, result2}
}

func (fake *PolicyFilter) FilterPoliciesReturnsOnCall(i int, result1 []store.Policy, result2 error) {
	fake.FilterPoliciesStub = nil
	if fake.filterPoliciesReturnsOnCall == nil {
		fake.filterPoliciesReturnsOnCall = make(map[int]struct {
			result1 []store.Policy
			result2 error
		})
	}
	fake.filterPoliciesReturnsOnCall[i] = struct {
		result1 []store.Policy
		result2 error
	}{result1, result2}
}

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

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