// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" "bnema.dev/ermite/internal/domain" mock "github.com/stretchr/testify/mock" ) // NewTokenStore creates a new instance of TokenStore. 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 NewTokenStore(t interface { mock.TestingT Cleanup(func()) }) *TokenStore { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &TokenStore{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // TokenStore is an autogenerated mock type for the TokenStore type type TokenStore struct { mock.Mock } type TokenStore_Expecter struct { mock *mock.Mock } func (_m *TokenStore) EXPECT() *TokenStore_Expecter { return &TokenStore_Expecter{mock: &_m.Mock} } // Create provides a mock function for the type TokenStore func (_mock *TokenStore) Create(ctx context.Context, token domain.Token) error { ret := _mock.Called(ctx, token) if len(ret) == 0 { panic("no return value specified for Create") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Token) error); ok { r0 = returnFunc(ctx, token) } else { r0 = ret.Error(0) } return r0 } // TokenStore_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' type TokenStore_Create_Call struct { *mock.Call } // Create is a helper method to define mock.On call // - ctx context.Context // - token domain.Token func (_e *TokenStore_Expecter) Create(ctx any, token any) *TokenStore_Create_Call { return &TokenStore_Create_Call{Call: _e.mock.On("Create", ctx, token)} } func (_c *TokenStore_Create_Call) Run(run func(ctx context.Context, token domain.Token)) *TokenStore_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.Token if args[1] != nil { arg1 = args[1].(domain.Token) } run( arg0, arg1, ) }) return _c } func (_c *TokenStore_Create_Call) Return(err error) *TokenStore_Create_Call { _c.Call.Return(err) return _c } func (_c *TokenStore_Create_Call) RunAndReturn(run func(ctx context.Context, token domain.Token) error) *TokenStore_Create_Call { _c.Call.Return(run) return _c } // FindByHash provides a mock function for the type TokenStore func (_mock *TokenStore) FindByHash(ctx context.Context, hash domain.TokenHash) (domain.Token, error) { ret := _mock.Called(ctx, hash) if len(ret) == 0 { panic("no return value specified for FindByHash") } var r0 domain.Token var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.TokenHash) (domain.Token, error)); ok { return returnFunc(ctx, hash) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.TokenHash) domain.Token); ok { r0 = returnFunc(ctx, hash) } else { r0 = ret.Get(0).(domain.Token) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.TokenHash) error); ok { r1 = returnFunc(ctx, hash) } else { r1 = ret.Error(1) } return r0, r1 } // TokenStore_FindByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByHash' type TokenStore_FindByHash_Call struct { *mock.Call } // FindByHash is a helper method to define mock.On call // - ctx context.Context // - hash domain.TokenHash func (_e *TokenStore_Expecter) FindByHash(ctx any, hash any) *TokenStore_FindByHash_Call { return &TokenStore_FindByHash_Call{Call: _e.mock.On("FindByHash", ctx, hash)} } func (_c *TokenStore_FindByHash_Call) Run(run func(ctx context.Context, hash domain.TokenHash)) *TokenStore_FindByHash_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.TokenHash if args[1] != nil { arg1 = args[1].(domain.TokenHash) } run( arg0, arg1, ) }) return _c } func (_c *TokenStore_FindByHash_Call) Return(token domain.Token, err error) *TokenStore_FindByHash_Call { _c.Call.Return(token, err) return _c } func (_c *TokenStore_FindByHash_Call) RunAndReturn(run func(ctx context.Context, hash domain.TokenHash) (domain.Token, error)) *TokenStore_FindByHash_Call { _c.Call.Return(run) return _c } // Get provides a mock function for the type TokenStore func (_mock *TokenStore) Get(ctx context.Context, id string) (domain.Token, error) { ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for Get") } var r0 domain.Token var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) (domain.Token, error)); ok { return returnFunc(ctx, id) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) domain.Token); ok { r0 = returnFunc(ctx, id) } else { r0 = ret.Get(0).(domain.Token) } if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = returnFunc(ctx, id) } else { r1 = ret.Error(1) } return r0, r1 } // TokenStore_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type TokenStore_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - ctx context.Context // - id string func (_e *TokenStore_Expecter) Get(ctx any, id any) *TokenStore_Get_Call { return &TokenStore_Get_Call{Call: _e.mock.On("Get", ctx, id)} } func (_c *TokenStore_Get_Call) Run(run func(ctx context.Context, id string)) *TokenStore_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *TokenStore_Get_Call) Return(token domain.Token, err error) *TokenStore_Get_Call { _c.Call.Return(token, err) return _c } func (_c *TokenStore_Get_Call) RunAndReturn(run func(ctx context.Context, id string) (domain.Token, error)) *TokenStore_Get_Call { _c.Call.Return(run) return _c } // List provides a mock function for the type TokenStore func (_mock *TokenStore) List(ctx context.Context) ([]domain.Token, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for List") } var r0 []domain.Token var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) ([]domain.Token, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) []domain.Token); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.Token) } } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // TokenStore_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' type TokenStore_List_Call struct { *mock.Call } // List is a helper method to define mock.On call // - ctx context.Context func (_e *TokenStore_Expecter) List(ctx any) *TokenStore_List_Call { return &TokenStore_List_Call{Call: _e.mock.On("List", ctx)} } func (_c *TokenStore_List_Call) Run(run func(ctx context.Context)) *TokenStore_List_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 *TokenStore_List_Call) Return(tokens []domain.Token, err error) *TokenStore_List_Call { _c.Call.Return(tokens, err) return _c } func (_c *TokenStore_List_Call) RunAndReturn(run func(ctx context.Context) ([]domain.Token, error)) *TokenStore_List_Call { _c.Call.Return(run) return _c } // Revoke provides a mock function for the type TokenStore func (_mock *TokenStore) Revoke(ctx context.Context, id string) error { ret := _mock.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for Revoke") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { r0 = returnFunc(ctx, id) } else { r0 = ret.Error(0) } return r0 } // TokenStore_Revoke_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revoke' type TokenStore_Revoke_Call struct { *mock.Call } // Revoke is a helper method to define mock.On call // - ctx context.Context // - id string func (_e *TokenStore_Expecter) Revoke(ctx any, id any) *TokenStore_Revoke_Call { return &TokenStore_Revoke_Call{Call: _e.mock.On("Revoke", ctx, id)} } func (_c *TokenStore_Revoke_Call) Run(run func(ctx context.Context, id string)) *TokenStore_Revoke_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *TokenStore_Revoke_Call) Return(err error) *TokenStore_Revoke_Call { _c.Call.Return(err) return _c } func (_c *TokenStore_Revoke_Call) RunAndReturn(run func(ctx context.Context, id string) error) *TokenStore_Revoke_Call { _c.Call.Return(run) return _c } // Touch provides a mock function for the type TokenStore func (_mock *TokenStore) Touch(ctx context.Context, id string, at time.Time) error { ret := _mock.Called(ctx, id, at) if len(ret) == 0 { panic("no return value specified for Touch") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, time.Time) error); ok { r0 = returnFunc(ctx, id, at) } else { r0 = ret.Error(0) } return r0 } // TokenStore_Touch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Touch' type TokenStore_Touch_Call struct { *mock.Call } // Touch is a helper method to define mock.On call // - ctx context.Context // - id string // - at time.Time func (_e *TokenStore_Expecter) Touch(ctx any, id any, at any) *TokenStore_Touch_Call { return &TokenStore_Touch_Call{Call: _e.mock.On("Touch", ctx, id, at)} } func (_c *TokenStore_Touch_Call) Run(run func(ctx context.Context, id string, at time.Time)) *TokenStore_Touch_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } var arg2 time.Time if args[2] != nil { arg2 = args[2].(time.Time) } run( arg0, arg1, arg2, ) }) return _c } func (_c *TokenStore_Touch_Call) Return(err error) *TokenStore_Touch_Call { _c.Call.Return(err) return _c } func (_c *TokenStore_Touch_Call) RunAndReturn(run func(ctx context.Context, id string, at time.Time) error) *TokenStore_Touch_Call { _c.Call.Return(run) return _c }