diff --git a/mocks/biz/CacheRepo.go b/mocks/biz/CacheRepo.go index 75b07e8c..b0b2a311 100644 --- a/mocks/biz/CacheRepo.go +++ b/mocks/biz/CacheRepo.go @@ -228,6 +228,51 @@ func (_c *CacheRepo_UpdateCategories_Call) RunAndReturn(run func() error) *Cache return _c } +// UpdateEnvironments provides a mock function with no fields +func (_m *CacheRepo) UpdateEnvironments() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for UpdateEnvironments") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// CacheRepo_UpdateEnvironments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateEnvironments' +type CacheRepo_UpdateEnvironments_Call struct { + *mock.Call +} + +// UpdateEnvironments is a helper method to define mock.On call +func (_e *CacheRepo_Expecter) UpdateEnvironments() *CacheRepo_UpdateEnvironments_Call { + return &CacheRepo_UpdateEnvironments_Call{Call: _e.mock.On("UpdateEnvironments")} +} + +func (_c *CacheRepo_UpdateEnvironments_Call) Run(run func()) *CacheRepo_UpdateEnvironments_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CacheRepo_UpdateEnvironments_Call) Return(_a0 error) *CacheRepo_UpdateEnvironments_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CacheRepo_UpdateEnvironments_Call) RunAndReturn(run func() error) *CacheRepo_UpdateEnvironments_Call { + _c.Call.Return(run) + return _c +} + // UpdateRewrites provides a mock function with no fields func (_m *CacheRepo) UpdateRewrites() error { ret := _m.Called() diff --git a/mocks/biz/EnvironmentRepo.go b/mocks/biz/EnvironmentRepo.go new file mode 100644 index 00000000..fe2f703c --- /dev/null +++ b/mocks/biz/EnvironmentRepo.go @@ -0,0 +1,381 @@ +// Code generated by mockery. DO NOT EDIT. + +package biz + +import ( + api "github.com/acepanel/panel/pkg/api" + + mock "github.com/stretchr/testify/mock" + + types "github.com/acepanel/panel/pkg/types" +) + +// EnvironmentRepo is an autogenerated mock type for the EnvironmentRepo type +type EnvironmentRepo struct { + mock.Mock +} + +type EnvironmentRepo_Expecter struct { + mock *mock.Mock +} + +func (_m *EnvironmentRepo) EXPECT() *EnvironmentRepo_Expecter { + return &EnvironmentRepo_Expecter{mock: &_m.Mock} +} + +// All provides a mock function with given fields: typ +func (_m *EnvironmentRepo) All(typ ...string) api.Environments { + _va := make([]interface{}, len(typ)) + for _i := range typ { + _va[_i] = typ[_i] + } + var _ca []interface{} + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for All") + } + + var r0 api.Environments + if rf, ok := ret.Get(0).(func(...string) api.Environments); ok { + r0 = rf(typ...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.Environments) + } + } + + return r0 +} + +// EnvironmentRepo_All_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'All' +type EnvironmentRepo_All_Call struct { + *mock.Call +} + +// All is a helper method to define mock.On call +// - typ ...string +func (_e *EnvironmentRepo_Expecter) All(typ ...interface{}) *EnvironmentRepo_All_Call { + return &EnvironmentRepo_All_Call{Call: _e.mock.On("All", + append([]interface{}{}, typ...)...)} +} + +func (_c *EnvironmentRepo_All_Call) Run(run func(typ ...string)) *EnvironmentRepo_All_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *EnvironmentRepo_All_Call) Return(_a0 api.Environments) *EnvironmentRepo_All_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EnvironmentRepo_All_Call) RunAndReturn(run func(...string) api.Environments) *EnvironmentRepo_All_Call { + _c.Call.Return(run) + return _c +} + +// HasUpdate provides a mock function with given fields: typ, slug +func (_m *EnvironmentRepo) HasUpdate(typ string, slug string) bool { + ret := _m.Called(typ, slug) + + if len(ret) == 0 { + panic("no return value specified for HasUpdate") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(string, string) bool); ok { + r0 = rf(typ, slug) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// EnvironmentRepo_HasUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasUpdate' +type EnvironmentRepo_HasUpdate_Call struct { + *mock.Call +} + +// HasUpdate is a helper method to define mock.On call +// - typ string +// - slug string +func (_e *EnvironmentRepo_Expecter) HasUpdate(typ interface{}, slug interface{}) *EnvironmentRepo_HasUpdate_Call { + return &EnvironmentRepo_HasUpdate_Call{Call: _e.mock.On("HasUpdate", typ, slug)} +} + +func (_c *EnvironmentRepo_HasUpdate_Call) Run(run func(typ string, slug string)) *EnvironmentRepo_HasUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *EnvironmentRepo_HasUpdate_Call) Return(_a0 bool) *EnvironmentRepo_HasUpdate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EnvironmentRepo_HasUpdate_Call) RunAndReturn(run func(string, string) bool) *EnvironmentRepo_HasUpdate_Call { + _c.Call.Return(run) + return _c +} + +// Install provides a mock function with given fields: typ, slug +func (_m *EnvironmentRepo) Install(typ string, slug string) error { + ret := _m.Called(typ, slug) + + if len(ret) == 0 { + panic("no return value specified for Install") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string) error); ok { + r0 = rf(typ, slug) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// EnvironmentRepo_Install_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Install' +type EnvironmentRepo_Install_Call struct { + *mock.Call +} + +// Install is a helper method to define mock.On call +// - typ string +// - slug string +func (_e *EnvironmentRepo_Expecter) Install(typ interface{}, slug interface{}) *EnvironmentRepo_Install_Call { + return &EnvironmentRepo_Install_Call{Call: _e.mock.On("Install", typ, slug)} +} + +func (_c *EnvironmentRepo_Install_Call) Run(run func(typ string, slug string)) *EnvironmentRepo_Install_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *EnvironmentRepo_Install_Call) Return(_a0 error) *EnvironmentRepo_Install_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EnvironmentRepo_Install_Call) RunAndReturn(run func(string, string) error) *EnvironmentRepo_Install_Call { + _c.Call.Return(run) + return _c +} + +// IsInstalled provides a mock function with given fields: typ, slug +func (_m *EnvironmentRepo) IsInstalled(typ string, slug string) bool { + ret := _m.Called(typ, slug) + + if len(ret) == 0 { + panic("no return value specified for IsInstalled") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(string, string) bool); ok { + r0 = rf(typ, slug) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// EnvironmentRepo_IsInstalled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsInstalled' +type EnvironmentRepo_IsInstalled_Call struct { + *mock.Call +} + +// IsInstalled is a helper method to define mock.On call +// - typ string +// - slug string +func (_e *EnvironmentRepo_Expecter) IsInstalled(typ interface{}, slug interface{}) *EnvironmentRepo_IsInstalled_Call { + return &EnvironmentRepo_IsInstalled_Call{Call: _e.mock.On("IsInstalled", typ, slug)} +} + +func (_c *EnvironmentRepo_IsInstalled_Call) Run(run func(typ string, slug string)) *EnvironmentRepo_IsInstalled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *EnvironmentRepo_IsInstalled_Call) Return(_a0 bool) *EnvironmentRepo_IsInstalled_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EnvironmentRepo_IsInstalled_Call) RunAndReturn(run func(string, string) bool) *EnvironmentRepo_IsInstalled_Call { + _c.Call.Return(run) + return _c +} + +// Types provides a mock function with no fields +func (_m *EnvironmentRepo) Types() []types.LV { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Types") + } + + var r0 []types.LV + if rf, ok := ret.Get(0).(func() []types.LV); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]types.LV) + } + } + + return r0 +} + +// EnvironmentRepo_Types_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Types' +type EnvironmentRepo_Types_Call struct { + *mock.Call +} + +// Types is a helper method to define mock.On call +func (_e *EnvironmentRepo_Expecter) Types() *EnvironmentRepo_Types_Call { + return &EnvironmentRepo_Types_Call{Call: _e.mock.On("Types")} +} + +func (_c *EnvironmentRepo_Types_Call) Run(run func()) *EnvironmentRepo_Types_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EnvironmentRepo_Types_Call) Return(_a0 []types.LV) *EnvironmentRepo_Types_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EnvironmentRepo_Types_Call) RunAndReturn(run func() []types.LV) *EnvironmentRepo_Types_Call { + _c.Call.Return(run) + return _c +} + +// Uninstall provides a mock function with given fields: typ, slug +func (_m *EnvironmentRepo) Uninstall(typ string, slug string) error { + ret := _m.Called(typ, slug) + + if len(ret) == 0 { + panic("no return value specified for Uninstall") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string) error); ok { + r0 = rf(typ, slug) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// EnvironmentRepo_Uninstall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Uninstall' +type EnvironmentRepo_Uninstall_Call struct { + *mock.Call +} + +// Uninstall is a helper method to define mock.On call +// - typ string +// - slug string +func (_e *EnvironmentRepo_Expecter) Uninstall(typ interface{}, slug interface{}) *EnvironmentRepo_Uninstall_Call { + return &EnvironmentRepo_Uninstall_Call{Call: _e.mock.On("Uninstall", typ, slug)} +} + +func (_c *EnvironmentRepo_Uninstall_Call) Run(run func(typ string, slug string)) *EnvironmentRepo_Uninstall_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *EnvironmentRepo_Uninstall_Call) Return(_a0 error) *EnvironmentRepo_Uninstall_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EnvironmentRepo_Uninstall_Call) RunAndReturn(run func(string, string) error) *EnvironmentRepo_Uninstall_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function with given fields: typ, slug +func (_m *EnvironmentRepo) Update(typ string, slug string) error { + ret := _m.Called(typ, slug) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string) error); ok { + r0 = rf(typ, slug) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// EnvironmentRepo_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type EnvironmentRepo_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - typ string +// - slug string +func (_e *EnvironmentRepo_Expecter) Update(typ interface{}, slug interface{}) *EnvironmentRepo_Update_Call { + return &EnvironmentRepo_Update_Call{Call: _e.mock.On("Update", typ, slug)} +} + +func (_c *EnvironmentRepo_Update_Call) Run(run func(typ string, slug string)) *EnvironmentRepo_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *EnvironmentRepo_Update_Call) Return(_a0 error) *EnvironmentRepo_Update_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EnvironmentRepo_Update_Call) RunAndReturn(run func(string, string) error) *EnvironmentRepo_Update_Call { + _c.Call.Return(run) + return _c +} + +// NewEnvironmentRepo creates a new instance of EnvironmentRepo. 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 NewEnvironmentRepo(t interface { + mock.TestingT + Cleanup(func()) +}) *EnvironmentRepo { + mock := &EnvironmentRepo{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}