// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" mock "github.com/stretchr/testify/mock" ) // NewRevalidator creates a new instance of Revalidator. 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 NewRevalidator(t interface { mock.TestingT Cleanup(func()) }) *Revalidator { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &Revalidator{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // Revalidator is an autogenerated mock type for the Revalidator type type Revalidator struct { mock.Mock } type Revalidator_Expecter struct { mock *mock.Mock } func (_m *Revalidator) EXPECT() *Revalidator_Expecter { return &Revalidator_Expecter{mock: &_m.Mock} } // Revalidate provides a mock function for the type Revalidator func (_mock *Revalidator) Revalidate(ctx context.Context, p domain.Principal) error { ret := _mock.Called(ctx, p) if len(ret) == 0 { panic("no return value specified for Revalidate") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) error); ok { r0 = returnFunc(ctx, p) } else { r0 = ret.Error(0) } return r0 } // Revalidator_Revalidate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revalidate' type Revalidator_Revalidate_Call struct { *mock.Call } // Revalidate is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal func (_e *Revalidator_Expecter) Revalidate(ctx any, p any) *Revalidator_Revalidate_Call { return &Revalidator_Revalidate_Call{Call: _e.mock.On("Revalidate", ctx, p)} } func (_c *Revalidator_Revalidate_Call) Run(run func(ctx context.Context, p domain.Principal)) *Revalidator_Revalidate_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } run( arg0, arg1, ) }) return _c } func (_c *Revalidator_Revalidate_Call) Return(err error) *Revalidator_Revalidate_Call { _c.Call.Return(err) return _c } func (_c *Revalidator_Revalidate_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal) error) *Revalidator_Revalidate_Call { _c.Call.Return(run) return _c }