mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-26 09:54:23 +00:00
447 lines
14 KiB
Go
447 lines
14 KiB
Go
// Code generated by mockery; DO NOT EDIT.
|
|
// github.com/vektra/mockery
|
|
// template: testify
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
"github.com/vmware-tanzu/velero/pkg/repository/udmrepo"
|
|
)
|
|
|
|
// NewBackupRepoService creates a new instance of BackupRepoService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewBackupRepoService(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *BackupRepoService {
|
|
mock := &BackupRepoService{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|
|
|
|
// BackupRepoService is an autogenerated mock type for the BackupRepoService type
|
|
type BackupRepoService struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type BackupRepoService_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *BackupRepoService) EXPECT() *BackupRepoService_Expecter {
|
|
return &BackupRepoService_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// ClientSideCacheLimit provides a mock function for the type BackupRepoService
|
|
func (_mock *BackupRepoService) ClientSideCacheLimit(repoOption map[string]string) int64 {
|
|
ret := _mock.Called(repoOption)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ClientSideCacheLimit")
|
|
}
|
|
|
|
var r0 int64
|
|
if returnFunc, ok := ret.Get(0).(func(map[string]string) int64); ok {
|
|
r0 = returnFunc(repoOption)
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// BackupRepoService_ClientSideCacheLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClientSideCacheLimit'
|
|
type BackupRepoService_ClientSideCacheLimit_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ClientSideCacheLimit is a helper method to define mock.On call
|
|
// - repoOption map[string]string
|
|
func (_e *BackupRepoService_Expecter) ClientSideCacheLimit(repoOption interface{}) *BackupRepoService_ClientSideCacheLimit_Call {
|
|
return &BackupRepoService_ClientSideCacheLimit_Call{Call: _e.mock.On("ClientSideCacheLimit", repoOption)}
|
|
}
|
|
|
|
func (_c *BackupRepoService_ClientSideCacheLimit_Call) Run(run func(repoOption map[string]string)) *BackupRepoService_ClientSideCacheLimit_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 map[string]string
|
|
if args[0] != nil {
|
|
arg0 = args[0].(map[string]string)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_ClientSideCacheLimit_Call) Return(n int64) *BackupRepoService_ClientSideCacheLimit_Call {
|
|
_c.Call.Return(n)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_ClientSideCacheLimit_Call) RunAndReturn(run func(repoOption map[string]string) int64) *BackupRepoService_ClientSideCacheLimit_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Connect provides a mock function for the type BackupRepoService
|
|
func (_mock *BackupRepoService) Connect(ctx context.Context, repoOption udmrepo.RepoOptions) error {
|
|
ret := _mock.Called(ctx, repoOption)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Connect")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, udmrepo.RepoOptions) error); ok {
|
|
r0 = returnFunc(ctx, repoOption)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// BackupRepoService_Connect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connect'
|
|
type BackupRepoService_Connect_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Connect is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - repoOption udmrepo.RepoOptions
|
|
func (_e *BackupRepoService_Expecter) Connect(ctx interface{}, repoOption interface{}) *BackupRepoService_Connect_Call {
|
|
return &BackupRepoService_Connect_Call{Call: _e.mock.On("Connect", ctx, repoOption)}
|
|
}
|
|
|
|
func (_c *BackupRepoService_Connect_Call) Run(run func(ctx context.Context, repoOption udmrepo.RepoOptions)) *BackupRepoService_Connect_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 udmrepo.RepoOptions
|
|
if args[1] != nil {
|
|
arg1 = args[1].(udmrepo.RepoOptions)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_Connect_Call) Return(err error) *BackupRepoService_Connect_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_Connect_Call) RunAndReturn(run func(ctx context.Context, repoOption udmrepo.RepoOptions) error) *BackupRepoService_Connect_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Create provides a mock function for the type BackupRepoService
|
|
func (_mock *BackupRepoService) Create(ctx context.Context, repoOption udmrepo.RepoOptions) error {
|
|
ret := _mock.Called(ctx, repoOption)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Create")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, udmrepo.RepoOptions) error); ok {
|
|
r0 = returnFunc(ctx, repoOption)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// BackupRepoService_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
|
|
type BackupRepoService_Create_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Create is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - repoOption udmrepo.RepoOptions
|
|
func (_e *BackupRepoService_Expecter) Create(ctx interface{}, repoOption interface{}) *BackupRepoService_Create_Call {
|
|
return &BackupRepoService_Create_Call{Call: _e.mock.On("Create", ctx, repoOption)}
|
|
}
|
|
|
|
func (_c *BackupRepoService_Create_Call) Run(run func(ctx context.Context, repoOption udmrepo.RepoOptions)) *BackupRepoService_Create_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 udmrepo.RepoOptions
|
|
if args[1] != nil {
|
|
arg1 = args[1].(udmrepo.RepoOptions)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_Create_Call) Return(err error) *BackupRepoService_Create_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_Create_Call) RunAndReturn(run func(ctx context.Context, repoOption udmrepo.RepoOptions) error) *BackupRepoService_Create_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// DefaultMaintenanceFrequency provides a mock function for the type BackupRepoService
|
|
func (_mock *BackupRepoService) DefaultMaintenanceFrequency() time.Duration {
|
|
ret := _mock.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DefaultMaintenanceFrequency")
|
|
}
|
|
|
|
var r0 time.Duration
|
|
if returnFunc, ok := ret.Get(0).(func() time.Duration); ok {
|
|
r0 = returnFunc()
|
|
} else {
|
|
r0 = ret.Get(0).(time.Duration)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// BackupRepoService_DefaultMaintenanceFrequency_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DefaultMaintenanceFrequency'
|
|
type BackupRepoService_DefaultMaintenanceFrequency_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// DefaultMaintenanceFrequency is a helper method to define mock.On call
|
|
func (_e *BackupRepoService_Expecter) DefaultMaintenanceFrequency() *BackupRepoService_DefaultMaintenanceFrequency_Call {
|
|
return &BackupRepoService_DefaultMaintenanceFrequency_Call{Call: _e.mock.On("DefaultMaintenanceFrequency")}
|
|
}
|
|
|
|
func (_c *BackupRepoService_DefaultMaintenanceFrequency_Call) Run(run func()) *BackupRepoService_DefaultMaintenanceFrequency_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_DefaultMaintenanceFrequency_Call) Return(duration time.Duration) *BackupRepoService_DefaultMaintenanceFrequency_Call {
|
|
_c.Call.Return(duration)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_DefaultMaintenanceFrequency_Call) RunAndReturn(run func() time.Duration) *BackupRepoService_DefaultMaintenanceFrequency_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// IsReady provides a mock function for the type BackupRepoService
|
|
func (_mock *BackupRepoService) IsReady(ctx context.Context, repoOption udmrepo.RepoOptions, readOnly bool) (bool, error) {
|
|
ret := _mock.Called(ctx, repoOption, readOnly)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for IsReady")
|
|
}
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, udmrepo.RepoOptions, bool) (bool, error)); ok {
|
|
return returnFunc(ctx, repoOption, readOnly)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, udmrepo.RepoOptions, bool) bool); ok {
|
|
r0 = returnFunc(ctx, repoOption, readOnly)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, udmrepo.RepoOptions, bool) error); ok {
|
|
r1 = returnFunc(ctx, repoOption, readOnly)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// BackupRepoService_IsReady_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsReady'
|
|
type BackupRepoService_IsReady_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// IsReady is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - repoOption udmrepo.RepoOptions
|
|
// - readOnly bool
|
|
func (_e *BackupRepoService_Expecter) IsReady(ctx interface{}, repoOption interface{}, readOnly interface{}) *BackupRepoService_IsReady_Call {
|
|
return &BackupRepoService_IsReady_Call{Call: _e.mock.On("IsReady", ctx, repoOption, readOnly)}
|
|
}
|
|
|
|
func (_c *BackupRepoService_IsReady_Call) Run(run func(ctx context.Context, repoOption udmrepo.RepoOptions, readOnly bool)) *BackupRepoService_IsReady_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 udmrepo.RepoOptions
|
|
if args[1] != nil {
|
|
arg1 = args[1].(udmrepo.RepoOptions)
|
|
}
|
|
var arg2 bool
|
|
if args[2] != nil {
|
|
arg2 = args[2].(bool)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_IsReady_Call) Return(b bool, err error) *BackupRepoService_IsReady_Call {
|
|
_c.Call.Return(b, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_IsReady_Call) RunAndReturn(run func(ctx context.Context, repoOption udmrepo.RepoOptions, readOnly bool) (bool, error)) *BackupRepoService_IsReady_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Maintain provides a mock function for the type BackupRepoService
|
|
func (_mock *BackupRepoService) Maintain(ctx context.Context, repoOption udmrepo.RepoOptions) error {
|
|
ret := _mock.Called(ctx, repoOption)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Maintain")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, udmrepo.RepoOptions) error); ok {
|
|
r0 = returnFunc(ctx, repoOption)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// BackupRepoService_Maintain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Maintain'
|
|
type BackupRepoService_Maintain_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Maintain is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - repoOption udmrepo.RepoOptions
|
|
func (_e *BackupRepoService_Expecter) Maintain(ctx interface{}, repoOption interface{}) *BackupRepoService_Maintain_Call {
|
|
return &BackupRepoService_Maintain_Call{Call: _e.mock.On("Maintain", ctx, repoOption)}
|
|
}
|
|
|
|
func (_c *BackupRepoService_Maintain_Call) Run(run func(ctx context.Context, repoOption udmrepo.RepoOptions)) *BackupRepoService_Maintain_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 udmrepo.RepoOptions
|
|
if args[1] != nil {
|
|
arg1 = args[1].(udmrepo.RepoOptions)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_Maintain_Call) Return(err error) *BackupRepoService_Maintain_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_Maintain_Call) RunAndReturn(run func(ctx context.Context, repoOption udmrepo.RepoOptions) error) *BackupRepoService_Maintain_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Open provides a mock function for the type BackupRepoService
|
|
func (_mock *BackupRepoService) Open(ctx context.Context, repoOption udmrepo.RepoOptions) (udmrepo.BackupRepo, error) {
|
|
ret := _mock.Called(ctx, repoOption)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Open")
|
|
}
|
|
|
|
var r0 udmrepo.BackupRepo
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, udmrepo.RepoOptions) (udmrepo.BackupRepo, error)); ok {
|
|
return returnFunc(ctx, repoOption)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, udmrepo.RepoOptions) udmrepo.BackupRepo); ok {
|
|
r0 = returnFunc(ctx, repoOption)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(udmrepo.BackupRepo)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, udmrepo.RepoOptions) error); ok {
|
|
r1 = returnFunc(ctx, repoOption)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// BackupRepoService_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open'
|
|
type BackupRepoService_Open_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Open is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - repoOption udmrepo.RepoOptions
|
|
func (_e *BackupRepoService_Expecter) Open(ctx interface{}, repoOption interface{}) *BackupRepoService_Open_Call {
|
|
return &BackupRepoService_Open_Call{Call: _e.mock.On("Open", ctx, repoOption)}
|
|
}
|
|
|
|
func (_c *BackupRepoService_Open_Call) Run(run func(ctx context.Context, repoOption udmrepo.RepoOptions)) *BackupRepoService_Open_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 udmrepo.RepoOptions
|
|
if args[1] != nil {
|
|
arg1 = args[1].(udmrepo.RepoOptions)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_Open_Call) Return(backupRepo udmrepo.BackupRepo, err error) *BackupRepoService_Open_Call {
|
|
_c.Call.Return(backupRepo, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *BackupRepoService_Open_Call) RunAndReturn(run func(ctx context.Context, repoOption udmrepo.RepoOptions) (udmrepo.BackupRepo, error)) *BackupRepoService_Open_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|