grafana/pkg/services/store/entity_events_mock.go

138 lines
3.2 KiB
Go
Raw Normal View History

// Code generated by mockery v2.12.3. DO NOT EDIT.
Search: in-memory index (#47709) * #45498: add entity events table * #45498: add entity events service * #45498: hook up entity events service to http server * #45498: use `dashboards.id` rather than `uid` and `org_id` in grn * Update pkg/services/entityevents/service.go Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * #45498: move entityeventsservice to services/store * #45498: add null check * #45498: rename * #45498: fix comment * #45498: switch grn back to uid * Search: listen for updates (#47719) * #45498: wire entity event service with searchv2 * load last event id before building index for org 1 * fix service init in integration tests * depend on required subset of event store methods * Update pkg/services/sqlstore/migrations/entity_events_mig.go Co-authored-by: Alexander Emelin <frvzmb@gmail.com> * #45498: pointer receiver * #45498: mockery! * #45498: add entity events service to background services * dashboard query pagination, allow queries while re-indexing * log level cleanups, use rlock, add comments * fix lint, check feature toggle in search v2 service * use unix time for event created column * add missing changes for created column * fix integration tests init * log re-index execution times on info level * #45498: fix entityEventsService tests * #45498: save events on dashboard delete * use camel case for log labels * formatting * #45498: rename grn to entityid * #45498: add `IsDisabled` to entityEventsService * #45498: remove feature flag from migration * better context usage, fix capacity, comments/cleanups * replace print with logger * Revert "#45498: remove feature flag from migration" This reverts commit ed23968898e27d65cfc5187acbcb1e8976c848a5. * revert:revert:revert conditional feature flag Co-authored-by: Ryan McKinley <ryantxu@gmail.com> Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2022-04-27 03:29:39 -05:00
package store
import (
context "context"
time "time"
mock "github.com/stretchr/testify/mock"
)
// MockEntityEventsService is an autogenerated mock type for the EntityEventsService type
type MockEntityEventsService struct {
mock.Mock
}
// GetAllEventsAfter provides a mock function with given fields: ctx, id
func (_m *MockEntityEventsService) GetAllEventsAfter(ctx context.Context, id int64) ([]*EntityEvent, error) {
ret := _m.Called(ctx, id)
var r0 []*EntityEvent
if rf, ok := ret.Get(0).(func(context.Context, int64) []*EntityEvent); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*EntityEvent)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetLastEvent provides a mock function with given fields: ctx
func (_m *MockEntityEventsService) GetLastEvent(ctx context.Context) (*EntityEvent, error) {
ret := _m.Called(ctx)
var r0 *EntityEvent
if rf, ok := ret.Get(0).(func(context.Context) *EntityEvent); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*EntityEvent)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// IsDisabled provides a mock function with given fields:
func (_m *MockEntityEventsService) IsDisabled() bool {
ret := _m.Called()
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// OnEvent provides a mock function with given fields: handler
func (_m *MockEntityEventsService) OnEvent(handler EventHandler) {
_m.Called(handler)
}
Search: in-memory index (#47709) * #45498: add entity events table * #45498: add entity events service * #45498: hook up entity events service to http server * #45498: use `dashboards.id` rather than `uid` and `org_id` in grn * Update pkg/services/entityevents/service.go Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * #45498: move entityeventsservice to services/store * #45498: add null check * #45498: rename * #45498: fix comment * #45498: switch grn back to uid * Search: listen for updates (#47719) * #45498: wire entity event service with searchv2 * load last event id before building index for org 1 * fix service init in integration tests * depend on required subset of event store methods * Update pkg/services/sqlstore/migrations/entity_events_mig.go Co-authored-by: Alexander Emelin <frvzmb@gmail.com> * #45498: pointer receiver * #45498: mockery! * #45498: add entity events service to background services * dashboard query pagination, allow queries while re-indexing * log level cleanups, use rlock, add comments * fix lint, check feature toggle in search v2 service * use unix time for event created column * add missing changes for created column * fix integration tests init * log re-index execution times on info level * #45498: fix entityEventsService tests * #45498: save events on dashboard delete * use camel case for log labels * formatting * #45498: rename grn to entityid * #45498: add `IsDisabled` to entityEventsService * #45498: remove feature flag from migration * better context usage, fix capacity, comments/cleanups * replace print with logger * Revert "#45498: remove feature flag from migration" This reverts commit ed23968898e27d65cfc5187acbcb1e8976c848a5. * revert:revert:revert conditional feature flag Co-authored-by: Ryan McKinley <ryantxu@gmail.com> Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2022-04-27 03:29:39 -05:00
// Run provides a mock function with given fields: ctx
func (_m *MockEntityEventsService) Run(ctx context.Context) error {
ret := _m.Called(ctx)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// SaveEvent provides a mock function with given fields: ctx, cmd
func (_m *MockEntityEventsService) SaveEvent(ctx context.Context, cmd SaveEventCmd) error {
ret := _m.Called(ctx, cmd)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, SaveEventCmd) error); ok {
r0 = rf(ctx, cmd)
} else {
r0 = ret.Error(0)
}
return r0
}
// deleteEventsOlderThan provides a mock function with given fields: ctx, duration
func (_m *MockEntityEventsService) deleteEventsOlderThan(ctx context.Context, duration time.Duration) error {
ret := _m.Called(ctx, duration)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, time.Duration) error); ok {
r0 = rf(ctx, duration)
} else {
r0 = ret.Error(0)
}
return r0
}
type NewMockEntityEventsServiceT interface {
mock.TestingT
Cleanup(func())
}
// NewMockEntityEventsService creates a new instance of MockEntityEventsService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMockEntityEventsService(t NewMockEntityEventsServiceT) *MockEntityEventsService {
mock := &MockEntityEventsService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}