github.com/hyperledger-labs/bdls@v2.1.1+incompatible/core/chaincode/lifecycle/mock/application_config.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package mock 3 4 import ( 5 "sync" 6 7 "github.com/hyperledger/fabric/common/channelconfig" 8 ) 9 10 type ApplicationConfig struct { 11 APIPolicyMapperStub func() channelconfig.PolicyMapper 12 aPIPolicyMapperMutex sync.RWMutex 13 aPIPolicyMapperArgsForCall []struct { 14 } 15 aPIPolicyMapperReturns struct { 16 result1 channelconfig.PolicyMapper 17 } 18 aPIPolicyMapperReturnsOnCall map[int]struct { 19 result1 channelconfig.PolicyMapper 20 } 21 CapabilitiesStub func() channelconfig.ApplicationCapabilities 22 capabilitiesMutex sync.RWMutex 23 capabilitiesArgsForCall []struct { 24 } 25 capabilitiesReturns struct { 26 result1 channelconfig.ApplicationCapabilities 27 } 28 capabilitiesReturnsOnCall map[int]struct { 29 result1 channelconfig.ApplicationCapabilities 30 } 31 OrganizationsStub func() map[string]channelconfig.ApplicationOrg 32 organizationsMutex sync.RWMutex 33 organizationsArgsForCall []struct { 34 } 35 organizationsReturns struct { 36 result1 map[string]channelconfig.ApplicationOrg 37 } 38 organizationsReturnsOnCall map[int]struct { 39 result1 map[string]channelconfig.ApplicationOrg 40 } 41 invocations map[string][][]interface{} 42 invocationsMutex sync.RWMutex 43 } 44 45 func (fake *ApplicationConfig) APIPolicyMapper() channelconfig.PolicyMapper { 46 fake.aPIPolicyMapperMutex.Lock() 47 ret, specificReturn := fake.aPIPolicyMapperReturnsOnCall[len(fake.aPIPolicyMapperArgsForCall)] 48 fake.aPIPolicyMapperArgsForCall = append(fake.aPIPolicyMapperArgsForCall, struct { 49 }{}) 50 fake.recordInvocation("APIPolicyMapper", []interface{}{}) 51 fake.aPIPolicyMapperMutex.Unlock() 52 if fake.APIPolicyMapperStub != nil { 53 return fake.APIPolicyMapperStub() 54 } 55 if specificReturn { 56 return ret.result1 57 } 58 fakeReturns := fake.aPIPolicyMapperReturns 59 return fakeReturns.result1 60 } 61 62 func (fake *ApplicationConfig) APIPolicyMapperCallCount() int { 63 fake.aPIPolicyMapperMutex.RLock() 64 defer fake.aPIPolicyMapperMutex.RUnlock() 65 return len(fake.aPIPolicyMapperArgsForCall) 66 } 67 68 func (fake *ApplicationConfig) APIPolicyMapperCalls(stub func() channelconfig.PolicyMapper) { 69 fake.aPIPolicyMapperMutex.Lock() 70 defer fake.aPIPolicyMapperMutex.Unlock() 71 fake.APIPolicyMapperStub = stub 72 } 73 74 func (fake *ApplicationConfig) APIPolicyMapperReturns(result1 channelconfig.PolicyMapper) { 75 fake.aPIPolicyMapperMutex.Lock() 76 defer fake.aPIPolicyMapperMutex.Unlock() 77 fake.APIPolicyMapperStub = nil 78 fake.aPIPolicyMapperReturns = struct { 79 result1 channelconfig.PolicyMapper 80 }{result1} 81 } 82 83 func (fake *ApplicationConfig) APIPolicyMapperReturnsOnCall(i int, result1 channelconfig.PolicyMapper) { 84 fake.aPIPolicyMapperMutex.Lock() 85 defer fake.aPIPolicyMapperMutex.Unlock() 86 fake.APIPolicyMapperStub = nil 87 if fake.aPIPolicyMapperReturnsOnCall == nil { 88 fake.aPIPolicyMapperReturnsOnCall = make(map[int]struct { 89 result1 channelconfig.PolicyMapper 90 }) 91 } 92 fake.aPIPolicyMapperReturnsOnCall[i] = struct { 93 result1 channelconfig.PolicyMapper 94 }{result1} 95 } 96 97 func (fake *ApplicationConfig) Capabilities() channelconfig.ApplicationCapabilities { 98 fake.capabilitiesMutex.Lock() 99 ret, specificReturn := fake.capabilitiesReturnsOnCall[len(fake.capabilitiesArgsForCall)] 100 fake.capabilitiesArgsForCall = append(fake.capabilitiesArgsForCall, struct { 101 }{}) 102 fake.recordInvocation("Capabilities", []interface{}{}) 103 fake.capabilitiesMutex.Unlock() 104 if fake.CapabilitiesStub != nil { 105 return fake.CapabilitiesStub() 106 } 107 if specificReturn { 108 return ret.result1 109 } 110 fakeReturns := fake.capabilitiesReturns 111 return fakeReturns.result1 112 } 113 114 func (fake *ApplicationConfig) CapabilitiesCallCount() int { 115 fake.capabilitiesMutex.RLock() 116 defer fake.capabilitiesMutex.RUnlock() 117 return len(fake.capabilitiesArgsForCall) 118 } 119 120 func (fake *ApplicationConfig) CapabilitiesCalls(stub func() channelconfig.ApplicationCapabilities) { 121 fake.capabilitiesMutex.Lock() 122 defer fake.capabilitiesMutex.Unlock() 123 fake.CapabilitiesStub = stub 124 } 125 126 func (fake *ApplicationConfig) CapabilitiesReturns(result1 channelconfig.ApplicationCapabilities) { 127 fake.capabilitiesMutex.Lock() 128 defer fake.capabilitiesMutex.Unlock() 129 fake.CapabilitiesStub = nil 130 fake.capabilitiesReturns = struct { 131 result1 channelconfig.ApplicationCapabilities 132 }{result1} 133 } 134 135 func (fake *ApplicationConfig) CapabilitiesReturnsOnCall(i int, result1 channelconfig.ApplicationCapabilities) { 136 fake.capabilitiesMutex.Lock() 137 defer fake.capabilitiesMutex.Unlock() 138 fake.CapabilitiesStub = nil 139 if fake.capabilitiesReturnsOnCall == nil { 140 fake.capabilitiesReturnsOnCall = make(map[int]struct { 141 result1 channelconfig.ApplicationCapabilities 142 }) 143 } 144 fake.capabilitiesReturnsOnCall[i] = struct { 145 result1 channelconfig.ApplicationCapabilities 146 }{result1} 147 } 148 149 func (fake *ApplicationConfig) Organizations() map[string]channelconfig.ApplicationOrg { 150 fake.organizationsMutex.Lock() 151 ret, specificReturn := fake.organizationsReturnsOnCall[len(fake.organizationsArgsForCall)] 152 fake.organizationsArgsForCall = append(fake.organizationsArgsForCall, struct { 153 }{}) 154 fake.recordInvocation("Organizations", []interface{}{}) 155 fake.organizationsMutex.Unlock() 156 if fake.OrganizationsStub != nil { 157 return fake.OrganizationsStub() 158 } 159 if specificReturn { 160 return ret.result1 161 } 162 fakeReturns := fake.organizationsReturns 163 return fakeReturns.result1 164 } 165 166 func (fake *ApplicationConfig) OrganizationsCallCount() int { 167 fake.organizationsMutex.RLock() 168 defer fake.organizationsMutex.RUnlock() 169 return len(fake.organizationsArgsForCall) 170 } 171 172 func (fake *ApplicationConfig) OrganizationsCalls(stub func() map[string]channelconfig.ApplicationOrg) { 173 fake.organizationsMutex.Lock() 174 defer fake.organizationsMutex.Unlock() 175 fake.OrganizationsStub = stub 176 } 177 178 func (fake *ApplicationConfig) OrganizationsReturns(result1 map[string]channelconfig.ApplicationOrg) { 179 fake.organizationsMutex.Lock() 180 defer fake.organizationsMutex.Unlock() 181 fake.OrganizationsStub = nil 182 fake.organizationsReturns = struct { 183 result1 map[string]channelconfig.ApplicationOrg 184 }{result1} 185 } 186 187 func (fake *ApplicationConfig) OrganizationsReturnsOnCall(i int, result1 map[string]channelconfig.ApplicationOrg) { 188 fake.organizationsMutex.Lock() 189 defer fake.organizationsMutex.Unlock() 190 fake.OrganizationsStub = nil 191 if fake.organizationsReturnsOnCall == nil { 192 fake.organizationsReturnsOnCall = make(map[int]struct { 193 result1 map[string]channelconfig.ApplicationOrg 194 }) 195 } 196 fake.organizationsReturnsOnCall[i] = struct { 197 result1 map[string]channelconfig.ApplicationOrg 198 }{result1} 199 } 200 201 func (fake *ApplicationConfig) Invocations() map[string][][]interface{} { 202 fake.invocationsMutex.RLock() 203 defer fake.invocationsMutex.RUnlock() 204 fake.aPIPolicyMapperMutex.RLock() 205 defer fake.aPIPolicyMapperMutex.RUnlock() 206 fake.capabilitiesMutex.RLock() 207 defer fake.capabilitiesMutex.RUnlock() 208 fake.organizationsMutex.RLock() 209 defer fake.organizationsMutex.RUnlock() 210 copiedInvocations := map[string][][]interface{}{} 211 for key, value := range fake.invocations { 212 copiedInvocations[key] = value 213 } 214 return copiedInvocations 215 } 216 217 func (fake *ApplicationConfig) recordInvocation(key string, args []interface{}) { 218 fake.invocationsMutex.Lock() 219 defer fake.invocationsMutex.Unlock() 220 if fake.invocations == nil { 221 fake.invocations = map[string][][]interface{}{} 222 } 223 if fake.invocations[key] == nil { 224 fake.invocations[key] = [][]interface{}{} 225 } 226 fake.invocations[key] = append(fake.invocations[key], args) 227 }