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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/authorization"
)

type CertIdentityInspector struct {
	WhoAmIStub        func(context.Context, []byte) (authorization.Identity, error)
	whoAmIMutex       sync.RWMutex
	whoAmIArgsForCall []struct {
		arg1 context.Context
		arg2 []byte
	}
	whoAmIReturns struct {
		result1 authorization.Identity
		result2 error
	}
	whoAmIReturnsOnCall map[int]struct {
		result1 authorization.Identity
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CertIdentityInspector) WhoAmI(arg1 context.Context, arg2 []byte) (authorization.Identity, error) {
	var arg2Copy []byte
	if arg2 != nil {
		arg2Copy = make([]byte, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.whoAmIMutex.Lock()
	ret, specificReturn := fake.whoAmIReturnsOnCall[len(fake.whoAmIArgsForCall)]
	fake.whoAmIArgsForCall = append(fake.whoAmIArgsForCall, struct {
		arg1 context.Context
		arg2 []byte
	}{arg1, arg2Copy})
	stub := fake.WhoAmIStub
	fakeReturns := fake.whoAmIReturns
	fake.recordInvocation("WhoAmI", []interface{}{arg1, arg2Copy})
	fake.whoAmIMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CertIdentityInspector) WhoAmICallCount() int {
	fake.whoAmIMutex.RLock()
	defer fake.whoAmIMutex.RUnlock()
	return len(fake.whoAmIArgsForCall)
}

func (fake *CertIdentityInspector) WhoAmICalls(stub func(context.Context, []byte) (authorization.Identity, error)) {
	fake.whoAmIMutex.Lock()
	defer fake.whoAmIMutex.Unlock()
	fake.WhoAmIStub = stub
}

func (fake *CertIdentityInspector) WhoAmIArgsForCall(i int) (context.Context, []byte) {
	fake.whoAmIMutex.RLock()
	defer fake.whoAmIMutex.RUnlock()
	argsForCall := fake.whoAmIArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *CertIdentityInspector) WhoAmIReturns(result1 authorization.Identity, result2 error) {
	fake.whoAmIMutex.Lock()
	defer fake.whoAmIMutex.Unlock()
	fake.WhoAmIStub = nil
	fake.whoAmIReturns = struct {
		result1 authorization.Identity
		result2 error
	}{result1, result2}
}

func (fake *CertIdentityInspector) WhoAmIReturnsOnCall(i int, result1 authorization.Identity, result2 error) {
	fake.whoAmIMutex.Lock()
	defer fake.whoAmIMutex.Unlock()
	fake.WhoAmIStub = nil
	if fake.whoAmIReturnsOnCall == nil {
		fake.whoAmIReturnsOnCall = make(map[int]struct {
			result1 authorization.Identity
			result2 error
		})
	}
	fake.whoAmIReturnsOnCall[i] = struct {
		result1 authorization.Identity
		result2 error
	}{result1, result2}
}

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

func (fake *CertIdentityInspector) 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 _ authorization.CertIdentityInspector = new(CertIdentityInspector)
