github.com/cs3org/reva/v2@v2.27.7/pkg/storage/utils/metadata/mocks/Storage.go (about) 1 // Copyright 2018-2022 CERN 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // 15 // In applying this license, CERN does not waive the privileges and immunities 16 // granted to it by virtue of its status as an Intergovernmental Organization 17 // or submit itself to any jurisdiction. 18 19 // Code generated by mockery v2.40.2. DO NOT EDIT. 20 21 package mocks 22 23 import ( 24 context "context" 25 26 metadata "github.com/cs3org/reva/v2/pkg/storage/utils/metadata" 27 mock "github.com/stretchr/testify/mock" 28 29 providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" 30 ) 31 32 // Storage is an autogenerated mock type for the Storage type 33 type Storage struct { 34 mock.Mock 35 } 36 37 type Storage_Expecter struct { 38 mock *mock.Mock 39 } 40 41 func (_m *Storage) EXPECT() *Storage_Expecter { 42 return &Storage_Expecter{mock: &_m.Mock} 43 } 44 45 // Backend provides a mock function with given fields: 46 func (_m *Storage) Backend() string { 47 ret := _m.Called() 48 49 if len(ret) == 0 { 50 panic("no return value specified for Backend") 51 } 52 53 var r0 string 54 if rf, ok := ret.Get(0).(func() string); ok { 55 r0 = rf() 56 } else { 57 r0 = ret.Get(0).(string) 58 } 59 60 return r0 61 } 62 63 // Storage_Backend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Backend' 64 type Storage_Backend_Call struct { 65 *mock.Call 66 } 67 68 // Backend is a helper method to define mock.On call 69 func (_e *Storage_Expecter) Backend() *Storage_Backend_Call { 70 return &Storage_Backend_Call{Call: _e.mock.On("Backend")} 71 } 72 73 func (_c *Storage_Backend_Call) Run(run func()) *Storage_Backend_Call { 74 _c.Call.Run(func(args mock.Arguments) { 75 run() 76 }) 77 return _c 78 } 79 80 func (_c *Storage_Backend_Call) Return(_a0 string) *Storage_Backend_Call { 81 _c.Call.Return(_a0) 82 return _c 83 } 84 85 func (_c *Storage_Backend_Call) RunAndReturn(run func() string) *Storage_Backend_Call { 86 _c.Call.Return(run) 87 return _c 88 } 89 90 // CreateSymlink provides a mock function with given fields: ctx, oldname, newname 91 func (_m *Storage) CreateSymlink(ctx context.Context, oldname string, newname string) error { 92 ret := _m.Called(ctx, oldname, newname) 93 94 if len(ret) == 0 { 95 panic("no return value specified for CreateSymlink") 96 } 97 98 var r0 error 99 if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { 100 r0 = rf(ctx, oldname, newname) 101 } else { 102 r0 = ret.Error(0) 103 } 104 105 return r0 106 } 107 108 // Storage_CreateSymlink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSymlink' 109 type Storage_CreateSymlink_Call struct { 110 *mock.Call 111 } 112 113 // CreateSymlink is a helper method to define mock.On call 114 // - ctx context.Context 115 // - oldname string 116 // - newname string 117 func (_e *Storage_Expecter) CreateSymlink(ctx interface{}, oldname interface{}, newname interface{}) *Storage_CreateSymlink_Call { 118 return &Storage_CreateSymlink_Call{Call: _e.mock.On("CreateSymlink", ctx, oldname, newname)} 119 } 120 121 func (_c *Storage_CreateSymlink_Call) Run(run func(ctx context.Context, oldname string, newname string)) *Storage_CreateSymlink_Call { 122 _c.Call.Run(func(args mock.Arguments) { 123 run(args[0].(context.Context), args[1].(string), args[2].(string)) 124 }) 125 return _c 126 } 127 128 func (_c *Storage_CreateSymlink_Call) Return(_a0 error) *Storage_CreateSymlink_Call { 129 _c.Call.Return(_a0) 130 return _c 131 } 132 133 func (_c *Storage_CreateSymlink_Call) RunAndReturn(run func(context.Context, string, string) error) *Storage_CreateSymlink_Call { 134 _c.Call.Return(run) 135 return _c 136 } 137 138 // Delete provides a mock function with given fields: ctx, path 139 func (_m *Storage) Delete(ctx context.Context, path string) error { 140 ret := _m.Called(ctx, path) 141 142 if len(ret) == 0 { 143 panic("no return value specified for Delete") 144 } 145 146 var r0 error 147 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 148 r0 = rf(ctx, path) 149 } else { 150 r0 = ret.Error(0) 151 } 152 153 return r0 154 } 155 156 // Storage_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' 157 type Storage_Delete_Call struct { 158 *mock.Call 159 } 160 161 // Delete is a helper method to define mock.On call 162 // - ctx context.Context 163 // - path string 164 func (_e *Storage_Expecter) Delete(ctx interface{}, path interface{}) *Storage_Delete_Call { 165 return &Storage_Delete_Call{Call: _e.mock.On("Delete", ctx, path)} 166 } 167 168 func (_c *Storage_Delete_Call) Run(run func(ctx context.Context, path string)) *Storage_Delete_Call { 169 _c.Call.Run(func(args mock.Arguments) { 170 run(args[0].(context.Context), args[1].(string)) 171 }) 172 return _c 173 } 174 175 func (_c *Storage_Delete_Call) Return(_a0 error) *Storage_Delete_Call { 176 _c.Call.Return(_a0) 177 return _c 178 } 179 180 func (_c *Storage_Delete_Call) RunAndReturn(run func(context.Context, string) error) *Storage_Delete_Call { 181 _c.Call.Return(run) 182 return _c 183 } 184 185 // Download provides a mock function with given fields: ctx, req 186 func (_m *Storage) Download(ctx context.Context, req metadata.DownloadRequest) (*metadata.DownloadResponse, error) { 187 ret := _m.Called(ctx, req) 188 189 if len(ret) == 0 { 190 panic("no return value specified for Download") 191 } 192 193 var r0 *metadata.DownloadResponse 194 var r1 error 195 if rf, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)); ok { 196 return rf(ctx, req) 197 } 198 if rf, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) *metadata.DownloadResponse); ok { 199 r0 = rf(ctx, req) 200 } else { 201 if ret.Get(0) != nil { 202 r0 = ret.Get(0).(*metadata.DownloadResponse) 203 } 204 } 205 206 if rf, ok := ret.Get(1).(func(context.Context, metadata.DownloadRequest) error); ok { 207 r1 = rf(ctx, req) 208 } else { 209 r1 = ret.Error(1) 210 } 211 212 return r0, r1 213 } 214 215 // Storage_Download_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Download' 216 type Storage_Download_Call struct { 217 *mock.Call 218 } 219 220 // Download is a helper method to define mock.On call 221 // - ctx context.Context 222 // - req metadata.DownloadRequest 223 func (_e *Storage_Expecter) Download(ctx interface{}, req interface{}) *Storage_Download_Call { 224 return &Storage_Download_Call{Call: _e.mock.On("Download", ctx, req)} 225 } 226 227 func (_c *Storage_Download_Call) Run(run func(ctx context.Context, req metadata.DownloadRequest)) *Storage_Download_Call { 228 _c.Call.Run(func(args mock.Arguments) { 229 run(args[0].(context.Context), args[1].(metadata.DownloadRequest)) 230 }) 231 return _c 232 } 233 234 func (_c *Storage_Download_Call) Return(_a0 *metadata.DownloadResponse, _a1 error) *Storage_Download_Call { 235 _c.Call.Return(_a0, _a1) 236 return _c 237 } 238 239 func (_c *Storage_Download_Call) RunAndReturn(run func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)) *Storage_Download_Call { 240 _c.Call.Return(run) 241 return _c 242 } 243 244 // Init provides a mock function with given fields: ctx, name 245 func (_m *Storage) Init(ctx context.Context, name string) error { 246 ret := _m.Called(ctx, name) 247 248 if len(ret) == 0 { 249 panic("no return value specified for Init") 250 } 251 252 var r0 error 253 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 254 r0 = rf(ctx, name) 255 } else { 256 r0 = ret.Error(0) 257 } 258 259 return r0 260 } 261 262 // Storage_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init' 263 type Storage_Init_Call struct { 264 *mock.Call 265 } 266 267 // Init is a helper method to define mock.On call 268 // - ctx context.Context 269 // - name string 270 func (_e *Storage_Expecter) Init(ctx interface{}, name interface{}) *Storage_Init_Call { 271 return &Storage_Init_Call{Call: _e.mock.On("Init", ctx, name)} 272 } 273 274 func (_c *Storage_Init_Call) Run(run func(ctx context.Context, name string)) *Storage_Init_Call { 275 _c.Call.Run(func(args mock.Arguments) { 276 run(args[0].(context.Context), args[1].(string)) 277 }) 278 return _c 279 } 280 281 func (_c *Storage_Init_Call) Return(err error) *Storage_Init_Call { 282 _c.Call.Return(err) 283 return _c 284 } 285 286 func (_c *Storage_Init_Call) RunAndReturn(run func(context.Context, string) error) *Storage_Init_Call { 287 _c.Call.Return(run) 288 return _c 289 } 290 291 // ListDir provides a mock function with given fields: ctx, path 292 func (_m *Storage) ListDir(ctx context.Context, path string) ([]*providerv1beta1.ResourceInfo, error) { 293 ret := _m.Called(ctx, path) 294 295 if len(ret) == 0 { 296 panic("no return value specified for ListDir") 297 } 298 299 var r0 []*providerv1beta1.ResourceInfo 300 var r1 error 301 if rf, ok := ret.Get(0).(func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)); ok { 302 return rf(ctx, path) 303 } 304 if rf, ok := ret.Get(0).(func(context.Context, string) []*providerv1beta1.ResourceInfo); ok { 305 r0 = rf(ctx, path) 306 } else { 307 if ret.Get(0) != nil { 308 r0 = ret.Get(0).([]*providerv1beta1.ResourceInfo) 309 } 310 } 311 312 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 313 r1 = rf(ctx, path) 314 } else { 315 r1 = ret.Error(1) 316 } 317 318 return r0, r1 319 } 320 321 // Storage_ListDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDir' 322 type Storage_ListDir_Call struct { 323 *mock.Call 324 } 325 326 // ListDir is a helper method to define mock.On call 327 // - ctx context.Context 328 // - path string 329 func (_e *Storage_Expecter) ListDir(ctx interface{}, path interface{}) *Storage_ListDir_Call { 330 return &Storage_ListDir_Call{Call: _e.mock.On("ListDir", ctx, path)} 331 } 332 333 func (_c *Storage_ListDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ListDir_Call { 334 _c.Call.Run(func(args mock.Arguments) { 335 run(args[0].(context.Context), args[1].(string)) 336 }) 337 return _c 338 } 339 340 func (_c *Storage_ListDir_Call) Return(_a0 []*providerv1beta1.ResourceInfo, _a1 error) *Storage_ListDir_Call { 341 _c.Call.Return(_a0, _a1) 342 return _c 343 } 344 345 func (_c *Storage_ListDir_Call) RunAndReturn(run func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)) *Storage_ListDir_Call { 346 _c.Call.Return(run) 347 return _c 348 } 349 350 // MakeDirIfNotExist provides a mock function with given fields: ctx, name 351 func (_m *Storage) MakeDirIfNotExist(ctx context.Context, name string) error { 352 ret := _m.Called(ctx, name) 353 354 if len(ret) == 0 { 355 panic("no return value specified for MakeDirIfNotExist") 356 } 357 358 var r0 error 359 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 360 r0 = rf(ctx, name) 361 } else { 362 r0 = ret.Error(0) 363 } 364 365 return r0 366 } 367 368 // Storage_MakeDirIfNotExist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeDirIfNotExist' 369 type Storage_MakeDirIfNotExist_Call struct { 370 *mock.Call 371 } 372 373 // MakeDirIfNotExist is a helper method to define mock.On call 374 // - ctx context.Context 375 // - name string 376 func (_e *Storage_Expecter) MakeDirIfNotExist(ctx interface{}, name interface{}) *Storage_MakeDirIfNotExist_Call { 377 return &Storage_MakeDirIfNotExist_Call{Call: _e.mock.On("MakeDirIfNotExist", ctx, name)} 378 } 379 380 func (_c *Storage_MakeDirIfNotExist_Call) Run(run func(ctx context.Context, name string)) *Storage_MakeDirIfNotExist_Call { 381 _c.Call.Run(func(args mock.Arguments) { 382 run(args[0].(context.Context), args[1].(string)) 383 }) 384 return _c 385 } 386 387 func (_c *Storage_MakeDirIfNotExist_Call) Return(_a0 error) *Storage_MakeDirIfNotExist_Call { 388 _c.Call.Return(_a0) 389 return _c 390 } 391 392 func (_c *Storage_MakeDirIfNotExist_Call) RunAndReturn(run func(context.Context, string) error) *Storage_MakeDirIfNotExist_Call { 393 _c.Call.Return(run) 394 return _c 395 } 396 397 // ReadDir provides a mock function with given fields: ctx, path 398 func (_m *Storage) ReadDir(ctx context.Context, path string) ([]string, error) { 399 ret := _m.Called(ctx, path) 400 401 if len(ret) == 0 { 402 panic("no return value specified for ReadDir") 403 } 404 405 var r0 []string 406 var r1 error 407 if rf, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok { 408 return rf(ctx, path) 409 } 410 if rf, ok := ret.Get(0).(func(context.Context, string) []string); ok { 411 r0 = rf(ctx, path) 412 } else { 413 if ret.Get(0) != nil { 414 r0 = ret.Get(0).([]string) 415 } 416 } 417 418 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 419 r1 = rf(ctx, path) 420 } else { 421 r1 = ret.Error(1) 422 } 423 424 return r0, r1 425 } 426 427 // Storage_ReadDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadDir' 428 type Storage_ReadDir_Call struct { 429 *mock.Call 430 } 431 432 // ReadDir is a helper method to define mock.On call 433 // - ctx context.Context 434 // - path string 435 func (_e *Storage_Expecter) ReadDir(ctx interface{}, path interface{}) *Storage_ReadDir_Call { 436 return &Storage_ReadDir_Call{Call: _e.mock.On("ReadDir", ctx, path)} 437 } 438 439 func (_c *Storage_ReadDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ReadDir_Call { 440 _c.Call.Run(func(args mock.Arguments) { 441 run(args[0].(context.Context), args[1].(string)) 442 }) 443 return _c 444 } 445 446 func (_c *Storage_ReadDir_Call) Return(_a0 []string, _a1 error) *Storage_ReadDir_Call { 447 _c.Call.Return(_a0, _a1) 448 return _c 449 } 450 451 func (_c *Storage_ReadDir_Call) RunAndReturn(run func(context.Context, string) ([]string, error)) *Storage_ReadDir_Call { 452 _c.Call.Return(run) 453 return _c 454 } 455 456 // ResolveSymlink provides a mock function with given fields: ctx, name 457 func (_m *Storage) ResolveSymlink(ctx context.Context, name string) (string, error) { 458 ret := _m.Called(ctx, name) 459 460 if len(ret) == 0 { 461 panic("no return value specified for ResolveSymlink") 462 } 463 464 var r0 string 465 var r1 error 466 if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { 467 return rf(ctx, name) 468 } 469 if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { 470 r0 = rf(ctx, name) 471 } else { 472 r0 = ret.Get(0).(string) 473 } 474 475 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 476 r1 = rf(ctx, name) 477 } else { 478 r1 = ret.Error(1) 479 } 480 481 return r0, r1 482 } 483 484 // Storage_ResolveSymlink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveSymlink' 485 type Storage_ResolveSymlink_Call struct { 486 *mock.Call 487 } 488 489 // ResolveSymlink is a helper method to define mock.On call 490 // - ctx context.Context 491 // - name string 492 func (_e *Storage_Expecter) ResolveSymlink(ctx interface{}, name interface{}) *Storage_ResolveSymlink_Call { 493 return &Storage_ResolveSymlink_Call{Call: _e.mock.On("ResolveSymlink", ctx, name)} 494 } 495 496 func (_c *Storage_ResolveSymlink_Call) Run(run func(ctx context.Context, name string)) *Storage_ResolveSymlink_Call { 497 _c.Call.Run(func(args mock.Arguments) { 498 run(args[0].(context.Context), args[1].(string)) 499 }) 500 return _c 501 } 502 503 func (_c *Storage_ResolveSymlink_Call) Return(_a0 string, _a1 error) *Storage_ResolveSymlink_Call { 504 _c.Call.Return(_a0, _a1) 505 return _c 506 } 507 508 func (_c *Storage_ResolveSymlink_Call) RunAndReturn(run func(context.Context, string) (string, error)) *Storage_ResolveSymlink_Call { 509 _c.Call.Return(run) 510 return _c 511 } 512 513 // SimpleDownload provides a mock function with given fields: ctx, path 514 func (_m *Storage) SimpleDownload(ctx context.Context, path string) ([]byte, error) { 515 ret := _m.Called(ctx, path) 516 517 if len(ret) == 0 { 518 panic("no return value specified for SimpleDownload") 519 } 520 521 var r0 []byte 522 var r1 error 523 if rf, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok { 524 return rf(ctx, path) 525 } 526 if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok { 527 r0 = rf(ctx, path) 528 } else { 529 if ret.Get(0) != nil { 530 r0 = ret.Get(0).([]byte) 531 } 532 } 533 534 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 535 r1 = rf(ctx, path) 536 } else { 537 r1 = ret.Error(1) 538 } 539 540 return r0, r1 541 } 542 543 // Storage_SimpleDownload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimpleDownload' 544 type Storage_SimpleDownload_Call struct { 545 *mock.Call 546 } 547 548 // SimpleDownload is a helper method to define mock.On call 549 // - ctx context.Context 550 // - path string 551 func (_e *Storage_Expecter) SimpleDownload(ctx interface{}, path interface{}) *Storage_SimpleDownload_Call { 552 return &Storage_SimpleDownload_Call{Call: _e.mock.On("SimpleDownload", ctx, path)} 553 } 554 555 func (_c *Storage_SimpleDownload_Call) Run(run func(ctx context.Context, path string)) *Storage_SimpleDownload_Call { 556 _c.Call.Run(func(args mock.Arguments) { 557 run(args[0].(context.Context), args[1].(string)) 558 }) 559 return _c 560 } 561 562 func (_c *Storage_SimpleDownload_Call) Return(_a0 []byte, _a1 error) *Storage_SimpleDownload_Call { 563 _c.Call.Return(_a0, _a1) 564 return _c 565 } 566 567 func (_c *Storage_SimpleDownload_Call) RunAndReturn(run func(context.Context, string) ([]byte, error)) *Storage_SimpleDownload_Call { 568 _c.Call.Return(run) 569 return _c 570 } 571 572 // SimpleUpload provides a mock function with given fields: ctx, uploadpath, content 573 func (_m *Storage) SimpleUpload(ctx context.Context, uploadpath string, content []byte) error { 574 ret := _m.Called(ctx, uploadpath, content) 575 576 if len(ret) == 0 { 577 panic("no return value specified for SimpleUpload") 578 } 579 580 var r0 error 581 if rf, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok { 582 r0 = rf(ctx, uploadpath, content) 583 } else { 584 r0 = ret.Error(0) 585 } 586 587 return r0 588 } 589 590 // Storage_SimpleUpload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimpleUpload' 591 type Storage_SimpleUpload_Call struct { 592 *mock.Call 593 } 594 595 // SimpleUpload is a helper method to define mock.On call 596 // - ctx context.Context 597 // - uploadpath string 598 // - content []byte 599 func (_e *Storage_Expecter) SimpleUpload(ctx interface{}, uploadpath interface{}, content interface{}) *Storage_SimpleUpload_Call { 600 return &Storage_SimpleUpload_Call{Call: _e.mock.On("SimpleUpload", ctx, uploadpath, content)} 601 } 602 603 func (_c *Storage_SimpleUpload_Call) Run(run func(ctx context.Context, uploadpath string, content []byte)) *Storage_SimpleUpload_Call { 604 _c.Call.Run(func(args mock.Arguments) { 605 run(args[0].(context.Context), args[1].(string), args[2].([]byte)) 606 }) 607 return _c 608 } 609 610 func (_c *Storage_SimpleUpload_Call) Return(_a0 error) *Storage_SimpleUpload_Call { 611 _c.Call.Return(_a0) 612 return _c 613 } 614 615 func (_c *Storage_SimpleUpload_Call) RunAndReturn(run func(context.Context, string, []byte) error) *Storage_SimpleUpload_Call { 616 _c.Call.Return(run) 617 return _c 618 } 619 620 // Stat provides a mock function with given fields: ctx, path 621 func (_m *Storage) Stat(ctx context.Context, path string) (*providerv1beta1.ResourceInfo, error) { 622 ret := _m.Called(ctx, path) 623 624 if len(ret) == 0 { 625 panic("no return value specified for Stat") 626 } 627 628 var r0 *providerv1beta1.ResourceInfo 629 var r1 error 630 if rf, ok := ret.Get(0).(func(context.Context, string) (*providerv1beta1.ResourceInfo, error)); ok { 631 return rf(ctx, path) 632 } 633 if rf, ok := ret.Get(0).(func(context.Context, string) *providerv1beta1.ResourceInfo); ok { 634 r0 = rf(ctx, path) 635 } else { 636 if ret.Get(0) != nil { 637 r0 = ret.Get(0).(*providerv1beta1.ResourceInfo) 638 } 639 } 640 641 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 642 r1 = rf(ctx, path) 643 } else { 644 r1 = ret.Error(1) 645 } 646 647 return r0, r1 648 } 649 650 // Storage_Stat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stat' 651 type Storage_Stat_Call struct { 652 *mock.Call 653 } 654 655 // Stat is a helper method to define mock.On call 656 // - ctx context.Context 657 // - path string 658 func (_e *Storage_Expecter) Stat(ctx interface{}, path interface{}) *Storage_Stat_Call { 659 return &Storage_Stat_Call{Call: _e.mock.On("Stat", ctx, path)} 660 } 661 662 func (_c *Storage_Stat_Call) Run(run func(ctx context.Context, path string)) *Storage_Stat_Call { 663 _c.Call.Run(func(args mock.Arguments) { 664 run(args[0].(context.Context), args[1].(string)) 665 }) 666 return _c 667 } 668 669 func (_c *Storage_Stat_Call) Return(_a0 *providerv1beta1.ResourceInfo, _a1 error) *Storage_Stat_Call { 670 _c.Call.Return(_a0, _a1) 671 return _c 672 } 673 674 func (_c *Storage_Stat_Call) RunAndReturn(run func(context.Context, string) (*providerv1beta1.ResourceInfo, error)) *Storage_Stat_Call { 675 _c.Call.Return(run) 676 return _c 677 } 678 679 // Upload provides a mock function with given fields: ctx, req 680 func (_m *Storage) Upload(ctx context.Context, req metadata.UploadRequest) (*metadata.UploadResponse, error) { 681 ret := _m.Called(ctx, req) 682 683 if len(ret) == 0 { 684 panic("no return value specified for Upload") 685 } 686 687 var r0 *metadata.UploadResponse 688 var r1 error 689 if rf, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)); ok { 690 return rf(ctx, req) 691 } 692 if rf, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) *metadata.UploadResponse); ok { 693 r0 = rf(ctx, req) 694 } else { 695 if ret.Get(0) != nil { 696 r0 = ret.Get(0).(*metadata.UploadResponse) 697 } 698 } 699 700 if rf, ok := ret.Get(1).(func(context.Context, metadata.UploadRequest) error); ok { 701 r1 = rf(ctx, req) 702 } else { 703 r1 = ret.Error(1) 704 } 705 706 return r0, r1 707 } 708 709 // Storage_Upload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upload' 710 type Storage_Upload_Call struct { 711 *mock.Call 712 } 713 714 // Upload is a helper method to define mock.On call 715 // - ctx context.Context 716 // - req metadata.UploadRequest 717 func (_e *Storage_Expecter) Upload(ctx interface{}, req interface{}) *Storage_Upload_Call { 718 return &Storage_Upload_Call{Call: _e.mock.On("Upload", ctx, req)} 719 } 720 721 func (_c *Storage_Upload_Call) Run(run func(ctx context.Context, req metadata.UploadRequest)) *Storage_Upload_Call { 722 _c.Call.Run(func(args mock.Arguments) { 723 run(args[0].(context.Context), args[1].(metadata.UploadRequest)) 724 }) 725 return _c 726 } 727 728 func (_c *Storage_Upload_Call) Return(_a0 *metadata.UploadResponse, _a1 error) *Storage_Upload_Call { 729 _c.Call.Return(_a0, _a1) 730 return _c 731 } 732 733 func (_c *Storage_Upload_Call) RunAndReturn(run func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)) *Storage_Upload_Call { 734 _c.Call.Return(run) 735 return _c 736 } 737 738 // NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 739 // The first argument is typically a *testing.T value. 740 func NewStorage(t interface { 741 mock.TestingT 742 Cleanup(func()) 743 }) *Storage { 744 mock := &Storage{} 745 mock.Mock.Test(t) 746 747 t.Cleanup(func() { mock.AssertExpectations(t) }) 748 749 return mock 750 }