mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 06:22:21 +08:00
375 lines
11 KiB
Go
375 lines
11 KiB
Go
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
|
|
|
package dualwrite
|
|
|
|
import (
|
|
context "context"
|
|
|
|
rest "github.com/grafana/grafana/pkg/apiserver/rest"
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
|
)
|
|
|
|
// MockService is an autogenerated mock type for the Service type
|
|
type MockService struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockService_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockService) EXPECT() *MockService_Expecter {
|
|
return &MockService_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// NewStorage provides a mock function with given fields: gr, legacy, storage
|
|
func (_m *MockService) NewStorage(gr schema.GroupResource, legacy rest.Storage, storage rest.Storage) (rest.Storage, error) {
|
|
ret := _m.Called(gr, legacy, storage)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for NewStorage")
|
|
}
|
|
|
|
var r0 rest.Storage
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(schema.GroupResource, rest.Storage, rest.Storage) (rest.Storage, error)); ok {
|
|
return rf(gr, legacy, storage)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(schema.GroupResource, rest.Storage, rest.Storage) rest.Storage); ok {
|
|
r0 = rf(gr, legacy, storage)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(rest.Storage)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(schema.GroupResource, rest.Storage, rest.Storage) error); ok {
|
|
r1 = rf(gr, legacy, storage)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockService_NewStorage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewStorage'
|
|
type MockService_NewStorage_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// NewStorage is a helper method to define mock.On call
|
|
// - gr schema.GroupResource
|
|
// - legacy rest.Storage
|
|
// - storage rest.Storage
|
|
func (_e *MockService_Expecter) NewStorage(gr interface{}, legacy interface{}, storage interface{}) *MockService_NewStorage_Call {
|
|
return &MockService_NewStorage_Call{Call: _e.mock.On("NewStorage", gr, legacy, storage)}
|
|
}
|
|
|
|
func (_c *MockService_NewStorage_Call) Run(run func(gr schema.GroupResource, legacy rest.Storage, storage rest.Storage)) *MockService_NewStorage_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(schema.GroupResource), args[1].(rest.Storage), args[2].(rest.Storage))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_NewStorage_Call) Return(_a0 rest.Storage, _a1 error) *MockService_NewStorage_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_NewStorage_Call) RunAndReturn(run func(schema.GroupResource, rest.Storage, rest.Storage) (rest.Storage, error)) *MockService_NewStorage_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ReadFromUnified provides a mock function with given fields: ctx, gr
|
|
func (_m *MockService) ReadFromUnified(ctx context.Context, gr schema.GroupResource) (bool, error) {
|
|
ret := _m.Called(ctx, gr)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ReadFromUnified")
|
|
}
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, schema.GroupResource) (bool, error)); ok {
|
|
return rf(ctx, gr)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, schema.GroupResource) bool); ok {
|
|
r0 = rf(ctx, gr)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, schema.GroupResource) error); ok {
|
|
r1 = rf(ctx, gr)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockService_ReadFromUnified_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadFromUnified'
|
|
type MockService_ReadFromUnified_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ReadFromUnified is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - gr schema.GroupResource
|
|
func (_e *MockService_Expecter) ReadFromUnified(ctx interface{}, gr interface{}) *MockService_ReadFromUnified_Call {
|
|
return &MockService_ReadFromUnified_Call{Call: _e.mock.On("ReadFromUnified", ctx, gr)}
|
|
}
|
|
|
|
func (_c *MockService_ReadFromUnified_Call) Run(run func(ctx context.Context, gr schema.GroupResource)) *MockService_ReadFromUnified_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(schema.GroupResource))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_ReadFromUnified_Call) Return(_a0 bool, _a1 error) *MockService_ReadFromUnified_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_ReadFromUnified_Call) RunAndReturn(run func(context.Context, schema.GroupResource) (bool, error)) *MockService_ReadFromUnified_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ShouldManage provides a mock function with given fields: gr
|
|
func (_m *MockService) ShouldManage(gr schema.GroupResource) bool {
|
|
ret := _m.Called(gr)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ShouldManage")
|
|
}
|
|
|
|
var r0 bool
|
|
if rf, ok := ret.Get(0).(func(schema.GroupResource) bool); ok {
|
|
r0 = rf(gr)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockService_ShouldManage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ShouldManage'
|
|
type MockService_ShouldManage_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ShouldManage is a helper method to define mock.On call
|
|
// - gr schema.GroupResource
|
|
func (_e *MockService_Expecter) ShouldManage(gr interface{}) *MockService_ShouldManage_Call {
|
|
return &MockService_ShouldManage_Call{Call: _e.mock.On("ShouldManage", gr)}
|
|
}
|
|
|
|
func (_c *MockService_ShouldManage_Call) Run(run func(gr schema.GroupResource)) *MockService_ShouldManage_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(schema.GroupResource))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_ShouldManage_Call) Return(_a0 bool) *MockService_ShouldManage_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_ShouldManage_Call) RunAndReturn(run func(schema.GroupResource) bool) *MockService_ShouldManage_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// StartMigration provides a mock function with given fields: ctx, gr, key
|
|
func (_m *MockService) StartMigration(ctx context.Context, gr schema.GroupResource, key int64) (StorageStatus, error) {
|
|
ret := _m.Called(ctx, gr, key)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for StartMigration")
|
|
}
|
|
|
|
var r0 StorageStatus
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, schema.GroupResource, int64) (StorageStatus, error)); ok {
|
|
return rf(ctx, gr, key)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, schema.GroupResource, int64) StorageStatus); ok {
|
|
r0 = rf(ctx, gr, key)
|
|
} else {
|
|
r0 = ret.Get(0).(StorageStatus)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, schema.GroupResource, int64) error); ok {
|
|
r1 = rf(ctx, gr, key)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockService_StartMigration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartMigration'
|
|
type MockService_StartMigration_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// StartMigration is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - gr schema.GroupResource
|
|
// - key int64
|
|
func (_e *MockService_Expecter) StartMigration(ctx interface{}, gr interface{}, key interface{}) *MockService_StartMigration_Call {
|
|
return &MockService_StartMigration_Call{Call: _e.mock.On("StartMigration", ctx, gr, key)}
|
|
}
|
|
|
|
func (_c *MockService_StartMigration_Call) Run(run func(ctx context.Context, gr schema.GroupResource, key int64)) *MockService_StartMigration_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(schema.GroupResource), args[2].(int64))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_StartMigration_Call) Return(_a0 StorageStatus, _a1 error) *MockService_StartMigration_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_StartMigration_Call) RunAndReturn(run func(context.Context, schema.GroupResource, int64) (StorageStatus, error)) *MockService_StartMigration_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Status provides a mock function with given fields: ctx, gr
|
|
func (_m *MockService) Status(ctx context.Context, gr schema.GroupResource) (StorageStatus, error) {
|
|
ret := _m.Called(ctx, gr)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Status")
|
|
}
|
|
|
|
var r0 StorageStatus
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, schema.GroupResource) (StorageStatus, error)); ok {
|
|
return rf(ctx, gr)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, schema.GroupResource) StorageStatus); ok {
|
|
r0 = rf(ctx, gr)
|
|
} else {
|
|
r0 = ret.Get(0).(StorageStatus)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, schema.GroupResource) error); ok {
|
|
r1 = rf(ctx, gr)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockService_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status'
|
|
type MockService_Status_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Status is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - gr schema.GroupResource
|
|
func (_e *MockService_Expecter) Status(ctx interface{}, gr interface{}) *MockService_Status_Call {
|
|
return &MockService_Status_Call{Call: _e.mock.On("Status", ctx, gr)}
|
|
}
|
|
|
|
func (_c *MockService_Status_Call) Run(run func(ctx context.Context, gr schema.GroupResource)) *MockService_Status_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(schema.GroupResource))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_Status_Call) Return(_a0 StorageStatus, _a1 error) *MockService_Status_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_Status_Call) RunAndReturn(run func(context.Context, schema.GroupResource) (StorageStatus, error)) *MockService_Status_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Update provides a mock function with given fields: ctx, status
|
|
func (_m *MockService) Update(ctx context.Context, status StorageStatus) (StorageStatus, error) {
|
|
ret := _m.Called(ctx, status)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Update")
|
|
}
|
|
|
|
var r0 StorageStatus
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, StorageStatus) (StorageStatus, error)); ok {
|
|
return rf(ctx, status)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, StorageStatus) StorageStatus); ok {
|
|
r0 = rf(ctx, status)
|
|
} else {
|
|
r0 = ret.Get(0).(StorageStatus)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, StorageStatus) error); ok {
|
|
r1 = rf(ctx, status)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockService_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
|
|
type MockService_Update_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Update is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - status StorageStatus
|
|
func (_e *MockService_Expecter) Update(ctx interface{}, status interface{}) *MockService_Update_Call {
|
|
return &MockService_Update_Call{Call: _e.mock.On("Update", ctx, status)}
|
|
}
|
|
|
|
func (_c *MockService_Update_Call) Run(run func(ctx context.Context, status StorageStatus)) *MockService_Update_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(StorageStatus))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_Update_Call) Return(_a0 StorageStatus, _a1 error) *MockService_Update_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockService_Update_Call) RunAndReturn(run func(context.Context, StorageStatus) (StorageStatus, error)) *MockService_Update_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewMockService creates a new instance of MockService. 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 NewMockService(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockService {
|
|
mock := &MockService{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|