Files
grafana/pkg/registry/apis/dashboard/legacy/legacy_migrator_mock.go
Roberto Jiménez Sánchez 364247e26b Provisioning: add most mocks to unit test provisioning jobs (#103446)
* Use interface for factories

* Add most mocks to unit test jobs

* Generate more mocks for main jobs package

* Interface for parser

* Use clients directly without parser

* Regenerate mock

* Eliminate resource clients from Parser

* Interface for folder tree
2025-04-04 15:42:20 +03:00

97 lines
2.8 KiB
Go

// Code generated by mockery v2.52.4. DO NOT EDIT.
package legacy
import (
context "context"
resource "github.com/grafana/grafana/pkg/storage/unified/resource"
mock "github.com/stretchr/testify/mock"
)
// MockLegacyMigrator is an autogenerated mock type for the LegacyMigrator type
type MockLegacyMigrator struct {
mock.Mock
}
type MockLegacyMigrator_Expecter struct {
mock *mock.Mock
}
func (_m *MockLegacyMigrator) EXPECT() *MockLegacyMigrator_Expecter {
return &MockLegacyMigrator_Expecter{mock: &_m.Mock}
}
// Migrate provides a mock function with given fields: ctx, opts
func (_m *MockLegacyMigrator) Migrate(ctx context.Context, opts MigrateOptions) (*resource.BulkResponse, error) {
ret := _m.Called(ctx, opts)
if len(ret) == 0 {
panic("no return value specified for Migrate")
}
var r0 *resource.BulkResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, MigrateOptions) (*resource.BulkResponse, error)); ok {
return rf(ctx, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, MigrateOptions) *resource.BulkResponse); ok {
r0 = rf(ctx, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*resource.BulkResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, MigrateOptions) error); ok {
r1 = rf(ctx, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockLegacyMigrator_Migrate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Migrate'
type MockLegacyMigrator_Migrate_Call struct {
*mock.Call
}
// Migrate is a helper method to define mock.On call
// - ctx context.Context
// - opts MigrateOptions
func (_e *MockLegacyMigrator_Expecter) Migrate(ctx interface{}, opts interface{}) *MockLegacyMigrator_Migrate_Call {
return &MockLegacyMigrator_Migrate_Call{Call: _e.mock.On("Migrate", ctx, opts)}
}
func (_c *MockLegacyMigrator_Migrate_Call) Run(run func(ctx context.Context, opts MigrateOptions)) *MockLegacyMigrator_Migrate_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(MigrateOptions))
})
return _c
}
func (_c *MockLegacyMigrator_Migrate_Call) Return(_a0 *resource.BulkResponse, _a1 error) *MockLegacyMigrator_Migrate_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockLegacyMigrator_Migrate_Call) RunAndReturn(run func(context.Context, MigrateOptions) (*resource.BulkResponse, error)) *MockLegacyMigrator_Migrate_Call {
_c.Call.Return(run)
return _c
}
// NewMockLegacyMigrator creates a new instance of MockLegacyMigrator. 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 NewMockLegacyMigrator(t interface {
mock.TestingT
Cleanup(func())
}) *MockLegacyMigrator {
mock := &MockLegacyMigrator{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}