github.com/IBM-Blockchain/fabric-operator@v1.0.4/pkg/initializer/cryptogen/mocks/config.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mocks 3 4 import ( 5 "sync" 6 7 "github.com/IBM-Blockchain/fabric-operator/pkg/apis/common" 8 "github.com/IBM-Blockchain/fabric-operator/pkg/initializer/cryptogen" 9 ) 10 11 type Config struct { 12 GetBCCSPSectionStub func() *common.BCCSP 13 getBCCSPSectionMutex sync.RWMutex 14 getBCCSPSectionArgsForCall []struct { 15 } 16 getBCCSPSectionReturns struct { 17 result1 *common.BCCSP 18 } 19 getBCCSPSectionReturnsOnCall map[int]struct { 20 result1 *common.BCCSP 21 } 22 SetDefaultKeyStoreStub func() 23 setDefaultKeyStoreMutex sync.RWMutex 24 setDefaultKeyStoreArgsForCall []struct { 25 } 26 SetPKCS11DefaultsStub func(bool) 27 setPKCS11DefaultsMutex sync.RWMutex 28 setPKCS11DefaultsArgsForCall []struct { 29 arg1 bool 30 } 31 invocations map[string][][]interface{} 32 invocationsMutex sync.RWMutex 33 } 34 35 func (fake *Config) GetBCCSPSection() *common.BCCSP { 36 fake.getBCCSPSectionMutex.Lock() 37 ret, specificReturn := fake.getBCCSPSectionReturnsOnCall[len(fake.getBCCSPSectionArgsForCall)] 38 fake.getBCCSPSectionArgsForCall = append(fake.getBCCSPSectionArgsForCall, struct { 39 }{}) 40 stub := fake.GetBCCSPSectionStub 41 fakeReturns := fake.getBCCSPSectionReturns 42 fake.recordInvocation("GetBCCSPSection", []interface{}{}) 43 fake.getBCCSPSectionMutex.Unlock() 44 if stub != nil { 45 return stub() 46 } 47 if specificReturn { 48 return ret.result1 49 } 50 return fakeReturns.result1 51 } 52 53 func (fake *Config) GetBCCSPSectionCallCount() int { 54 fake.getBCCSPSectionMutex.RLock() 55 defer fake.getBCCSPSectionMutex.RUnlock() 56 return len(fake.getBCCSPSectionArgsForCall) 57 } 58 59 func (fake *Config) GetBCCSPSectionCalls(stub func() *common.BCCSP) { 60 fake.getBCCSPSectionMutex.Lock() 61 defer fake.getBCCSPSectionMutex.Unlock() 62 fake.GetBCCSPSectionStub = stub 63 } 64 65 func (fake *Config) GetBCCSPSectionReturns(result1 *common.BCCSP) { 66 fake.getBCCSPSectionMutex.Lock() 67 defer fake.getBCCSPSectionMutex.Unlock() 68 fake.GetBCCSPSectionStub = nil 69 fake.getBCCSPSectionReturns = struct { 70 result1 *common.BCCSP 71 }{result1} 72 } 73 74 func (fake *Config) GetBCCSPSectionReturnsOnCall(i int, result1 *common.BCCSP) { 75 fake.getBCCSPSectionMutex.Lock() 76 defer fake.getBCCSPSectionMutex.Unlock() 77 fake.GetBCCSPSectionStub = nil 78 if fake.getBCCSPSectionReturnsOnCall == nil { 79 fake.getBCCSPSectionReturnsOnCall = make(map[int]struct { 80 result1 *common.BCCSP 81 }) 82 } 83 fake.getBCCSPSectionReturnsOnCall[i] = struct { 84 result1 *common.BCCSP 85 }{result1} 86 } 87 88 func (fake *Config) SetDefaultKeyStore() { 89 fake.setDefaultKeyStoreMutex.Lock() 90 fake.setDefaultKeyStoreArgsForCall = append(fake.setDefaultKeyStoreArgsForCall, struct { 91 }{}) 92 stub := fake.SetDefaultKeyStoreStub 93 fake.recordInvocation("SetDefaultKeyStore", []interface{}{}) 94 fake.setDefaultKeyStoreMutex.Unlock() 95 if stub != nil { 96 fake.SetDefaultKeyStoreStub() 97 } 98 } 99 100 func (fake *Config) SetDefaultKeyStoreCallCount() int { 101 fake.setDefaultKeyStoreMutex.RLock() 102 defer fake.setDefaultKeyStoreMutex.RUnlock() 103 return len(fake.setDefaultKeyStoreArgsForCall) 104 } 105 106 func (fake *Config) SetDefaultKeyStoreCalls(stub func()) { 107 fake.setDefaultKeyStoreMutex.Lock() 108 defer fake.setDefaultKeyStoreMutex.Unlock() 109 fake.SetDefaultKeyStoreStub = stub 110 } 111 112 func (fake *Config) SetPKCS11Defaults(arg1 bool) { 113 fake.setPKCS11DefaultsMutex.Lock() 114 fake.setPKCS11DefaultsArgsForCall = append(fake.setPKCS11DefaultsArgsForCall, struct { 115 arg1 bool 116 }{arg1}) 117 stub := fake.SetPKCS11DefaultsStub 118 fake.recordInvocation("SetPKCS11Defaults", []interface{}{arg1}) 119 fake.setPKCS11DefaultsMutex.Unlock() 120 if stub != nil { 121 fake.SetPKCS11DefaultsStub(arg1) 122 } 123 } 124 125 func (fake *Config) SetPKCS11DefaultsCallCount() int { 126 fake.setPKCS11DefaultsMutex.RLock() 127 defer fake.setPKCS11DefaultsMutex.RUnlock() 128 return len(fake.setPKCS11DefaultsArgsForCall) 129 } 130 131 func (fake *Config) SetPKCS11DefaultsCalls(stub func(bool)) { 132 fake.setPKCS11DefaultsMutex.Lock() 133 defer fake.setPKCS11DefaultsMutex.Unlock() 134 fake.SetPKCS11DefaultsStub = stub 135 } 136 137 func (fake *Config) SetPKCS11DefaultsArgsForCall(i int) bool { 138 fake.setPKCS11DefaultsMutex.RLock() 139 defer fake.setPKCS11DefaultsMutex.RUnlock() 140 argsForCall := fake.setPKCS11DefaultsArgsForCall[i] 141 return argsForCall.arg1 142 } 143 144 func (fake *Config) Invocations() map[string][][]interface{} { 145 fake.invocationsMutex.RLock() 146 defer fake.invocationsMutex.RUnlock() 147 fake.getBCCSPSectionMutex.RLock() 148 defer fake.getBCCSPSectionMutex.RUnlock() 149 fake.setDefaultKeyStoreMutex.RLock() 150 defer fake.setDefaultKeyStoreMutex.RUnlock() 151 fake.setPKCS11DefaultsMutex.RLock() 152 defer fake.setPKCS11DefaultsMutex.RUnlock() 153 copiedInvocations := map[string][][]interface{}{} 154 for key, value := range fake.invocations { 155 copiedInvocations[key] = value 156 } 157 return copiedInvocations 158 } 159 160 func (fake *Config) recordInvocation(key string, args []interface{}) { 161 fake.invocationsMutex.Lock() 162 defer fake.invocationsMutex.Unlock() 163 if fake.invocations == nil { 164 fake.invocations = map[string][][]interface{}{} 165 } 166 if fake.invocations[key] == nil { 167 fake.invocations[key] = [][]interface{}{} 168 } 169 fake.invocations[key] = append(fake.invocations[key], args) 170 } 171 172 var _ cryptogen.Config = new(Config)