github.com/mattermosttest/mattermost-server/v5@v5.0.0-20200917143240-9dfa12e121f9/store/storetest/mocks/JobStore.go (about) 1 // Code generated by mockery v1.0.0. DO NOT EDIT. 2 3 // Regenerate this file using `make store-mocks`. 4 5 package mocks 6 7 import ( 8 model "github.com/mattermost/mattermost-server/v5/model" 9 mock "github.com/stretchr/testify/mock" 10 ) 11 12 // JobStore is an autogenerated mock type for the JobStore type 13 type JobStore struct { 14 mock.Mock 15 } 16 17 // Delete provides a mock function with given fields: id 18 func (_m *JobStore) Delete(id string) (string, *model.AppError) { 19 ret := _m.Called(id) 20 21 var r0 string 22 if rf, ok := ret.Get(0).(func(string) string); ok { 23 r0 = rf(id) 24 } else { 25 r0 = ret.Get(0).(string) 26 } 27 28 var r1 *model.AppError 29 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 30 r1 = rf(id) 31 } else { 32 if ret.Get(1) != nil { 33 r1 = ret.Get(1).(*model.AppError) 34 } 35 } 36 37 return r0, r1 38 } 39 40 // Get provides a mock function with given fields: id 41 func (_m *JobStore) Get(id string) (*model.Job, *model.AppError) { 42 ret := _m.Called(id) 43 44 var r0 *model.Job 45 if rf, ok := ret.Get(0).(func(string) *model.Job); ok { 46 r0 = rf(id) 47 } else { 48 if ret.Get(0) != nil { 49 r0 = ret.Get(0).(*model.Job) 50 } 51 } 52 53 var r1 *model.AppError 54 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 55 r1 = rf(id) 56 } else { 57 if ret.Get(1) != nil { 58 r1 = ret.Get(1).(*model.AppError) 59 } 60 } 61 62 return r0, r1 63 } 64 65 // GetAllByStatus provides a mock function with given fields: status 66 func (_m *JobStore) GetAllByStatus(status string) ([]*model.Job, *model.AppError) { 67 ret := _m.Called(status) 68 69 var r0 []*model.Job 70 if rf, ok := ret.Get(0).(func(string) []*model.Job); ok { 71 r0 = rf(status) 72 } else { 73 if ret.Get(0) != nil { 74 r0 = ret.Get(0).([]*model.Job) 75 } 76 } 77 78 var r1 *model.AppError 79 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 80 r1 = rf(status) 81 } else { 82 if ret.Get(1) != nil { 83 r1 = ret.Get(1).(*model.AppError) 84 } 85 } 86 87 return r0, r1 88 } 89 90 // GetAllByType provides a mock function with given fields: jobType 91 func (_m *JobStore) GetAllByType(jobType string) ([]*model.Job, *model.AppError) { 92 ret := _m.Called(jobType) 93 94 var r0 []*model.Job 95 if rf, ok := ret.Get(0).(func(string) []*model.Job); ok { 96 r0 = rf(jobType) 97 } else { 98 if ret.Get(0) != nil { 99 r0 = ret.Get(0).([]*model.Job) 100 } 101 } 102 103 var r1 *model.AppError 104 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 105 r1 = rf(jobType) 106 } else { 107 if ret.Get(1) != nil { 108 r1 = ret.Get(1).(*model.AppError) 109 } 110 } 111 112 return r0, r1 113 } 114 115 // GetAllByTypePage provides a mock function with given fields: jobType, offset, limit 116 func (_m *JobStore) GetAllByTypePage(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) { 117 ret := _m.Called(jobType, offset, limit) 118 119 var r0 []*model.Job 120 if rf, ok := ret.Get(0).(func(string, int, int) []*model.Job); ok { 121 r0 = rf(jobType, offset, limit) 122 } else { 123 if ret.Get(0) != nil { 124 r0 = ret.Get(0).([]*model.Job) 125 } 126 } 127 128 var r1 *model.AppError 129 if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok { 130 r1 = rf(jobType, offset, limit) 131 } else { 132 if ret.Get(1) != nil { 133 r1 = ret.Get(1).(*model.AppError) 134 } 135 } 136 137 return r0, r1 138 } 139 140 // GetAllPage provides a mock function with given fields: offset, limit 141 func (_m *JobStore) GetAllPage(offset int, limit int) ([]*model.Job, *model.AppError) { 142 ret := _m.Called(offset, limit) 143 144 var r0 []*model.Job 145 if rf, ok := ret.Get(0).(func(int, int) []*model.Job); ok { 146 r0 = rf(offset, limit) 147 } else { 148 if ret.Get(0) != nil { 149 r0 = ret.Get(0).([]*model.Job) 150 } 151 } 152 153 var r1 *model.AppError 154 if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok { 155 r1 = rf(offset, limit) 156 } else { 157 if ret.Get(1) != nil { 158 r1 = ret.Get(1).(*model.AppError) 159 } 160 } 161 162 return r0, r1 163 } 164 165 // GetCountByStatusAndType provides a mock function with given fields: status, jobType 166 func (_m *JobStore) GetCountByStatusAndType(status string, jobType string) (int64, *model.AppError) { 167 ret := _m.Called(status, jobType) 168 169 var r0 int64 170 if rf, ok := ret.Get(0).(func(string, string) int64); ok { 171 r0 = rf(status, jobType) 172 } else { 173 r0 = ret.Get(0).(int64) 174 } 175 176 var r1 *model.AppError 177 if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { 178 r1 = rf(status, jobType) 179 } else { 180 if ret.Get(1) != nil { 181 r1 = ret.Get(1).(*model.AppError) 182 } 183 } 184 185 return r0, r1 186 } 187 188 // GetNewestJobByStatusAndType provides a mock function with given fields: status, jobType 189 func (_m *JobStore) GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, *model.AppError) { 190 ret := _m.Called(status, jobType) 191 192 var r0 *model.Job 193 if rf, ok := ret.Get(0).(func(string, string) *model.Job); ok { 194 r0 = rf(status, jobType) 195 } else { 196 if ret.Get(0) != nil { 197 r0 = ret.Get(0).(*model.Job) 198 } 199 } 200 201 var r1 *model.AppError 202 if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { 203 r1 = rf(status, jobType) 204 } else { 205 if ret.Get(1) != nil { 206 r1 = ret.Get(1).(*model.AppError) 207 } 208 } 209 210 return r0, r1 211 } 212 213 // Save provides a mock function with given fields: job 214 func (_m *JobStore) Save(job *model.Job) (*model.Job, *model.AppError) { 215 ret := _m.Called(job) 216 217 var r0 *model.Job 218 if rf, ok := ret.Get(0).(func(*model.Job) *model.Job); ok { 219 r0 = rf(job) 220 } else { 221 if ret.Get(0) != nil { 222 r0 = ret.Get(0).(*model.Job) 223 } 224 } 225 226 var r1 *model.AppError 227 if rf, ok := ret.Get(1).(func(*model.Job) *model.AppError); ok { 228 r1 = rf(job) 229 } else { 230 if ret.Get(1) != nil { 231 r1 = ret.Get(1).(*model.AppError) 232 } 233 } 234 235 return r0, r1 236 } 237 238 // UpdateOptimistically provides a mock function with given fields: job, currentStatus 239 func (_m *JobStore) UpdateOptimistically(job *model.Job, currentStatus string) (bool, *model.AppError) { 240 ret := _m.Called(job, currentStatus) 241 242 var r0 bool 243 if rf, ok := ret.Get(0).(func(*model.Job, string) bool); ok { 244 r0 = rf(job, currentStatus) 245 } else { 246 r0 = ret.Get(0).(bool) 247 } 248 249 var r1 *model.AppError 250 if rf, ok := ret.Get(1).(func(*model.Job, string) *model.AppError); ok { 251 r1 = rf(job, currentStatus) 252 } else { 253 if ret.Get(1) != nil { 254 r1 = ret.Get(1).(*model.AppError) 255 } 256 } 257 258 return r0, r1 259 } 260 261 // UpdateStatus provides a mock function with given fields: id, status 262 func (_m *JobStore) UpdateStatus(id string, status string) (*model.Job, *model.AppError) { 263 ret := _m.Called(id, status) 264 265 var r0 *model.Job 266 if rf, ok := ret.Get(0).(func(string, string) *model.Job); ok { 267 r0 = rf(id, status) 268 } else { 269 if ret.Get(0) != nil { 270 r0 = ret.Get(0).(*model.Job) 271 } 272 } 273 274 var r1 *model.AppError 275 if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { 276 r1 = rf(id, status) 277 } else { 278 if ret.Get(1) != nil { 279 r1 = ret.Get(1).(*model.AppError) 280 } 281 } 282 283 return r0, r1 284 } 285 286 // UpdateStatusOptimistically provides a mock function with given fields: id, currentStatus, newStatus 287 func (_m *JobStore) UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (bool, *model.AppError) { 288 ret := _m.Called(id, currentStatus, newStatus) 289 290 var r0 bool 291 if rf, ok := ret.Get(0).(func(string, string, string) bool); ok { 292 r0 = rf(id, currentStatus, newStatus) 293 } else { 294 r0 = ret.Get(0).(bool) 295 } 296 297 var r1 *model.AppError 298 if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok { 299 r1 = rf(id, currentStatus, newStatus) 300 } else { 301 if ret.Get(1) != nil { 302 r1 = ret.Get(1).(*model.AppError) 303 } 304 } 305 306 return r0, r1 307 }