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

import (
	"sync"

	"code.cloudfoundry.org/gorouter/proxy/utils"
)

type ErrorHandler struct {
	HandleErrorStub        func(utils.ProxyResponseWriter, error)
	handleErrorMutex       sync.RWMutex
	handleErrorArgsForCall []struct {
		arg1 utils.ProxyResponseWriter
		arg2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *ErrorHandler) HandleError(arg1 utils.ProxyResponseWriter, arg2 error) {
	fake.handleErrorMutex.Lock()
	fake.handleErrorArgsForCall = append(fake.handleErrorArgsForCall, struct {
		arg1 utils.ProxyResponseWriter
		arg2 error
	}{arg1, arg2})
	stub := fake.HandleErrorStub
	fake.recordInvocation("HandleError", []interface{}{arg1, arg2})
	fake.handleErrorMutex.Unlock()
	if stub != nil {
		fake.HandleErrorStub(arg1, arg2)
	}
}

func (fake *ErrorHandler) HandleErrorCallCount() int {
	fake.handleErrorMutex.RLock()
	defer fake.handleErrorMutex.RUnlock()
	return len(fake.handleErrorArgsForCall)
}

func (fake *ErrorHandler) HandleErrorCalls(stub func(utils.ProxyResponseWriter, error)) {
	fake.handleErrorMutex.Lock()
	defer fake.handleErrorMutex.Unlock()
	fake.HandleErrorStub = stub
}

func (fake *ErrorHandler) HandleErrorArgsForCall(i int) (utils.ProxyResponseWriter, error) {
	fake.handleErrorMutex.RLock()
	defer fake.handleErrorMutex.RUnlock()
	argsForCall := fake.handleErrorArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

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

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