The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/accesscontrol/actest/store_mock.go

252 lines
7.4 KiB

// Code generated by mockery v2.53.4. DO NOT EDIT.
package actest
import (
context "context"
accesscontrol "github.com/grafana/grafana/pkg/services/accesscontrol"
mock "github.com/stretchr/testify/mock"
)
// MockStore is an autogenerated mock type for the Store type
type MockStore struct {
mock.Mock
}
// DeleteExternalServiceRole provides a mock function with given fields: ctx, externalServiceID
func (_m *MockStore) DeleteExternalServiceRole(ctx context.Context, externalServiceID string) error {
ret := _m.Called(ctx, externalServiceID)
if len(ret) == 0 {
panic("no return value specified for DeleteExternalServiceRole")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, externalServiceID)
} else {
r0 = ret.Error(0)
}
return r0
}
// DeleteTeamPermissions provides a mock function with given fields: ctx, orgID, teamID
func (_m *MockStore) DeleteTeamPermissions(ctx context.Context, orgID int64, teamID int64) error {
ret := _m.Called(ctx, orgID, teamID)
if len(ret) == 0 {
panic("no return value specified for DeleteTeamPermissions")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64, int64) error); ok {
r0 = rf(ctx, orgID, teamID)
} else {
r0 = ret.Error(0)
}
return r0
}
// DeleteUserPermissions provides a mock function with given fields: ctx, orgID, userID
func (_m *MockStore) DeleteUserPermissions(ctx context.Context, orgID int64, userID int64) error {
ret := _m.Called(ctx, orgID, userID)
if len(ret) == 0 {
panic("no return value specified for DeleteUserPermissions")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int64, int64) error); ok {
r0 = rf(ctx, orgID, userID)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetBasicRolesPermissions provides a mock function with given fields: ctx, query
func (_m *MockStore) GetBasicRolesPermissions(ctx context.Context, query accesscontrol.GetUserPermissionsQuery) ([]accesscontrol.Permission, error) {
ret := _m.Called(ctx, query)
if len(ret) == 0 {
panic("no return value specified for GetBasicRolesPermissions")
}
var r0 []accesscontrol.Permission
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, accesscontrol.GetUserPermissionsQuery) ([]accesscontrol.Permission, error)); ok {
return rf(ctx, query)
}
if rf, ok := ret.Get(0).(func(context.Context, accesscontrol.GetUserPermissionsQuery) []accesscontrol.Permission); ok {
r0 = rf(ctx, query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]accesscontrol.Permission)
}
}
if rf, ok := ret.Get(1).(func(context.Context, accesscontrol.GetUserPermissionsQuery) error); ok {
r1 = rf(ctx, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetTeamsPermissions provides a mock function with given fields: ctx, query
func (_m *MockStore) GetTeamsPermissions(ctx context.Context, query accesscontrol.GetUserPermissionsQuery) (map[int64][]accesscontrol.Permission, error) {
ret := _m.Called(ctx, query)
if len(ret) == 0 {
panic("no return value specified for GetTeamsPermissions")
}
var r0 map[int64][]accesscontrol.Permission
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, accesscontrol.GetUserPermissionsQuery) (map[int64][]accesscontrol.Permission, error)); ok {
return rf(ctx, query)
}
if rf, ok := ret.Get(0).(func(context.Context, accesscontrol.GetUserPermissionsQuery) map[int64][]accesscontrol.Permission); ok {
r0 = rf(ctx, query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[int64][]accesscontrol.Permission)
}
}
if rf, ok := ret.Get(1).(func(context.Context, accesscontrol.GetUserPermissionsQuery) error); ok {
r1 = rf(ctx, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetUserPermissions provides a mock function with given fields: ctx, query
func (_m *MockStore) GetUserPermissions(ctx context.Context, query accesscontrol.GetUserPermissionsQuery) ([]accesscontrol.Permission, error) {
ret := _m.Called(ctx, query)
if len(ret) == 0 {
panic("no return value specified for GetUserPermissions")
}
var r0 []accesscontrol.Permission
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, accesscontrol.GetUserPermissionsQuery) ([]accesscontrol.Permission, error)); ok {
return rf(ctx, query)
}
if rf, ok := ret.Get(0).(func(context.Context, accesscontrol.GetUserPermissionsQuery) []accesscontrol.Permission); ok {
r0 = rf(ctx, query)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]accesscontrol.Permission)
}
}
if rf, ok := ret.Get(1).(func(context.Context, accesscontrol.GetUserPermissionsQuery) error); ok {
r1 = rf(ctx, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetUsersBasicRoles provides a mock function with given fields: ctx, userFilter, orgID
func (_m *MockStore) GetUsersBasicRoles(ctx context.Context, userFilter []int64, orgID int64) (map[int64][]string, error) {
ret := _m.Called(ctx, userFilter, orgID)
if len(ret) == 0 {
panic("no return value specified for GetUsersBasicRoles")
}
var r0 map[int64][]string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, []int64, int64) (map[int64][]string, error)); ok {
return rf(ctx, userFilter, orgID)
}
if rf, ok := ret.Get(0).(func(context.Context, []int64, int64) map[int64][]string); ok {
r0 = rf(ctx, userFilter, orgID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[int64][]string)
}
}
if rf, ok := ret.Get(1).(func(context.Context, []int64, int64) error); ok {
r1 = rf(ctx, userFilter, orgID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SaveExternalServiceRole provides a mock function with given fields: ctx, cmd
func (_m *MockStore) SaveExternalServiceRole(ctx context.Context, cmd accesscontrol.SaveExternalServiceRoleCommand) error {
ret := _m.Called(ctx, cmd)
if len(ret) == 0 {
panic("no return value specified for SaveExternalServiceRole")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, accesscontrol.SaveExternalServiceRoleCommand) error); ok {
r0 = rf(ctx, cmd)
} else {
r0 = ret.Error(0)
}
return r0
}
// SearchUsersPermissions provides a mock function with given fields: ctx, orgID, options
func (_m *MockStore) SearchUsersPermissions(ctx context.Context, orgID int64, options accesscontrol.SearchOptions) (map[int64][]accesscontrol.Permission, error) {
ret := _m.Called(ctx, orgID, options)
if len(ret) == 0 {
panic("no return value specified for SearchUsersPermissions")
}
var r0 map[int64][]accesscontrol.Permission
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int64, accesscontrol.SearchOptions) (map[int64][]accesscontrol.Permission, error)); ok {
return rf(ctx, orgID, options)
}
if rf, ok := ret.Get(0).(func(context.Context, int64, accesscontrol.SearchOptions) map[int64][]accesscontrol.Permission); ok {
r0 = rf(ctx, orgID, options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[int64][]accesscontrol.Permission)
}
}
if rf, ok := ret.Get(1).(func(context.Context, int64, accesscontrol.SearchOptions) error); ok {
r1 = rf(ctx, orgID, options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewMockStore creates a new instance of MockStore. 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 NewMockStore(t interface {
mock.TestingT
Cleanup(func())
}) *MockStore {
mock := &MockStore{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}