mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
152 lines
4.5 KiB
Go
152 lines
4.5 KiB
Go
|
// Code generated by mockery v2.20.0. DO NOT EDIT.
|
||
|
|
||
|
package actest
|
||
|
|
||
|
import (
|
||
|
accesscontrol "github.com/grafana/grafana/pkg/services/accesscontrol"
|
||
|
|
||
|
context "context"
|
||
|
|
||
|
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)
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
// 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)
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
// 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)
|
||
|
|
||
|
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)
|
||
|
|
||
|
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)
|
||
|
|
||
|
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)
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
type mockConstructorTestingTNewMockStore interface {
|
||
|
mock.TestingT
|
||
|
Cleanup(func())
|
||
|
}
|
||
|
|
||
|
// 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.
|
||
|
func NewMockStore(t mockConstructorTestingTNewMockStore) *MockStore {
|
||
|
mock := &MockStore{}
|
||
|
mock.Mock.Test(t)
|
||
|
|
||
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||
|
|
||
|
return mock
|
||
|
}
|