github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/apifakes/fake_buildpack_bits_repository.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package apifakes 3 4 import ( 5 "os" 6 "sync" 7 8 "code.cloudfoundry.org/cli/cf/api" 9 "code.cloudfoundry.org/cli/cf/models" 10 ) 11 12 type FakeBuildpackBitsRepository struct { 13 CreateBuildpackZipFileStub func(string) (*os.File, string, error) 14 createBuildpackZipFileMutex sync.RWMutex 15 createBuildpackZipFileArgsForCall []struct { 16 arg1 string 17 } 18 createBuildpackZipFileReturns struct { 19 result1 *os.File 20 result2 string 21 result3 error 22 } 23 createBuildpackZipFileReturnsOnCall map[int]struct { 24 result1 *os.File 25 result2 string 26 result3 error 27 } 28 UploadBuildpackStub func(models.Buildpack, *os.File, string) error 29 uploadBuildpackMutex sync.RWMutex 30 uploadBuildpackArgsForCall []struct { 31 arg1 models.Buildpack 32 arg2 *os.File 33 arg3 string 34 } 35 uploadBuildpackReturns struct { 36 result1 error 37 } 38 uploadBuildpackReturnsOnCall map[int]struct { 39 result1 error 40 } 41 invocations map[string][][]interface{} 42 invocationsMutex sync.RWMutex 43 } 44 45 func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFile(arg1 string) (*os.File, string, error) { 46 fake.createBuildpackZipFileMutex.Lock() 47 ret, specificReturn := fake.createBuildpackZipFileReturnsOnCall[len(fake.createBuildpackZipFileArgsForCall)] 48 fake.createBuildpackZipFileArgsForCall = append(fake.createBuildpackZipFileArgsForCall, struct { 49 arg1 string 50 }{arg1}) 51 fake.recordInvocation("CreateBuildpackZipFile", []interface{}{arg1}) 52 fake.createBuildpackZipFileMutex.Unlock() 53 if fake.CreateBuildpackZipFileStub != nil { 54 return fake.CreateBuildpackZipFileStub(arg1) 55 } 56 if specificReturn { 57 return ret.result1, ret.result2, ret.result3 58 } 59 fakeReturns := fake.createBuildpackZipFileReturns 60 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 61 } 62 63 func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileCallCount() int { 64 fake.createBuildpackZipFileMutex.RLock() 65 defer fake.createBuildpackZipFileMutex.RUnlock() 66 return len(fake.createBuildpackZipFileArgsForCall) 67 } 68 69 func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileCalls(stub func(string) (*os.File, string, error)) { 70 fake.createBuildpackZipFileMutex.Lock() 71 defer fake.createBuildpackZipFileMutex.Unlock() 72 fake.CreateBuildpackZipFileStub = stub 73 } 74 75 func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileArgsForCall(i int) string { 76 fake.createBuildpackZipFileMutex.RLock() 77 defer fake.createBuildpackZipFileMutex.RUnlock() 78 argsForCall := fake.createBuildpackZipFileArgsForCall[i] 79 return argsForCall.arg1 80 } 81 82 func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileReturns(result1 *os.File, result2 string, result3 error) { 83 fake.createBuildpackZipFileMutex.Lock() 84 defer fake.createBuildpackZipFileMutex.Unlock() 85 fake.CreateBuildpackZipFileStub = nil 86 fake.createBuildpackZipFileReturns = struct { 87 result1 *os.File 88 result2 string 89 result3 error 90 }{result1, result2, result3} 91 } 92 93 func (fake *FakeBuildpackBitsRepository) CreateBuildpackZipFileReturnsOnCall(i int, result1 *os.File, result2 string, result3 error) { 94 fake.createBuildpackZipFileMutex.Lock() 95 defer fake.createBuildpackZipFileMutex.Unlock() 96 fake.CreateBuildpackZipFileStub = nil 97 if fake.createBuildpackZipFileReturnsOnCall == nil { 98 fake.createBuildpackZipFileReturnsOnCall = make(map[int]struct { 99 result1 *os.File 100 result2 string 101 result3 error 102 }) 103 } 104 fake.createBuildpackZipFileReturnsOnCall[i] = struct { 105 result1 *os.File 106 result2 string 107 result3 error 108 }{result1, result2, result3} 109 } 110 111 func (fake *FakeBuildpackBitsRepository) UploadBuildpack(arg1 models.Buildpack, arg2 *os.File, arg3 string) error { 112 fake.uploadBuildpackMutex.Lock() 113 ret, specificReturn := fake.uploadBuildpackReturnsOnCall[len(fake.uploadBuildpackArgsForCall)] 114 fake.uploadBuildpackArgsForCall = append(fake.uploadBuildpackArgsForCall, struct { 115 arg1 models.Buildpack 116 arg2 *os.File 117 arg3 string 118 }{arg1, arg2, arg3}) 119 fake.recordInvocation("UploadBuildpack", []interface{}{arg1, arg2, arg3}) 120 fake.uploadBuildpackMutex.Unlock() 121 if fake.UploadBuildpackStub != nil { 122 return fake.UploadBuildpackStub(arg1, arg2, arg3) 123 } 124 if specificReturn { 125 return ret.result1 126 } 127 fakeReturns := fake.uploadBuildpackReturns 128 return fakeReturns.result1 129 } 130 131 func (fake *FakeBuildpackBitsRepository) UploadBuildpackCallCount() int { 132 fake.uploadBuildpackMutex.RLock() 133 defer fake.uploadBuildpackMutex.RUnlock() 134 return len(fake.uploadBuildpackArgsForCall) 135 } 136 137 func (fake *FakeBuildpackBitsRepository) UploadBuildpackCalls(stub func(models.Buildpack, *os.File, string) error) { 138 fake.uploadBuildpackMutex.Lock() 139 defer fake.uploadBuildpackMutex.Unlock() 140 fake.UploadBuildpackStub = stub 141 } 142 143 func (fake *FakeBuildpackBitsRepository) UploadBuildpackArgsForCall(i int) (models.Buildpack, *os.File, string) { 144 fake.uploadBuildpackMutex.RLock() 145 defer fake.uploadBuildpackMutex.RUnlock() 146 argsForCall := fake.uploadBuildpackArgsForCall[i] 147 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 148 } 149 150 func (fake *FakeBuildpackBitsRepository) UploadBuildpackReturns(result1 error) { 151 fake.uploadBuildpackMutex.Lock() 152 defer fake.uploadBuildpackMutex.Unlock() 153 fake.UploadBuildpackStub = nil 154 fake.uploadBuildpackReturns = struct { 155 result1 error 156 }{result1} 157 } 158 159 func (fake *FakeBuildpackBitsRepository) UploadBuildpackReturnsOnCall(i int, result1 error) { 160 fake.uploadBuildpackMutex.Lock() 161 defer fake.uploadBuildpackMutex.Unlock() 162 fake.UploadBuildpackStub = nil 163 if fake.uploadBuildpackReturnsOnCall == nil { 164 fake.uploadBuildpackReturnsOnCall = make(map[int]struct { 165 result1 error 166 }) 167 } 168 fake.uploadBuildpackReturnsOnCall[i] = struct { 169 result1 error 170 }{result1} 171 } 172 173 func (fake *FakeBuildpackBitsRepository) Invocations() map[string][][]interface{} { 174 fake.invocationsMutex.RLock() 175 defer fake.invocationsMutex.RUnlock() 176 fake.createBuildpackZipFileMutex.RLock() 177 defer fake.createBuildpackZipFileMutex.RUnlock() 178 fake.uploadBuildpackMutex.RLock() 179 defer fake.uploadBuildpackMutex.RUnlock() 180 copiedInvocations := map[string][][]interface{}{} 181 for key, value := range fake.invocations { 182 copiedInvocations[key] = value 183 } 184 return copiedInvocations 185 } 186 187 func (fake *FakeBuildpackBitsRepository) recordInvocation(key string, args []interface{}) { 188 fake.invocationsMutex.Lock() 189 defer fake.invocationsMutex.Unlock() 190 if fake.invocations == nil { 191 fake.invocations = map[string][][]interface{}{} 192 } 193 if fake.invocations[key] == nil { 194 fake.invocations[key] = [][]interface{}{} 195 } 196 fake.invocations[key] = append(fake.invocations[key], args) 197 } 198 199 var _ api.BuildpackBitsRepository = new(FakeBuildpackBitsRepository)