github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/state/mocks/mongo_mock.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: github.com/juju/juju/mongo (interfaces: Collection,Query) 3 // 4 // Generated by this command: 5 // 6 // mockgen -package mocks -destination mocks/mongo_mock.go github.com/juju/juju/mongo Collection,Query 7 // 8 9 // Package mocks is a generated GoMock package. 10 package mocks 11 12 import ( 13 reflect "reflect" 14 time "time" 15 16 mongo "github.com/juju/juju/mongo" 17 mgo "github.com/juju/mgo/v3" 18 gomock "go.uber.org/mock/gomock" 19 ) 20 21 // MockCollection is a mock of Collection interface. 22 type MockCollection struct { 23 ctrl *gomock.Controller 24 recorder *MockCollectionMockRecorder 25 } 26 27 // MockCollectionMockRecorder is the mock recorder for MockCollection. 28 type MockCollectionMockRecorder struct { 29 mock *MockCollection 30 } 31 32 // NewMockCollection creates a new mock instance. 33 func NewMockCollection(ctrl *gomock.Controller) *MockCollection { 34 mock := &MockCollection{ctrl: ctrl} 35 mock.recorder = &MockCollectionMockRecorder{mock} 36 return mock 37 } 38 39 // EXPECT returns an object that allows the caller to indicate expected use. 40 func (m *MockCollection) EXPECT() *MockCollectionMockRecorder { 41 return m.recorder 42 } 43 44 // Count mocks base method. 45 func (m *MockCollection) Count() (int, error) { 46 m.ctrl.T.Helper() 47 ret := m.ctrl.Call(m, "Count") 48 ret0, _ := ret[0].(int) 49 ret1, _ := ret[1].(error) 50 return ret0, ret1 51 } 52 53 // Count indicates an expected call of Count. 54 func (mr *MockCollectionMockRecorder) Count() *gomock.Call { 55 mr.mock.ctrl.T.Helper() 56 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockCollection)(nil).Count)) 57 } 58 59 // Find mocks base method. 60 func (m *MockCollection) Find(arg0 any) mongo.Query { 61 m.ctrl.T.Helper() 62 ret := m.ctrl.Call(m, "Find", arg0) 63 ret0, _ := ret[0].(mongo.Query) 64 return ret0 65 } 66 67 // Find indicates an expected call of Find. 68 func (mr *MockCollectionMockRecorder) Find(arg0 any) *gomock.Call { 69 mr.mock.ctrl.T.Helper() 70 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockCollection)(nil).Find), arg0) 71 } 72 73 // FindId mocks base method. 74 func (m *MockCollection) FindId(arg0 any) mongo.Query { 75 m.ctrl.T.Helper() 76 ret := m.ctrl.Call(m, "FindId", arg0) 77 ret0, _ := ret[0].(mongo.Query) 78 return ret0 79 } 80 81 // FindId indicates an expected call of FindId. 82 func (mr *MockCollectionMockRecorder) FindId(arg0 any) *gomock.Call { 83 mr.mock.ctrl.T.Helper() 84 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindId", reflect.TypeOf((*MockCollection)(nil).FindId), arg0) 85 } 86 87 // Name mocks base method. 88 func (m *MockCollection) Name() string { 89 m.ctrl.T.Helper() 90 ret := m.ctrl.Call(m, "Name") 91 ret0, _ := ret[0].(string) 92 return ret0 93 } 94 95 // Name indicates an expected call of Name. 96 func (mr *MockCollectionMockRecorder) Name() *gomock.Call { 97 mr.mock.ctrl.T.Helper() 98 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockCollection)(nil).Name)) 99 } 100 101 // Pipe mocks base method. 102 func (m *MockCollection) Pipe(arg0 any) *mgo.Pipe { 103 m.ctrl.T.Helper() 104 ret := m.ctrl.Call(m, "Pipe", arg0) 105 ret0, _ := ret[0].(*mgo.Pipe) 106 return ret0 107 } 108 109 // Pipe indicates an expected call of Pipe. 110 func (mr *MockCollectionMockRecorder) Pipe(arg0 any) *gomock.Call { 111 mr.mock.ctrl.T.Helper() 112 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Pipe", reflect.TypeOf((*MockCollection)(nil).Pipe), arg0) 113 } 114 115 // Writeable mocks base method. 116 func (m *MockCollection) Writeable() mongo.WriteCollection { 117 m.ctrl.T.Helper() 118 ret := m.ctrl.Call(m, "Writeable") 119 ret0, _ := ret[0].(mongo.WriteCollection) 120 return ret0 121 } 122 123 // Writeable indicates an expected call of Writeable. 124 func (mr *MockCollectionMockRecorder) Writeable() *gomock.Call { 125 mr.mock.ctrl.T.Helper() 126 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Writeable", reflect.TypeOf((*MockCollection)(nil).Writeable)) 127 } 128 129 // MockQuery is a mock of Query interface. 130 type MockQuery struct { 131 ctrl *gomock.Controller 132 recorder *MockQueryMockRecorder 133 } 134 135 // MockQueryMockRecorder is the mock recorder for MockQuery. 136 type MockQueryMockRecorder struct { 137 mock *MockQuery 138 } 139 140 // NewMockQuery creates a new mock instance. 141 func NewMockQuery(ctrl *gomock.Controller) *MockQuery { 142 mock := &MockQuery{ctrl: ctrl} 143 mock.recorder = &MockQueryMockRecorder{mock} 144 return mock 145 } 146 147 // EXPECT returns an object that allows the caller to indicate expected use. 148 func (m *MockQuery) EXPECT() *MockQueryMockRecorder { 149 return m.recorder 150 } 151 152 // All mocks base method. 153 func (m *MockQuery) All(arg0 any) error { 154 m.ctrl.T.Helper() 155 ret := m.ctrl.Call(m, "All", arg0) 156 ret0, _ := ret[0].(error) 157 return ret0 158 } 159 160 // All indicates an expected call of All. 161 func (mr *MockQueryMockRecorder) All(arg0 any) *gomock.Call { 162 mr.mock.ctrl.T.Helper() 163 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "All", reflect.TypeOf((*MockQuery)(nil).All), arg0) 164 } 165 166 // Apply mocks base method. 167 func (m *MockQuery) Apply(arg0 mgo.Change, arg1 any) (*mgo.ChangeInfo, error) { 168 m.ctrl.T.Helper() 169 ret := m.ctrl.Call(m, "Apply", arg0, arg1) 170 ret0, _ := ret[0].(*mgo.ChangeInfo) 171 ret1, _ := ret[1].(error) 172 return ret0, ret1 173 } 174 175 // Apply indicates an expected call of Apply. 176 func (mr *MockQueryMockRecorder) Apply(arg0, arg1 any) *gomock.Call { 177 mr.mock.ctrl.T.Helper() 178 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Apply", reflect.TypeOf((*MockQuery)(nil).Apply), arg0, arg1) 179 } 180 181 // Batch mocks base method. 182 func (m *MockQuery) Batch(arg0 int) mongo.Query { 183 m.ctrl.T.Helper() 184 ret := m.ctrl.Call(m, "Batch", arg0) 185 ret0, _ := ret[0].(mongo.Query) 186 return ret0 187 } 188 189 // Batch indicates an expected call of Batch. 190 func (mr *MockQueryMockRecorder) Batch(arg0 any) *gomock.Call { 191 mr.mock.ctrl.T.Helper() 192 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Batch", reflect.TypeOf((*MockQuery)(nil).Batch), arg0) 193 } 194 195 // Comment mocks base method. 196 func (m *MockQuery) Comment(arg0 string) mongo.Query { 197 m.ctrl.T.Helper() 198 ret := m.ctrl.Call(m, "Comment", arg0) 199 ret0, _ := ret[0].(mongo.Query) 200 return ret0 201 } 202 203 // Comment indicates an expected call of Comment. 204 func (mr *MockQueryMockRecorder) Comment(arg0 any) *gomock.Call { 205 mr.mock.ctrl.T.Helper() 206 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Comment", reflect.TypeOf((*MockQuery)(nil).Comment), arg0) 207 } 208 209 // Count mocks base method. 210 func (m *MockQuery) Count() (int, error) { 211 m.ctrl.T.Helper() 212 ret := m.ctrl.Call(m, "Count") 213 ret0, _ := ret[0].(int) 214 ret1, _ := ret[1].(error) 215 return ret0, ret1 216 } 217 218 // Count indicates an expected call of Count. 219 func (mr *MockQueryMockRecorder) Count() *gomock.Call { 220 mr.mock.ctrl.T.Helper() 221 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Count", reflect.TypeOf((*MockQuery)(nil).Count)) 222 } 223 224 // Distinct mocks base method. 225 func (m *MockQuery) Distinct(arg0 string, arg1 any) error { 226 m.ctrl.T.Helper() 227 ret := m.ctrl.Call(m, "Distinct", arg0, arg1) 228 ret0, _ := ret[0].(error) 229 return ret0 230 } 231 232 // Distinct indicates an expected call of Distinct. 233 func (mr *MockQueryMockRecorder) Distinct(arg0, arg1 any) *gomock.Call { 234 mr.mock.ctrl.T.Helper() 235 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Distinct", reflect.TypeOf((*MockQuery)(nil).Distinct), arg0, arg1) 236 } 237 238 // Explain mocks base method. 239 func (m *MockQuery) Explain(arg0 any) error { 240 m.ctrl.T.Helper() 241 ret := m.ctrl.Call(m, "Explain", arg0) 242 ret0, _ := ret[0].(error) 243 return ret0 244 } 245 246 // Explain indicates an expected call of Explain. 247 func (mr *MockQueryMockRecorder) Explain(arg0 any) *gomock.Call { 248 mr.mock.ctrl.T.Helper() 249 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Explain", reflect.TypeOf((*MockQuery)(nil).Explain), arg0) 250 } 251 252 // For mocks base method. 253 func (m *MockQuery) For(arg0 any, arg1 func() error) error { 254 m.ctrl.T.Helper() 255 ret := m.ctrl.Call(m, "For", arg0, arg1) 256 ret0, _ := ret[0].(error) 257 return ret0 258 } 259 260 // For indicates an expected call of For. 261 func (mr *MockQueryMockRecorder) For(arg0, arg1 any) *gomock.Call { 262 mr.mock.ctrl.T.Helper() 263 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "For", reflect.TypeOf((*MockQuery)(nil).For), arg0, arg1) 264 } 265 266 // Hint mocks base method. 267 func (m *MockQuery) Hint(arg0 ...string) mongo.Query { 268 m.ctrl.T.Helper() 269 varargs := []any{} 270 for _, a := range arg0 { 271 varargs = append(varargs, a) 272 } 273 ret := m.ctrl.Call(m, "Hint", varargs...) 274 ret0, _ := ret[0].(mongo.Query) 275 return ret0 276 } 277 278 // Hint indicates an expected call of Hint. 279 func (mr *MockQueryMockRecorder) Hint(arg0 ...any) *gomock.Call { 280 mr.mock.ctrl.T.Helper() 281 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Hint", reflect.TypeOf((*MockQuery)(nil).Hint), arg0...) 282 } 283 284 // Iter mocks base method. 285 func (m *MockQuery) Iter() mongo.Iterator { 286 m.ctrl.T.Helper() 287 ret := m.ctrl.Call(m, "Iter") 288 ret0, _ := ret[0].(mongo.Iterator) 289 return ret0 290 } 291 292 // Iter indicates an expected call of Iter. 293 func (mr *MockQueryMockRecorder) Iter() *gomock.Call { 294 mr.mock.ctrl.T.Helper() 295 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iter", reflect.TypeOf((*MockQuery)(nil).Iter)) 296 } 297 298 // Limit mocks base method. 299 func (m *MockQuery) Limit(arg0 int) mongo.Query { 300 m.ctrl.T.Helper() 301 ret := m.ctrl.Call(m, "Limit", arg0) 302 ret0, _ := ret[0].(mongo.Query) 303 return ret0 304 } 305 306 // Limit indicates an expected call of Limit. 307 func (mr *MockQueryMockRecorder) Limit(arg0 any) *gomock.Call { 308 mr.mock.ctrl.T.Helper() 309 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Limit", reflect.TypeOf((*MockQuery)(nil).Limit), arg0) 310 } 311 312 // LogReplay mocks base method. 313 func (m *MockQuery) LogReplay() mongo.Query { 314 m.ctrl.T.Helper() 315 ret := m.ctrl.Call(m, "LogReplay") 316 ret0, _ := ret[0].(mongo.Query) 317 return ret0 318 } 319 320 // LogReplay indicates an expected call of LogReplay. 321 func (mr *MockQueryMockRecorder) LogReplay() *gomock.Call { 322 mr.mock.ctrl.T.Helper() 323 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogReplay", reflect.TypeOf((*MockQuery)(nil).LogReplay)) 324 } 325 326 // MapReduce mocks base method. 327 func (m *MockQuery) MapReduce(arg0 *mgo.MapReduce, arg1 any) (*mgo.MapReduceInfo, error) { 328 m.ctrl.T.Helper() 329 ret := m.ctrl.Call(m, "MapReduce", arg0, arg1) 330 ret0, _ := ret[0].(*mgo.MapReduceInfo) 331 ret1, _ := ret[1].(error) 332 return ret0, ret1 333 } 334 335 // MapReduce indicates an expected call of MapReduce. 336 func (mr *MockQueryMockRecorder) MapReduce(arg0, arg1 any) *gomock.Call { 337 mr.mock.ctrl.T.Helper() 338 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MapReduce", reflect.TypeOf((*MockQuery)(nil).MapReduce), arg0, arg1) 339 } 340 341 // One mocks base method. 342 func (m *MockQuery) One(arg0 any) error { 343 m.ctrl.T.Helper() 344 ret := m.ctrl.Call(m, "One", arg0) 345 ret0, _ := ret[0].(error) 346 return ret0 347 } 348 349 // One indicates an expected call of One. 350 func (mr *MockQueryMockRecorder) One(arg0 any) *gomock.Call { 351 mr.mock.ctrl.T.Helper() 352 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "One", reflect.TypeOf((*MockQuery)(nil).One), arg0) 353 } 354 355 // Prefetch mocks base method. 356 func (m *MockQuery) Prefetch(arg0 float64) mongo.Query { 357 m.ctrl.T.Helper() 358 ret := m.ctrl.Call(m, "Prefetch", arg0) 359 ret0, _ := ret[0].(mongo.Query) 360 return ret0 361 } 362 363 // Prefetch indicates an expected call of Prefetch. 364 func (mr *MockQueryMockRecorder) Prefetch(arg0 any) *gomock.Call { 365 mr.mock.ctrl.T.Helper() 366 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prefetch", reflect.TypeOf((*MockQuery)(nil).Prefetch), arg0) 367 } 368 369 // Select mocks base method. 370 func (m *MockQuery) Select(arg0 any) mongo.Query { 371 m.ctrl.T.Helper() 372 ret := m.ctrl.Call(m, "Select", arg0) 373 ret0, _ := ret[0].(mongo.Query) 374 return ret0 375 } 376 377 // Select indicates an expected call of Select. 378 func (mr *MockQueryMockRecorder) Select(arg0 any) *gomock.Call { 379 mr.mock.ctrl.T.Helper() 380 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Select", reflect.TypeOf((*MockQuery)(nil).Select), arg0) 381 } 382 383 // SetMaxScan mocks base method. 384 func (m *MockQuery) SetMaxScan(arg0 int) mongo.Query { 385 m.ctrl.T.Helper() 386 ret := m.ctrl.Call(m, "SetMaxScan", arg0) 387 ret0, _ := ret[0].(mongo.Query) 388 return ret0 389 } 390 391 // SetMaxScan indicates an expected call of SetMaxScan. 392 func (mr *MockQueryMockRecorder) SetMaxScan(arg0 any) *gomock.Call { 393 mr.mock.ctrl.T.Helper() 394 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetMaxScan", reflect.TypeOf((*MockQuery)(nil).SetMaxScan), arg0) 395 } 396 397 // SetMaxTime mocks base method. 398 func (m *MockQuery) SetMaxTime(arg0 time.Duration) mongo.Query { 399 m.ctrl.T.Helper() 400 ret := m.ctrl.Call(m, "SetMaxTime", arg0) 401 ret0, _ := ret[0].(mongo.Query) 402 return ret0 403 } 404 405 // SetMaxTime indicates an expected call of SetMaxTime. 406 func (mr *MockQueryMockRecorder) SetMaxTime(arg0 any) *gomock.Call { 407 mr.mock.ctrl.T.Helper() 408 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetMaxTime", reflect.TypeOf((*MockQuery)(nil).SetMaxTime), arg0) 409 } 410 411 // Skip mocks base method. 412 func (m *MockQuery) Skip(arg0 int) mongo.Query { 413 m.ctrl.T.Helper() 414 ret := m.ctrl.Call(m, "Skip", arg0) 415 ret0, _ := ret[0].(mongo.Query) 416 return ret0 417 } 418 419 // Skip indicates an expected call of Skip. 420 func (mr *MockQueryMockRecorder) Skip(arg0 any) *gomock.Call { 421 mr.mock.ctrl.T.Helper() 422 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Skip", reflect.TypeOf((*MockQuery)(nil).Skip), arg0) 423 } 424 425 // Snapshot mocks base method. 426 func (m *MockQuery) Snapshot() mongo.Query { 427 m.ctrl.T.Helper() 428 ret := m.ctrl.Call(m, "Snapshot") 429 ret0, _ := ret[0].(mongo.Query) 430 return ret0 431 } 432 433 // Snapshot indicates an expected call of Snapshot. 434 func (mr *MockQueryMockRecorder) Snapshot() *gomock.Call { 435 mr.mock.ctrl.T.Helper() 436 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Snapshot", reflect.TypeOf((*MockQuery)(nil).Snapshot)) 437 } 438 439 // Sort mocks base method. 440 func (m *MockQuery) Sort(arg0 ...string) mongo.Query { 441 m.ctrl.T.Helper() 442 varargs := []any{} 443 for _, a := range arg0 { 444 varargs = append(varargs, a) 445 } 446 ret := m.ctrl.Call(m, "Sort", varargs...) 447 ret0, _ := ret[0].(mongo.Query) 448 return ret0 449 } 450 451 // Sort indicates an expected call of Sort. 452 func (mr *MockQueryMockRecorder) Sort(arg0 ...any) *gomock.Call { 453 mr.mock.ctrl.T.Helper() 454 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sort", reflect.TypeOf((*MockQuery)(nil).Sort), arg0...) 455 } 456 457 // Tail mocks base method. 458 func (m *MockQuery) Tail(arg0 time.Duration) *mgo.Iter { 459 m.ctrl.T.Helper() 460 ret := m.ctrl.Call(m, "Tail", arg0) 461 ret0, _ := ret[0].(*mgo.Iter) 462 return ret0 463 } 464 465 // Tail indicates an expected call of Tail. 466 func (mr *MockQueryMockRecorder) Tail(arg0 any) *gomock.Call { 467 mr.mock.ctrl.T.Helper() 468 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tail", reflect.TypeOf((*MockQuery)(nil).Tail), arg0) 469 }