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

import (
	"sync"

	"github.com/hyperledger/fabric/common/channelconfig"
	"github.com/hyperledger/fabric/common/policies"
	"github.com/hyperledger/fabric/core/ledger"
)

type SystemChaincodeProvider struct {
	GetApplicationConfigStub        func(string) (channelconfig.Application, bool)
	getApplicationConfigMutex       sync.RWMutex
	getApplicationConfigArgsForCall []struct {
		arg1 string
	}
	getApplicationConfigReturns struct {
		result1 channelconfig.Application
		result2 bool
	}
	getApplicationConfigReturnsOnCall map[int]struct {
		result1 channelconfig.Application
		result2 bool
	}
	GetQueryExecutorForLedgerStub        func(string) (ledger.QueryExecutor, error)
	getQueryExecutorForLedgerMutex       sync.RWMutex
	getQueryExecutorForLedgerArgsForCall []struct {
		arg1 string
	}
	getQueryExecutorForLedgerReturns struct {
		result1 ledger.QueryExecutor
		result2 error
	}
	getQueryExecutorForLedgerReturnsOnCall map[int]struct {
		result1 ledger.QueryExecutor
		result2 error
	}
	PolicyManagerStub        func(string) (policies.Manager, bool)
	policyManagerMutex       sync.RWMutex
	policyManagerArgsForCall []struct {
		arg1 string
	}
	policyManagerReturns struct {
		result1 policies.Manager
		result2 bool
	}
	policyManagerReturnsOnCall map[int]struct {
		result1 policies.Manager
		result2 bool
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *SystemChaincodeProvider) GetApplicationConfig(arg1 string) (channelconfig.Application, bool) {
	fake.getApplicationConfigMutex.Lock()
	ret, specificReturn := fake.getApplicationConfigReturnsOnCall[len(fake.getApplicationConfigArgsForCall)]
	fake.getApplicationConfigArgsForCall = append(fake.getApplicationConfigArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("GetApplicationConfig", []interface{}{arg1})
	fake.getApplicationConfigMutex.Unlock()
	if fake.GetApplicationConfigStub != nil {
		return fake.GetApplicationConfigStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getApplicationConfigReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *SystemChaincodeProvider) GetApplicationConfigCallCount() int {
	fake.getApplicationConfigMutex.RLock()
	defer fake.getApplicationConfigMutex.RUnlock()
	return len(fake.getApplicationConfigArgsForCall)
}

func (fake *SystemChaincodeProvider) GetApplicationConfigCalls(stub func(string) (channelconfig.Application, bool)) {
	fake.getApplicationConfigMutex.Lock()
	defer fake.getApplicationConfigMutex.Unlock()
	fake.GetApplicationConfigStub = stub
}

func (fake *SystemChaincodeProvider) GetApplicationConfigArgsForCall(i int) string {
	fake.getApplicationConfigMutex.RLock()
	defer fake.getApplicationConfigMutex.RUnlock()
	argsForCall := fake.getApplicationConfigArgsForCall[i]
	return argsForCall.arg1
}

func (fake *SystemChaincodeProvider) GetApplicationConfigReturns(result1 channelconfig.Application, result2 bool) {
	fake.getApplicationConfigMutex.Lock()
	defer fake.getApplicationConfigMutex.Unlock()
	fake.GetApplicationConfigStub = nil
	fake.getApplicationConfigReturns = struct {
		result1 channelconfig.Application
		result2 bool
	}{result1, result2}
}

func (fake *SystemChaincodeProvider) GetApplicationConfigReturnsOnCall(i int, result1 channelconfig.Application, result2 bool) {
	fake.getApplicationConfigMutex.Lock()
	defer fake.getApplicationConfigMutex.Unlock()
	fake.GetApplicationConfigStub = nil
	if fake.getApplicationConfigReturnsOnCall == nil {
		fake.getApplicationConfigReturnsOnCall = make(map[int]struct {
			result1 channelconfig.Application
			result2 bool
		})
	}
	fake.getApplicationConfigReturnsOnCall[i] = struct {
		result1 channelconfig.Application
		result2 bool
	}{result1, result2}
}

func (fake *SystemChaincodeProvider) GetQueryExecutorForLedger(arg1 string) (ledger.QueryExecutor, error) {
	fake.getQueryExecutorForLedgerMutex.Lock()
	ret, specificReturn := fake.getQueryExecutorForLedgerReturnsOnCall[len(fake.getQueryExecutorForLedgerArgsForCall)]
	fake.getQueryExecutorForLedgerArgsForCall = append(fake.getQueryExecutorForLedgerArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("GetQueryExecutorForLedger", []interface{}{arg1})
	fake.getQueryExecutorForLedgerMutex.Unlock()
	if fake.GetQueryExecutorForLedgerStub != nil {
		return fake.GetQueryExecutorForLedgerStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.getQueryExecutorForLedgerReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *SystemChaincodeProvider) GetQueryExecutorForLedgerCallCount() int {
	fake.getQueryExecutorForLedgerMutex.RLock()
	defer fake.getQueryExecutorForLedgerMutex.RUnlock()
	return len(fake.getQueryExecutorForLedgerArgsForCall)
}

func (fake *SystemChaincodeProvider) GetQueryExecutorForLedgerCalls(stub func(string) (ledger.QueryExecutor, error)) {
	fake.getQueryExecutorForLedgerMutex.Lock()
	defer fake.getQueryExecutorForLedgerMutex.Unlock()
	fake.GetQueryExecutorForLedgerStub = stub
}

func (fake *SystemChaincodeProvider) GetQueryExecutorForLedgerArgsForCall(i int) string {
	fake.getQueryExecutorForLedgerMutex.RLock()
	defer fake.getQueryExecutorForLedgerMutex.RUnlock()
	argsForCall := fake.getQueryExecutorForLedgerArgsForCall[i]
	return argsForCall.arg1
}

func (fake *SystemChaincodeProvider) GetQueryExecutorForLedgerReturns(result1 ledger.QueryExecutor, result2 error) {
	fake.getQueryExecutorForLedgerMutex.Lock()
	defer fake.getQueryExecutorForLedgerMutex.Unlock()
	fake.GetQueryExecutorForLedgerStub = nil
	fake.getQueryExecutorForLedgerReturns = struct {
		result1 ledger.QueryExecutor
		result2 error
	}{result1, result2}
}

func (fake *SystemChaincodeProvider) GetQueryExecutorForLedgerReturnsOnCall(i int, result1 ledger.QueryExecutor, result2 error) {
	fake.getQueryExecutorForLedgerMutex.Lock()
	defer fake.getQueryExecutorForLedgerMutex.Unlock()
	fake.GetQueryExecutorForLedgerStub = nil
	if fake.getQueryExecutorForLedgerReturnsOnCall == nil {
		fake.getQueryExecutorForLedgerReturnsOnCall = make(map[int]struct {
			result1 ledger.QueryExecutor
			result2 error
		})
	}
	fake.getQueryExecutorForLedgerReturnsOnCall[i] = struct {
		result1 ledger.QueryExecutor
		result2 error
	}{result1, result2}
}

func (fake *SystemChaincodeProvider) PolicyManager(arg1 string) (policies.Manager, bool) {
	fake.policyManagerMutex.Lock()
	ret, specificReturn := fake.policyManagerReturnsOnCall[len(fake.policyManagerArgsForCall)]
	fake.policyManagerArgsForCall = append(fake.policyManagerArgsForCall, struct {
		arg1 string
	}{arg1})
	fake.recordInvocation("PolicyManager", []interface{}{arg1})
	fake.policyManagerMutex.Unlock()
	if fake.PolicyManagerStub != nil {
		return fake.PolicyManagerStub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.policyManagerReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *SystemChaincodeProvider) PolicyManagerCallCount() int {
	fake.policyManagerMutex.RLock()
	defer fake.policyManagerMutex.RUnlock()
	return len(fake.policyManagerArgsForCall)
}

func (fake *SystemChaincodeProvider) PolicyManagerCalls(stub func(string) (policies.Manager, bool)) {
	fake.policyManagerMutex.Lock()
	defer fake.policyManagerMutex.Unlock()
	fake.PolicyManagerStub = stub
}

func (fake *SystemChaincodeProvider) PolicyManagerArgsForCall(i int) string {
	fake.policyManagerMutex.RLock()
	defer fake.policyManagerMutex.RUnlock()
	argsForCall := fake.policyManagerArgsForCall[i]
	return argsForCall.arg1
}

func (fake *SystemChaincodeProvider) PolicyManagerReturns(result1 policies.Manager, result2 bool) {
	fake.policyManagerMutex.Lock()
	defer fake.policyManagerMutex.Unlock()
	fake.PolicyManagerStub = nil
	fake.policyManagerReturns = struct {
		result1 policies.Manager
		result2 bool
	}{result1, result2}
}

func (fake *SystemChaincodeProvider) PolicyManagerReturnsOnCall(i int, result1 policies.Manager, result2 bool) {
	fake.policyManagerMutex.Lock()
	defer fake.policyManagerMutex.Unlock()
	fake.PolicyManagerStub = nil
	if fake.policyManagerReturnsOnCall == nil {
		fake.policyManagerReturnsOnCall = make(map[int]struct {
			result1 policies.Manager
			result2 bool
		})
	}
	fake.policyManagerReturnsOnCall[i] = struct {
		result1 policies.Manager
		result2 bool
	}{result1, result2}
}

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

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