// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "github.com/bnema/dumber/internal/domain/entity" mock "github.com/stretchr/testify/mock" ) // NewMockPermissionRepository creates a new instance of MockPermissionRepository. 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 NewMockPermissionRepository(t interface { mock.TestingT Cleanup(func()) }) *MockPermissionRepository { mock := &MockPermissionRepository{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockPermissionRepository is an autogenerated mock type for the PermissionRepository type type MockPermissionRepository struct { mock.Mock } type MockPermissionRepository_Expecter struct { mock *mock.Mock } func (_m *MockPermissionRepository) EXPECT() *MockPermissionRepository_Expecter { return &MockPermissionRepository_Expecter{mock: &_m.Mock} } // Delete provides a mock function for the type MockPermissionRepository func (_mock *MockPermissionRepository) Delete(ctx context.Context, origin string, permType entity.PermissionType) error { ret := _mock.Called(ctx, origin, permType) if len(ret) == 0 { panic("no return value specified for Delete") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, entity.PermissionType) error); ok { r0 = returnFunc(ctx, origin, permType) } else { r0 = ret.Error(0) } return r0 } // MockPermissionRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' type MockPermissionRepository_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - ctx context.Context // - origin string // - permType entity.PermissionType func (_e *MockPermissionRepository_Expecter) Delete(ctx any, origin any, permType any) *MockPermissionRepository_Delete_Call { return &MockPermissionRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, origin, permType)} } func (_c *MockPermissionRepository_Delete_Call) Run(run func(ctx context.Context, origin string, permType entity.PermissionType)) *MockPermissionRepository_Delete_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 entity.PermissionType if args[2] != nil { arg2 = args[2].(entity.PermissionType) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MockPermissionRepository_Delete_Call) Return(err error) *MockPermissionRepository_Delete_Call { _c.Call.Return(err) return _c } func (_c *MockPermissionRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, origin string, permType entity.PermissionType) error) *MockPermissionRepository_Delete_Call { _c.Call.Return(run) return _c } // Get provides a mock function for the type MockPermissionRepository func (_mock *MockPermissionRepository) Get(ctx context.Context, origin string, permType entity.PermissionType) (*entity.PermissionRecord, error) { ret := _mock.Called(ctx, origin, permType) if len(ret) == 0 { panic("no return value specified for Get") } var r0 *entity.PermissionRecord var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, entity.PermissionType) (*entity.PermissionRecord, error)); ok { return returnFunc(ctx, origin, permType) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, entity.PermissionType) *entity.PermissionRecord); ok { r0 = returnFunc(ctx, origin, permType) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*entity.PermissionRecord) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string, entity.PermissionType) error); ok { r1 = returnFunc(ctx, origin, permType) } else { r1 = ret.Error(1) } return r0, r1 } // MockPermissionRepository_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockPermissionRepository_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - ctx context.Context // - origin string // - permType entity.PermissionType func (_e *MockPermissionRepository_Expecter) Get(ctx any, origin any, permType any) *MockPermissionRepository_Get_Call { return &MockPermissionRepository_Get_Call{Call: _e.mock.On("Get", ctx, origin, permType)} } func (_c *MockPermissionRepository_Get_Call) Run(run func(ctx context.Context, origin string, permType entity.PermissionType)) *MockPermissionRepository_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) } var arg2 entity.PermissionType if args[2] != nil { arg2 = args[2].(entity.PermissionType) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MockPermissionRepository_Get_Call) Return(permissionRecord *entity.PermissionRecord, err error) *MockPermissionRepository_Get_Call { _c.Call.Return(permissionRecord, err) return _c } func (_c *MockPermissionRepository_Get_Call) RunAndReturn(run func(ctx context.Context, origin string, permType entity.PermissionType) (*entity.PermissionRecord, error)) *MockPermissionRepository_Get_Call { _c.Call.Return(run) return _c } // GetAll provides a mock function for the type MockPermissionRepository func (_mock *MockPermissionRepository) GetAll(ctx context.Context, origin string) ([]*entity.PermissionRecord, error) { ret := _mock.Called(ctx, origin) if len(ret) == 0 { panic("no return value specified for GetAll") } var r0 []*entity.PermissionRecord var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*entity.PermissionRecord, error)); ok { return returnFunc(ctx, origin) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*entity.PermissionRecord); ok { r0 = returnFunc(ctx, origin) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*entity.PermissionRecord) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = returnFunc(ctx, origin) } else { r1 = ret.Error(1) } return r0, r1 } // MockPermissionRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' type MockPermissionRepository_GetAll_Call struct { *mock.Call } // GetAll is a helper method to define mock.On call // - ctx context.Context // - origin string func (_e *MockPermissionRepository_Expecter) GetAll(ctx any, origin any) *MockPermissionRepository_GetAll_Call { return &MockPermissionRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx, origin)} } func (_c *MockPermissionRepository_GetAll_Call) Run(run func(ctx context.Context, origin string)) *MockPermissionRepository_GetAll_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 *MockPermissionRepository_GetAll_Call) Return(permissionRecords []*entity.PermissionRecord, err error) *MockPermissionRepository_GetAll_Call { _c.Call.Return(permissionRecords, err) return _c } func (_c *MockPermissionRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context, origin string) ([]*entity.PermissionRecord, error)) *MockPermissionRepository_GetAll_Call { _c.Call.Return(run) return _c } // Set provides a mock function for the type MockPermissionRepository func (_mock *MockPermissionRepository) Set(ctx context.Context, record *entity.PermissionRecord) error { ret := _mock.Called(ctx, record) if len(ret) == 0 { panic("no return value specified for Set") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.PermissionRecord) error); ok { r0 = returnFunc(ctx, record) } else { r0 = ret.Error(0) } return r0 } // MockPermissionRepository_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' type MockPermissionRepository_Set_Call struct { *mock.Call } // Set is a helper method to define mock.On call // - ctx context.Context // - record *entity.PermissionRecord func (_e *MockPermissionRepository_Expecter) Set(ctx any, record any) *MockPermissionRepository_Set_Call { return &MockPermissionRepository_Set_Call{Call: _e.mock.On("Set", ctx, record)} } func (_c *MockPermissionRepository_Set_Call) Run(run func(ctx context.Context, record *entity.PermissionRecord)) *MockPermissionRepository_Set_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 *entity.PermissionRecord if args[1] != nil { arg1 = args[1].(*entity.PermissionRecord) } run( arg0, arg1, ) }) return _c } func (_c *MockPermissionRepository_Set_Call) Return(err error) *MockPermissionRepository_Set_Call { _c.Call.Return(err) return _c } func (_c *MockPermissionRepository_Set_Call) RunAndReturn(run func(ctx context.Context, record *entity.PermissionRecord) error) *MockPermissionRepository_Set_Call { _c.Call.Return(run) return _c }