// 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" ) // NewHookTokens creates a new instance of HookTokens. 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 NewHookTokens(t interface { mock.TestingT Cleanup(func()) }) *HookTokens { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &HookTokens{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // HookTokens is an autogenerated mock type for the HookTokens type type HookTokens struct { mock.Mock } type HookTokens_Expecter struct { mock *mock.Mock } func (_m *HookTokens) EXPECT() *HookTokens_Expecter { return &HookTokens_Expecter{mock: &_m.Mock} } // Register provides a mock function for the type HookTokens func (_mock *HookTokens) Register(ctx context.Context, repo domain.RepoName, p domain.Principal) (string, func()) { ret := _mock.Called(ctx, repo, p) if len(ret) == 0 { panic("no return value specified for Register") } var r0 string var r1 func() if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Principal) (string, func())); ok { return returnFunc(ctx, repo, p) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.Principal) string); ok { r0 = returnFunc(ctx, repo, p) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.Principal) func()); ok { r1 = returnFunc(ctx, repo, p) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(func()) } } return r0, r1 } // HookTokens_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' type HookTokens_Register_Call struct { *mock.Call } // Register is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - p domain.Principal func (_e *HookTokens_Expecter) Register(ctx any, repo any, p any) *HookTokens_Register_Call { return &HookTokens_Register_Call{Call: _e.mock.On("Register", ctx, repo, p)} } func (_c *HookTokens_Register_Call) Run(run func(ctx context.Context, repo domain.RepoName, p domain.Principal)) *HookTokens_Register_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 domain.Principal if args[2] != nil { arg2 = args[2].(domain.Principal) } run( arg0, arg1, arg2, ) }) return _c } func (_c *HookTokens_Register_Call) Return(token string, release func()) *HookTokens_Register_Call { _c.Call.Return(token, release) return _c } func (_c *HookTokens_Register_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, p domain.Principal) (string, func())) *HookTokens_Register_Call { _c.Call.Return(run) return _c } // Socket provides a mock function for the type HookTokens func (_mock *HookTokens) Socket() string { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Socket") } var r0 string if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } return r0 } // HookTokens_Socket_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Socket' type HookTokens_Socket_Call struct { *mock.Call } // Socket is a helper method to define mock.On call func (_e *HookTokens_Expecter) Socket() *HookTokens_Socket_Call { return &HookTokens_Socket_Call{Call: _e.mock.On("Socket")} } func (_c *HookTokens_Socket_Call) Run(run func()) *HookTokens_Socket_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *HookTokens_Socket_Call) Return(s string) *HookTokens_Socket_Call { _c.Call.Return(s) return _c } func (_c *HookTokens_Socket_Call) RunAndReturn(run func() string) *HookTokens_Socket_Call { _c.Call.Return(run) return _c }