Files
supermq/re/mocks/service.go
T
Dušan Borovčanin 7bdf4c681e NOISSUE - Update dependencies (#336)
* NOISSUE - Update dependencies

Signed-off-by: dusan <borovcanindusan1@gmail.com>

* Update go.mod

Signed-off-by: dusan <borovcanindusan1@gmail.com>

---------

Signed-off-by: dusan <borovcanindusan1@gmail.com>
2025-10-20 20:45:24 +02:00

831 lines
23 KiB
Go

// Copyright (c) Abstract Machines
// SPDX-License-Identifier: Apache-2.0
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/absmach/magistrala/re"
"github.com/absmach/supermq/pkg/authn"
"github.com/absmach/supermq/pkg/messaging"
mock "github.com/stretchr/testify/mock"
)
// NewService creates a new instance of Service. 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 NewService(t interface {
mock.TestingT
Cleanup(func())
}) *Service {
mock := &Service{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Service is an autogenerated mock type for the Service type
type Service struct {
mock.Mock
}
type Service_Expecter struct {
mock *mock.Mock
}
func (_m *Service) EXPECT() *Service_Expecter {
return &Service_Expecter{mock: &_m.Mock}
}
// AddRule provides a mock function for the type Service
func (_mock *Service) AddRule(ctx context.Context, session authn.Session, r re.Rule) (re.Rule, error) {
ret := _mock.Called(ctx, session, r)
if len(ret) == 0 {
panic("no return value specified for AddRule")
}
var r0 re.Rule
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.Rule) (re.Rule, error)); ok {
return returnFunc(ctx, session, r)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.Rule) re.Rule); ok {
r0 = returnFunc(ctx, session, r)
} else {
r0 = ret.Get(0).(re.Rule)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, re.Rule) error); ok {
r1 = returnFunc(ctx, session, r)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_AddRule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddRule'
type Service_AddRule_Call struct {
*mock.Call
}
// AddRule is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - r re.Rule
func (_e *Service_Expecter) AddRule(ctx interface{}, session interface{}, r interface{}) *Service_AddRule_Call {
return &Service_AddRule_Call{Call: _e.mock.On("AddRule", ctx, session, r)}
}
func (_c *Service_AddRule_Call) Run(run func(ctx context.Context, session authn.Session, r re.Rule)) *Service_AddRule_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 re.Rule
if args[2] != nil {
arg2 = args[2].(re.Rule)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_AddRule_Call) Return(rule re.Rule, err error) *Service_AddRule_Call {
_c.Call.Return(rule, err)
return _c
}
func (_c *Service_AddRule_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, r re.Rule) (re.Rule, error)) *Service_AddRule_Call {
_c.Call.Return(run)
return _c
}
// Cancel provides a mock function for the type Service
func (_mock *Service) Cancel() error {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Cancel")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func() error); ok {
r0 = returnFunc()
} else {
r0 = ret.Error(0)
}
return r0
}
// Service_Cancel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cancel'
type Service_Cancel_Call struct {
*mock.Call
}
// Cancel is a helper method to define mock.On call
func (_e *Service_Expecter) Cancel() *Service_Cancel_Call {
return &Service_Cancel_Call{Call: _e.mock.On("Cancel")}
}
func (_c *Service_Cancel_Call) Run(run func()) *Service_Cancel_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *Service_Cancel_Call) Return(err error) *Service_Cancel_Call {
_c.Call.Return(err)
return _c
}
func (_c *Service_Cancel_Call) RunAndReturn(run func() error) *Service_Cancel_Call {
_c.Call.Return(run)
return _c
}
// DisableRule provides a mock function for the type Service
func (_mock *Service) DisableRule(ctx context.Context, session authn.Session, id string) (re.Rule, error) {
ret := _mock.Called(ctx, session, id)
if len(ret) == 0 {
panic("no return value specified for DisableRule")
}
var r0 re.Rule
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, string) (re.Rule, error)); ok {
return returnFunc(ctx, session, id)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, string) re.Rule); ok {
r0 = returnFunc(ctx, session, id)
} else {
r0 = ret.Get(0).(re.Rule)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, string) error); ok {
r1 = returnFunc(ctx, session, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_DisableRule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisableRule'
type Service_DisableRule_Call struct {
*mock.Call
}
// DisableRule is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - id string
func (_e *Service_Expecter) DisableRule(ctx interface{}, session interface{}, id interface{}) *Service_DisableRule_Call {
return &Service_DisableRule_Call{Call: _e.mock.On("DisableRule", ctx, session, id)}
}
func (_c *Service_DisableRule_Call) Run(run func(ctx context.Context, session authn.Session, id string)) *Service_DisableRule_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_DisableRule_Call) Return(rule re.Rule, err error) *Service_DisableRule_Call {
_c.Call.Return(rule, err)
return _c
}
func (_c *Service_DisableRule_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, id string) (re.Rule, error)) *Service_DisableRule_Call {
_c.Call.Return(run)
return _c
}
// EnableRule provides a mock function for the type Service
func (_mock *Service) EnableRule(ctx context.Context, session authn.Session, id string) (re.Rule, error) {
ret := _mock.Called(ctx, session, id)
if len(ret) == 0 {
panic("no return value specified for EnableRule")
}
var r0 re.Rule
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, string) (re.Rule, error)); ok {
return returnFunc(ctx, session, id)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, string) re.Rule); ok {
r0 = returnFunc(ctx, session, id)
} else {
r0 = ret.Get(0).(re.Rule)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, string) error); ok {
r1 = returnFunc(ctx, session, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_EnableRule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableRule'
type Service_EnableRule_Call struct {
*mock.Call
}
// EnableRule is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - id string
func (_e *Service_Expecter) EnableRule(ctx interface{}, session interface{}, id interface{}) *Service_EnableRule_Call {
return &Service_EnableRule_Call{Call: _e.mock.On("EnableRule", ctx, session, id)}
}
func (_c *Service_EnableRule_Call) Run(run func(ctx context.Context, session authn.Session, id string)) *Service_EnableRule_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_EnableRule_Call) Return(rule re.Rule, err error) *Service_EnableRule_Call {
_c.Call.Return(rule, err)
return _c
}
func (_c *Service_EnableRule_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, id string) (re.Rule, error)) *Service_EnableRule_Call {
_c.Call.Return(run)
return _c
}
// Handle provides a mock function for the type Service
func (_mock *Service) Handle(msg *messaging.Message) error {
ret := _mock.Called(msg)
if len(ret) == 0 {
panic("no return value specified for Handle")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(*messaging.Message) error); ok {
r0 = returnFunc(msg)
} else {
r0 = ret.Error(0)
}
return r0
}
// Service_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle'
type Service_Handle_Call struct {
*mock.Call
}
// Handle is a helper method to define mock.On call
// - msg *messaging.Message
func (_e *Service_Expecter) Handle(msg interface{}) *Service_Handle_Call {
return &Service_Handle_Call{Call: _e.mock.On("Handle", msg)}
}
func (_c *Service_Handle_Call) Run(run func(msg *messaging.Message)) *Service_Handle_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 *messaging.Message
if args[0] != nil {
arg0 = args[0].(*messaging.Message)
}
run(
arg0,
)
})
return _c
}
func (_c *Service_Handle_Call) Return(err error) *Service_Handle_Call {
_c.Call.Return(err)
return _c
}
func (_c *Service_Handle_Call) RunAndReturn(run func(msg *messaging.Message) error) *Service_Handle_Call {
_c.Call.Return(run)
return _c
}
// ListRules provides a mock function for the type Service
func (_mock *Service) ListRules(ctx context.Context, session authn.Session, pm re.PageMeta) (re.Page, error) {
ret := _mock.Called(ctx, session, pm)
if len(ret) == 0 {
panic("no return value specified for ListRules")
}
var r0 re.Page
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.PageMeta) (re.Page, error)); ok {
return returnFunc(ctx, session, pm)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.PageMeta) re.Page); ok {
r0 = returnFunc(ctx, session, pm)
} else {
r0 = ret.Get(0).(re.Page)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, re.PageMeta) error); ok {
r1 = returnFunc(ctx, session, pm)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_ListRules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRules'
type Service_ListRules_Call struct {
*mock.Call
}
// ListRules is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - pm re.PageMeta
func (_e *Service_Expecter) ListRules(ctx interface{}, session interface{}, pm interface{}) *Service_ListRules_Call {
return &Service_ListRules_Call{Call: _e.mock.On("ListRules", ctx, session, pm)}
}
func (_c *Service_ListRules_Call) Run(run func(ctx context.Context, session authn.Session, pm re.PageMeta)) *Service_ListRules_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 re.PageMeta
if args[2] != nil {
arg2 = args[2].(re.PageMeta)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_ListRules_Call) Return(page re.Page, err error) *Service_ListRules_Call {
_c.Call.Return(page, err)
return _c
}
func (_c *Service_ListRules_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, pm re.PageMeta) (re.Page, error)) *Service_ListRules_Call {
_c.Call.Return(run)
return _c
}
// RemoveRule provides a mock function for the type Service
func (_mock *Service) RemoveRule(ctx context.Context, session authn.Session, id string) error {
ret := _mock.Called(ctx, session, id)
if len(ret) == 0 {
panic("no return value specified for RemoveRule")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, string) error); ok {
r0 = returnFunc(ctx, session, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// Service_RemoveRule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRule'
type Service_RemoveRule_Call struct {
*mock.Call
}
// RemoveRule is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - id string
func (_e *Service_Expecter) RemoveRule(ctx interface{}, session interface{}, id interface{}) *Service_RemoveRule_Call {
return &Service_RemoveRule_Call{Call: _e.mock.On("RemoveRule", ctx, session, id)}
}
func (_c *Service_RemoveRule_Call) Run(run func(ctx context.Context, session authn.Session, id string)) *Service_RemoveRule_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_RemoveRule_Call) Return(err error) *Service_RemoveRule_Call {
_c.Call.Return(err)
return _c
}
func (_c *Service_RemoveRule_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, id string) error) *Service_RemoveRule_Call {
_c.Call.Return(run)
return _c
}
// StartScheduler provides a mock function for the type Service
func (_mock *Service) StartScheduler(ctx context.Context) error {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for StartScheduler")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = returnFunc(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// Service_StartScheduler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartScheduler'
type Service_StartScheduler_Call struct {
*mock.Call
}
// StartScheduler is a helper method to define mock.On call
// - ctx context.Context
func (_e *Service_Expecter) StartScheduler(ctx interface{}) *Service_StartScheduler_Call {
return &Service_StartScheduler_Call{Call: _e.mock.On("StartScheduler", ctx)}
}
func (_c *Service_StartScheduler_Call) Run(run func(ctx context.Context)) *Service_StartScheduler_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *Service_StartScheduler_Call) Return(err error) *Service_StartScheduler_Call {
_c.Call.Return(err)
return _c
}
func (_c *Service_StartScheduler_Call) RunAndReturn(run func(ctx context.Context) error) *Service_StartScheduler_Call {
_c.Call.Return(run)
return _c
}
// UpdateRule provides a mock function for the type Service
func (_mock *Service) UpdateRule(ctx context.Context, session authn.Session, r re.Rule) (re.Rule, error) {
ret := _mock.Called(ctx, session, r)
if len(ret) == 0 {
panic("no return value specified for UpdateRule")
}
var r0 re.Rule
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.Rule) (re.Rule, error)); ok {
return returnFunc(ctx, session, r)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.Rule) re.Rule); ok {
r0 = returnFunc(ctx, session, r)
} else {
r0 = ret.Get(0).(re.Rule)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, re.Rule) error); ok {
r1 = returnFunc(ctx, session, r)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_UpdateRule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRule'
type Service_UpdateRule_Call struct {
*mock.Call
}
// UpdateRule is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - r re.Rule
func (_e *Service_Expecter) UpdateRule(ctx interface{}, session interface{}, r interface{}) *Service_UpdateRule_Call {
return &Service_UpdateRule_Call{Call: _e.mock.On("UpdateRule", ctx, session, r)}
}
func (_c *Service_UpdateRule_Call) Run(run func(ctx context.Context, session authn.Session, r re.Rule)) *Service_UpdateRule_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 re.Rule
if args[2] != nil {
arg2 = args[2].(re.Rule)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_UpdateRule_Call) Return(rule re.Rule, err error) *Service_UpdateRule_Call {
_c.Call.Return(rule, err)
return _c
}
func (_c *Service_UpdateRule_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, r re.Rule) (re.Rule, error)) *Service_UpdateRule_Call {
_c.Call.Return(run)
return _c
}
// UpdateRuleSchedule provides a mock function for the type Service
func (_mock *Service) UpdateRuleSchedule(ctx context.Context, session authn.Session, r re.Rule) (re.Rule, error) {
ret := _mock.Called(ctx, session, r)
if len(ret) == 0 {
panic("no return value specified for UpdateRuleSchedule")
}
var r0 re.Rule
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.Rule) (re.Rule, error)); ok {
return returnFunc(ctx, session, r)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.Rule) re.Rule); ok {
r0 = returnFunc(ctx, session, r)
} else {
r0 = ret.Get(0).(re.Rule)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, re.Rule) error); ok {
r1 = returnFunc(ctx, session, r)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_UpdateRuleSchedule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRuleSchedule'
type Service_UpdateRuleSchedule_Call struct {
*mock.Call
}
// UpdateRuleSchedule is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - r re.Rule
func (_e *Service_Expecter) UpdateRuleSchedule(ctx interface{}, session interface{}, r interface{}) *Service_UpdateRuleSchedule_Call {
return &Service_UpdateRuleSchedule_Call{Call: _e.mock.On("UpdateRuleSchedule", ctx, session, r)}
}
func (_c *Service_UpdateRuleSchedule_Call) Run(run func(ctx context.Context, session authn.Session, r re.Rule)) *Service_UpdateRuleSchedule_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 re.Rule
if args[2] != nil {
arg2 = args[2].(re.Rule)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_UpdateRuleSchedule_Call) Return(rule re.Rule, err error) *Service_UpdateRuleSchedule_Call {
_c.Call.Return(rule, err)
return _c
}
func (_c *Service_UpdateRuleSchedule_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, r re.Rule) (re.Rule, error)) *Service_UpdateRuleSchedule_Call {
_c.Call.Return(run)
return _c
}
// UpdateRuleTags provides a mock function for the type Service
func (_mock *Service) UpdateRuleTags(ctx context.Context, session authn.Session, r re.Rule) (re.Rule, error) {
ret := _mock.Called(ctx, session, r)
if len(ret) == 0 {
panic("no return value specified for UpdateRuleTags")
}
var r0 re.Rule
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.Rule) (re.Rule, error)); ok {
return returnFunc(ctx, session, r)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, re.Rule) re.Rule); ok {
r0 = returnFunc(ctx, session, r)
} else {
r0 = ret.Get(0).(re.Rule)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, re.Rule) error); ok {
r1 = returnFunc(ctx, session, r)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_UpdateRuleTags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRuleTags'
type Service_UpdateRuleTags_Call struct {
*mock.Call
}
// UpdateRuleTags is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - r re.Rule
func (_e *Service_Expecter) UpdateRuleTags(ctx interface{}, session interface{}, r interface{}) *Service_UpdateRuleTags_Call {
return &Service_UpdateRuleTags_Call{Call: _e.mock.On("UpdateRuleTags", ctx, session, r)}
}
func (_c *Service_UpdateRuleTags_Call) Run(run func(ctx context.Context, session authn.Session, r re.Rule)) *Service_UpdateRuleTags_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 re.Rule
if args[2] != nil {
arg2 = args[2].(re.Rule)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_UpdateRuleTags_Call) Return(rule re.Rule, err error) *Service_UpdateRuleTags_Call {
_c.Call.Return(rule, err)
return _c
}
func (_c *Service_UpdateRuleTags_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, r re.Rule) (re.Rule, error)) *Service_UpdateRuleTags_Call {
_c.Call.Return(run)
return _c
}
// ViewRule provides a mock function for the type Service
func (_mock *Service) ViewRule(ctx context.Context, session authn.Session, id string) (re.Rule, error) {
ret := _mock.Called(ctx, session, id)
if len(ret) == 0 {
panic("no return value specified for ViewRule")
}
var r0 re.Rule
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, string) (re.Rule, error)); ok {
return returnFunc(ctx, session, id)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, string) re.Rule); ok {
r0 = returnFunc(ctx, session, id)
} else {
r0 = ret.Get(0).(re.Rule)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, string) error); ok {
r1 = returnFunc(ctx, session, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_ViewRule_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ViewRule'
type Service_ViewRule_Call struct {
*mock.Call
}
// ViewRule is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - id string
func (_e *Service_Expecter) ViewRule(ctx interface{}, session interface{}, id interface{}) *Service_ViewRule_Call {
return &Service_ViewRule_Call{Call: _e.mock.On("ViewRule", ctx, session, id)}
}
func (_c *Service_ViewRule_Call) Run(run func(ctx context.Context, session authn.Session, id string)) *Service_ViewRule_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_ViewRule_Call) Return(rule re.Rule, err error) *Service_ViewRule_Call {
_c.Call.Return(rule, err)
return _c
}
func (_c *Service_ViewRule_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, id string) (re.Rule, error)) *Service_ViewRule_Call {
_c.Call.Return(run)
return _c
}