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

import (
	"context"
	"sync"

	"code.cloudfoundry.org/korifi/api/authorization"
	"code.cloudfoundry.org/korifi/api/handlers/stats"
	"code.cloudfoundry.org/korifi/api/repositories"
)

type CFProcessRepository struct {
	GetProcessStub        func(context.Context, authorization.Info, string) (repositories.ProcessRecord, error)
	getProcessMutex       sync.RWMutex
	getProcessArgsForCall []struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}
	getProcessReturns struct {
		result1 repositories.ProcessRecord
		result2 error
	}
	getProcessReturnsOnCall map[int]struct {
		result1 repositories.ProcessRecord
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *CFProcessRepository) GetProcess(arg1 context.Context, arg2 authorization.Info, arg3 string) (repositories.ProcessRecord, error) {
	fake.getProcessMutex.Lock()
	ret, specificReturn := fake.getProcessReturnsOnCall[len(fake.getProcessArgsForCall)]
	fake.getProcessArgsForCall = append(fake.getProcessArgsForCall, struct {
		arg1 context.Context
		arg2 authorization.Info
		arg3 string
	}{arg1, arg2, arg3})
	stub := fake.GetProcessStub
	fakeReturns := fake.getProcessReturns
	fake.recordInvocation("GetProcess", []interface{}{arg1, arg2, arg3})
	fake.getProcessMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *CFProcessRepository) GetProcessCallCount() int {
	fake.getProcessMutex.RLock()
	defer fake.getProcessMutex.RUnlock()
	return len(fake.getProcessArgsForCall)
}

func (fake *CFProcessRepository) GetProcessCalls(stub func(context.Context, authorization.Info, string) (repositories.ProcessRecord, error)) {
	fake.getProcessMutex.Lock()
	defer fake.getProcessMutex.Unlock()
	fake.GetProcessStub = stub
}

func (fake *CFProcessRepository) GetProcessArgsForCall(i int) (context.Context, authorization.Info, string) {
	fake.getProcessMutex.RLock()
	defer fake.getProcessMutex.RUnlock()
	argsForCall := fake.getProcessArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *CFProcessRepository) GetProcessReturns(result1 repositories.ProcessRecord, result2 error) {
	fake.getProcessMutex.Lock()
	defer fake.getProcessMutex.Unlock()
	fake.GetProcessStub = nil
	fake.getProcessReturns = struct {
		result1 repositories.ProcessRecord
		result2 error
	}{result1, result2}
}

func (fake *CFProcessRepository) GetProcessReturnsOnCall(i int, result1 repositories.ProcessRecord, result2 error) {
	fake.getProcessMutex.Lock()
	defer fake.getProcessMutex.Unlock()
	fake.GetProcessStub = nil
	if fake.getProcessReturnsOnCall == nil {
		fake.getProcessReturnsOnCall = make(map[int]struct {
			result1 repositories.ProcessRecord
			result2 error
		})
	}
	fake.getProcessReturnsOnCall[i] = struct {
		result1 repositories.ProcessRecord
		result2 error
	}{result1, result2}
}

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