github.com/true-sqn/fabric@v2.1.1+incompatible/core/chaincode/fake/application_config_retriever.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package fake
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/hyperledger/fabric/common/channelconfig"
     8  )
     9  
    10  type ApplicationConfigRetriever struct {
    11  	GetApplicationConfigStub        func(string) (channelconfig.Application, bool)
    12  	getApplicationConfigMutex       sync.RWMutex
    13  	getApplicationConfigArgsForCall []struct {
    14  		arg1 string
    15  	}
    16  	getApplicationConfigReturns struct {
    17  		result1 channelconfig.Application
    18  		result2 bool
    19  	}
    20  	getApplicationConfigReturnsOnCall map[int]struct {
    21  		result1 channelconfig.Application
    22  		result2 bool
    23  	}
    24  	invocations      map[string][][]interface{}
    25  	invocationsMutex sync.RWMutex
    26  }
    27  
    28  func (fake *ApplicationConfigRetriever) GetApplicationConfig(arg1 string) (channelconfig.Application, bool) {
    29  	fake.getApplicationConfigMutex.Lock()
    30  	ret, specificReturn := fake.getApplicationConfigReturnsOnCall[len(fake.getApplicationConfigArgsForCall)]
    31  	fake.getApplicationConfigArgsForCall = append(fake.getApplicationConfigArgsForCall, struct {
    32  		arg1 string
    33  	}{arg1})
    34  	fake.recordInvocation("GetApplicationConfig", []interface{}{arg1})
    35  	fake.getApplicationConfigMutex.Unlock()
    36  	if fake.GetApplicationConfigStub != nil {
    37  		return fake.GetApplicationConfigStub(arg1)
    38  	}
    39  	if specificReturn {
    40  		return ret.result1, ret.result2
    41  	}
    42  	fakeReturns := fake.getApplicationConfigReturns
    43  	return fakeReturns.result1, fakeReturns.result2
    44  }
    45  
    46  func (fake *ApplicationConfigRetriever) GetApplicationConfigCallCount() int {
    47  	fake.getApplicationConfigMutex.RLock()
    48  	defer fake.getApplicationConfigMutex.RUnlock()
    49  	return len(fake.getApplicationConfigArgsForCall)
    50  }
    51  
    52  func (fake *ApplicationConfigRetriever) GetApplicationConfigCalls(stub func(string) (channelconfig.Application, bool)) {
    53  	fake.getApplicationConfigMutex.Lock()
    54  	defer fake.getApplicationConfigMutex.Unlock()
    55  	fake.GetApplicationConfigStub = stub
    56  }
    57  
    58  func (fake *ApplicationConfigRetriever) GetApplicationConfigArgsForCall(i int) string {
    59  	fake.getApplicationConfigMutex.RLock()
    60  	defer fake.getApplicationConfigMutex.RUnlock()
    61  	argsForCall := fake.getApplicationConfigArgsForCall[i]
    62  	return argsForCall.arg1
    63  }
    64  
    65  func (fake *ApplicationConfigRetriever) GetApplicationConfigReturns(result1 channelconfig.Application, result2 bool) {
    66  	fake.getApplicationConfigMutex.Lock()
    67  	defer fake.getApplicationConfigMutex.Unlock()
    68  	fake.GetApplicationConfigStub = nil
    69  	fake.getApplicationConfigReturns = struct {
    70  		result1 channelconfig.Application
    71  		result2 bool
    72  	}{result1, result2}
    73  }
    74  
    75  func (fake *ApplicationConfigRetriever) GetApplicationConfigReturnsOnCall(i int, result1 channelconfig.Application, result2 bool) {
    76  	fake.getApplicationConfigMutex.Lock()
    77  	defer fake.getApplicationConfigMutex.Unlock()
    78  	fake.GetApplicationConfigStub = nil
    79  	if fake.getApplicationConfigReturnsOnCall == nil {
    80  		fake.getApplicationConfigReturnsOnCall = make(map[int]struct {
    81  			result1 channelconfig.Application
    82  			result2 bool
    83  		})
    84  	}
    85  	fake.getApplicationConfigReturnsOnCall[i] = struct {
    86  		result1 channelconfig.Application
    87  		result2 bool
    88  	}{result1, result2}
    89  }
    90  
    91  func (fake *ApplicationConfigRetriever) Invocations() map[string][][]interface{} {
    92  	fake.invocationsMutex.RLock()
    93  	defer fake.invocationsMutex.RUnlock()
    94  	fake.getApplicationConfigMutex.RLock()
    95  	defer fake.getApplicationConfigMutex.RUnlock()
    96  	copiedInvocations := map[string][][]interface{}{}
    97  	for key, value := range fake.invocations {
    98  		copiedInvocations[key] = value
    99  	}
   100  	return copiedInvocations
   101  }
   102  
   103  func (fake *ApplicationConfigRetriever) recordInvocation(key string, args []interface{}) {
   104  	fake.invocationsMutex.Lock()
   105  	defer fake.invocationsMutex.Unlock()
   106  	if fake.invocations == nil {
   107  		fake.invocations = map[string][][]interface{}{}
   108  	}
   109  	if fake.invocations[key] == nil {
   110  		fake.invocations[key] = [][]interface{}{}
   111  	}
   112  	fake.invocations[key] = append(fake.invocations[key], args)
   113  }