// 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" ) // NewTrustedKeyService creates a new instance of TrustedKeyService. 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 NewTrustedKeyService(t interface { mock.TestingT Cleanup(func()) }) *TrustedKeyService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &TrustedKeyService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // TrustedKeyService is an autogenerated mock type for the TrustedKeyService type type TrustedKeyService struct { mock.Mock } type TrustedKeyService_Expecter struct { mock *mock.Mock } func (_m *TrustedKeyService) EXPECT() *TrustedKeyService_Expecter { return &TrustedKeyService_Expecter{mock: &_m.Mock} } // AddTrustedKey provides a mock function for the type TrustedKeyService func (_mock *TrustedKeyService) AddTrustedKey(ctx context.Context, p domain.Principal, format domain.SignatureFormat, title string, publicKey string, emails []string) (domain.TrustedKey, error) { ret := _mock.Called(ctx, p, format, title, publicKey, emails) if len(ret) == 0 { panic("no return value specified for AddTrustedKey") } var r0 domain.TrustedKey var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SignatureFormat, string, string, []string) (domain.TrustedKey, error)); ok { return returnFunc(ctx, p, format, title, publicKey, emails) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SignatureFormat, string, string, []string) domain.TrustedKey); ok { r0 = returnFunc(ctx, p, format, title, publicKey, emails) } else { r0 = ret.Get(0).(domain.TrustedKey) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.SignatureFormat, string, string, []string) error); ok { r1 = returnFunc(ctx, p, format, title, publicKey, emails) } else { r1 = ret.Error(1) } return r0, r1 } // TrustedKeyService_AddTrustedKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddTrustedKey' type TrustedKeyService_AddTrustedKey_Call struct { *mock.Call } // AddTrustedKey is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - format domain.SignatureFormat // - title string // - publicKey string // - emails []string func (_e *TrustedKeyService_Expecter) AddTrustedKey(ctx any, p any, format any, title any, publicKey any, emails any) *TrustedKeyService_AddTrustedKey_Call { return &TrustedKeyService_AddTrustedKey_Call{Call: _e.mock.On("AddTrustedKey", ctx, p, format, title, publicKey, emails)} } func (_c *TrustedKeyService_AddTrustedKey_Call) Run(run func(ctx context.Context, p domain.Principal, format domain.SignatureFormat, title string, publicKey string, emails []string)) *TrustedKeyService_AddTrustedKey_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 domain.SignatureFormat if args[2] != nil { arg2 = args[2].(domain.SignatureFormat) } var arg3 string if args[3] != nil { arg3 = args[3].(string) } var arg4 string if args[4] != nil { arg4 = args[4].(string) } var arg5 []string if args[5] != nil { arg5 = args[5].([]string) } run( arg0, arg1, arg2, arg3, arg4, arg5, ) }) return _c } func (_c *TrustedKeyService_AddTrustedKey_Call) Return(trustedKey domain.TrustedKey, err error) *TrustedKeyService_AddTrustedKey_Call { _c.Call.Return(trustedKey, err) return _c } func (_c *TrustedKeyService_AddTrustedKey_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, format domain.SignatureFormat, title string, publicKey string, emails []string) (domain.TrustedKey, error)) *TrustedKeyService_AddTrustedKey_Call { _c.Call.Return(run) return _c } // ListTrustedKeys provides a mock function for the type TrustedKeyService func (_mock *TrustedKeyService) ListTrustedKeys(ctx context.Context, p domain.Principal) ([]domain.TrustedKey, error) { ret := _mock.Called(ctx, p) if len(ret) == 0 { panic("no return value specified for ListTrustedKeys") } var r0 []domain.TrustedKey var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) ([]domain.TrustedKey, error)); ok { return returnFunc(ctx, p) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) []domain.TrustedKey); ok { r0 = returnFunc(ctx, p) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.TrustedKey) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal) error); ok { r1 = returnFunc(ctx, p) } else { r1 = ret.Error(1) } return r0, r1 } // TrustedKeyService_ListTrustedKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTrustedKeys' type TrustedKeyService_ListTrustedKeys_Call struct { *mock.Call } // ListTrustedKeys is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal func (_e *TrustedKeyService_Expecter) ListTrustedKeys(ctx any, p any) *TrustedKeyService_ListTrustedKeys_Call { return &TrustedKeyService_ListTrustedKeys_Call{Call: _e.mock.On("ListTrustedKeys", ctx, p)} } func (_c *TrustedKeyService_ListTrustedKeys_Call) Run(run func(ctx context.Context, p domain.Principal)) *TrustedKeyService_ListTrustedKeys_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 *TrustedKeyService_ListTrustedKeys_Call) Return(trustedKeys []domain.TrustedKey, err error) *TrustedKeyService_ListTrustedKeys_Call { _c.Call.Return(trustedKeys, err) return _c } func (_c *TrustedKeyService_ListTrustedKeys_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal) ([]domain.TrustedKey, error)) *TrustedKeyService_ListTrustedKeys_Call { _c.Call.Return(run) return _c } // RemoveTrustedKey provides a mock function for the type TrustedKeyService func (_mock *TrustedKeyService) RemoveTrustedKey(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 RemoveTrustedKey") } 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 } // TrustedKeyService_RemoveTrustedKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveTrustedKey' type TrustedKeyService_RemoveTrustedKey_Call struct { *mock.Call } // RemoveTrustedKey is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - id string func (_e *TrustedKeyService_Expecter) RemoveTrustedKey(ctx any, p any, id any) *TrustedKeyService_RemoveTrustedKey_Call { return &TrustedKeyService_RemoveTrustedKey_Call{Call: _e.mock.On("RemoveTrustedKey", ctx, p, id)} } func (_c *TrustedKeyService_RemoveTrustedKey_Call) Run(run func(ctx context.Context, p domain.Principal, id string)) *TrustedKeyService_RemoveTrustedKey_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 *TrustedKeyService_RemoveTrustedKey_Call) Return(err error) *TrustedKeyService_RemoveTrustedKey_Call { _c.Call.Return(err) return _c } func (_c *TrustedKeyService_RemoveTrustedKey_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, id string) error) *TrustedKeyService_RemoveTrustedKey_Call { _c.Call.Return(run) return _c }