Files
grafana/pkg/registry/apis/preferences/utils/teams_mock.go

157 lines
4.7 KiB
Go

// Code generated by mockery v2.53.4. DO NOT EDIT.
package utils
import (
context "context"
types "github.com/grafana/authlib/types"
mock "github.com/stretchr/testify/mock"
)
// MockTeamService is an autogenerated mock type for the TeamService type
type MockTeamService struct {
mock.Mock
}
type MockTeamService_Expecter struct {
mock *mock.Mock
}
func (_m *MockTeamService) EXPECT() *MockTeamService_Expecter {
return &MockTeamService_Expecter{mock: &_m.Mock}
}
// GetTeams provides a mock function with given fields: ctx, id, admin
func (_m *MockTeamService) GetTeams(ctx context.Context, id types.AuthInfo, admin bool) ([]string, error) {
ret := _m.Called(ctx, id, admin)
if len(ret) == 0 {
panic("no return value specified for GetTeams")
}
var r0 []string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.AuthInfo, bool) ([]string, error)); ok {
return rf(ctx, id, admin)
}
if rf, ok := ret.Get(0).(func(context.Context, types.AuthInfo, bool) []string); ok {
r0 = rf(ctx, id, admin)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
if rf, ok := ret.Get(1).(func(context.Context, types.AuthInfo, bool) error); ok {
r1 = rf(ctx, id, admin)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockTeamService_GetTeams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTeams'
type MockTeamService_GetTeams_Call struct {
*mock.Call
}
// GetTeams is a helper method to define mock.On call
// - ctx context.Context
// - id types.AuthInfo
// - admin bool
func (_e *MockTeamService_Expecter) GetTeams(ctx interface{}, id interface{}, admin interface{}) *MockTeamService_GetTeams_Call {
return &MockTeamService_GetTeams_Call{Call: _e.mock.On("GetTeams", ctx, id, admin)}
}
func (_c *MockTeamService_GetTeams_Call) Run(run func(ctx context.Context, id types.AuthInfo, admin bool)) *MockTeamService_GetTeams_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(types.AuthInfo), args[2].(bool))
})
return _c
}
func (_c *MockTeamService_GetTeams_Call) Return(_a0 []string, _a1 error) *MockTeamService_GetTeams_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockTeamService_GetTeams_Call) RunAndReturn(run func(context.Context, types.AuthInfo, bool) ([]string, error)) *MockTeamService_GetTeams_Call {
_c.Call.Return(run)
return _c
}
// InTeam provides a mock function with given fields: ctx, id, team, admin
func (_m *MockTeamService) InTeam(ctx context.Context, id types.AuthInfo, team string, admin bool) (bool, error) {
ret := _m.Called(ctx, id, team, admin)
if len(ret) == 0 {
panic("no return value specified for InTeam")
}
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, types.AuthInfo, string, bool) (bool, error)); ok {
return rf(ctx, id, team, admin)
}
if rf, ok := ret.Get(0).(func(context.Context, types.AuthInfo, string, bool) bool); ok {
r0 = rf(ctx, id, team, admin)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(context.Context, types.AuthInfo, string, bool) error); ok {
r1 = rf(ctx, id, team, admin)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockTeamService_InTeam_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InTeam'
type MockTeamService_InTeam_Call struct {
*mock.Call
}
// InTeam is a helper method to define mock.On call
// - ctx context.Context
// - id types.AuthInfo
// - team string
// - admin bool
func (_e *MockTeamService_Expecter) InTeam(ctx interface{}, id interface{}, team interface{}, admin interface{}) *MockTeamService_InTeam_Call {
return &MockTeamService_InTeam_Call{Call: _e.mock.On("InTeam", ctx, id, team, admin)}
}
func (_c *MockTeamService_InTeam_Call) Run(run func(ctx context.Context, id types.AuthInfo, team string, admin bool)) *MockTeamService_InTeam_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(types.AuthInfo), args[2].(string), args[3].(bool))
})
return _c
}
func (_c *MockTeamService_InTeam_Call) Return(_a0 bool, _a1 error) *MockTeamService_InTeam_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockTeamService_InTeam_Call) RunAndReturn(run func(context.Context, types.AuthInfo, string, bool) (bool, error)) *MockTeamService_InTeam_Call {
_c.Call.Return(run)
return _c
}
// NewMockTeamService creates a new instance of MockTeamService. 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 NewMockTeamService(t interface {
mock.TestingT
Cleanup(func())
}) *MockTeamService {
mock := &MockTeamService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}