// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" "bnema.dev/ermite/internal/ports" mock "github.com/stretchr/testify/mock" ) // NewTokenService creates a new instance of TokenService. 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 NewTokenService(t interface { mock.TestingT Cleanup(func()) }) *TokenService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &TokenService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // TokenService is an autogenerated mock type for the TokenService type type TokenService struct { mock.Mock } type TokenService_Expecter struct { mock *mock.Mock } func (_m *TokenService) EXPECT() *TokenService_Expecter { return &TokenService_Expecter{mock: &_m.Mock} } // Create provides a mock function for the type TokenService func (_mock *TokenService) Create(ctx context.Context, p domain.Principal, params ports.CreateTokenParams) (ports.CreatedToken, error) { ret := _mock.Called(ctx, p, params) if len(ret) == 0 { panic("no return value specified for Create") } var r0 ports.CreatedToken var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.CreateTokenParams) (ports.CreatedToken, error)); ok { return returnFunc(ctx, p, params) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.CreateTokenParams) ports.CreatedToken); ok { r0 = returnFunc(ctx, p, params) } else { r0 = ret.Get(0).(ports.CreatedToken) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, ports.CreateTokenParams) error); ok { r1 = returnFunc(ctx, p, params) } else { r1 = ret.Error(1) } return r0, r1 } // TokenService_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' type TokenService_Create_Call struct { *mock.Call } // Create is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - params ports.CreateTokenParams func (_e *TokenService_Expecter) Create(ctx any, p any, params any) *TokenService_Create_Call { return &TokenService_Create_Call{Call: _e.mock.On("Create", ctx, p, params)} } func (_c *TokenService_Create_Call) Run(run func(ctx context.Context, p domain.Principal, params ports.CreateTokenParams)) *TokenService_Create_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) } var arg2 ports.CreateTokenParams if args[2] != nil { arg2 = args[2].(ports.CreateTokenParams) } run( arg0, arg1, arg2, ) }) return _c } func (_c *TokenService_Create_Call) Return(createdToken ports.CreatedToken, err error) *TokenService_Create_Call { _c.Call.Return(createdToken, err) return _c } func (_c *TokenService_Create_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, params ports.CreateTokenParams) (ports.CreatedToken, error)) *TokenService_Create_Call { _c.Call.Return(run) return _c } // ListPage provides a mock function for the type TokenService func (_mock *TokenService) ListPage(ctx context.Context, p domain.Principal, size int, token string) (ports.TokenPage, error) { ret := _mock.Called(ctx, p, size, token) if len(ret) == 0 { panic("no return value specified for ListPage") } var r0 ports.TokenPage var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) (ports.TokenPage, error)); ok { return returnFunc(ctx, p, size, token) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, int, string) ports.TokenPage); ok { r0 = returnFunc(ctx, p, size, token) } else { r0 = ret.Get(0).(ports.TokenPage) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, int, string) error); ok { r1 = returnFunc(ctx, p, size, token) } else { r1 = ret.Error(1) } return r0, r1 } // TokenService_ListPage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPage' type TokenService_ListPage_Call struct { *mock.Call } // ListPage is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - size int // - token string func (_e *TokenService_Expecter) ListPage(ctx any, p any, size any, token any) *TokenService_ListPage_Call { return &TokenService_ListPage_Call{Call: _e.mock.On("ListPage", ctx, p, size, token)} } func (_c *TokenService_ListPage_Call) Run(run func(ctx context.Context, p domain.Principal, size int, token string)) *TokenService_ListPage_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) } var arg2 int if args[2] != nil { arg2 = args[2].(int) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *TokenService_ListPage_Call) Return(tokenPage ports.TokenPage, err error) *TokenService_ListPage_Call { _c.Call.Return(tokenPage, err) return _c } func (_c *TokenService_ListPage_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, size int, token string) (ports.TokenPage, error)) *TokenService_ListPage_Call { _c.Call.Return(run) return _c } // Revoke provides a mock function for the type TokenService func (_mock *TokenService) Revoke(ctx context.Context, p domain.Principal, id string) error { ret := _mock.Called(ctx, p, id) if len(ret) == 0 { panic("no return value specified for Revoke") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, string) error); ok { r0 = returnFunc(ctx, p, id) } else { r0 = ret.Error(0) } return r0 } // TokenService_Revoke_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revoke' type TokenService_Revoke_Call struct { *mock.Call } // Revoke is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - id string func (_e *TokenService_Expecter) Revoke(ctx any, p any, id any) *TokenService_Revoke_Call { return &TokenService_Revoke_Call{Call: _e.mock.On("Revoke", ctx, p, id)} } func (_c *TokenService_Revoke_Call) Run(run func(ctx context.Context, p domain.Principal, id string)) *TokenService_Revoke_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) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } run( arg0, arg1, arg2, ) }) return _c } func (_c *TokenService_Revoke_Call) Return(err error) *TokenService_Revoke_Call { _c.Call.Return(err) return _c } func (_c *TokenService_Revoke_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, id string) error) *TokenService_Revoke_Call { _c.Call.Return(run) return _c }