Files
grafana/pkg/services/annotations/annotations_repository_mock.go
2025-07-09 09:15:34 +02:00

159 lines
3.7 KiB
Go

// Code generated by mockery v2.53.4. DO NOT EDIT.
package annotations
import (
context "context"
mock "github.com/stretchr/testify/mock"
)
// FakeAnnotationsRepo is an autogenerated mock type for the Repository type
type FakeAnnotationsRepo struct {
mock.Mock
}
// Delete provides a mock function with given fields: ctx, params
func (_m *FakeAnnotationsRepo) Delete(ctx context.Context, params *DeleteParams) error {
ret := _m.Called(ctx, params)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *DeleteParams) error); ok {
r0 = rf(ctx, params)
} else {
r0 = ret.Error(0)
}
return r0
}
// Find provides a mock function with given fields: ctx, query
func (_m *FakeAnnotationsRepo) Find(ctx context.Context, query *ItemQuery) ([]*ItemDTO, error) {
ret := _m.Called(ctx, query)
if len(ret) == 0 {
panic("no return value specified for Find")
}
var r0 []*ItemDTO
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *ItemQuery) ([]*ItemDTO, error)); ok {
return rf(ctx, query)
}
if rf, ok := ret.Get(0).(func(context.Context, *ItemQuery) []*ItemDTO); ok {
r0 = rf(ctx, query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*ItemDTO)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *ItemQuery) error); ok {
r1 = rf(ctx, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindTags provides a mock function with given fields: ctx, query
func (_m *FakeAnnotationsRepo) FindTags(ctx context.Context, query *TagsQuery) (FindTagsResult, error) {
ret := _m.Called(ctx, query)
if len(ret) == 0 {
panic("no return value specified for FindTags")
}
var r0 FindTagsResult
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *TagsQuery) (FindTagsResult, error)); ok {
return rf(ctx, query)
}
if rf, ok := ret.Get(0).(func(context.Context, *TagsQuery) FindTagsResult); ok {
r0 = rf(ctx, query)
} else {
r0 = ret.Get(0).(FindTagsResult)
}
if rf, ok := ret.Get(1).(func(context.Context, *TagsQuery) error); ok {
r1 = rf(ctx, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Save provides a mock function with given fields: ctx, item
func (_m *FakeAnnotationsRepo) Save(ctx context.Context, item *Item) error {
ret := _m.Called(ctx, item)
if len(ret) == 0 {
panic("no return value specified for Save")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *Item) error); ok {
r0 = rf(ctx, item)
} else {
r0 = ret.Error(0)
}
return r0
}
// SaveMany provides a mock function with given fields: ctx, items
func (_m *FakeAnnotationsRepo) SaveMany(ctx context.Context, items []Item) error {
ret := _m.Called(ctx, items)
if len(ret) == 0 {
panic("no return value specified for SaveMany")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, []Item) error); ok {
r0 = rf(ctx, items)
} else {
r0 = ret.Error(0)
}
return r0
}
// Update provides a mock function with given fields: ctx, item
func (_m *FakeAnnotationsRepo) Update(ctx context.Context, item *Item) error {
ret := _m.Called(ctx, item)
if len(ret) == 0 {
panic("no return value specified for Update")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *Item) error); ok {
r0 = rf(ctx, item)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewFakeAnnotationsRepo creates a new instance of FakeAnnotationsRepo. 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 NewFakeAnnotationsRepo(t interface {
mock.TestingT
Cleanup(func())
}) *FakeAnnotationsRepo {
mock := &FakeAnnotationsRepo{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}