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