mirror of https://github.com/grafana/grafana.git
700 lines
24 KiB
Go
700 lines
24 KiB
Go
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
|
|
|
package rest
|
|
|
|
import (
|
|
context "context"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
internalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
|
|
|
|
registryrest "k8s.io/apiserver/pkg/registry/rest"
|
|
|
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
|
|
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
)
|
|
|
|
// MockStorage is an autogenerated mock type for the Storage type
|
|
type MockStorage struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockStorage_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockStorage) EXPECT() *MockStorage_Expecter {
|
|
return &MockStorage_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// ConvertToTable provides a mock function with given fields: ctx, object, tableOptions
|
|
func (_m *MockStorage) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*v1.Table, error) {
|
|
ret := _m.Called(ctx, object, tableOptions)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ConvertToTable")
|
|
}
|
|
|
|
var r0 *v1.Table
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, runtime.Object, runtime.Object) (*v1.Table, error)); ok {
|
|
return rf(ctx, object, tableOptions)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, runtime.Object, runtime.Object) *v1.Table); ok {
|
|
r0 = rf(ctx, object, tableOptions)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*v1.Table)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, runtime.Object, runtime.Object) error); ok {
|
|
r1 = rf(ctx, object, tableOptions)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockStorage_ConvertToTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConvertToTable'
|
|
type MockStorage_ConvertToTable_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ConvertToTable is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - object runtime.Object
|
|
// - tableOptions runtime.Object
|
|
func (_e *MockStorage_Expecter) ConvertToTable(ctx interface{}, object interface{}, tableOptions interface{}) *MockStorage_ConvertToTable_Call {
|
|
return &MockStorage_ConvertToTable_Call{Call: _e.mock.On("ConvertToTable", ctx, object, tableOptions)}
|
|
}
|
|
|
|
func (_c *MockStorage_ConvertToTable_Call) Run(run func(ctx context.Context, object runtime.Object, tableOptions runtime.Object)) *MockStorage_ConvertToTable_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(runtime.Object), args[2].(runtime.Object))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_ConvertToTable_Call) Return(_a0 *v1.Table, _a1 error) *MockStorage_ConvertToTable_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_ConvertToTable_Call) RunAndReturn(run func(context.Context, runtime.Object, runtime.Object) (*v1.Table, error)) *MockStorage_ConvertToTable_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Create provides a mock function with given fields: ctx, obj, createValidation, options
|
|
func (_m *MockStorage) Create(ctx context.Context, obj runtime.Object, createValidation registryrest.ValidateObjectFunc, options *v1.CreateOptions) (runtime.Object, error) {
|
|
ret := _m.Called(ctx, obj, createValidation, options)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Create")
|
|
}
|
|
|
|
var r0 runtime.Object
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, runtime.Object, registryrest.ValidateObjectFunc, *v1.CreateOptions) (runtime.Object, error)); ok {
|
|
return rf(ctx, obj, createValidation, options)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, runtime.Object, registryrest.ValidateObjectFunc, *v1.CreateOptions) runtime.Object); ok {
|
|
r0 = rf(ctx, obj, createValidation, options)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(runtime.Object)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, runtime.Object, registryrest.ValidateObjectFunc, *v1.CreateOptions) error); ok {
|
|
r1 = rf(ctx, obj, createValidation, options)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockStorage_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
|
|
type MockStorage_Create_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Create is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - obj runtime.Object
|
|
// - createValidation registryrest.ValidateObjectFunc
|
|
// - options *v1.CreateOptions
|
|
func (_e *MockStorage_Expecter) Create(ctx interface{}, obj interface{}, createValidation interface{}, options interface{}) *MockStorage_Create_Call {
|
|
return &MockStorage_Create_Call{Call: _e.mock.On("Create", ctx, obj, createValidation, options)}
|
|
}
|
|
|
|
func (_c *MockStorage_Create_Call) Run(run func(ctx context.Context, obj runtime.Object, createValidation registryrest.ValidateObjectFunc, options *v1.CreateOptions)) *MockStorage_Create_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(runtime.Object), args[2].(registryrest.ValidateObjectFunc), args[3].(*v1.CreateOptions))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Create_Call) Return(_a0 runtime.Object, _a1 error) *MockStorage_Create_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Create_Call) RunAndReturn(run func(context.Context, runtime.Object, registryrest.ValidateObjectFunc, *v1.CreateOptions) (runtime.Object, error)) *MockStorage_Create_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Delete provides a mock function with given fields: ctx, name, deleteValidation, options
|
|
func (_m *MockStorage) Delete(ctx context.Context, name string, deleteValidation registryrest.ValidateObjectFunc, options *v1.DeleteOptions) (runtime.Object, bool, error) {
|
|
ret := _m.Called(ctx, name, deleteValidation, options)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Delete")
|
|
}
|
|
|
|
var r0 runtime.Object
|
|
var r1 bool
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, registryrest.ValidateObjectFunc, *v1.DeleteOptions) (runtime.Object, bool, error)); ok {
|
|
return rf(ctx, name, deleteValidation, options)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, registryrest.ValidateObjectFunc, *v1.DeleteOptions) runtime.Object); ok {
|
|
r0 = rf(ctx, name, deleteValidation, options)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(runtime.Object)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, registryrest.ValidateObjectFunc, *v1.DeleteOptions) bool); ok {
|
|
r1 = rf(ctx, name, deleteValidation, options)
|
|
} else {
|
|
r1 = ret.Get(1).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(context.Context, string, registryrest.ValidateObjectFunc, *v1.DeleteOptions) error); ok {
|
|
r2 = rf(ctx, name, deleteValidation, options)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// MockStorage_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
|
|
type MockStorage_Delete_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Delete is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - name string
|
|
// - deleteValidation registryrest.ValidateObjectFunc
|
|
// - options *v1.DeleteOptions
|
|
func (_e *MockStorage_Expecter) Delete(ctx interface{}, name interface{}, deleteValidation interface{}, options interface{}) *MockStorage_Delete_Call {
|
|
return &MockStorage_Delete_Call{Call: _e.mock.On("Delete", ctx, name, deleteValidation, options)}
|
|
}
|
|
|
|
func (_c *MockStorage_Delete_Call) Run(run func(ctx context.Context, name string, deleteValidation registryrest.ValidateObjectFunc, options *v1.DeleteOptions)) *MockStorage_Delete_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(registryrest.ValidateObjectFunc), args[3].(*v1.DeleteOptions))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Delete_Call) Return(_a0 runtime.Object, _a1 bool, _a2 error) *MockStorage_Delete_Call {
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Delete_Call) RunAndReturn(run func(context.Context, string, registryrest.ValidateObjectFunc, *v1.DeleteOptions) (runtime.Object, bool, error)) *MockStorage_Delete_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// DeleteCollection provides a mock function with given fields: ctx, deleteValidation, options, listOptions
|
|
func (_m *MockStorage) DeleteCollection(ctx context.Context, deleteValidation registryrest.ValidateObjectFunc, options *v1.DeleteOptions, listOptions *internalversion.ListOptions) (runtime.Object, error) {
|
|
ret := _m.Called(ctx, deleteValidation, options, listOptions)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DeleteCollection")
|
|
}
|
|
|
|
var r0 runtime.Object
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, registryrest.ValidateObjectFunc, *v1.DeleteOptions, *internalversion.ListOptions) (runtime.Object, error)); ok {
|
|
return rf(ctx, deleteValidation, options, listOptions)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, registryrest.ValidateObjectFunc, *v1.DeleteOptions, *internalversion.ListOptions) runtime.Object); ok {
|
|
r0 = rf(ctx, deleteValidation, options, listOptions)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(runtime.Object)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, registryrest.ValidateObjectFunc, *v1.DeleteOptions, *internalversion.ListOptions) error); ok {
|
|
r1 = rf(ctx, deleteValidation, options, listOptions)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockStorage_DeleteCollection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteCollection'
|
|
type MockStorage_DeleteCollection_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// DeleteCollection is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - deleteValidation registryrest.ValidateObjectFunc
|
|
// - options *v1.DeleteOptions
|
|
// - listOptions *internalversion.ListOptions
|
|
func (_e *MockStorage_Expecter) DeleteCollection(ctx interface{}, deleteValidation interface{}, options interface{}, listOptions interface{}) *MockStorage_DeleteCollection_Call {
|
|
return &MockStorage_DeleteCollection_Call{Call: _e.mock.On("DeleteCollection", ctx, deleteValidation, options, listOptions)}
|
|
}
|
|
|
|
func (_c *MockStorage_DeleteCollection_Call) Run(run func(ctx context.Context, deleteValidation registryrest.ValidateObjectFunc, options *v1.DeleteOptions, listOptions *internalversion.ListOptions)) *MockStorage_DeleteCollection_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(registryrest.ValidateObjectFunc), args[2].(*v1.DeleteOptions), args[3].(*internalversion.ListOptions))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_DeleteCollection_Call) Return(_a0 runtime.Object, _a1 error) *MockStorage_DeleteCollection_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_DeleteCollection_Call) RunAndReturn(run func(context.Context, registryrest.ValidateObjectFunc, *v1.DeleteOptions, *internalversion.ListOptions) (runtime.Object, error)) *MockStorage_DeleteCollection_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Destroy provides a mock function with no fields
|
|
func (_m *MockStorage) Destroy() {
|
|
_m.Called()
|
|
}
|
|
|
|
// MockStorage_Destroy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Destroy'
|
|
type MockStorage_Destroy_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Destroy is a helper method to define mock.On call
|
|
func (_e *MockStorage_Expecter) Destroy() *MockStorage_Destroy_Call {
|
|
return &MockStorage_Destroy_Call{Call: _e.mock.On("Destroy")}
|
|
}
|
|
|
|
func (_c *MockStorage_Destroy_Call) Run(run func()) *MockStorage_Destroy_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Destroy_Call) Return() *MockStorage_Destroy_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Destroy_Call) RunAndReturn(run func()) *MockStorage_Destroy_Call {
|
|
_c.Run(run)
|
|
return _c
|
|
}
|
|
|
|
// Get provides a mock function with given fields: ctx, name, options
|
|
func (_m *MockStorage) Get(ctx context.Context, name string, options *v1.GetOptions) (runtime.Object, error) {
|
|
ret := _m.Called(ctx, name, options)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Get")
|
|
}
|
|
|
|
var r0 runtime.Object
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, *v1.GetOptions) (runtime.Object, error)); ok {
|
|
return rf(ctx, name, options)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, *v1.GetOptions) runtime.Object); ok {
|
|
r0 = rf(ctx, name, options)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(runtime.Object)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, *v1.GetOptions) error); ok {
|
|
r1 = rf(ctx, name, options)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockStorage_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
|
|
type MockStorage_Get_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Get is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - name string
|
|
// - options *v1.GetOptions
|
|
func (_e *MockStorage_Expecter) Get(ctx interface{}, name interface{}, options interface{}) *MockStorage_Get_Call {
|
|
return &MockStorage_Get_Call{Call: _e.mock.On("Get", ctx, name, options)}
|
|
}
|
|
|
|
func (_c *MockStorage_Get_Call) Run(run func(ctx context.Context, name string, options *v1.GetOptions)) *MockStorage_Get_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(*v1.GetOptions))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Get_Call) Return(_a0 runtime.Object, _a1 error) *MockStorage_Get_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Get_Call) RunAndReturn(run func(context.Context, string, *v1.GetOptions) (runtime.Object, error)) *MockStorage_Get_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetSingularName provides a mock function with no fields
|
|
func (_m *MockStorage) GetSingularName() string {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetSingularName")
|
|
}
|
|
|
|
var r0 string
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockStorage_GetSingularName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSingularName'
|
|
type MockStorage_GetSingularName_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetSingularName is a helper method to define mock.On call
|
|
func (_e *MockStorage_Expecter) GetSingularName() *MockStorage_GetSingularName_Call {
|
|
return &MockStorage_GetSingularName_Call{Call: _e.mock.On("GetSingularName")}
|
|
}
|
|
|
|
func (_c *MockStorage_GetSingularName_Call) Run(run func()) *MockStorage_GetSingularName_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_GetSingularName_Call) Return(_a0 string) *MockStorage_GetSingularName_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_GetSingularName_Call) RunAndReturn(run func() string) *MockStorage_GetSingularName_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// List provides a mock function with given fields: ctx, options
|
|
func (_m *MockStorage) List(ctx context.Context, options *internalversion.ListOptions) (runtime.Object, error) {
|
|
ret := _m.Called(ctx, options)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for List")
|
|
}
|
|
|
|
var r0 runtime.Object
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *internalversion.ListOptions) (runtime.Object, error)); ok {
|
|
return rf(ctx, options)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *internalversion.ListOptions) runtime.Object); ok {
|
|
r0 = rf(ctx, options)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(runtime.Object)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *internalversion.ListOptions) error); ok {
|
|
r1 = rf(ctx, options)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockStorage_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
|
|
type MockStorage_List_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// List is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - options *internalversion.ListOptions
|
|
func (_e *MockStorage_Expecter) List(ctx interface{}, options interface{}) *MockStorage_List_Call {
|
|
return &MockStorage_List_Call{Call: _e.mock.On("List", ctx, options)}
|
|
}
|
|
|
|
func (_c *MockStorage_List_Call) Run(run func(ctx context.Context, options *internalversion.ListOptions)) *MockStorage_List_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(*internalversion.ListOptions))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_List_Call) Return(_a0 runtime.Object, _a1 error) *MockStorage_List_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_List_Call) RunAndReturn(run func(context.Context, *internalversion.ListOptions) (runtime.Object, error)) *MockStorage_List_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NamespaceScoped provides a mock function with no fields
|
|
func (_m *MockStorage) NamespaceScoped() bool {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for NamespaceScoped")
|
|
}
|
|
|
|
var r0 bool
|
|
if rf, ok := ret.Get(0).(func() bool); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockStorage_NamespaceScoped_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NamespaceScoped'
|
|
type MockStorage_NamespaceScoped_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// NamespaceScoped is a helper method to define mock.On call
|
|
func (_e *MockStorage_Expecter) NamespaceScoped() *MockStorage_NamespaceScoped_Call {
|
|
return &MockStorage_NamespaceScoped_Call{Call: _e.mock.On("NamespaceScoped")}
|
|
}
|
|
|
|
func (_c *MockStorage_NamespaceScoped_Call) Run(run func()) *MockStorage_NamespaceScoped_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_NamespaceScoped_Call) Return(_a0 bool) *MockStorage_NamespaceScoped_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_NamespaceScoped_Call) RunAndReturn(run func() bool) *MockStorage_NamespaceScoped_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// New provides a mock function with no fields
|
|
func (_m *MockStorage) New() runtime.Object {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for New")
|
|
}
|
|
|
|
var r0 runtime.Object
|
|
if rf, ok := ret.Get(0).(func() runtime.Object); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(runtime.Object)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockStorage_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New'
|
|
type MockStorage_New_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// New is a helper method to define mock.On call
|
|
func (_e *MockStorage_Expecter) New() *MockStorage_New_Call {
|
|
return &MockStorage_New_Call{Call: _e.mock.On("New")}
|
|
}
|
|
|
|
func (_c *MockStorage_New_Call) Run(run func()) *MockStorage_New_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_New_Call) Return(_a0 runtime.Object) *MockStorage_New_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_New_Call) RunAndReturn(run func() runtime.Object) *MockStorage_New_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewList provides a mock function with no fields
|
|
func (_m *MockStorage) NewList() runtime.Object {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for NewList")
|
|
}
|
|
|
|
var r0 runtime.Object
|
|
if rf, ok := ret.Get(0).(func() runtime.Object); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(runtime.Object)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockStorage_NewList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewList'
|
|
type MockStorage_NewList_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// NewList is a helper method to define mock.On call
|
|
func (_e *MockStorage_Expecter) NewList() *MockStorage_NewList_Call {
|
|
return &MockStorage_NewList_Call{Call: _e.mock.On("NewList")}
|
|
}
|
|
|
|
func (_c *MockStorage_NewList_Call) Run(run func()) *MockStorage_NewList_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_NewList_Call) Return(_a0 runtime.Object) *MockStorage_NewList_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_NewList_Call) RunAndReturn(run func() runtime.Object) *MockStorage_NewList_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Update provides a mock function with given fields: ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate, options
|
|
func (_m *MockStorage) Update(ctx context.Context, name string, objInfo registryrest.UpdatedObjectInfo, createValidation registryrest.ValidateObjectFunc, updateValidation registryrest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *v1.UpdateOptions) (runtime.Object, bool, error) {
|
|
ret := _m.Called(ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate, options)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Update")
|
|
}
|
|
|
|
var r0 runtime.Object
|
|
var r1 bool
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, registryrest.UpdatedObjectInfo, registryrest.ValidateObjectFunc, registryrest.ValidateObjectUpdateFunc, bool, *v1.UpdateOptions) (runtime.Object, bool, error)); ok {
|
|
return rf(ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate, options)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, registryrest.UpdatedObjectInfo, registryrest.ValidateObjectFunc, registryrest.ValidateObjectUpdateFunc, bool, *v1.UpdateOptions) runtime.Object); ok {
|
|
r0 = rf(ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate, options)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(runtime.Object)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, registryrest.UpdatedObjectInfo, registryrest.ValidateObjectFunc, registryrest.ValidateObjectUpdateFunc, bool, *v1.UpdateOptions) bool); ok {
|
|
r1 = rf(ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate, options)
|
|
} else {
|
|
r1 = ret.Get(1).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(context.Context, string, registryrest.UpdatedObjectInfo, registryrest.ValidateObjectFunc, registryrest.ValidateObjectUpdateFunc, bool, *v1.UpdateOptions) error); ok {
|
|
r2 = rf(ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate, options)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// MockStorage_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
|
|
type MockStorage_Update_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Update is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - name string
|
|
// - objInfo registryrest.UpdatedObjectInfo
|
|
// - createValidation registryrest.ValidateObjectFunc
|
|
// - updateValidation registryrest.ValidateObjectUpdateFunc
|
|
// - forceAllowCreate bool
|
|
// - options *v1.UpdateOptions
|
|
func (_e *MockStorage_Expecter) Update(ctx interface{}, name interface{}, objInfo interface{}, createValidation interface{}, updateValidation interface{}, forceAllowCreate interface{}, options interface{}) *MockStorage_Update_Call {
|
|
return &MockStorage_Update_Call{Call: _e.mock.On("Update", ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate, options)}
|
|
}
|
|
|
|
func (_c *MockStorage_Update_Call) Run(run func(ctx context.Context, name string, objInfo registryrest.UpdatedObjectInfo, createValidation registryrest.ValidateObjectFunc, updateValidation registryrest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *v1.UpdateOptions)) *MockStorage_Update_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(registryrest.UpdatedObjectInfo), args[3].(registryrest.ValidateObjectFunc), args[4].(registryrest.ValidateObjectUpdateFunc), args[5].(bool), args[6].(*v1.UpdateOptions))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Update_Call) Return(_a0 runtime.Object, _a1 bool, _a2 error) *MockStorage_Update_Call {
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockStorage_Update_Call) RunAndReturn(run func(context.Context, string, registryrest.UpdatedObjectInfo, registryrest.ValidateObjectFunc, registryrest.ValidateObjectUpdateFunc, bool, *v1.UpdateOptions) (runtime.Object, bool, error)) *MockStorage_Update_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewMockStorage creates a new instance of MockStorage. 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 NewMockStorage(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockStorage {
|
|
mock := &MockStorage{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|