From e35e68445c52bdfecdac4a4184d69e7906e4c0bb Mon Sep 17 00:00:00 2001 From: Bujjibabukatta Date: Thu, 10 Sep 2026 15:40:42 +0530 Subject: [PATCH] fix(build): commit generated mocks so fresh clones work with plain Go tooling --- .github/workflows/test.yml | 6 + .gitignore | 1 - backend/mocks/core/config/ConfigReader.go | 859 ++++++ backend/mocks/core/context/BasicRes.go | 335 +++ backend/mocks/core/dal/ColumnMeta.go | 655 +++++ backend/mocks/core/dal/Dal.go | 2343 +++++++++++++++ backend/mocks/core/dal/Rows.go | 340 +++ backend/mocks/core/dal/Tabler.go | 80 + backend/mocks/core/dal/Transaction.go | 2534 +++++++++++++++++ backend/mocks/core/errors/Error.go | 316 ++ .../mocks/core/errors/requiredSupertype.go | 124 + backend/mocks/core/log/Logger.go | 569 ++++ backend/mocks/core/models/DynamicTabler.go | 570 ++++ .../core/models/common/GetRawDataOrigin.go | 83 + .../core/models/common/ScopeConfigOperator.go | 83 + .../core/plugin/AccessTokenAuthenticator.go | 83 + backend/mocks/core/plugin/ApiAuthenticator.go | 92 + backend/mocks/core/plugin/ApiClient.go | 510 ++++ backend/mocks/core/plugin/ApiConnection.go | 168 ++ backend/mocks/core/plugin/ApiGroup.go | 124 + backend/mocks/core/plugin/ApiScope.go | 83 + .../mocks/core/plugin/AppKeyAuthenticator.go | 83 + .../mocks/core/plugin/BasicAuthenticator.go | 83 + .../mocks/core/plugin/CacheableConnection.go | 212 ++ .../mocks/core/plugin/CloseablePluginTask.go | 207 ++ .../CompositeDataSourcePluginBlueprintV200.go | 249 ++ .../CompositeMetricPluginBlueprintV200.go | 242 ++ .../plugin/CompositePluginBlueprintV200.go | 321 +++ .../core/plugin/CompositeProjectMapper.go | 241 ++ .../mocks/core/plugin/ConnectionValidator.go | 97 + .../plugin/DataSourcePluginBlueprintV200.go | 117 + backend/mocks/core/plugin/ExecContext.go | 603 ++++ .../core/plugin/MetricPluginBlueprintV200.go | 110 + backend/mocks/core/plugin/MigrationScript.go | 179 ++ backend/mocks/core/plugin/Migrator.go | 174 ++ .../mocks/core/plugin/MultiAuthenticator.go | 80 + backend/mocks/core/plugin/PluginApi.go | 83 + backend/mocks/core/plugin/PluginDashboard.go | 83 + .../mocks/core/plugin/PluginDeprecation.go | 80 + backend/mocks/core/plugin/PluginIcon.go | 80 + backend/mocks/core/plugin/PluginInit.go | 91 + backend/mocks/core/plugin/PluginMeta.go | 168 ++ backend/mocks/core/plugin/PluginMetric.go | 241 ++ backend/mocks/core/plugin/PluginMigration.go | 83 + backend/mocks/core/plugin/PluginModel.go | 83 + .../mocks/core/plugin/PluginOpenApiSpec.go | 80 + backend/mocks/core/plugin/PluginSource.go | 176 ++ backend/mocks/core/plugin/PluginTask.go | 154 + backend/mocks/core/plugin/PrepareApiClient.go | 91 + backend/mocks/core/plugin/ProjectMapper.go | 109 + backend/mocks/core/plugin/Scope.go | 168 ++ backend/mocks/core/plugin/SubTask.go | 83 + backend/mocks/core/plugin/SubTaskContext.go | 650 +++++ backend/mocks/core/plugin/TaskContext.go | 796 ++++++ .../core/plugin/ToolLayerApiConnection.go | 256 ++ .../mocks/core/plugin/ToolLayerConnection.go | 124 + backend/mocks/core/plugin/ToolLayerScope.go | 346 +++ .../mocks/core/plugin/ToolLayerScopeConfig.go | 168 ++ .../core/runner/mysqlMigratorInternals.go | 200 ++ .../helpers/pluginhelper/api/CustomMerge.go | 94 + .../helpers/pluginhelper/api/Iterator.go | 184 ++ .../helpers/pluginhelper/api/QueueNode.go | 168 ++ .../pluginhelper/api/RateLimitedApiClient.go | 541 ++++ .../pluginhelper/api/ScopeDatabaseHelper.go | 602 ++++ .../helpers/pluginhelper/api/TaskOptions.go | 82 + .../api/apihelperabstract/ComplexValidate.go | 83 + .../subtaskmeta/sorter/SubTaskMetaSorter.go | 95 + .../helpers/srvhelper/CustomValidator.go | 97 + 68 files changed, 19294 insertions(+), 1 deletion(-) create mode 100644 backend/mocks/core/config/ConfigReader.go create mode 100644 backend/mocks/core/context/BasicRes.go create mode 100644 backend/mocks/core/dal/ColumnMeta.go create mode 100644 backend/mocks/core/dal/Dal.go create mode 100644 backend/mocks/core/dal/Rows.go create mode 100644 backend/mocks/core/dal/Tabler.go create mode 100644 backend/mocks/core/dal/Transaction.go create mode 100644 backend/mocks/core/errors/Error.go create mode 100644 backend/mocks/core/errors/requiredSupertype.go create mode 100644 backend/mocks/core/log/Logger.go create mode 100644 backend/mocks/core/models/DynamicTabler.go create mode 100644 backend/mocks/core/models/common/GetRawDataOrigin.go create mode 100644 backend/mocks/core/models/common/ScopeConfigOperator.go create mode 100644 backend/mocks/core/plugin/AccessTokenAuthenticator.go create mode 100644 backend/mocks/core/plugin/ApiAuthenticator.go create mode 100644 backend/mocks/core/plugin/ApiClient.go create mode 100644 backend/mocks/core/plugin/ApiConnection.go create mode 100644 backend/mocks/core/plugin/ApiGroup.go create mode 100644 backend/mocks/core/plugin/ApiScope.go create mode 100644 backend/mocks/core/plugin/AppKeyAuthenticator.go create mode 100644 backend/mocks/core/plugin/BasicAuthenticator.go create mode 100644 backend/mocks/core/plugin/CacheableConnection.go create mode 100644 backend/mocks/core/plugin/CloseablePluginTask.go create mode 100644 backend/mocks/core/plugin/CompositeDataSourcePluginBlueprintV200.go create mode 100644 backend/mocks/core/plugin/CompositeMetricPluginBlueprintV200.go create mode 100644 backend/mocks/core/plugin/CompositePluginBlueprintV200.go create mode 100644 backend/mocks/core/plugin/CompositeProjectMapper.go create mode 100644 backend/mocks/core/plugin/ConnectionValidator.go create mode 100644 backend/mocks/core/plugin/DataSourcePluginBlueprintV200.go create mode 100644 backend/mocks/core/plugin/ExecContext.go create mode 100644 backend/mocks/core/plugin/MetricPluginBlueprintV200.go create mode 100644 backend/mocks/core/plugin/MigrationScript.go create mode 100644 backend/mocks/core/plugin/Migrator.go create mode 100644 backend/mocks/core/plugin/MultiAuthenticator.go create mode 100644 backend/mocks/core/plugin/PluginApi.go create mode 100644 backend/mocks/core/plugin/PluginDashboard.go create mode 100644 backend/mocks/core/plugin/PluginDeprecation.go create mode 100644 backend/mocks/core/plugin/PluginIcon.go create mode 100644 backend/mocks/core/plugin/PluginInit.go create mode 100644 backend/mocks/core/plugin/PluginMeta.go create mode 100644 backend/mocks/core/plugin/PluginMetric.go create mode 100644 backend/mocks/core/plugin/PluginMigration.go create mode 100644 backend/mocks/core/plugin/PluginModel.go create mode 100644 backend/mocks/core/plugin/PluginOpenApiSpec.go create mode 100644 backend/mocks/core/plugin/PluginSource.go create mode 100644 backend/mocks/core/plugin/PluginTask.go create mode 100644 backend/mocks/core/plugin/PrepareApiClient.go create mode 100644 backend/mocks/core/plugin/ProjectMapper.go create mode 100644 backend/mocks/core/plugin/Scope.go create mode 100644 backend/mocks/core/plugin/SubTask.go create mode 100644 backend/mocks/core/plugin/SubTaskContext.go create mode 100644 backend/mocks/core/plugin/TaskContext.go create mode 100644 backend/mocks/core/plugin/ToolLayerApiConnection.go create mode 100644 backend/mocks/core/plugin/ToolLayerConnection.go create mode 100644 backend/mocks/core/plugin/ToolLayerScope.go create mode 100644 backend/mocks/core/plugin/ToolLayerScopeConfig.go create mode 100644 backend/mocks/core/runner/mysqlMigratorInternals.go create mode 100644 backend/mocks/helpers/pluginhelper/api/CustomMerge.go create mode 100644 backend/mocks/helpers/pluginhelper/api/Iterator.go create mode 100644 backend/mocks/helpers/pluginhelper/api/QueueNode.go create mode 100644 backend/mocks/helpers/pluginhelper/api/RateLimitedApiClient.go create mode 100644 backend/mocks/helpers/pluginhelper/api/ScopeDatabaseHelper.go create mode 100644 backend/mocks/helpers/pluginhelper/api/TaskOptions.go create mode 100644 backend/mocks/helpers/pluginhelper/api/apihelperabstract/ComplexValidate.go create mode 100644 backend/mocks/helpers/pluginhelper/subtaskmeta/sorter/SubTaskMetaSorter.go create mode 100644 backend/mocks/helpers/srvhelper/CustomValidator.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5fe88805b49..552776be640 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,6 +53,12 @@ jobs: run: backend/scripts/install-go.sh - name: Install mockery 3.7.4 run: backend/scripts/install-mockery.sh + - name: Verify committed mocks are up to date + run: | + cd backend + make mock + git diff --exit-code -- mocks || \ + (echo "::error::backend/mocks is stale — run 'make mock' and commit the result" && exit 1) - name: Build Python run: | cd backend diff --git a/.gitignore b/.gitignore index 88f07eb195b..443a7934084 100644 --- a/.gitignore +++ b/.gitignore @@ -154,7 +154,6 @@ libgit2 .playwright-cli/ # auto generated code -backend/mocks/ backend/server/api/docs/swagger.json backend/server/api/docs/swagger.yaml backend/server/api/docs/docs.go diff --git a/backend/mocks/core/config/ConfigReader.go b/backend/mocks/core/config/ConfigReader.go new file mode 100644 index 00000000000..558f0687050 --- /dev/null +++ b/backend/mocks/core/config/ConfigReader.go @@ -0,0 +1,859 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "time" + + mock "github.com/stretchr/testify/mock" +) + +// NewConfigReader creates a new instance of ConfigReader. 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 NewConfigReader(t interface { + mock.TestingT + Cleanup(func()) +}) *ConfigReader { + mock := &ConfigReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ConfigReader is an autogenerated mock type for the ConfigReader type +type ConfigReader struct { + mock.Mock +} + +type ConfigReader_Expecter struct { + mock *mock.Mock +} + +func (_m *ConfigReader) EXPECT() *ConfigReader_Expecter { + return &ConfigReader_Expecter{mock: &_m.Mock} +} + +// AllSettings provides a mock function for the type ConfigReader +func (_mock *ConfigReader) AllSettings() map[string]interface{} { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for AllSettings") + } + + var r0 map[string]interface{} + if returnFunc, ok := ret.Get(0).(func() map[string]interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]interface{}) + } + } + return r0 +} + +// ConfigReader_AllSettings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllSettings' +type ConfigReader_AllSettings_Call struct { + *mock.Call +} + +// AllSettings is a helper method to define mock.On call +func (_e *ConfigReader_Expecter) AllSettings() *ConfigReader_AllSettings_Call { + return &ConfigReader_AllSettings_Call{Call: _e.mock.On("AllSettings")} +} + +func (_c *ConfigReader_AllSettings_Call) Run(run func()) *ConfigReader_AllSettings_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ConfigReader_AllSettings_Call) Return(stringToIfaceVal map[string]interface{}) *ConfigReader_AllSettings_Call { + _c.Call.Return(stringToIfaceVal) + return _c +} + +func (_c *ConfigReader_AllSettings_Call) RunAndReturn(run func() map[string]interface{}) *ConfigReader_AllSettings_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function for the type ConfigReader +func (_mock *ConfigReader) Get(key string) interface{} { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func(string) interface{}); ok { + r0 = returnFunc(key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// ConfigReader_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type ConfigReader_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) Get(key any) *ConfigReader_Get_Call { + return &ConfigReader_Get_Call{Call: _e.mock.On("Get", key)} +} + +func (_c *ConfigReader_Get_Call) Run(run func(key string)) *ConfigReader_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_Get_Call) Return(ifaceVal interface{}) *ConfigReader_Get_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *ConfigReader_Get_Call) RunAndReturn(run func(key string) interface{}) *ConfigReader_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetBool provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetBool(name string) bool { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetBool") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(string) bool); ok { + r0 = returnFunc(name) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// ConfigReader_GetBool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBool' +type ConfigReader_GetBool_Call struct { + *mock.Call +} + +// GetBool is a helper method to define mock.On call +// - name string +func (_e *ConfigReader_Expecter) GetBool(name any) *ConfigReader_GetBool_Call { + return &ConfigReader_GetBool_Call{Call: _e.mock.On("GetBool", name)} +} + +func (_c *ConfigReader_GetBool_Call) Run(run func(name string)) *ConfigReader_GetBool_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetBool_Call) Return(b bool) *ConfigReader_GetBool_Call { + _c.Call.Return(b) + return _c +} + +func (_c *ConfigReader_GetBool_Call) RunAndReturn(run func(name string) bool) *ConfigReader_GetBool_Call { + _c.Call.Return(run) + return _c +} + +// GetDuration provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetDuration(key string) time.Duration { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetDuration") + } + + var r0 time.Duration + if returnFunc, ok := ret.Get(0).(func(string) time.Duration); ok { + r0 = returnFunc(key) + } else { + r0 = ret.Get(0).(time.Duration) + } + return r0 +} + +// ConfigReader_GetDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDuration' +type ConfigReader_GetDuration_Call struct { + *mock.Call +} + +// GetDuration is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetDuration(key any) *ConfigReader_GetDuration_Call { + return &ConfigReader_GetDuration_Call{Call: _e.mock.On("GetDuration", key)} +} + +func (_c *ConfigReader_GetDuration_Call) Run(run func(key string)) *ConfigReader_GetDuration_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetDuration_Call) Return(duration time.Duration) *ConfigReader_GetDuration_Call { + _c.Call.Return(duration) + return _c +} + +func (_c *ConfigReader_GetDuration_Call) RunAndReturn(run func(key string) time.Duration) *ConfigReader_GetDuration_Call { + _c.Call.Return(run) + return _c +} + +// GetFloat64 provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetFloat64(key string) float64 { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetFloat64") + } + + var r0 float64 + if returnFunc, ok := ret.Get(0).(func(string) float64); ok { + r0 = returnFunc(key) + } else { + r0 = ret.Get(0).(float64) + } + return r0 +} + +// ConfigReader_GetFloat64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFloat64' +type ConfigReader_GetFloat64_Call struct { + *mock.Call +} + +// GetFloat64 is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetFloat64(key any) *ConfigReader_GetFloat64_Call { + return &ConfigReader_GetFloat64_Call{Call: _e.mock.On("GetFloat64", key)} +} + +func (_c *ConfigReader_GetFloat64_Call) Run(run func(key string)) *ConfigReader_GetFloat64_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetFloat64_Call) Return(f float64) *ConfigReader_GetFloat64_Call { + _c.Call.Return(f) + return _c +} + +func (_c *ConfigReader_GetFloat64_Call) RunAndReturn(run func(key string) float64) *ConfigReader_GetFloat64_Call { + _c.Call.Return(run) + return _c +} + +// GetInt provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetInt(key string) int { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetInt") + } + + var r0 int + if returnFunc, ok := ret.Get(0).(func(string) int); ok { + r0 = returnFunc(key) + } else { + r0 = ret.Get(0).(int) + } + return r0 +} + +// ConfigReader_GetInt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInt' +type ConfigReader_GetInt_Call struct { + *mock.Call +} + +// GetInt is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetInt(key any) *ConfigReader_GetInt_Call { + return &ConfigReader_GetInt_Call{Call: _e.mock.On("GetInt", key)} +} + +func (_c *ConfigReader_GetInt_Call) Run(run func(key string)) *ConfigReader_GetInt_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetInt_Call) Return(n int) *ConfigReader_GetInt_Call { + _c.Call.Return(n) + return _c +} + +func (_c *ConfigReader_GetInt_Call) RunAndReturn(run func(key string) int) *ConfigReader_GetInt_Call { + _c.Call.Return(run) + return _c +} + +// GetInt64 provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetInt64(key string) int64 { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetInt64") + } + + var r0 int64 + if returnFunc, ok := ret.Get(0).(func(string) int64); ok { + r0 = returnFunc(key) + } else { + r0 = ret.Get(0).(int64) + } + return r0 +} + +// ConfigReader_GetInt64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInt64' +type ConfigReader_GetInt64_Call struct { + *mock.Call +} + +// GetInt64 is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetInt64(key any) *ConfigReader_GetInt64_Call { + return &ConfigReader_GetInt64_Call{Call: _e.mock.On("GetInt64", key)} +} + +func (_c *ConfigReader_GetInt64_Call) Run(run func(key string)) *ConfigReader_GetInt64_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetInt64_Call) Return(n int64) *ConfigReader_GetInt64_Call { + _c.Call.Return(n) + return _c +} + +func (_c *ConfigReader_GetInt64_Call) RunAndReturn(run func(key string) int64) *ConfigReader_GetInt64_Call { + _c.Call.Return(run) + return _c +} + +// GetIntSlice provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetIntSlice(key string) []int { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetIntSlice") + } + + var r0 []int + if returnFunc, ok := ret.Get(0).(func(string) []int); ok { + r0 = returnFunc(key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]int) + } + } + return r0 +} + +// ConfigReader_GetIntSlice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIntSlice' +type ConfigReader_GetIntSlice_Call struct { + *mock.Call +} + +// GetIntSlice is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetIntSlice(key any) *ConfigReader_GetIntSlice_Call { + return &ConfigReader_GetIntSlice_Call{Call: _e.mock.On("GetIntSlice", key)} +} + +func (_c *ConfigReader_GetIntSlice_Call) Run(run func(key string)) *ConfigReader_GetIntSlice_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetIntSlice_Call) Return(ints []int) *ConfigReader_GetIntSlice_Call { + _c.Call.Return(ints) + return _c +} + +func (_c *ConfigReader_GetIntSlice_Call) RunAndReturn(run func(key string) []int) *ConfigReader_GetIntSlice_Call { + _c.Call.Return(run) + return _c +} + +// GetString provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetString(key string) string { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetString") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func(string) string); ok { + r0 = returnFunc(key) + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ConfigReader_GetString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetString' +type ConfigReader_GetString_Call struct { + *mock.Call +} + +// GetString is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetString(key any) *ConfigReader_GetString_Call { + return &ConfigReader_GetString_Call{Call: _e.mock.On("GetString", key)} +} + +func (_c *ConfigReader_GetString_Call) Run(run func(key string)) *ConfigReader_GetString_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetString_Call) Return(s string) *ConfigReader_GetString_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ConfigReader_GetString_Call) RunAndReturn(run func(key string) string) *ConfigReader_GetString_Call { + _c.Call.Return(run) + return _c +} + +// GetStringMap provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetStringMap(key string) map[string]interface{} { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetStringMap") + } + + var r0 map[string]interface{} + if returnFunc, ok := ret.Get(0).(func(string) map[string]interface{}); ok { + r0 = returnFunc(key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]interface{}) + } + } + return r0 +} + +// ConfigReader_GetStringMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStringMap' +type ConfigReader_GetStringMap_Call struct { + *mock.Call +} + +// GetStringMap is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetStringMap(key any) *ConfigReader_GetStringMap_Call { + return &ConfigReader_GetStringMap_Call{Call: _e.mock.On("GetStringMap", key)} +} + +func (_c *ConfigReader_GetStringMap_Call) Run(run func(key string)) *ConfigReader_GetStringMap_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetStringMap_Call) Return(stringToIfaceVal map[string]interface{}) *ConfigReader_GetStringMap_Call { + _c.Call.Return(stringToIfaceVal) + return _c +} + +func (_c *ConfigReader_GetStringMap_Call) RunAndReturn(run func(key string) map[string]interface{}) *ConfigReader_GetStringMap_Call { + _c.Call.Return(run) + return _c +} + +// GetStringMapString provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetStringMapString(key string) map[string]string { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetStringMapString") + } + + var r0 map[string]string + if returnFunc, ok := ret.Get(0).(func(string) map[string]string); ok { + r0 = returnFunc(key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]string) + } + } + return r0 +} + +// ConfigReader_GetStringMapString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStringMapString' +type ConfigReader_GetStringMapString_Call struct { + *mock.Call +} + +// GetStringMapString is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetStringMapString(key any) *ConfigReader_GetStringMapString_Call { + return &ConfigReader_GetStringMapString_Call{Call: _e.mock.On("GetStringMapString", key)} +} + +func (_c *ConfigReader_GetStringMapString_Call) Run(run func(key string)) *ConfigReader_GetStringMapString_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetStringMapString_Call) Return(stringToString map[string]string) *ConfigReader_GetStringMapString_Call { + _c.Call.Return(stringToString) + return _c +} + +func (_c *ConfigReader_GetStringMapString_Call) RunAndReturn(run func(key string) map[string]string) *ConfigReader_GetStringMapString_Call { + _c.Call.Return(run) + return _c +} + +// GetStringSlice provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetStringSlice(key string) []string { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetStringSlice") + } + + var r0 []string + if returnFunc, ok := ret.Get(0).(func(string) []string); ok { + r0 = returnFunc(key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + return r0 +} + +// ConfigReader_GetStringSlice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStringSlice' +type ConfigReader_GetStringSlice_Call struct { + *mock.Call +} + +// GetStringSlice is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetStringSlice(key any) *ConfigReader_GetStringSlice_Call { + return &ConfigReader_GetStringSlice_Call{Call: _e.mock.On("GetStringSlice", key)} +} + +func (_c *ConfigReader_GetStringSlice_Call) Run(run func(key string)) *ConfigReader_GetStringSlice_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetStringSlice_Call) Return(strings []string) *ConfigReader_GetStringSlice_Call { + _c.Call.Return(strings) + return _c +} + +func (_c *ConfigReader_GetStringSlice_Call) RunAndReturn(run func(key string) []string) *ConfigReader_GetStringSlice_Call { + _c.Call.Return(run) + return _c +} + +// GetTime provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetTime(key string) time.Time { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetTime") + } + + var r0 time.Time + if returnFunc, ok := ret.Get(0).(func(string) time.Time); ok { + r0 = returnFunc(key) + } else { + r0 = ret.Get(0).(time.Time) + } + return r0 +} + +// ConfigReader_GetTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTime' +type ConfigReader_GetTime_Call struct { + *mock.Call +} + +// GetTime is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetTime(key any) *ConfigReader_GetTime_Call { + return &ConfigReader_GetTime_Call{Call: _e.mock.On("GetTime", key)} +} + +func (_c *ConfigReader_GetTime_Call) Run(run func(key string)) *ConfigReader_GetTime_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetTime_Call) Return(time1 time.Time) *ConfigReader_GetTime_Call { + _c.Call.Return(time1) + return _c +} + +func (_c *ConfigReader_GetTime_Call) RunAndReturn(run func(key string) time.Time) *ConfigReader_GetTime_Call { + _c.Call.Return(run) + return _c +} + +// GetUint provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetUint(key string) uint { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetUint") + } + + var r0 uint + if returnFunc, ok := ret.Get(0).(func(string) uint); ok { + r0 = returnFunc(key) + } else { + r0 = ret.Get(0).(uint) + } + return r0 +} + +// ConfigReader_GetUint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUint' +type ConfigReader_GetUint_Call struct { + *mock.Call +} + +// GetUint is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetUint(key any) *ConfigReader_GetUint_Call { + return &ConfigReader_GetUint_Call{Call: _e.mock.On("GetUint", key)} +} + +func (_c *ConfigReader_GetUint_Call) Run(run func(key string)) *ConfigReader_GetUint_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetUint_Call) Return(v uint) *ConfigReader_GetUint_Call { + _c.Call.Return(v) + return _c +} + +func (_c *ConfigReader_GetUint_Call) RunAndReturn(run func(key string) uint) *ConfigReader_GetUint_Call { + _c.Call.Return(run) + return _c +} + +// GetUint64 provides a mock function for the type ConfigReader +func (_mock *ConfigReader) GetUint64(key string) uint64 { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for GetUint64") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func(string) uint64); ok { + r0 = returnFunc(key) + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// ConfigReader_GetUint64_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUint64' +type ConfigReader_GetUint64_Call struct { + *mock.Call +} + +// GetUint64 is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) GetUint64(key any) *ConfigReader_GetUint64_Call { + return &ConfigReader_GetUint64_Call{Call: _e.mock.On("GetUint64", key)} +} + +func (_c *ConfigReader_GetUint64_Call) Run(run func(key string)) *ConfigReader_GetUint64_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_GetUint64_Call) Return(v uint64) *ConfigReader_GetUint64_Call { + _c.Call.Return(v) + return _c +} + +func (_c *ConfigReader_GetUint64_Call) RunAndReturn(run func(key string) uint64) *ConfigReader_GetUint64_Call { + _c.Call.Return(run) + return _c +} + +// IsSet provides a mock function for the type ConfigReader +func (_mock *ConfigReader) IsSet(key string) bool { + ret := _mock.Called(key) + + if len(ret) == 0 { + panic("no return value specified for IsSet") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(string) bool); ok { + r0 = returnFunc(key) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// ConfigReader_IsSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSet' +type ConfigReader_IsSet_Call struct { + *mock.Call +} + +// IsSet is a helper method to define mock.On call +// - key string +func (_e *ConfigReader_Expecter) IsSet(key any) *ConfigReader_IsSet_Call { + return &ConfigReader_IsSet_Call{Call: _e.mock.On("IsSet", key)} +} + +func (_c *ConfigReader_IsSet_Call) Run(run func(key string)) *ConfigReader_IsSet_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ConfigReader_IsSet_Call) Return(b bool) *ConfigReader_IsSet_Call { + _c.Call.Return(b) + return _c +} + +func (_c *ConfigReader_IsSet_Call) RunAndReturn(run func(key string) bool) *ConfigReader_IsSet_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/context/BasicRes.go b/backend/mocks/core/context/BasicRes.go new file mode 100644 index 00000000000..84fc7b1c395 --- /dev/null +++ b/backend/mocks/core/context/BasicRes.go @@ -0,0 +1,335 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/config" + "github.com/apache/devlake/core/context" + "github.com/apache/devlake/core/dal" + "github.com/apache/devlake/core/log" + mock "github.com/stretchr/testify/mock" +) + +// NewBasicRes creates a new instance of BasicRes. 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 NewBasicRes(t interface { + mock.TestingT + Cleanup(func()) +}) *BasicRes { + mock := &BasicRes{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// BasicRes is an autogenerated mock type for the BasicRes type +type BasicRes struct { + mock.Mock +} + +type BasicRes_Expecter struct { + mock *mock.Mock +} + +func (_m *BasicRes) EXPECT() *BasicRes_Expecter { + return &BasicRes_Expecter{mock: &_m.Mock} +} + +// GetConfig provides a mock function for the type BasicRes +func (_mock *BasicRes) GetConfig(name string) string { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetConfig") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func(string) string); ok { + r0 = returnFunc(name) + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// BasicRes_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig' +type BasicRes_GetConfig_Call struct { + *mock.Call +} + +// GetConfig is a helper method to define mock.On call +// - name string +func (_e *BasicRes_Expecter) GetConfig(name any) *BasicRes_GetConfig_Call { + return &BasicRes_GetConfig_Call{Call: _e.mock.On("GetConfig", name)} +} + +func (_c *BasicRes_GetConfig_Call) Run(run func(name string)) *BasicRes_GetConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *BasicRes_GetConfig_Call) Return(s string) *BasicRes_GetConfig_Call { + _c.Call.Return(s) + return _c +} + +func (_c *BasicRes_GetConfig_Call) RunAndReturn(run func(name string) string) *BasicRes_GetConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetConfigReader provides a mock function for the type BasicRes +func (_mock *BasicRes) GetConfigReader() config.ConfigReader { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetConfigReader") + } + + var r0 config.ConfigReader + if returnFunc, ok := ret.Get(0).(func() config.ConfigReader); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.ConfigReader) + } + } + return r0 +} + +// BasicRes_GetConfigReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfigReader' +type BasicRes_GetConfigReader_Call struct { + *mock.Call +} + +// GetConfigReader is a helper method to define mock.On call +func (_e *BasicRes_Expecter) GetConfigReader() *BasicRes_GetConfigReader_Call { + return &BasicRes_GetConfigReader_Call{Call: _e.mock.On("GetConfigReader")} +} + +func (_c *BasicRes_GetConfigReader_Call) Run(run func()) *BasicRes_GetConfigReader_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BasicRes_GetConfigReader_Call) Return(configReader config.ConfigReader) *BasicRes_GetConfigReader_Call { + _c.Call.Return(configReader) + return _c +} + +func (_c *BasicRes_GetConfigReader_Call) RunAndReturn(run func() config.ConfigReader) *BasicRes_GetConfigReader_Call { + _c.Call.Return(run) + return _c +} + +// GetDal provides a mock function for the type BasicRes +func (_mock *BasicRes) GetDal() dal.Dal { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDal") + } + + var r0 dal.Dal + if returnFunc, ok := ret.Get(0).(func() dal.Dal); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Dal) + } + } + return r0 +} + +// BasicRes_GetDal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDal' +type BasicRes_GetDal_Call struct { + *mock.Call +} + +// GetDal is a helper method to define mock.On call +func (_e *BasicRes_Expecter) GetDal() *BasicRes_GetDal_Call { + return &BasicRes_GetDal_Call{Call: _e.mock.On("GetDal")} +} + +func (_c *BasicRes_GetDal_Call) Run(run func()) *BasicRes_GetDal_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BasicRes_GetDal_Call) Return(dal1 dal.Dal) *BasicRes_GetDal_Call { + _c.Call.Return(dal1) + return _c +} + +func (_c *BasicRes_GetDal_Call) RunAndReturn(run func() dal.Dal) *BasicRes_GetDal_Call { + _c.Call.Return(run) + return _c +} + +// GetLogger provides a mock function for the type BasicRes +func (_mock *BasicRes) GetLogger() log.Logger { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLogger") + } + + var r0 log.Logger + if returnFunc, ok := ret.Get(0).(func() log.Logger); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(log.Logger) + } + } + return r0 +} + +// BasicRes_GetLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogger' +type BasicRes_GetLogger_Call struct { + *mock.Call +} + +// GetLogger is a helper method to define mock.On call +func (_e *BasicRes_Expecter) GetLogger() *BasicRes_GetLogger_Call { + return &BasicRes_GetLogger_Call{Call: _e.mock.On("GetLogger")} +} + +func (_c *BasicRes_GetLogger_Call) Run(run func()) *BasicRes_GetLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BasicRes_GetLogger_Call) Return(logger log.Logger) *BasicRes_GetLogger_Call { + _c.Call.Return(logger) + return _c +} + +func (_c *BasicRes_GetLogger_Call) RunAndReturn(run func() log.Logger) *BasicRes_GetLogger_Call { + _c.Call.Return(run) + return _c +} + +// NestedLogger provides a mock function for the type BasicRes +func (_mock *BasicRes) NestedLogger(name string) context.BasicRes { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for NestedLogger") + } + + var r0 context.BasicRes + if returnFunc, ok := ret.Get(0).(func(string) context.BasicRes); ok { + r0 = returnFunc(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context.BasicRes) + } + } + return r0 +} + +// BasicRes_NestedLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NestedLogger' +type BasicRes_NestedLogger_Call struct { + *mock.Call +} + +// NestedLogger is a helper method to define mock.On call +// - name string +func (_e *BasicRes_Expecter) NestedLogger(name any) *BasicRes_NestedLogger_Call { + return &BasicRes_NestedLogger_Call{Call: _e.mock.On("NestedLogger", name)} +} + +func (_c *BasicRes_NestedLogger_Call) Run(run func(name string)) *BasicRes_NestedLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *BasicRes_NestedLogger_Call) Return(basicRes context.BasicRes) *BasicRes_NestedLogger_Call { + _c.Call.Return(basicRes) + return _c +} + +func (_c *BasicRes_NestedLogger_Call) RunAndReturn(run func(name string) context.BasicRes) *BasicRes_NestedLogger_Call { + _c.Call.Return(run) + return _c +} + +// ReplaceLogger provides a mock function for the type BasicRes +func (_mock *BasicRes) ReplaceLogger(logger log.Logger) context.BasicRes { + ret := _mock.Called(logger) + + if len(ret) == 0 { + panic("no return value specified for ReplaceLogger") + } + + var r0 context.BasicRes + if returnFunc, ok := ret.Get(0).(func(log.Logger) context.BasicRes); ok { + r0 = returnFunc(logger) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context.BasicRes) + } + } + return r0 +} + +// BasicRes_ReplaceLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplaceLogger' +type BasicRes_ReplaceLogger_Call struct { + *mock.Call +} + +// ReplaceLogger is a helper method to define mock.On call +// - logger log.Logger +func (_e *BasicRes_Expecter) ReplaceLogger(logger any) *BasicRes_ReplaceLogger_Call { + return &BasicRes_ReplaceLogger_Call{Call: _e.mock.On("ReplaceLogger", logger)} +} + +func (_c *BasicRes_ReplaceLogger_Call) Run(run func(logger log.Logger)) *BasicRes_ReplaceLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 log.Logger + if args[0] != nil { + arg0 = args[0].(log.Logger) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *BasicRes_ReplaceLogger_Call) Return(basicRes context.BasicRes) *BasicRes_ReplaceLogger_Call { + _c.Call.Return(basicRes) + return _c +} + +func (_c *BasicRes_ReplaceLogger_Call) RunAndReturn(run func(logger log.Logger) context.BasicRes) *BasicRes_ReplaceLogger_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/dal/ColumnMeta.go b/backend/mocks/core/dal/ColumnMeta.go new file mode 100644 index 00000000000..9687d9e496b --- /dev/null +++ b/backend/mocks/core/dal/ColumnMeta.go @@ -0,0 +1,655 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "reflect" + + mock "github.com/stretchr/testify/mock" +) + +// NewColumnMeta creates a new instance of ColumnMeta. 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 NewColumnMeta(t interface { + mock.TestingT + Cleanup(func()) +}) *ColumnMeta { + mock := &ColumnMeta{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ColumnMeta is an autogenerated mock type for the ColumnMeta type +type ColumnMeta struct { + mock.Mock +} + +type ColumnMeta_Expecter struct { + mock *mock.Mock +} + +func (_m *ColumnMeta) EXPECT() *ColumnMeta_Expecter { + return &ColumnMeta_Expecter{mock: &_m.Mock} +} + +// AutoIncrement provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) AutoIncrement() (bool, bool) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for AutoIncrement") + } + + var r0 bool + var r1 bool + if returnFunc, ok := ret.Get(0).(func() (bool, bool)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + if returnFunc, ok := ret.Get(1).(func() bool); ok { + r1 = returnFunc() + } else { + r1 = ret.Get(1).(bool) + } + return r0, r1 +} + +// ColumnMeta_AutoIncrement_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AutoIncrement' +type ColumnMeta_AutoIncrement_Call struct { + *mock.Call +} + +// AutoIncrement is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) AutoIncrement() *ColumnMeta_AutoIncrement_Call { + return &ColumnMeta_AutoIncrement_Call{Call: _e.mock.On("AutoIncrement")} +} + +func (_c *ColumnMeta_AutoIncrement_Call) Run(run func()) *ColumnMeta_AutoIncrement_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_AutoIncrement_Call) Return(isAutoIncrement bool, ok bool) *ColumnMeta_AutoIncrement_Call { + _c.Call.Return(isAutoIncrement, ok) + return _c +} + +func (_c *ColumnMeta_AutoIncrement_Call) RunAndReturn(run func() (bool, bool)) *ColumnMeta_AutoIncrement_Call { + _c.Call.Return(run) + return _c +} + +// ColumnType provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) ColumnType() (string, bool) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ColumnType") + } + + var r0 string + var r1 bool + if returnFunc, ok := ret.Get(0).(func() (string, bool)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + if returnFunc, ok := ret.Get(1).(func() bool); ok { + r1 = returnFunc() + } else { + r1 = ret.Get(1).(bool) + } + return r0, r1 +} + +// ColumnMeta_ColumnType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ColumnType' +type ColumnMeta_ColumnType_Call struct { + *mock.Call +} + +// ColumnType is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) ColumnType() *ColumnMeta_ColumnType_Call { + return &ColumnMeta_ColumnType_Call{Call: _e.mock.On("ColumnType")} +} + +func (_c *ColumnMeta_ColumnType_Call) Run(run func()) *ColumnMeta_ColumnType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_ColumnType_Call) Return(columnType string, ok bool) *ColumnMeta_ColumnType_Call { + _c.Call.Return(columnType, ok) + return _c +} + +func (_c *ColumnMeta_ColumnType_Call) RunAndReturn(run func() (string, bool)) *ColumnMeta_ColumnType_Call { + _c.Call.Return(run) + return _c +} + +// Comment provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) Comment() (string, bool) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Comment") + } + + var r0 string + var r1 bool + if returnFunc, ok := ret.Get(0).(func() (string, bool)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + if returnFunc, ok := ret.Get(1).(func() bool); ok { + r1 = returnFunc() + } else { + r1 = ret.Get(1).(bool) + } + return r0, r1 +} + +// ColumnMeta_Comment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Comment' +type ColumnMeta_Comment_Call struct { + *mock.Call +} + +// Comment is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) Comment() *ColumnMeta_Comment_Call { + return &ColumnMeta_Comment_Call{Call: _e.mock.On("Comment")} +} + +func (_c *ColumnMeta_Comment_Call) Run(run func()) *ColumnMeta_Comment_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_Comment_Call) Return(value string, ok bool) *ColumnMeta_Comment_Call { + _c.Call.Return(value, ok) + return _c +} + +func (_c *ColumnMeta_Comment_Call) RunAndReturn(run func() (string, bool)) *ColumnMeta_Comment_Call { + _c.Call.Return(run) + return _c +} + +// DatabaseTypeName provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) DatabaseTypeName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for DatabaseTypeName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ColumnMeta_DatabaseTypeName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DatabaseTypeName' +type ColumnMeta_DatabaseTypeName_Call struct { + *mock.Call +} + +// DatabaseTypeName is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) DatabaseTypeName() *ColumnMeta_DatabaseTypeName_Call { + return &ColumnMeta_DatabaseTypeName_Call{Call: _e.mock.On("DatabaseTypeName")} +} + +func (_c *ColumnMeta_DatabaseTypeName_Call) Run(run func()) *ColumnMeta_DatabaseTypeName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_DatabaseTypeName_Call) Return(s string) *ColumnMeta_DatabaseTypeName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ColumnMeta_DatabaseTypeName_Call) RunAndReturn(run func() string) *ColumnMeta_DatabaseTypeName_Call { + _c.Call.Return(run) + return _c +} + +// DecimalSize provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) DecimalSize() (int64, int64, bool) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for DecimalSize") + } + + var r0 int64 + var r1 int64 + var r2 bool + if returnFunc, ok := ret.Get(0).(func() (int64, int64, bool)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int64) + } + if returnFunc, ok := ret.Get(1).(func() int64); ok { + r1 = returnFunc() + } else { + r1 = ret.Get(1).(int64) + } + if returnFunc, ok := ret.Get(2).(func() bool); ok { + r2 = returnFunc() + } else { + r2 = ret.Get(2).(bool) + } + return r0, r1, r2 +} + +// ColumnMeta_DecimalSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecimalSize' +type ColumnMeta_DecimalSize_Call struct { + *mock.Call +} + +// DecimalSize is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) DecimalSize() *ColumnMeta_DecimalSize_Call { + return &ColumnMeta_DecimalSize_Call{Call: _e.mock.On("DecimalSize")} +} + +func (_c *ColumnMeta_DecimalSize_Call) Run(run func()) *ColumnMeta_DecimalSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_DecimalSize_Call) Return(precision int64, scale int64, ok bool) *ColumnMeta_DecimalSize_Call { + _c.Call.Return(precision, scale, ok) + return _c +} + +func (_c *ColumnMeta_DecimalSize_Call) RunAndReturn(run func() (int64, int64, bool)) *ColumnMeta_DecimalSize_Call { + _c.Call.Return(run) + return _c +} + +// DefaultValue provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) DefaultValue() (string, bool) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for DefaultValue") + } + + var r0 string + var r1 bool + if returnFunc, ok := ret.Get(0).(func() (string, bool)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + if returnFunc, ok := ret.Get(1).(func() bool); ok { + r1 = returnFunc() + } else { + r1 = ret.Get(1).(bool) + } + return r0, r1 +} + +// ColumnMeta_DefaultValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DefaultValue' +type ColumnMeta_DefaultValue_Call struct { + *mock.Call +} + +// DefaultValue is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) DefaultValue() *ColumnMeta_DefaultValue_Call { + return &ColumnMeta_DefaultValue_Call{Call: _e.mock.On("DefaultValue")} +} + +func (_c *ColumnMeta_DefaultValue_Call) Run(run func()) *ColumnMeta_DefaultValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_DefaultValue_Call) Return(value string, ok bool) *ColumnMeta_DefaultValue_Call { + _c.Call.Return(value, ok) + return _c +} + +func (_c *ColumnMeta_DefaultValue_Call) RunAndReturn(run func() (string, bool)) *ColumnMeta_DefaultValue_Call { + _c.Call.Return(run) + return _c +} + +// Length provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) Length() (int64, bool) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Length") + } + + var r0 int64 + var r1 bool + if returnFunc, ok := ret.Get(0).(func() (int64, bool)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int64) + } + if returnFunc, ok := ret.Get(1).(func() bool); ok { + r1 = returnFunc() + } else { + r1 = ret.Get(1).(bool) + } + return r0, r1 +} + +// ColumnMeta_Length_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Length' +type ColumnMeta_Length_Call struct { + *mock.Call +} + +// Length is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) Length() *ColumnMeta_Length_Call { + return &ColumnMeta_Length_Call{Call: _e.mock.On("Length")} +} + +func (_c *ColumnMeta_Length_Call) Run(run func()) *ColumnMeta_Length_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_Length_Call) Return(length int64, ok bool) *ColumnMeta_Length_Call { + _c.Call.Return(length, ok) + return _c +} + +func (_c *ColumnMeta_Length_Call) RunAndReturn(run func() (int64, bool)) *ColumnMeta_Length_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) Name() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ColumnMeta_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type ColumnMeta_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) Name() *ColumnMeta_Name_Call { + return &ColumnMeta_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *ColumnMeta_Name_Call) Run(run func()) *ColumnMeta_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_Name_Call) Return(s string) *ColumnMeta_Name_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ColumnMeta_Name_Call) RunAndReturn(run func() string) *ColumnMeta_Name_Call { + _c.Call.Return(run) + return _c +} + +// Nullable provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) Nullable() (bool, bool) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Nullable") + } + + var r0 bool + var r1 bool + if returnFunc, ok := ret.Get(0).(func() (bool, bool)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + if returnFunc, ok := ret.Get(1).(func() bool); ok { + r1 = returnFunc() + } else { + r1 = ret.Get(1).(bool) + } + return r0, r1 +} + +// ColumnMeta_Nullable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Nullable' +type ColumnMeta_Nullable_Call struct { + *mock.Call +} + +// Nullable is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) Nullable() *ColumnMeta_Nullable_Call { + return &ColumnMeta_Nullable_Call{Call: _e.mock.On("Nullable")} +} + +func (_c *ColumnMeta_Nullable_Call) Run(run func()) *ColumnMeta_Nullable_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_Nullable_Call) Return(nullable bool, ok bool) *ColumnMeta_Nullable_Call { + _c.Call.Return(nullable, ok) + return _c +} + +func (_c *ColumnMeta_Nullable_Call) RunAndReturn(run func() (bool, bool)) *ColumnMeta_Nullable_Call { + _c.Call.Return(run) + return _c +} + +// PrimaryKey provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) PrimaryKey() (bool, bool) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for PrimaryKey") + } + + var r0 bool + var r1 bool + if returnFunc, ok := ret.Get(0).(func() (bool, bool)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + if returnFunc, ok := ret.Get(1).(func() bool); ok { + r1 = returnFunc() + } else { + r1 = ret.Get(1).(bool) + } + return r0, r1 +} + +// ColumnMeta_PrimaryKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrimaryKey' +type ColumnMeta_PrimaryKey_Call struct { + *mock.Call +} + +// PrimaryKey is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) PrimaryKey() *ColumnMeta_PrimaryKey_Call { + return &ColumnMeta_PrimaryKey_Call{Call: _e.mock.On("PrimaryKey")} +} + +func (_c *ColumnMeta_PrimaryKey_Call) Run(run func()) *ColumnMeta_PrimaryKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_PrimaryKey_Call) Return(isPrimaryKey bool, ok bool) *ColumnMeta_PrimaryKey_Call { + _c.Call.Return(isPrimaryKey, ok) + return _c +} + +func (_c *ColumnMeta_PrimaryKey_Call) RunAndReturn(run func() (bool, bool)) *ColumnMeta_PrimaryKey_Call { + _c.Call.Return(run) + return _c +} + +// ScanType provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) ScanType() reflect.Type { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScanType") + } + + var r0 reflect.Type + if returnFunc, ok := ret.Get(0).(func() reflect.Type); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(reflect.Type) + } + } + return r0 +} + +// ColumnMeta_ScanType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScanType' +type ColumnMeta_ScanType_Call struct { + *mock.Call +} + +// ScanType is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) ScanType() *ColumnMeta_ScanType_Call { + return &ColumnMeta_ScanType_Call{Call: _e.mock.On("ScanType")} +} + +func (_c *ColumnMeta_ScanType_Call) Run(run func()) *ColumnMeta_ScanType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_ScanType_Call) Return(typeParam reflect.Type) *ColumnMeta_ScanType_Call { + _c.Call.Return(typeParam) + return _c +} + +func (_c *ColumnMeta_ScanType_Call) RunAndReturn(run func() reflect.Type) *ColumnMeta_ScanType_Call { + _c.Call.Return(run) + return _c +} + +// Unique provides a mock function for the type ColumnMeta +func (_mock *ColumnMeta) Unique() (bool, bool) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Unique") + } + + var r0 bool + var r1 bool + if returnFunc, ok := ret.Get(0).(func() (bool, bool)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + if returnFunc, ok := ret.Get(1).(func() bool); ok { + r1 = returnFunc() + } else { + r1 = ret.Get(1).(bool) + } + return r0, r1 +} + +// ColumnMeta_Unique_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unique' +type ColumnMeta_Unique_Call struct { + *mock.Call +} + +// Unique is a helper method to define mock.On call +func (_e *ColumnMeta_Expecter) Unique() *ColumnMeta_Unique_Call { + return &ColumnMeta_Unique_Call{Call: _e.mock.On("Unique")} +} + +func (_c *ColumnMeta_Unique_Call) Run(run func()) *ColumnMeta_Unique_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ColumnMeta_Unique_Call) Return(unique bool, ok bool) *ColumnMeta_Unique_Call { + _c.Call.Return(unique, ok) + return _c +} + +func (_c *ColumnMeta_Unique_Call) RunAndReturn(run func() (bool, bool)) *ColumnMeta_Unique_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/dal/Dal.go b/backend/mocks/core/dal/Dal.go new file mode 100644 index 00000000000..60d3d819a29 --- /dev/null +++ b/backend/mocks/core/dal/Dal.go @@ -0,0 +1,2343 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "database/sql" + "reflect" + + "github.com/apache/devlake/core/dal" + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewDal creates a new instance of Dal. 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 NewDal(t interface { + mock.TestingT + Cleanup(func()) +}) *Dal { + mock := &Dal{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// Dal is an autogenerated mock type for the Dal type +type Dal struct { + mock.Mock +} + +type Dal_Expecter struct { + mock *mock.Mock +} + +func (_m *Dal) EXPECT() *Dal_Expecter { + return &Dal_Expecter{mock: &_m.Mock} +} + +// AddColumn provides a mock function for the type Dal +func (_mock *Dal) AddColumn(table string, columnName string, columnType dal.ColumnType) errors.Error { + ret := _mock.Called(table, columnName, columnType) + + if len(ret) == 0 { + panic("no return value specified for AddColumn") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, string, dal.ColumnType) errors.Error); ok { + r0 = returnFunc(table, columnName, columnType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_AddColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddColumn' +type Dal_AddColumn_Call struct { + *mock.Call +} + +// AddColumn is a helper method to define mock.On call +// - table string +// - columnName string +// - columnType dal.ColumnType +func (_e *Dal_Expecter) AddColumn(table any, columnName any, columnType any) *Dal_AddColumn_Call { + return &Dal_AddColumn_Call{Call: _e.mock.On("AddColumn", table, columnName, columnType)} +} + +func (_c *Dal_AddColumn_Call) Run(run func(table string, columnName string, columnType dal.ColumnType)) *Dal_AddColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 dal.ColumnType + if args[2] != nil { + arg2 = args[2].(dal.ColumnType) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *Dal_AddColumn_Call) Return(error errors.Error) *Dal_AddColumn_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_AddColumn_Call) RunAndReturn(run func(table string, columnName string, columnType dal.ColumnType) errors.Error) *Dal_AddColumn_Call { + _c.Call.Return(run) + return _c +} + +// All provides a mock function for the type Dal +func (_mock *Dal) All(dst interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(dst, clauses) + } else { + tmpRet = _mock.Called(dst) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for All") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(dst, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_All_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'All' +type Dal_All_Call struct { + *mock.Call +} + +// All is a helper method to define mock.On call +// - dst interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) All(dst any, clauses ...any) *Dal_All_Call { + return &Dal_All_Call{Call: _e.mock.On("All", + append([]any{dst}, clauses...)...)} +} + +func (_c *Dal_All_Call) Run(run func(dst interface{}, clauses ...dal.Clause)) *Dal_All_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_All_Call) Return(error errors.Error) *Dal_All_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_All_Call) RunAndReturn(run func(dst interface{}, clauses ...dal.Clause) errors.Error) *Dal_All_Call { + _c.Call.Return(run) + return _c +} + +// AllTables provides a mock function for the type Dal +func (_mock *Dal) AllTables() ([]string, errors.Error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for AllTables") + } + + var r0 []string + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func() ([]string, errors.Error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []string); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + if returnFunc, ok := ret.Get(1).(func() errors.Error); ok { + r1 = returnFunc() + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Dal_AllTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllTables' +type Dal_AllTables_Call struct { + *mock.Call +} + +// AllTables is a helper method to define mock.On call +func (_e *Dal_Expecter) AllTables() *Dal_AllTables_Call { + return &Dal_AllTables_Call{Call: _e.mock.On("AllTables")} +} + +func (_c *Dal_AllTables_Call) Run(run func()) *Dal_AllTables_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Dal_AllTables_Call) Return(strings []string, error errors.Error) *Dal_AllTables_Call { + _c.Call.Return(strings, error) + return _c +} + +func (_c *Dal_AllTables_Call) RunAndReturn(run func() ([]string, errors.Error)) *Dal_AllTables_Call { + _c.Call.Return(run) + return _c +} + +// AutoMigrate provides a mock function for the type Dal +func (_mock *Dal) AutoMigrate(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for AutoMigrate") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_AutoMigrate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AutoMigrate' +type Dal_AutoMigrate_Call struct { + *mock.Call +} + +// AutoMigrate is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) AutoMigrate(entity any, clauses ...any) *Dal_AutoMigrate_Call { + return &Dal_AutoMigrate_Call{Call: _e.mock.On("AutoMigrate", + append([]any{entity}, clauses...)...)} +} + +func (_c *Dal_AutoMigrate_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Dal_AutoMigrate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_AutoMigrate_Call) Return(error errors.Error) *Dal_AutoMigrate_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_AutoMigrate_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Dal_AutoMigrate_Call { + _c.Call.Return(run) + return _c +} + +// Begin provides a mock function for the type Dal +func (_mock *Dal) Begin() dal.Transaction { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Begin") + } + + var r0 dal.Transaction + if returnFunc, ok := ret.Get(0).(func() dal.Transaction); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Transaction) + } + } + return r0 +} + +// Dal_Begin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Begin' +type Dal_Begin_Call struct { + *mock.Call +} + +// Begin is a helper method to define mock.On call +func (_e *Dal_Expecter) Begin() *Dal_Begin_Call { + return &Dal_Begin_Call{Call: _e.mock.On("Begin")} +} + +func (_c *Dal_Begin_Call) Run(run func()) *Dal_Begin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Dal_Begin_Call) Return(transaction dal.Transaction) *Dal_Begin_Call { + _c.Call.Return(transaction) + return _c +} + +func (_c *Dal_Begin_Call) RunAndReturn(run func() dal.Transaction) *Dal_Begin_Call { + _c.Call.Return(run) + return _c +} + +// Count provides a mock function for the type Dal +func (_mock *Dal) Count(clauses ...dal.Clause) (int64, errors.Error) { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(clauses) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Count") + } + + var r0 int64 + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(...dal.Clause) (int64, errors.Error)); ok { + return returnFunc(clauses...) + } + if returnFunc, ok := ret.Get(0).(func(...dal.Clause) int64); ok { + r0 = returnFunc(clauses...) + } else { + r0 = ret.Get(0).(int64) + } + if returnFunc, ok := ret.Get(1).(func(...dal.Clause) errors.Error); ok { + r1 = returnFunc(clauses...) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Dal_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count' +type Dal_Count_Call struct { + *mock.Call +} + +// Count is a helper method to define mock.On call +// - clauses ...dal.Clause +func (_e *Dal_Expecter) Count(clauses ...any) *Dal_Count_Call { + return &Dal_Count_Call{Call: _e.mock.On("Count", + append([]any{}, clauses...)...)} +} + +func (_c *Dal_Count_Call) Run(run func(clauses ...dal.Clause)) *Dal_Count_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 0 { + variadicArgs = args[0].([]dal.Clause) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *Dal_Count_Call) Return(n int64, error errors.Error) *Dal_Count_Call { + _c.Call.Return(n, error) + return _c +} + +func (_c *Dal_Count_Call) RunAndReturn(run func(clauses ...dal.Clause) (int64, errors.Error)) *Dal_Count_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function for the type Dal +func (_mock *Dal) Create(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Dal_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) Create(entity any, clauses ...any) *Dal_Create_Call { + return &Dal_Create_Call{Call: _e.mock.On("Create", + append([]any{entity}, clauses...)...)} +} + +func (_c *Dal_Create_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Dal_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_Create_Call) Return(error errors.Error) *Dal_Create_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_Create_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Dal_Create_Call { + _c.Call.Return(run) + return _c +} + +// CreateIfNotExist provides a mock function for the type Dal +func (_mock *Dal) CreateIfNotExist(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for CreateIfNotExist") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_CreateIfNotExist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateIfNotExist' +type Dal_CreateIfNotExist_Call struct { + *mock.Call +} + +// CreateIfNotExist is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) CreateIfNotExist(entity any, clauses ...any) *Dal_CreateIfNotExist_Call { + return &Dal_CreateIfNotExist_Call{Call: _e.mock.On("CreateIfNotExist", + append([]any{entity}, clauses...)...)} +} + +func (_c *Dal_CreateIfNotExist_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Dal_CreateIfNotExist_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_CreateIfNotExist_Call) Return(error errors.Error) *Dal_CreateIfNotExist_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_CreateIfNotExist_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Dal_CreateIfNotExist_Call { + _c.Call.Return(run) + return _c +} + +// CreateOrUpdate provides a mock function for the type Dal +func (_mock *Dal) CreateOrUpdate(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for CreateOrUpdate") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_CreateOrUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrUpdate' +type Dal_CreateOrUpdate_Call struct { + *mock.Call +} + +// CreateOrUpdate is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) CreateOrUpdate(entity any, clauses ...any) *Dal_CreateOrUpdate_Call { + return &Dal_CreateOrUpdate_Call{Call: _e.mock.On("CreateOrUpdate", + append([]any{entity}, clauses...)...)} +} + +func (_c *Dal_CreateOrUpdate_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Dal_CreateOrUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_CreateOrUpdate_Call) Return(error errors.Error) *Dal_CreateOrUpdate_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_CreateOrUpdate_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Dal_CreateOrUpdate_Call { + _c.Call.Return(run) + return _c +} + +// CreateWithMap provides a mock function for the type Dal +func (_mock *Dal) CreateWithMap(entity interface{}, record map[string]interface{}) errors.Error { + ret := _mock.Called(entity, record) + + if len(ret) == 0 { + panic("no return value specified for CreateWithMap") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, map[string]interface{}) errors.Error); ok { + r0 = returnFunc(entity, record) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_CreateWithMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateWithMap' +type Dal_CreateWithMap_Call struct { + *mock.Call +} + +// CreateWithMap is a helper method to define mock.On call +// - entity interface{} +// - record map[string]interface{} +func (_e *Dal_Expecter) CreateWithMap(entity any, record any) *Dal_CreateWithMap_Call { + return &Dal_CreateWithMap_Call{Call: _e.mock.On("CreateWithMap", entity, record)} +} + +func (_c *Dal_CreateWithMap_Call) Run(run func(entity interface{}, record map[string]interface{})) *Dal_CreateWithMap_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 map[string]interface{} + if args[1] != nil { + arg1 = args[1].(map[string]interface{}) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Dal_CreateWithMap_Call) Return(error errors.Error) *Dal_CreateWithMap_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_CreateWithMap_Call) RunAndReturn(run func(entity interface{}, record map[string]interface{}) errors.Error) *Dal_CreateWithMap_Call { + _c.Call.Return(run) + return _c +} + +// Cursor provides a mock function for the type Dal +func (_mock *Dal) Cursor(clauses ...dal.Clause) (dal.Rows, errors.Error) { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(clauses) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Cursor") + } + + var r0 dal.Rows + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(...dal.Clause) (dal.Rows, errors.Error)); ok { + return returnFunc(clauses...) + } + if returnFunc, ok := ret.Get(0).(func(...dal.Clause) dal.Rows); ok { + r0 = returnFunc(clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Rows) + } + } + if returnFunc, ok := ret.Get(1).(func(...dal.Clause) errors.Error); ok { + r1 = returnFunc(clauses...) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Dal_Cursor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cursor' +type Dal_Cursor_Call struct { + *mock.Call +} + +// Cursor is a helper method to define mock.On call +// - clauses ...dal.Clause +func (_e *Dal_Expecter) Cursor(clauses ...any) *Dal_Cursor_Call { + return &Dal_Cursor_Call{Call: _e.mock.On("Cursor", + append([]any{}, clauses...)...)} +} + +func (_c *Dal_Cursor_Call) Run(run func(clauses ...dal.Clause)) *Dal_Cursor_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 0 { + variadicArgs = args[0].([]dal.Clause) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *Dal_Cursor_Call) Return(rows dal.Rows, error errors.Error) *Dal_Cursor_Call { + _c.Call.Return(rows, error) + return _c +} + +func (_c *Dal_Cursor_Call) RunAndReturn(run func(clauses ...dal.Clause) (dal.Rows, errors.Error)) *Dal_Cursor_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function for the type Dal +func (_mock *Dal) Delete(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Dal_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) Delete(entity any, clauses ...any) *Dal_Delete_Call { + return &Dal_Delete_Call{Call: _e.mock.On("Delete", + append([]any{entity}, clauses...)...)} +} + +func (_c *Dal_Delete_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Dal_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_Delete_Call) Return(error errors.Error) *Dal_Delete_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_Delete_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Dal_Delete_Call { + _c.Call.Return(run) + return _c +} + +// Dialect provides a mock function for the type Dal +func (_mock *Dal) Dialect() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Dialect") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// Dal_Dialect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dialect' +type Dal_Dialect_Call struct { + *mock.Call +} + +// Dialect is a helper method to define mock.On call +func (_e *Dal_Expecter) Dialect() *Dal_Dialect_Call { + return &Dal_Dialect_Call{Call: _e.mock.On("Dialect")} +} + +func (_c *Dal_Dialect_Call) Run(run func()) *Dal_Dialect_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Dal_Dialect_Call) Return(s string) *Dal_Dialect_Call { + _c.Call.Return(s) + return _c +} + +func (_c *Dal_Dialect_Call) RunAndReturn(run func() string) *Dal_Dialect_Call { + _c.Call.Return(run) + return _c +} + +// DropColumns provides a mock function for the type Dal +func (_mock *Dal) DropColumns(table string, columnName ...string) errors.Error { + var tmpRet mock.Arguments + if len(columnName) > 0 { + tmpRet = _mock.Called(table, columnName) + } else { + tmpRet = _mock.Called(table) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for DropColumns") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...string) errors.Error); ok { + r0 = returnFunc(table, columnName...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_DropColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropColumns' +type Dal_DropColumns_Call struct { + *mock.Call +} + +// DropColumns is a helper method to define mock.On call +// - table string +// - columnName ...string +func (_e *Dal_Expecter) DropColumns(table any, columnName ...any) *Dal_DropColumns_Call { + return &Dal_DropColumns_Call{Call: _e.mock.On("DropColumns", + append([]any{table}, columnName...)...)} +} + +func (_c *Dal_DropColumns_Call) Run(run func(table string, columnName ...string)) *Dal_DropColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []string + var variadicArgs []string + if len(args) > 1 { + variadicArgs = args[1].([]string) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_DropColumns_Call) Return(error errors.Error) *Dal_DropColumns_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_DropColumns_Call) RunAndReturn(run func(table string, columnName ...string) errors.Error) *Dal_DropColumns_Call { + _c.Call.Return(run) + return _c +} + +// DropIndex provides a mock function for the type Dal +func (_mock *Dal) DropIndex(table string, columnNames ...string) errors.Error { + var tmpRet mock.Arguments + if len(columnNames) > 0 { + tmpRet = _mock.Called(table, columnNames) + } else { + tmpRet = _mock.Called(table) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for DropIndex") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...string) errors.Error); ok { + r0 = returnFunc(table, columnNames...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_DropIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropIndex' +type Dal_DropIndex_Call struct { + *mock.Call +} + +// DropIndex is a helper method to define mock.On call +// - table string +// - columnNames ...string +func (_e *Dal_Expecter) DropIndex(table any, columnNames ...any) *Dal_DropIndex_Call { + return &Dal_DropIndex_Call{Call: _e.mock.On("DropIndex", + append([]any{table}, columnNames...)...)} +} + +func (_c *Dal_DropIndex_Call) Run(run func(table string, columnNames ...string)) *Dal_DropIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []string + var variadicArgs []string + if len(args) > 1 { + variadicArgs = args[1].([]string) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_DropIndex_Call) Return(error errors.Error) *Dal_DropIndex_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_DropIndex_Call) RunAndReturn(run func(table string, columnNames ...string) errors.Error) *Dal_DropIndex_Call { + _c.Call.Return(run) + return _c +} + +// DropIndexes provides a mock function for the type Dal +func (_mock *Dal) DropIndexes(table string, indexes ...string) errors.Error { + var tmpRet mock.Arguments + if len(indexes) > 0 { + tmpRet = _mock.Called(table, indexes) + } else { + tmpRet = _mock.Called(table) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for DropIndexes") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...string) errors.Error); ok { + r0 = returnFunc(table, indexes...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_DropIndexes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropIndexes' +type Dal_DropIndexes_Call struct { + *mock.Call +} + +// DropIndexes is a helper method to define mock.On call +// - table string +// - indexes ...string +func (_e *Dal_Expecter) DropIndexes(table any, indexes ...any) *Dal_DropIndexes_Call { + return &Dal_DropIndexes_Call{Call: _e.mock.On("DropIndexes", + append([]any{table}, indexes...)...)} +} + +func (_c *Dal_DropIndexes_Call) Run(run func(table string, indexes ...string)) *Dal_DropIndexes_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []string + var variadicArgs []string + if len(args) > 1 { + variadicArgs = args[1].([]string) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_DropIndexes_Call) Return(error errors.Error) *Dal_DropIndexes_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_DropIndexes_Call) RunAndReturn(run func(table string, indexes ...string) errors.Error) *Dal_DropIndexes_Call { + _c.Call.Return(run) + return _c +} + +// DropTables provides a mock function for the type Dal +func (_mock *Dal) DropTables(dst ...interface{}) errors.Error { + var tmpRet mock.Arguments + if len(dst) > 0 { + tmpRet = _mock.Called(dst) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for DropTables") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(...interface{}) errors.Error); ok { + r0 = returnFunc(dst...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_DropTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropTables' +type Dal_DropTables_Call struct { + *mock.Call +} + +// DropTables is a helper method to define mock.On call +// - dst ...interface{} +func (_e *Dal_Expecter) DropTables(dst ...any) *Dal_DropTables_Call { + return &Dal_DropTables_Call{Call: _e.mock.On("DropTables", + append([]any{}, dst...)...)} +} + +func (_c *Dal_DropTables_Call) Run(run func(dst ...interface{})) *Dal_DropTables_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []interface{} + var variadicArgs []interface{} + if len(args) > 0 { + variadicArgs = args[0].([]interface{}) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *Dal_DropTables_Call) Return(error errors.Error) *Dal_DropTables_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_DropTables_Call) RunAndReturn(run func(dst ...interface{}) errors.Error) *Dal_DropTables_Call { + _c.Call.Return(run) + return _c +} + +// Exec provides a mock function for the type Dal +func (_mock *Dal) Exec(query string, params ...interface{}) errors.Error { + var tmpRet mock.Arguments + if len(params) > 0 { + tmpRet = _mock.Called(query, params) + } else { + tmpRet = _mock.Called(query) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Exec") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...interface{}) errors.Error); ok { + r0 = returnFunc(query, params...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_Exec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exec' +type Dal_Exec_Call struct { + *mock.Call +} + +// Exec is a helper method to define mock.On call +// - query string +// - params ...interface{} +func (_e *Dal_Expecter) Exec(query any, params ...any) *Dal_Exec_Call { + return &Dal_Exec_Call{Call: _e.mock.On("Exec", + append([]any{query}, params...)...)} +} + +func (_c *Dal_Exec_Call) Run(run func(query string, params ...interface{})) *Dal_Exec_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []interface{} + var variadicArgs []interface{} + if len(args) > 1 { + variadicArgs = args[1].([]interface{}) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_Exec_Call) Return(error errors.Error) *Dal_Exec_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_Exec_Call) RunAndReturn(run func(query string, params ...interface{}) errors.Error) *Dal_Exec_Call { + _c.Call.Return(run) + return _c +} + +// Fetch provides a mock function for the type Dal +func (_mock *Dal) Fetch(cursor dal.Rows, dst interface{}) errors.Error { + ret := _mock.Called(cursor, dst) + + if len(ret) == 0 { + panic("no return value specified for Fetch") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(dal.Rows, interface{}) errors.Error); ok { + r0 = returnFunc(cursor, dst) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_Fetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fetch' +type Dal_Fetch_Call struct { + *mock.Call +} + +// Fetch is a helper method to define mock.On call +// - cursor dal.Rows +// - dst interface{} +func (_e *Dal_Expecter) Fetch(cursor any, dst any) *Dal_Fetch_Call { + return &Dal_Fetch_Call{Call: _e.mock.On("Fetch", cursor, dst)} +} + +func (_c *Dal_Fetch_Call) Run(run func(cursor dal.Rows, dst interface{})) *Dal_Fetch_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 dal.Rows + if args[0] != nil { + arg0 = args[0].(dal.Rows) + } + var arg1 interface{} + if args[1] != nil { + arg1 = args[1].(interface{}) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Dal_Fetch_Call) Return(error errors.Error) *Dal_Fetch_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_Fetch_Call) RunAndReturn(run func(cursor dal.Rows, dst interface{}) errors.Error) *Dal_Fetch_Call { + _c.Call.Return(run) + return _c +} + +// First provides a mock function for the type Dal +func (_mock *Dal) First(dst interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(dst, clauses) + } else { + tmpRet = _mock.Called(dst) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for First") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(dst, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_First_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'First' +type Dal_First_Call struct { + *mock.Call +} + +// First is a helper method to define mock.On call +// - dst interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) First(dst any, clauses ...any) *Dal_First_Call { + return &Dal_First_Call{Call: _e.mock.On("First", + append([]any{dst}, clauses...)...)} +} + +func (_c *Dal_First_Call) Run(run func(dst interface{}, clauses ...dal.Clause)) *Dal_First_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_First_Call) Return(error errors.Error) *Dal_First_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_First_Call) RunAndReturn(run func(dst interface{}, clauses ...dal.Clause) errors.Error) *Dal_First_Call { + _c.Call.Return(run) + return _c +} + +// GetColumns provides a mock function for the type Dal +func (_mock *Dal) GetColumns(dst dal.Tabler, filter func(columnMeta dal.ColumnMeta) bool) ([]dal.ColumnMeta, errors.Error) { + ret := _mock.Called(dst, filter) + + if len(ret) == 0 { + panic("no return value specified for GetColumns") + } + + var r0 []dal.ColumnMeta + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(dal.Tabler, func(columnMeta dal.ColumnMeta) bool) ([]dal.ColumnMeta, errors.Error)); ok { + return returnFunc(dst, filter) + } + if returnFunc, ok := ret.Get(0).(func(dal.Tabler, func(columnMeta dal.ColumnMeta) bool) []dal.ColumnMeta); ok { + r0 = returnFunc(dst, filter) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]dal.ColumnMeta) + } + } + if returnFunc, ok := ret.Get(1).(func(dal.Tabler, func(columnMeta dal.ColumnMeta) bool) errors.Error); ok { + r1 = returnFunc(dst, filter) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Dal_GetColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetColumns' +type Dal_GetColumns_Call struct { + *mock.Call +} + +// GetColumns is a helper method to define mock.On call +// - dst dal.Tabler +// - filter func(columnMeta dal.ColumnMeta) bool +func (_e *Dal_Expecter) GetColumns(dst any, filter any) *Dal_GetColumns_Call { + return &Dal_GetColumns_Call{Call: _e.mock.On("GetColumns", dst, filter)} +} + +func (_c *Dal_GetColumns_Call) Run(run func(dst dal.Tabler, filter func(columnMeta dal.ColumnMeta) bool)) *Dal_GetColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 dal.Tabler + if args[0] != nil { + arg0 = args[0].(dal.Tabler) + } + var arg1 func(columnMeta dal.ColumnMeta) bool + if args[1] != nil { + arg1 = args[1].(func(columnMeta dal.ColumnMeta) bool) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Dal_GetColumns_Call) Return(cms []dal.ColumnMeta, err errors.Error) *Dal_GetColumns_Call { + _c.Call.Return(cms, err) + return _c +} + +func (_c *Dal_GetColumns_Call) RunAndReturn(run func(dst dal.Tabler, filter func(columnMeta dal.ColumnMeta) bool) ([]dal.ColumnMeta, errors.Error)) *Dal_GetColumns_Call { + _c.Call.Return(run) + return _c +} + +// GetPrimaryKeyFields provides a mock function for the type Dal +func (_mock *Dal) GetPrimaryKeyFields(t reflect.Type) []reflect.StructField { + ret := _mock.Called(t) + + if len(ret) == 0 { + panic("no return value specified for GetPrimaryKeyFields") + } + + var r0 []reflect.StructField + if returnFunc, ok := ret.Get(0).(func(reflect.Type) []reflect.StructField); ok { + r0 = returnFunc(t) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]reflect.StructField) + } + } + return r0 +} + +// Dal_GetPrimaryKeyFields_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrimaryKeyFields' +type Dal_GetPrimaryKeyFields_Call struct { + *mock.Call +} + +// GetPrimaryKeyFields is a helper method to define mock.On call +// - t reflect.Type +func (_e *Dal_Expecter) GetPrimaryKeyFields(t any) *Dal_GetPrimaryKeyFields_Call { + return &Dal_GetPrimaryKeyFields_Call{Call: _e.mock.On("GetPrimaryKeyFields", t)} +} + +func (_c *Dal_GetPrimaryKeyFields_Call) Run(run func(t reflect.Type)) *Dal_GetPrimaryKeyFields_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 reflect.Type + if args[0] != nil { + arg0 = args[0].(reflect.Type) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Dal_GetPrimaryKeyFields_Call) Return(structFields []reflect.StructField) *Dal_GetPrimaryKeyFields_Call { + _c.Call.Return(structFields) + return _c +} + +func (_c *Dal_GetPrimaryKeyFields_Call) RunAndReturn(run func(t reflect.Type) []reflect.StructField) *Dal_GetPrimaryKeyFields_Call { + _c.Call.Return(run) + return _c +} + +// HasColumn provides a mock function for the type Dal +func (_mock *Dal) HasColumn(table interface{}, columnName string) bool { + ret := _mock.Called(table, columnName) + + if len(ret) == 0 { + panic("no return value specified for HasColumn") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(interface{}, string) bool); ok { + r0 = returnFunc(table, columnName) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Dal_HasColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasColumn' +type Dal_HasColumn_Call struct { + *mock.Call +} + +// HasColumn is a helper method to define mock.On call +// - table interface{} +// - columnName string +func (_e *Dal_Expecter) HasColumn(table any, columnName any) *Dal_HasColumn_Call { + return &Dal_HasColumn_Call{Call: _e.mock.On("HasColumn", table, columnName)} +} + +func (_c *Dal_HasColumn_Call) Run(run func(table interface{}, columnName string)) *Dal_HasColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Dal_HasColumn_Call) Return(b bool) *Dal_HasColumn_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Dal_HasColumn_Call) RunAndReturn(run func(table interface{}, columnName string) bool) *Dal_HasColumn_Call { + _c.Call.Return(run) + return _c +} + +// HasTable provides a mock function for the type Dal +func (_mock *Dal) HasTable(table interface{}) bool { + ret := _mock.Called(table) + + if len(ret) == 0 { + panic("no return value specified for HasTable") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(interface{}) bool); ok { + r0 = returnFunc(table) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Dal_HasTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasTable' +type Dal_HasTable_Call struct { + *mock.Call +} + +// HasTable is a helper method to define mock.On call +// - table interface{} +func (_e *Dal_Expecter) HasTable(table any) *Dal_HasTable_Call { + return &Dal_HasTable_Call{Call: _e.mock.On("HasTable", table)} +} + +func (_c *Dal_HasTable_Call) Run(run func(table interface{})) *Dal_HasTable_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Dal_HasTable_Call) Return(b bool) *Dal_HasTable_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Dal_HasTable_Call) RunAndReturn(run func(table interface{}) bool) *Dal_HasTable_Call { + _c.Call.Return(run) + return _c +} + +// IsDuplicationError provides a mock function for the type Dal +func (_mock *Dal) IsDuplicationError(err error) bool { + ret := _mock.Called(err) + + if len(ret) == 0 { + panic("no return value specified for IsDuplicationError") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(error) bool); ok { + r0 = returnFunc(err) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Dal_IsDuplicationError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDuplicationError' +type Dal_IsDuplicationError_Call struct { + *mock.Call +} + +// IsDuplicationError is a helper method to define mock.On call +// - err error +func (_e *Dal_Expecter) IsDuplicationError(err any) *Dal_IsDuplicationError_Call { + return &Dal_IsDuplicationError_Call{Call: _e.mock.On("IsDuplicationError", err)} +} + +func (_c *Dal_IsDuplicationError_Call) Run(run func(err error)) *Dal_IsDuplicationError_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 error + if args[0] != nil { + arg0 = args[0].(error) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Dal_IsDuplicationError_Call) Return(b bool) *Dal_IsDuplicationError_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Dal_IsDuplicationError_Call) RunAndReturn(run func(err error) bool) *Dal_IsDuplicationError_Call { + _c.Call.Return(run) + return _c +} + +// IsErrorNotFound provides a mock function for the type Dal +func (_mock *Dal) IsErrorNotFound(err error) bool { + ret := _mock.Called(err) + + if len(ret) == 0 { + panic("no return value specified for IsErrorNotFound") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(error) bool); ok { + r0 = returnFunc(err) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Dal_IsErrorNotFound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsErrorNotFound' +type Dal_IsErrorNotFound_Call struct { + *mock.Call +} + +// IsErrorNotFound is a helper method to define mock.On call +// - err error +func (_e *Dal_Expecter) IsErrorNotFound(err any) *Dal_IsErrorNotFound_Call { + return &Dal_IsErrorNotFound_Call{Call: _e.mock.On("IsErrorNotFound", err)} +} + +func (_c *Dal_IsErrorNotFound_Call) Run(run func(err error)) *Dal_IsErrorNotFound_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 error + if args[0] != nil { + arg0 = args[0].(error) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Dal_IsErrorNotFound_Call) Return(b bool) *Dal_IsErrorNotFound_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Dal_IsErrorNotFound_Call) RunAndReturn(run func(err error) bool) *Dal_IsErrorNotFound_Call { + _c.Call.Return(run) + return _c +} + +// ModifyColumnType provides a mock function for the type Dal +func (_mock *Dal) ModifyColumnType(table string, columnName string, columnType string) errors.Error { + ret := _mock.Called(table, columnName, columnType) + + if len(ret) == 0 { + panic("no return value specified for ModifyColumnType") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, string, string) errors.Error); ok { + r0 = returnFunc(table, columnName, columnType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_ModifyColumnType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyColumnType' +type Dal_ModifyColumnType_Call struct { + *mock.Call +} + +// ModifyColumnType is a helper method to define mock.On call +// - table string +// - columnName string +// - columnType string +func (_e *Dal_Expecter) ModifyColumnType(table any, columnName any, columnType any) *Dal_ModifyColumnType_Call { + return &Dal_ModifyColumnType_Call{Call: _e.mock.On("ModifyColumnType", table, columnName, columnType)} +} + +func (_c *Dal_ModifyColumnType_Call) Run(run func(table string, columnName string, columnType string)) *Dal_ModifyColumnType_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *Dal_ModifyColumnType_Call) Return(error errors.Error) *Dal_ModifyColumnType_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_ModifyColumnType_Call) RunAndReturn(run func(table string, columnName string, columnType string) errors.Error) *Dal_ModifyColumnType_Call { + _c.Call.Return(run) + return _c +} + +// Pluck provides a mock function for the type Dal +func (_mock *Dal) Pluck(column string, dest interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(column, dest, clauses) + } else { + tmpRet = _mock.Called(column, dest) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Pluck") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(column, dest, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_Pluck_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pluck' +type Dal_Pluck_Call struct { + *mock.Call +} + +// Pluck is a helper method to define mock.On call +// - column string +// - dest interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) Pluck(column any, dest any, clauses ...any) *Dal_Pluck_Call { + return &Dal_Pluck_Call{Call: _e.mock.On("Pluck", + append([]any{column, dest}, clauses...)...)} +} + +func (_c *Dal_Pluck_Call) Run(run func(column string, dest interface{}, clauses ...dal.Clause)) *Dal_Pluck_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 interface{} + if args[1] != nil { + arg1 = args[1].(interface{}) + } + var arg2 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 2 { + variadicArgs = args[2].([]dal.Clause) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *Dal_Pluck_Call) Return(error errors.Error) *Dal_Pluck_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_Pluck_Call) RunAndReturn(run func(column string, dest interface{}, clauses ...dal.Clause) errors.Error) *Dal_Pluck_Call { + _c.Call.Return(run) + return _c +} + +// RawCursor provides a mock function for the type Dal +func (_mock *Dal) RawCursor(query string, params ...interface{}) (*sql.Rows, errors.Error) { + var tmpRet mock.Arguments + if len(params) > 0 { + tmpRet = _mock.Called(query, params) + } else { + tmpRet = _mock.Called(query) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for RawCursor") + } + + var r0 *sql.Rows + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...interface{}) (*sql.Rows, errors.Error)); ok { + return returnFunc(query, params...) + } + if returnFunc, ok := ret.Get(0).(func(string, ...interface{}) *sql.Rows); ok { + r0 = returnFunc(query, params...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sql.Rows) + } + } + if returnFunc, ok := ret.Get(1).(func(string, ...interface{}) errors.Error); ok { + r1 = returnFunc(query, params...) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Dal_RawCursor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RawCursor' +type Dal_RawCursor_Call struct { + *mock.Call +} + +// RawCursor is a helper method to define mock.On call +// - query string +// - params ...interface{} +func (_e *Dal_Expecter) RawCursor(query any, params ...any) *Dal_RawCursor_Call { + return &Dal_RawCursor_Call{Call: _e.mock.On("RawCursor", + append([]any{query}, params...)...)} +} + +func (_c *Dal_RawCursor_Call) Run(run func(query string, params ...interface{})) *Dal_RawCursor_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []interface{} + var variadicArgs []interface{} + if len(args) > 1 { + variadicArgs = args[1].([]interface{}) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_RawCursor_Call) Return(rows *sql.Rows, error errors.Error) *Dal_RawCursor_Call { + _c.Call.Return(rows, error) + return _c +} + +func (_c *Dal_RawCursor_Call) RunAndReturn(run func(query string, params ...interface{}) (*sql.Rows, errors.Error)) *Dal_RawCursor_Call { + _c.Call.Return(run) + return _c +} + +// RenameColumn provides a mock function for the type Dal +func (_mock *Dal) RenameColumn(table string, oldColumnName string, newColumnName string) errors.Error { + ret := _mock.Called(table, oldColumnName, newColumnName) + + if len(ret) == 0 { + panic("no return value specified for RenameColumn") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, string, string) errors.Error); ok { + r0 = returnFunc(table, oldColumnName, newColumnName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_RenameColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenameColumn' +type Dal_RenameColumn_Call struct { + *mock.Call +} + +// RenameColumn is a helper method to define mock.On call +// - table string +// - oldColumnName string +// - newColumnName string +func (_e *Dal_Expecter) RenameColumn(table any, oldColumnName any, newColumnName any) *Dal_RenameColumn_Call { + return &Dal_RenameColumn_Call{Call: _e.mock.On("RenameColumn", table, oldColumnName, newColumnName)} +} + +func (_c *Dal_RenameColumn_Call) Run(run func(table string, oldColumnName string, newColumnName string)) *Dal_RenameColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *Dal_RenameColumn_Call) Return(error errors.Error) *Dal_RenameColumn_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_RenameColumn_Call) RunAndReturn(run func(table string, oldColumnName string, newColumnName string) errors.Error) *Dal_RenameColumn_Call { + _c.Call.Return(run) + return _c +} + +// RenameTable provides a mock function for the type Dal +func (_mock *Dal) RenameTable(oldName string, newName string) errors.Error { + ret := _mock.Called(oldName, newName) + + if len(ret) == 0 { + panic("no return value specified for RenameTable") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, string) errors.Error); ok { + r0 = returnFunc(oldName, newName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_RenameTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenameTable' +type Dal_RenameTable_Call struct { + *mock.Call +} + +// RenameTable is a helper method to define mock.On call +// - oldName string +// - newName string +func (_e *Dal_Expecter) RenameTable(oldName any, newName any) *Dal_RenameTable_Call { + return &Dal_RenameTable_Call{Call: _e.mock.On("RenameTable", oldName, newName)} +} + +func (_c *Dal_RenameTable_Call) Run(run func(oldName string, newName string)) *Dal_RenameTable_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Dal_RenameTable_Call) Return(error errors.Error) *Dal_RenameTable_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_RenameTable_Call) RunAndReturn(run func(oldName string, newName string) errors.Error) *Dal_RenameTable_Call { + _c.Call.Return(run) + return _c +} + +// Session provides a mock function for the type Dal +func (_mock *Dal) Session(config dal.SessionConfig) dal.Dal { + ret := _mock.Called(config) + + if len(ret) == 0 { + panic("no return value specified for Session") + } + + var r0 dal.Dal + if returnFunc, ok := ret.Get(0).(func(dal.SessionConfig) dal.Dal); ok { + r0 = returnFunc(config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Dal) + } + } + return r0 +} + +// Dal_Session_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Session' +type Dal_Session_Call struct { + *mock.Call +} + +// Session is a helper method to define mock.On call +// - config dal.SessionConfig +func (_e *Dal_Expecter) Session(config any) *Dal_Session_Call { + return &Dal_Session_Call{Call: _e.mock.On("Session", config)} +} + +func (_c *Dal_Session_Call) Run(run func(config dal.SessionConfig)) *Dal_Session_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 dal.SessionConfig + if args[0] != nil { + arg0 = args[0].(dal.SessionConfig) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Dal_Session_Call) Return(dal1 dal.Dal) *Dal_Session_Call { + _c.Call.Return(dal1) + return _c +} + +func (_c *Dal_Session_Call) RunAndReturn(run func(config dal.SessionConfig) dal.Dal) *Dal_Session_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function for the type Dal +func (_mock *Dal) Update(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type Dal_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) Update(entity any, clauses ...any) *Dal_Update_Call { + return &Dal_Update_Call{Call: _e.mock.On("Update", + append([]any{entity}, clauses...)...)} +} + +func (_c *Dal_Update_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Dal_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_Update_Call) Return(error errors.Error) *Dal_Update_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_Update_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Dal_Update_Call { + _c.Call.Return(run) + return _c +} + +// UpdateAllColumn provides a mock function for the type Dal +func (_mock *Dal) UpdateAllColumn(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for UpdateAllColumn") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_UpdateAllColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAllColumn' +type Dal_UpdateAllColumn_Call struct { + *mock.Call +} + +// UpdateAllColumn is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) UpdateAllColumn(entity any, clauses ...any) *Dal_UpdateAllColumn_Call { + return &Dal_UpdateAllColumn_Call{Call: _e.mock.On("UpdateAllColumn", + append([]any{entity}, clauses...)...)} +} + +func (_c *Dal_UpdateAllColumn_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Dal_UpdateAllColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Dal_UpdateAllColumn_Call) Return(error errors.Error) *Dal_UpdateAllColumn_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_UpdateAllColumn_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Dal_UpdateAllColumn_Call { + _c.Call.Return(run) + return _c +} + +// UpdateColumn provides a mock function for the type Dal +func (_mock *Dal) UpdateColumn(entityOrTable interface{}, columnName string, value interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entityOrTable, columnName, value, clauses) + } else { + tmpRet = _mock.Called(entityOrTable, columnName, value) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for UpdateColumn") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, string, interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entityOrTable, columnName, value, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_UpdateColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateColumn' +type Dal_UpdateColumn_Call struct { + *mock.Call +} + +// UpdateColumn is a helper method to define mock.On call +// - entityOrTable interface{} +// - columnName string +// - value interface{} +// - clauses ...dal.Clause +func (_e *Dal_Expecter) UpdateColumn(entityOrTable any, columnName any, value any, clauses ...any) *Dal_UpdateColumn_Call { + return &Dal_UpdateColumn_Call{Call: _e.mock.On("UpdateColumn", + append([]any{entityOrTable, columnName, value}, clauses...)...)} +} + +func (_c *Dal_UpdateColumn_Call) Run(run func(entityOrTable interface{}, columnName string, value interface{}, clauses ...dal.Clause)) *Dal_UpdateColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 interface{} + if args[2] != nil { + arg2 = args[2].(interface{}) + } + var arg3 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 3 { + variadicArgs = args[3].([]dal.Clause) + } + arg3 = variadicArgs + run( + arg0, + arg1, + arg2, + arg3..., + ) + }) + return _c +} + +func (_c *Dal_UpdateColumn_Call) Return(error errors.Error) *Dal_UpdateColumn_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_UpdateColumn_Call) RunAndReturn(run func(entityOrTable interface{}, columnName string, value interface{}, clauses ...dal.Clause) errors.Error) *Dal_UpdateColumn_Call { + _c.Call.Return(run) + return _c +} + +// UpdateColumns provides a mock function for the type Dal +func (_mock *Dal) UpdateColumns(entityOrTable interface{}, set []dal.DalSet, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entityOrTable, set, clauses) + } else { + tmpRet = _mock.Called(entityOrTable, set) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for UpdateColumns") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, []dal.DalSet, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entityOrTable, set, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Dal_UpdateColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateColumns' +type Dal_UpdateColumns_Call struct { + *mock.Call +} + +// UpdateColumns is a helper method to define mock.On call +// - entityOrTable interface{} +// - set []dal.DalSet +// - clauses ...dal.Clause +func (_e *Dal_Expecter) UpdateColumns(entityOrTable any, set any, clauses ...any) *Dal_UpdateColumns_Call { + return &Dal_UpdateColumns_Call{Call: _e.mock.On("UpdateColumns", + append([]any{entityOrTable, set}, clauses...)...)} +} + +func (_c *Dal_UpdateColumns_Call) Run(run func(entityOrTable interface{}, set []dal.DalSet, clauses ...dal.Clause)) *Dal_UpdateColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.DalSet + if args[1] != nil { + arg1 = args[1].([]dal.DalSet) + } + var arg2 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 2 { + variadicArgs = args[2].([]dal.Clause) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *Dal_UpdateColumns_Call) Return(error errors.Error) *Dal_UpdateColumns_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Dal_UpdateColumns_Call) RunAndReturn(run func(entityOrTable interface{}, set []dal.DalSet, clauses ...dal.Clause) errors.Error) *Dal_UpdateColumns_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/dal/Rows.go b/backend/mocks/core/dal/Rows.go new file mode 100644 index 00000000000..b692bfd237e --- /dev/null +++ b/backend/mocks/core/dal/Rows.go @@ -0,0 +1,340 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "database/sql" + + mock "github.com/stretchr/testify/mock" +) + +// NewRows creates a new instance of Rows. 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 NewRows(t interface { + mock.TestingT + Cleanup(func()) +}) *Rows { + mock := &Rows{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// Rows is an autogenerated mock type for the Rows type +type Rows struct { + mock.Mock +} + +type Rows_Expecter struct { + mock *mock.Mock +} + +func (_m *Rows) EXPECT() *Rows_Expecter { + return &Rows_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function for the type Rows +func (_mock *Rows) Close() error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() + } else { + r0 = ret.Error(0) + } + return r0 +} + +// Rows_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Rows_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Rows_Expecter) Close() *Rows_Close_Call { + return &Rows_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Rows_Close_Call) Run(run func()) *Rows_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Rows_Close_Call) Return(err error) *Rows_Close_Call { + _c.Call.Return(err) + return _c +} + +func (_c *Rows_Close_Call) RunAndReturn(run func() error) *Rows_Close_Call { + _c.Call.Return(run) + return _c +} + +// ColumnTypes provides a mock function for the type Rows +func (_mock *Rows) ColumnTypes() ([]*sql.ColumnType, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ColumnTypes") + } + + var r0 []*sql.ColumnType + var r1 error + if returnFunc, ok := ret.Get(0).(func() ([]*sql.ColumnType, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []*sql.ColumnType); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*sql.ColumnType) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// Rows_ColumnTypes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ColumnTypes' +type Rows_ColumnTypes_Call struct { + *mock.Call +} + +// ColumnTypes is a helper method to define mock.On call +func (_e *Rows_Expecter) ColumnTypes() *Rows_ColumnTypes_Call { + return &Rows_ColumnTypes_Call{Call: _e.mock.On("ColumnTypes")} +} + +func (_c *Rows_ColumnTypes_Call) Run(run func()) *Rows_ColumnTypes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Rows_ColumnTypes_Call) Return(columnTypes []*sql.ColumnType, err error) *Rows_ColumnTypes_Call { + _c.Call.Return(columnTypes, err) + return _c +} + +func (_c *Rows_ColumnTypes_Call) RunAndReturn(run func() ([]*sql.ColumnType, error)) *Rows_ColumnTypes_Call { + _c.Call.Return(run) + return _c +} + +// Columns provides a mock function for the type Rows +func (_mock *Rows) Columns() ([]string, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Columns") + } + + var r0 []string + var r1 error + if returnFunc, ok := ret.Get(0).(func() ([]string, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []string); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// Rows_Columns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Columns' +type Rows_Columns_Call struct { + *mock.Call +} + +// Columns is a helper method to define mock.On call +func (_e *Rows_Expecter) Columns() *Rows_Columns_Call { + return &Rows_Columns_Call{Call: _e.mock.On("Columns")} +} + +func (_c *Rows_Columns_Call) Run(run func()) *Rows_Columns_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Rows_Columns_Call) Return(strings []string, err error) *Rows_Columns_Call { + _c.Call.Return(strings, err) + return _c +} + +func (_c *Rows_Columns_Call) RunAndReturn(run func() ([]string, error)) *Rows_Columns_Call { + _c.Call.Return(run) + return _c +} + +// Err provides a mock function for the type Rows +func (_mock *Rows) Err() error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Err") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() + } else { + r0 = ret.Error(0) + } + return r0 +} + +// Rows_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err' +type Rows_Err_Call struct { + *mock.Call +} + +// Err is a helper method to define mock.On call +func (_e *Rows_Expecter) Err() *Rows_Err_Call { + return &Rows_Err_Call{Call: _e.mock.On("Err")} +} + +func (_c *Rows_Err_Call) Run(run func()) *Rows_Err_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Rows_Err_Call) Return(err error) *Rows_Err_Call { + _c.Call.Return(err) + return _c +} + +func (_c *Rows_Err_Call) RunAndReturn(run func() error) *Rows_Err_Call { + _c.Call.Return(run) + return _c +} + +// Next provides a mock function for the type Rows +func (_mock *Rows) Next() bool { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Next") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Rows_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next' +type Rows_Next_Call struct { + *mock.Call +} + +// Next is a helper method to define mock.On call +func (_e *Rows_Expecter) Next() *Rows_Next_Call { + return &Rows_Next_Call{Call: _e.mock.On("Next")} +} + +func (_c *Rows_Next_Call) Run(run func()) *Rows_Next_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Rows_Next_Call) Return(b bool) *Rows_Next_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Rows_Next_Call) RunAndReturn(run func() bool) *Rows_Next_Call { + _c.Call.Return(run) + return _c +} + +// Scan provides a mock function for the type Rows +func (_mock *Rows) Scan(dest ...any) error { + var tmpRet mock.Arguments + if len(dest) > 0 { + tmpRet = _mock.Called(dest) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Scan") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(...any) error); ok { + r0 = returnFunc(dest...) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// Rows_Scan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Scan' +type Rows_Scan_Call struct { + *mock.Call +} + +// Scan is a helper method to define mock.On call +// - dest ...any +func (_e *Rows_Expecter) Scan(dest ...any) *Rows_Scan_Call { + return &Rows_Scan_Call{Call: _e.mock.On("Scan", + append([]any{}, dest...)...)} +} + +func (_c *Rows_Scan_Call) Run(run func(dest ...any)) *Rows_Scan_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []any + var variadicArgs []any + if len(args) > 0 { + variadicArgs = args[0].([]any) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *Rows_Scan_Call) Return(err error) *Rows_Scan_Call { + _c.Call.Return(err) + return _c +} + +func (_c *Rows_Scan_Call) RunAndReturn(run func(dest ...any) error) *Rows_Scan_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/dal/Tabler.go b/backend/mocks/core/dal/Tabler.go new file mode 100644 index 00000000000..aed39698d94 --- /dev/null +++ b/backend/mocks/core/dal/Tabler.go @@ -0,0 +1,80 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewTabler creates a new instance of Tabler. 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 NewTabler(t interface { + mock.TestingT + Cleanup(func()) +}) *Tabler { + mock := &Tabler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// Tabler is an autogenerated mock type for the Tabler type +type Tabler struct { + mock.Mock +} + +type Tabler_Expecter struct { + mock *mock.Mock +} + +func (_m *Tabler) EXPECT() *Tabler_Expecter { + return &Tabler_Expecter{mock: &_m.Mock} +} + +// TableName provides a mock function for the type Tabler +func (_mock *Tabler) TableName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for TableName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// Tabler_TableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TableName' +type Tabler_TableName_Call struct { + *mock.Call +} + +// TableName is a helper method to define mock.On call +func (_e *Tabler_Expecter) TableName() *Tabler_TableName_Call { + return &Tabler_TableName_Call{Call: _e.mock.On("TableName")} +} + +func (_c *Tabler_TableName_Call) Run(run func()) *Tabler_TableName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Tabler_TableName_Call) Return(s string) *Tabler_TableName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *Tabler_TableName_Call) RunAndReturn(run func() string) *Tabler_TableName_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/dal/Transaction.go b/backend/mocks/core/dal/Transaction.go new file mode 100644 index 00000000000..3af2de16088 --- /dev/null +++ b/backend/mocks/core/dal/Transaction.go @@ -0,0 +1,2534 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "database/sql" + "reflect" + + "github.com/apache/devlake/core/dal" + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewTransaction creates a new instance of Transaction. 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 NewTransaction(t interface { + mock.TestingT + Cleanup(func()) +}) *Transaction { + mock := &Transaction{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// Transaction is an autogenerated mock type for the Transaction type +type Transaction struct { + mock.Mock +} + +type Transaction_Expecter struct { + mock *mock.Mock +} + +func (_m *Transaction) EXPECT() *Transaction_Expecter { + return &Transaction_Expecter{mock: &_m.Mock} +} + +// AddColumn provides a mock function for the type Transaction +func (_mock *Transaction) AddColumn(table string, columnName string, columnType dal.ColumnType) errors.Error { + ret := _mock.Called(table, columnName, columnType) + + if len(ret) == 0 { + panic("no return value specified for AddColumn") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, string, dal.ColumnType) errors.Error); ok { + r0 = returnFunc(table, columnName, columnType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_AddColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddColumn' +type Transaction_AddColumn_Call struct { + *mock.Call +} + +// AddColumn is a helper method to define mock.On call +// - table string +// - columnName string +// - columnType dal.ColumnType +func (_e *Transaction_Expecter) AddColumn(table any, columnName any, columnType any) *Transaction_AddColumn_Call { + return &Transaction_AddColumn_Call{Call: _e.mock.On("AddColumn", table, columnName, columnType)} +} + +func (_c *Transaction_AddColumn_Call) Run(run func(table string, columnName string, columnType dal.ColumnType)) *Transaction_AddColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 dal.ColumnType + if args[2] != nil { + arg2 = args[2].(dal.ColumnType) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *Transaction_AddColumn_Call) Return(error errors.Error) *Transaction_AddColumn_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_AddColumn_Call) RunAndReturn(run func(table string, columnName string, columnType dal.ColumnType) errors.Error) *Transaction_AddColumn_Call { + _c.Call.Return(run) + return _c +} + +// All provides a mock function for the type Transaction +func (_mock *Transaction) All(dst interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(dst, clauses) + } else { + tmpRet = _mock.Called(dst) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for All") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(dst, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_All_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'All' +type Transaction_All_Call struct { + *mock.Call +} + +// All is a helper method to define mock.On call +// - dst interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) All(dst any, clauses ...any) *Transaction_All_Call { + return &Transaction_All_Call{Call: _e.mock.On("All", + append([]any{dst}, clauses...)...)} +} + +func (_c *Transaction_All_Call) Run(run func(dst interface{}, clauses ...dal.Clause)) *Transaction_All_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_All_Call) Return(error errors.Error) *Transaction_All_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_All_Call) RunAndReturn(run func(dst interface{}, clauses ...dal.Clause) errors.Error) *Transaction_All_Call { + _c.Call.Return(run) + return _c +} + +// AllTables provides a mock function for the type Transaction +func (_mock *Transaction) AllTables() ([]string, errors.Error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for AllTables") + } + + var r0 []string + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func() ([]string, errors.Error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []string); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + if returnFunc, ok := ret.Get(1).(func() errors.Error); ok { + r1 = returnFunc() + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Transaction_AllTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllTables' +type Transaction_AllTables_Call struct { + *mock.Call +} + +// AllTables is a helper method to define mock.On call +func (_e *Transaction_Expecter) AllTables() *Transaction_AllTables_Call { + return &Transaction_AllTables_Call{Call: _e.mock.On("AllTables")} +} + +func (_c *Transaction_AllTables_Call) Run(run func()) *Transaction_AllTables_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_AllTables_Call) Return(strings []string, error errors.Error) *Transaction_AllTables_Call { + _c.Call.Return(strings, error) + return _c +} + +func (_c *Transaction_AllTables_Call) RunAndReturn(run func() ([]string, errors.Error)) *Transaction_AllTables_Call { + _c.Call.Return(run) + return _c +} + +// AutoMigrate provides a mock function for the type Transaction +func (_mock *Transaction) AutoMigrate(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for AutoMigrate") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_AutoMigrate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AutoMigrate' +type Transaction_AutoMigrate_Call struct { + *mock.Call +} + +// AutoMigrate is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) AutoMigrate(entity any, clauses ...any) *Transaction_AutoMigrate_Call { + return &Transaction_AutoMigrate_Call{Call: _e.mock.On("AutoMigrate", + append([]any{entity}, clauses...)...)} +} + +func (_c *Transaction_AutoMigrate_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Transaction_AutoMigrate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_AutoMigrate_Call) Return(error errors.Error) *Transaction_AutoMigrate_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_AutoMigrate_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Transaction_AutoMigrate_Call { + _c.Call.Return(run) + return _c +} + +// Begin provides a mock function for the type Transaction +func (_mock *Transaction) Begin() dal.Transaction { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Begin") + } + + var r0 dal.Transaction + if returnFunc, ok := ret.Get(0).(func() dal.Transaction); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Transaction) + } + } + return r0 +} + +// Transaction_Begin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Begin' +type Transaction_Begin_Call struct { + *mock.Call +} + +// Begin is a helper method to define mock.On call +func (_e *Transaction_Expecter) Begin() *Transaction_Begin_Call { + return &Transaction_Begin_Call{Call: _e.mock.On("Begin")} +} + +func (_c *Transaction_Begin_Call) Run(run func()) *Transaction_Begin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_Begin_Call) Return(transaction dal.Transaction) *Transaction_Begin_Call { + _c.Call.Return(transaction) + return _c +} + +func (_c *Transaction_Begin_Call) RunAndReturn(run func() dal.Transaction) *Transaction_Begin_Call { + _c.Call.Return(run) + return _c +} + +// Commit provides a mock function for the type Transaction +func (_mock *Transaction) Commit() errors.Error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Commit") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func() errors.Error); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit' +type Transaction_Commit_Call struct { + *mock.Call +} + +// Commit is a helper method to define mock.On call +func (_e *Transaction_Expecter) Commit() *Transaction_Commit_Call { + return &Transaction_Commit_Call{Call: _e.mock.On("Commit")} +} + +func (_c *Transaction_Commit_Call) Run(run func()) *Transaction_Commit_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_Commit_Call) Return(error errors.Error) *Transaction_Commit_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_Commit_Call) RunAndReturn(run func() errors.Error) *Transaction_Commit_Call { + _c.Call.Return(run) + return _c +} + +// Count provides a mock function for the type Transaction +func (_mock *Transaction) Count(clauses ...dal.Clause) (int64, errors.Error) { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(clauses) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Count") + } + + var r0 int64 + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(...dal.Clause) (int64, errors.Error)); ok { + return returnFunc(clauses...) + } + if returnFunc, ok := ret.Get(0).(func(...dal.Clause) int64); ok { + r0 = returnFunc(clauses...) + } else { + r0 = ret.Get(0).(int64) + } + if returnFunc, ok := ret.Get(1).(func(...dal.Clause) errors.Error); ok { + r1 = returnFunc(clauses...) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Transaction_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count' +type Transaction_Count_Call struct { + *mock.Call +} + +// Count is a helper method to define mock.On call +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) Count(clauses ...any) *Transaction_Count_Call { + return &Transaction_Count_Call{Call: _e.mock.On("Count", + append([]any{}, clauses...)...)} +} + +func (_c *Transaction_Count_Call) Run(run func(clauses ...dal.Clause)) *Transaction_Count_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 0 { + variadicArgs = args[0].([]dal.Clause) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *Transaction_Count_Call) Return(n int64, error errors.Error) *Transaction_Count_Call { + _c.Call.Return(n, error) + return _c +} + +func (_c *Transaction_Count_Call) RunAndReturn(run func(clauses ...dal.Clause) (int64, errors.Error)) *Transaction_Count_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function for the type Transaction +func (_mock *Transaction) Create(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Transaction_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) Create(entity any, clauses ...any) *Transaction_Create_Call { + return &Transaction_Create_Call{Call: _e.mock.On("Create", + append([]any{entity}, clauses...)...)} +} + +func (_c *Transaction_Create_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Transaction_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_Create_Call) Return(error errors.Error) *Transaction_Create_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_Create_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Transaction_Create_Call { + _c.Call.Return(run) + return _c +} + +// CreateIfNotExist provides a mock function for the type Transaction +func (_mock *Transaction) CreateIfNotExist(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for CreateIfNotExist") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_CreateIfNotExist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateIfNotExist' +type Transaction_CreateIfNotExist_Call struct { + *mock.Call +} + +// CreateIfNotExist is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) CreateIfNotExist(entity any, clauses ...any) *Transaction_CreateIfNotExist_Call { + return &Transaction_CreateIfNotExist_Call{Call: _e.mock.On("CreateIfNotExist", + append([]any{entity}, clauses...)...)} +} + +func (_c *Transaction_CreateIfNotExist_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Transaction_CreateIfNotExist_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_CreateIfNotExist_Call) Return(error errors.Error) *Transaction_CreateIfNotExist_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_CreateIfNotExist_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Transaction_CreateIfNotExist_Call { + _c.Call.Return(run) + return _c +} + +// CreateOrUpdate provides a mock function for the type Transaction +func (_mock *Transaction) CreateOrUpdate(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for CreateOrUpdate") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_CreateOrUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrUpdate' +type Transaction_CreateOrUpdate_Call struct { + *mock.Call +} + +// CreateOrUpdate is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) CreateOrUpdate(entity any, clauses ...any) *Transaction_CreateOrUpdate_Call { + return &Transaction_CreateOrUpdate_Call{Call: _e.mock.On("CreateOrUpdate", + append([]any{entity}, clauses...)...)} +} + +func (_c *Transaction_CreateOrUpdate_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Transaction_CreateOrUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_CreateOrUpdate_Call) Return(error errors.Error) *Transaction_CreateOrUpdate_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_CreateOrUpdate_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Transaction_CreateOrUpdate_Call { + _c.Call.Return(run) + return _c +} + +// CreateWithMap provides a mock function for the type Transaction +func (_mock *Transaction) CreateWithMap(entity interface{}, record map[string]interface{}) errors.Error { + ret := _mock.Called(entity, record) + + if len(ret) == 0 { + panic("no return value specified for CreateWithMap") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, map[string]interface{}) errors.Error); ok { + r0 = returnFunc(entity, record) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_CreateWithMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateWithMap' +type Transaction_CreateWithMap_Call struct { + *mock.Call +} + +// CreateWithMap is a helper method to define mock.On call +// - entity interface{} +// - record map[string]interface{} +func (_e *Transaction_Expecter) CreateWithMap(entity any, record any) *Transaction_CreateWithMap_Call { + return &Transaction_CreateWithMap_Call{Call: _e.mock.On("CreateWithMap", entity, record)} +} + +func (_c *Transaction_CreateWithMap_Call) Run(run func(entity interface{}, record map[string]interface{})) *Transaction_CreateWithMap_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 map[string]interface{} + if args[1] != nil { + arg1 = args[1].(map[string]interface{}) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Transaction_CreateWithMap_Call) Return(error errors.Error) *Transaction_CreateWithMap_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_CreateWithMap_Call) RunAndReturn(run func(entity interface{}, record map[string]interface{}) errors.Error) *Transaction_CreateWithMap_Call { + _c.Call.Return(run) + return _c +} + +// Cursor provides a mock function for the type Transaction +func (_mock *Transaction) Cursor(clauses ...dal.Clause) (dal.Rows, errors.Error) { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(clauses) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Cursor") + } + + var r0 dal.Rows + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(...dal.Clause) (dal.Rows, errors.Error)); ok { + return returnFunc(clauses...) + } + if returnFunc, ok := ret.Get(0).(func(...dal.Clause) dal.Rows); ok { + r0 = returnFunc(clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Rows) + } + } + if returnFunc, ok := ret.Get(1).(func(...dal.Clause) errors.Error); ok { + r1 = returnFunc(clauses...) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Transaction_Cursor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cursor' +type Transaction_Cursor_Call struct { + *mock.Call +} + +// Cursor is a helper method to define mock.On call +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) Cursor(clauses ...any) *Transaction_Cursor_Call { + return &Transaction_Cursor_Call{Call: _e.mock.On("Cursor", + append([]any{}, clauses...)...)} +} + +func (_c *Transaction_Cursor_Call) Run(run func(clauses ...dal.Clause)) *Transaction_Cursor_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 0 { + variadicArgs = args[0].([]dal.Clause) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *Transaction_Cursor_Call) Return(rows dal.Rows, error errors.Error) *Transaction_Cursor_Call { + _c.Call.Return(rows, error) + return _c +} + +func (_c *Transaction_Cursor_Call) RunAndReturn(run func(clauses ...dal.Clause) (dal.Rows, errors.Error)) *Transaction_Cursor_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function for the type Transaction +func (_mock *Transaction) Delete(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Transaction_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) Delete(entity any, clauses ...any) *Transaction_Delete_Call { + return &Transaction_Delete_Call{Call: _e.mock.On("Delete", + append([]any{entity}, clauses...)...)} +} + +func (_c *Transaction_Delete_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Transaction_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_Delete_Call) Return(error errors.Error) *Transaction_Delete_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_Delete_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Transaction_Delete_Call { + _c.Call.Return(run) + return _c +} + +// Dialect provides a mock function for the type Transaction +func (_mock *Transaction) Dialect() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Dialect") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// Transaction_Dialect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dialect' +type Transaction_Dialect_Call struct { + *mock.Call +} + +// Dialect is a helper method to define mock.On call +func (_e *Transaction_Expecter) Dialect() *Transaction_Dialect_Call { + return &Transaction_Dialect_Call{Call: _e.mock.On("Dialect")} +} + +func (_c *Transaction_Dialect_Call) Run(run func()) *Transaction_Dialect_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_Dialect_Call) Return(s string) *Transaction_Dialect_Call { + _c.Call.Return(s) + return _c +} + +func (_c *Transaction_Dialect_Call) RunAndReturn(run func() string) *Transaction_Dialect_Call { + _c.Call.Return(run) + return _c +} + +// DropColumns provides a mock function for the type Transaction +func (_mock *Transaction) DropColumns(table string, columnName ...string) errors.Error { + var tmpRet mock.Arguments + if len(columnName) > 0 { + tmpRet = _mock.Called(table, columnName) + } else { + tmpRet = _mock.Called(table) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for DropColumns") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...string) errors.Error); ok { + r0 = returnFunc(table, columnName...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_DropColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropColumns' +type Transaction_DropColumns_Call struct { + *mock.Call +} + +// DropColumns is a helper method to define mock.On call +// - table string +// - columnName ...string +func (_e *Transaction_Expecter) DropColumns(table any, columnName ...any) *Transaction_DropColumns_Call { + return &Transaction_DropColumns_Call{Call: _e.mock.On("DropColumns", + append([]any{table}, columnName...)...)} +} + +func (_c *Transaction_DropColumns_Call) Run(run func(table string, columnName ...string)) *Transaction_DropColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []string + var variadicArgs []string + if len(args) > 1 { + variadicArgs = args[1].([]string) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_DropColumns_Call) Return(error errors.Error) *Transaction_DropColumns_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_DropColumns_Call) RunAndReturn(run func(table string, columnName ...string) errors.Error) *Transaction_DropColumns_Call { + _c.Call.Return(run) + return _c +} + +// DropIndex provides a mock function for the type Transaction +func (_mock *Transaction) DropIndex(table string, columnNames ...string) errors.Error { + var tmpRet mock.Arguments + if len(columnNames) > 0 { + tmpRet = _mock.Called(table, columnNames) + } else { + tmpRet = _mock.Called(table) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for DropIndex") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...string) errors.Error); ok { + r0 = returnFunc(table, columnNames...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_DropIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropIndex' +type Transaction_DropIndex_Call struct { + *mock.Call +} + +// DropIndex is a helper method to define mock.On call +// - table string +// - columnNames ...string +func (_e *Transaction_Expecter) DropIndex(table any, columnNames ...any) *Transaction_DropIndex_Call { + return &Transaction_DropIndex_Call{Call: _e.mock.On("DropIndex", + append([]any{table}, columnNames...)...)} +} + +func (_c *Transaction_DropIndex_Call) Run(run func(table string, columnNames ...string)) *Transaction_DropIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []string + var variadicArgs []string + if len(args) > 1 { + variadicArgs = args[1].([]string) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_DropIndex_Call) Return(error errors.Error) *Transaction_DropIndex_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_DropIndex_Call) RunAndReturn(run func(table string, columnNames ...string) errors.Error) *Transaction_DropIndex_Call { + _c.Call.Return(run) + return _c +} + +// DropIndexes provides a mock function for the type Transaction +func (_mock *Transaction) DropIndexes(table string, indexes ...string) errors.Error { + var tmpRet mock.Arguments + if len(indexes) > 0 { + tmpRet = _mock.Called(table, indexes) + } else { + tmpRet = _mock.Called(table) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for DropIndexes") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...string) errors.Error); ok { + r0 = returnFunc(table, indexes...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_DropIndexes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropIndexes' +type Transaction_DropIndexes_Call struct { + *mock.Call +} + +// DropIndexes is a helper method to define mock.On call +// - table string +// - indexes ...string +func (_e *Transaction_Expecter) DropIndexes(table any, indexes ...any) *Transaction_DropIndexes_Call { + return &Transaction_DropIndexes_Call{Call: _e.mock.On("DropIndexes", + append([]any{table}, indexes...)...)} +} + +func (_c *Transaction_DropIndexes_Call) Run(run func(table string, indexes ...string)) *Transaction_DropIndexes_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []string + var variadicArgs []string + if len(args) > 1 { + variadicArgs = args[1].([]string) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_DropIndexes_Call) Return(error errors.Error) *Transaction_DropIndexes_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_DropIndexes_Call) RunAndReturn(run func(table string, indexes ...string) errors.Error) *Transaction_DropIndexes_Call { + _c.Call.Return(run) + return _c +} + +// DropTables provides a mock function for the type Transaction +func (_mock *Transaction) DropTables(dst ...interface{}) errors.Error { + var tmpRet mock.Arguments + if len(dst) > 0 { + tmpRet = _mock.Called(dst) + } else { + tmpRet = _mock.Called() + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for DropTables") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(...interface{}) errors.Error); ok { + r0 = returnFunc(dst...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_DropTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DropTables' +type Transaction_DropTables_Call struct { + *mock.Call +} + +// DropTables is a helper method to define mock.On call +// - dst ...interface{} +func (_e *Transaction_Expecter) DropTables(dst ...any) *Transaction_DropTables_Call { + return &Transaction_DropTables_Call{Call: _e.mock.On("DropTables", + append([]any{}, dst...)...)} +} + +func (_c *Transaction_DropTables_Call) Run(run func(dst ...interface{})) *Transaction_DropTables_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []interface{} + var variadicArgs []interface{} + if len(args) > 0 { + variadicArgs = args[0].([]interface{}) + } + arg0 = variadicArgs + run( + arg0..., + ) + }) + return _c +} + +func (_c *Transaction_DropTables_Call) Return(error errors.Error) *Transaction_DropTables_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_DropTables_Call) RunAndReturn(run func(dst ...interface{}) errors.Error) *Transaction_DropTables_Call { + _c.Call.Return(run) + return _c +} + +// Exec provides a mock function for the type Transaction +func (_mock *Transaction) Exec(query string, params ...interface{}) errors.Error { + var tmpRet mock.Arguments + if len(params) > 0 { + tmpRet = _mock.Called(query, params) + } else { + tmpRet = _mock.Called(query) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Exec") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...interface{}) errors.Error); ok { + r0 = returnFunc(query, params...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_Exec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Exec' +type Transaction_Exec_Call struct { + *mock.Call +} + +// Exec is a helper method to define mock.On call +// - query string +// - params ...interface{} +func (_e *Transaction_Expecter) Exec(query any, params ...any) *Transaction_Exec_Call { + return &Transaction_Exec_Call{Call: _e.mock.On("Exec", + append([]any{query}, params...)...)} +} + +func (_c *Transaction_Exec_Call) Run(run func(query string, params ...interface{})) *Transaction_Exec_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []interface{} + var variadicArgs []interface{} + if len(args) > 1 { + variadicArgs = args[1].([]interface{}) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_Exec_Call) Return(error errors.Error) *Transaction_Exec_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_Exec_Call) RunAndReturn(run func(query string, params ...interface{}) errors.Error) *Transaction_Exec_Call { + _c.Call.Return(run) + return _c +} + +// Fetch provides a mock function for the type Transaction +func (_mock *Transaction) Fetch(cursor dal.Rows, dst interface{}) errors.Error { + ret := _mock.Called(cursor, dst) + + if len(ret) == 0 { + panic("no return value specified for Fetch") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(dal.Rows, interface{}) errors.Error); ok { + r0 = returnFunc(cursor, dst) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_Fetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fetch' +type Transaction_Fetch_Call struct { + *mock.Call +} + +// Fetch is a helper method to define mock.On call +// - cursor dal.Rows +// - dst interface{} +func (_e *Transaction_Expecter) Fetch(cursor any, dst any) *Transaction_Fetch_Call { + return &Transaction_Fetch_Call{Call: _e.mock.On("Fetch", cursor, dst)} +} + +func (_c *Transaction_Fetch_Call) Run(run func(cursor dal.Rows, dst interface{})) *Transaction_Fetch_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 dal.Rows + if args[0] != nil { + arg0 = args[0].(dal.Rows) + } + var arg1 interface{} + if args[1] != nil { + arg1 = args[1].(interface{}) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Transaction_Fetch_Call) Return(error errors.Error) *Transaction_Fetch_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_Fetch_Call) RunAndReturn(run func(cursor dal.Rows, dst interface{}) errors.Error) *Transaction_Fetch_Call { + _c.Call.Return(run) + return _c +} + +// First provides a mock function for the type Transaction +func (_mock *Transaction) First(dst interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(dst, clauses) + } else { + tmpRet = _mock.Called(dst) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for First") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(dst, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_First_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'First' +type Transaction_First_Call struct { + *mock.Call +} + +// First is a helper method to define mock.On call +// - dst interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) First(dst any, clauses ...any) *Transaction_First_Call { + return &Transaction_First_Call{Call: _e.mock.On("First", + append([]any{dst}, clauses...)...)} +} + +func (_c *Transaction_First_Call) Run(run func(dst interface{}, clauses ...dal.Clause)) *Transaction_First_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_First_Call) Return(error errors.Error) *Transaction_First_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_First_Call) RunAndReturn(run func(dst interface{}, clauses ...dal.Clause) errors.Error) *Transaction_First_Call { + _c.Call.Return(run) + return _c +} + +// GetColumns provides a mock function for the type Transaction +func (_mock *Transaction) GetColumns(dst dal.Tabler, filter func(columnMeta dal.ColumnMeta) bool) ([]dal.ColumnMeta, errors.Error) { + ret := _mock.Called(dst, filter) + + if len(ret) == 0 { + panic("no return value specified for GetColumns") + } + + var r0 []dal.ColumnMeta + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(dal.Tabler, func(columnMeta dal.ColumnMeta) bool) ([]dal.ColumnMeta, errors.Error)); ok { + return returnFunc(dst, filter) + } + if returnFunc, ok := ret.Get(0).(func(dal.Tabler, func(columnMeta dal.ColumnMeta) bool) []dal.ColumnMeta); ok { + r0 = returnFunc(dst, filter) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]dal.ColumnMeta) + } + } + if returnFunc, ok := ret.Get(1).(func(dal.Tabler, func(columnMeta dal.ColumnMeta) bool) errors.Error); ok { + r1 = returnFunc(dst, filter) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Transaction_GetColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetColumns' +type Transaction_GetColumns_Call struct { + *mock.Call +} + +// GetColumns is a helper method to define mock.On call +// - dst dal.Tabler +// - filter func(columnMeta dal.ColumnMeta) bool +func (_e *Transaction_Expecter) GetColumns(dst any, filter any) *Transaction_GetColumns_Call { + return &Transaction_GetColumns_Call{Call: _e.mock.On("GetColumns", dst, filter)} +} + +func (_c *Transaction_GetColumns_Call) Run(run func(dst dal.Tabler, filter func(columnMeta dal.ColumnMeta) bool)) *Transaction_GetColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 dal.Tabler + if args[0] != nil { + arg0 = args[0].(dal.Tabler) + } + var arg1 func(columnMeta dal.ColumnMeta) bool + if args[1] != nil { + arg1 = args[1].(func(columnMeta dal.ColumnMeta) bool) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Transaction_GetColumns_Call) Return(cms []dal.ColumnMeta, err errors.Error) *Transaction_GetColumns_Call { + _c.Call.Return(cms, err) + return _c +} + +func (_c *Transaction_GetColumns_Call) RunAndReturn(run func(dst dal.Tabler, filter func(columnMeta dal.ColumnMeta) bool) ([]dal.ColumnMeta, errors.Error)) *Transaction_GetColumns_Call { + _c.Call.Return(run) + return _c +} + +// GetPrimaryKeyFields provides a mock function for the type Transaction +func (_mock *Transaction) GetPrimaryKeyFields(t reflect.Type) []reflect.StructField { + ret := _mock.Called(t) + + if len(ret) == 0 { + panic("no return value specified for GetPrimaryKeyFields") + } + + var r0 []reflect.StructField + if returnFunc, ok := ret.Get(0).(func(reflect.Type) []reflect.StructField); ok { + r0 = returnFunc(t) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]reflect.StructField) + } + } + return r0 +} + +// Transaction_GetPrimaryKeyFields_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrimaryKeyFields' +type Transaction_GetPrimaryKeyFields_Call struct { + *mock.Call +} + +// GetPrimaryKeyFields is a helper method to define mock.On call +// - t reflect.Type +func (_e *Transaction_Expecter) GetPrimaryKeyFields(t any) *Transaction_GetPrimaryKeyFields_Call { + return &Transaction_GetPrimaryKeyFields_Call{Call: _e.mock.On("GetPrimaryKeyFields", t)} +} + +func (_c *Transaction_GetPrimaryKeyFields_Call) Run(run func(t reflect.Type)) *Transaction_GetPrimaryKeyFields_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 reflect.Type + if args[0] != nil { + arg0 = args[0].(reflect.Type) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Transaction_GetPrimaryKeyFields_Call) Return(structFields []reflect.StructField) *Transaction_GetPrimaryKeyFields_Call { + _c.Call.Return(structFields) + return _c +} + +func (_c *Transaction_GetPrimaryKeyFields_Call) RunAndReturn(run func(t reflect.Type) []reflect.StructField) *Transaction_GetPrimaryKeyFields_Call { + _c.Call.Return(run) + return _c +} + +// HasColumn provides a mock function for the type Transaction +func (_mock *Transaction) HasColumn(table interface{}, columnName string) bool { + ret := _mock.Called(table, columnName) + + if len(ret) == 0 { + panic("no return value specified for HasColumn") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(interface{}, string) bool); ok { + r0 = returnFunc(table, columnName) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Transaction_HasColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasColumn' +type Transaction_HasColumn_Call struct { + *mock.Call +} + +// HasColumn is a helper method to define mock.On call +// - table interface{} +// - columnName string +func (_e *Transaction_Expecter) HasColumn(table any, columnName any) *Transaction_HasColumn_Call { + return &Transaction_HasColumn_Call{Call: _e.mock.On("HasColumn", table, columnName)} +} + +func (_c *Transaction_HasColumn_Call) Run(run func(table interface{}, columnName string)) *Transaction_HasColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Transaction_HasColumn_Call) Return(b bool) *Transaction_HasColumn_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Transaction_HasColumn_Call) RunAndReturn(run func(table interface{}, columnName string) bool) *Transaction_HasColumn_Call { + _c.Call.Return(run) + return _c +} + +// HasTable provides a mock function for the type Transaction +func (_mock *Transaction) HasTable(table interface{}) bool { + ret := _mock.Called(table) + + if len(ret) == 0 { + panic("no return value specified for HasTable") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(interface{}) bool); ok { + r0 = returnFunc(table) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Transaction_HasTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasTable' +type Transaction_HasTable_Call struct { + *mock.Call +} + +// HasTable is a helper method to define mock.On call +// - table interface{} +func (_e *Transaction_Expecter) HasTable(table any) *Transaction_HasTable_Call { + return &Transaction_HasTable_Call{Call: _e.mock.On("HasTable", table)} +} + +func (_c *Transaction_HasTable_Call) Run(run func(table interface{})) *Transaction_HasTable_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Transaction_HasTable_Call) Return(b bool) *Transaction_HasTable_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Transaction_HasTable_Call) RunAndReturn(run func(table interface{}) bool) *Transaction_HasTable_Call { + _c.Call.Return(run) + return _c +} + +// IsDuplicationError provides a mock function for the type Transaction +func (_mock *Transaction) IsDuplicationError(err error) bool { + ret := _mock.Called(err) + + if len(ret) == 0 { + panic("no return value specified for IsDuplicationError") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(error) bool); ok { + r0 = returnFunc(err) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Transaction_IsDuplicationError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsDuplicationError' +type Transaction_IsDuplicationError_Call struct { + *mock.Call +} + +// IsDuplicationError is a helper method to define mock.On call +// - err error +func (_e *Transaction_Expecter) IsDuplicationError(err any) *Transaction_IsDuplicationError_Call { + return &Transaction_IsDuplicationError_Call{Call: _e.mock.On("IsDuplicationError", err)} +} + +func (_c *Transaction_IsDuplicationError_Call) Run(run func(err error)) *Transaction_IsDuplicationError_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 error + if args[0] != nil { + arg0 = args[0].(error) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Transaction_IsDuplicationError_Call) Return(b bool) *Transaction_IsDuplicationError_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Transaction_IsDuplicationError_Call) RunAndReturn(run func(err error) bool) *Transaction_IsDuplicationError_Call { + _c.Call.Return(run) + return _c +} + +// IsErrorNotFound provides a mock function for the type Transaction +func (_mock *Transaction) IsErrorNotFound(err error) bool { + ret := _mock.Called(err) + + if len(ret) == 0 { + panic("no return value specified for IsErrorNotFound") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(error) bool); ok { + r0 = returnFunc(err) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Transaction_IsErrorNotFound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsErrorNotFound' +type Transaction_IsErrorNotFound_Call struct { + *mock.Call +} + +// IsErrorNotFound is a helper method to define mock.On call +// - err error +func (_e *Transaction_Expecter) IsErrorNotFound(err any) *Transaction_IsErrorNotFound_Call { + return &Transaction_IsErrorNotFound_Call{Call: _e.mock.On("IsErrorNotFound", err)} +} + +func (_c *Transaction_IsErrorNotFound_Call) Run(run func(err error)) *Transaction_IsErrorNotFound_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 error + if args[0] != nil { + arg0 = args[0].(error) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Transaction_IsErrorNotFound_Call) Return(b bool) *Transaction_IsErrorNotFound_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Transaction_IsErrorNotFound_Call) RunAndReturn(run func(err error) bool) *Transaction_IsErrorNotFound_Call { + _c.Call.Return(run) + return _c +} + +// LockTables provides a mock function for the type Transaction +func (_mock *Transaction) LockTables(lockTables dal.LockTables) errors.Error { + ret := _mock.Called(lockTables) + + if len(ret) == 0 { + panic("no return value specified for LockTables") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(dal.LockTables) errors.Error); ok { + r0 = returnFunc(lockTables) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_LockTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LockTables' +type Transaction_LockTables_Call struct { + *mock.Call +} + +// LockTables is a helper method to define mock.On call +// - lockTables dal.LockTables +func (_e *Transaction_Expecter) LockTables(lockTables any) *Transaction_LockTables_Call { + return &Transaction_LockTables_Call{Call: _e.mock.On("LockTables", lockTables)} +} + +func (_c *Transaction_LockTables_Call) Run(run func(lockTables dal.LockTables)) *Transaction_LockTables_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 dal.LockTables + if args[0] != nil { + arg0 = args[0].(dal.LockTables) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Transaction_LockTables_Call) Return(error errors.Error) *Transaction_LockTables_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_LockTables_Call) RunAndReturn(run func(lockTables dal.LockTables) errors.Error) *Transaction_LockTables_Call { + _c.Call.Return(run) + return _c +} + +// ModifyColumnType provides a mock function for the type Transaction +func (_mock *Transaction) ModifyColumnType(table string, columnName string, columnType string) errors.Error { + ret := _mock.Called(table, columnName, columnType) + + if len(ret) == 0 { + panic("no return value specified for ModifyColumnType") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, string, string) errors.Error); ok { + r0 = returnFunc(table, columnName, columnType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_ModifyColumnType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyColumnType' +type Transaction_ModifyColumnType_Call struct { + *mock.Call +} + +// ModifyColumnType is a helper method to define mock.On call +// - table string +// - columnName string +// - columnType string +func (_e *Transaction_Expecter) ModifyColumnType(table any, columnName any, columnType any) *Transaction_ModifyColumnType_Call { + return &Transaction_ModifyColumnType_Call{Call: _e.mock.On("ModifyColumnType", table, columnName, columnType)} +} + +func (_c *Transaction_ModifyColumnType_Call) Run(run func(table string, columnName string, columnType string)) *Transaction_ModifyColumnType_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *Transaction_ModifyColumnType_Call) Return(error errors.Error) *Transaction_ModifyColumnType_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_ModifyColumnType_Call) RunAndReturn(run func(table string, columnName string, columnType string) errors.Error) *Transaction_ModifyColumnType_Call { + _c.Call.Return(run) + return _c +} + +// Pluck provides a mock function for the type Transaction +func (_mock *Transaction) Pluck(column string, dest interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(column, dest, clauses) + } else { + tmpRet = _mock.Called(column, dest) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Pluck") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(column, dest, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_Pluck_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pluck' +type Transaction_Pluck_Call struct { + *mock.Call +} + +// Pluck is a helper method to define mock.On call +// - column string +// - dest interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) Pluck(column any, dest any, clauses ...any) *Transaction_Pluck_Call { + return &Transaction_Pluck_Call{Call: _e.mock.On("Pluck", + append([]any{column, dest}, clauses...)...)} +} + +func (_c *Transaction_Pluck_Call) Run(run func(column string, dest interface{}, clauses ...dal.Clause)) *Transaction_Pluck_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 interface{} + if args[1] != nil { + arg1 = args[1].(interface{}) + } + var arg2 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 2 { + variadicArgs = args[2].([]dal.Clause) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *Transaction_Pluck_Call) Return(error errors.Error) *Transaction_Pluck_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_Pluck_Call) RunAndReturn(run func(column string, dest interface{}, clauses ...dal.Clause) errors.Error) *Transaction_Pluck_Call { + _c.Call.Return(run) + return _c +} + +// RawCursor provides a mock function for the type Transaction +func (_mock *Transaction) RawCursor(query string, params ...interface{}) (*sql.Rows, errors.Error) { + var tmpRet mock.Arguments + if len(params) > 0 { + tmpRet = _mock.Called(query, params) + } else { + tmpRet = _mock.Called(query) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for RawCursor") + } + + var r0 *sql.Rows + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, ...interface{}) (*sql.Rows, errors.Error)); ok { + return returnFunc(query, params...) + } + if returnFunc, ok := ret.Get(0).(func(string, ...interface{}) *sql.Rows); ok { + r0 = returnFunc(query, params...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sql.Rows) + } + } + if returnFunc, ok := ret.Get(1).(func(string, ...interface{}) errors.Error); ok { + r1 = returnFunc(query, params...) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Transaction_RawCursor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RawCursor' +type Transaction_RawCursor_Call struct { + *mock.Call +} + +// RawCursor is a helper method to define mock.On call +// - query string +// - params ...interface{} +func (_e *Transaction_Expecter) RawCursor(query any, params ...any) *Transaction_RawCursor_Call { + return &Transaction_RawCursor_Call{Call: _e.mock.On("RawCursor", + append([]any{query}, params...)...)} +} + +func (_c *Transaction_RawCursor_Call) Run(run func(query string, params ...interface{})) *Transaction_RawCursor_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []interface{} + var variadicArgs []interface{} + if len(args) > 1 { + variadicArgs = args[1].([]interface{}) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_RawCursor_Call) Return(rows *sql.Rows, error errors.Error) *Transaction_RawCursor_Call { + _c.Call.Return(rows, error) + return _c +} + +func (_c *Transaction_RawCursor_Call) RunAndReturn(run func(query string, params ...interface{}) (*sql.Rows, errors.Error)) *Transaction_RawCursor_Call { + _c.Call.Return(run) + return _c +} + +// RenameColumn provides a mock function for the type Transaction +func (_mock *Transaction) RenameColumn(table string, oldColumnName string, newColumnName string) errors.Error { + ret := _mock.Called(table, oldColumnName, newColumnName) + + if len(ret) == 0 { + panic("no return value specified for RenameColumn") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, string, string) errors.Error); ok { + r0 = returnFunc(table, oldColumnName, newColumnName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_RenameColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenameColumn' +type Transaction_RenameColumn_Call struct { + *mock.Call +} + +// RenameColumn is a helper method to define mock.On call +// - table string +// - oldColumnName string +// - newColumnName string +func (_e *Transaction_Expecter) RenameColumn(table any, oldColumnName any, newColumnName any) *Transaction_RenameColumn_Call { + return &Transaction_RenameColumn_Call{Call: _e.mock.On("RenameColumn", table, oldColumnName, newColumnName)} +} + +func (_c *Transaction_RenameColumn_Call) Run(run func(table string, oldColumnName string, newColumnName string)) *Transaction_RenameColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *Transaction_RenameColumn_Call) Return(error errors.Error) *Transaction_RenameColumn_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_RenameColumn_Call) RunAndReturn(run func(table string, oldColumnName string, newColumnName string) errors.Error) *Transaction_RenameColumn_Call { + _c.Call.Return(run) + return _c +} + +// RenameTable provides a mock function for the type Transaction +func (_mock *Transaction) RenameTable(oldName string, newName string) errors.Error { + ret := _mock.Called(oldName, newName) + + if len(ret) == 0 { + panic("no return value specified for RenameTable") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, string) errors.Error); ok { + r0 = returnFunc(oldName, newName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_RenameTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RenameTable' +type Transaction_RenameTable_Call struct { + *mock.Call +} + +// RenameTable is a helper method to define mock.On call +// - oldName string +// - newName string +func (_e *Transaction_Expecter) RenameTable(oldName any, newName any) *Transaction_RenameTable_Call { + return &Transaction_RenameTable_Call{Call: _e.mock.On("RenameTable", oldName, newName)} +} + +func (_c *Transaction_RenameTable_Call) Run(run func(oldName string, newName string)) *Transaction_RenameTable_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Transaction_RenameTable_Call) Return(error errors.Error) *Transaction_RenameTable_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_RenameTable_Call) RunAndReturn(run func(oldName string, newName string) errors.Error) *Transaction_RenameTable_Call { + _c.Call.Return(run) + return _c +} + +// Rollback provides a mock function for the type Transaction +func (_mock *Transaction) Rollback() errors.Error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Rollback") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func() errors.Error); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_Rollback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rollback' +type Transaction_Rollback_Call struct { + *mock.Call +} + +// Rollback is a helper method to define mock.On call +func (_e *Transaction_Expecter) Rollback() *Transaction_Rollback_Call { + return &Transaction_Rollback_Call{Call: _e.mock.On("Rollback")} +} + +func (_c *Transaction_Rollback_Call) Run(run func()) *Transaction_Rollback_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_Rollback_Call) Return(error errors.Error) *Transaction_Rollback_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_Rollback_Call) RunAndReturn(run func() errors.Error) *Transaction_Rollback_Call { + _c.Call.Return(run) + return _c +} + +// Session provides a mock function for the type Transaction +func (_mock *Transaction) Session(config dal.SessionConfig) dal.Dal { + ret := _mock.Called(config) + + if len(ret) == 0 { + panic("no return value specified for Session") + } + + var r0 dal.Dal + if returnFunc, ok := ret.Get(0).(func(dal.SessionConfig) dal.Dal); ok { + r0 = returnFunc(config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Dal) + } + } + return r0 +} + +// Transaction_Session_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Session' +type Transaction_Session_Call struct { + *mock.Call +} + +// Session is a helper method to define mock.On call +// - config dal.SessionConfig +func (_e *Transaction_Expecter) Session(config any) *Transaction_Session_Call { + return &Transaction_Session_Call{Call: _e.mock.On("Session", config)} +} + +func (_c *Transaction_Session_Call) Run(run func(config dal.SessionConfig)) *Transaction_Session_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 dal.SessionConfig + if args[0] != nil { + arg0 = args[0].(dal.SessionConfig) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Transaction_Session_Call) Return(dal1 dal.Dal) *Transaction_Session_Call { + _c.Call.Return(dal1) + return _c +} + +func (_c *Transaction_Session_Call) RunAndReturn(run func(config dal.SessionConfig) dal.Dal) *Transaction_Session_Call { + _c.Call.Return(run) + return _c +} + +// UnlockTables provides a mock function for the type Transaction +func (_mock *Transaction) UnlockTables() errors.Error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for UnlockTables") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func() errors.Error); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_UnlockTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnlockTables' +type Transaction_UnlockTables_Call struct { + *mock.Call +} + +// UnlockTables is a helper method to define mock.On call +func (_e *Transaction_Expecter) UnlockTables() *Transaction_UnlockTables_Call { + return &Transaction_UnlockTables_Call{Call: _e.mock.On("UnlockTables")} +} + +func (_c *Transaction_UnlockTables_Call) Run(run func()) *Transaction_UnlockTables_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transaction_UnlockTables_Call) Return(error errors.Error) *Transaction_UnlockTables_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_UnlockTables_Call) RunAndReturn(run func() errors.Error) *Transaction_UnlockTables_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function for the type Transaction +func (_mock *Transaction) Update(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type Transaction_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) Update(entity any, clauses ...any) *Transaction_Update_Call { + return &Transaction_Update_Call{Call: _e.mock.On("Update", + append([]any{entity}, clauses...)...)} +} + +func (_c *Transaction_Update_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Transaction_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_Update_Call) Return(error errors.Error) *Transaction_Update_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_Update_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Transaction_Update_Call { + _c.Call.Return(run) + return _c +} + +// UpdateAllColumn provides a mock function for the type Transaction +func (_mock *Transaction) UpdateAllColumn(entity interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entity, clauses) + } else { + tmpRet = _mock.Called(entity) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for UpdateAllColumn") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entity, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_UpdateAllColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAllColumn' +type Transaction_UpdateAllColumn_Call struct { + *mock.Call +} + +// UpdateAllColumn is a helper method to define mock.On call +// - entity interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) UpdateAllColumn(entity any, clauses ...any) *Transaction_UpdateAllColumn_Call { + return &Transaction_UpdateAllColumn_Call{Call: _e.mock.On("UpdateAllColumn", + append([]any{entity}, clauses...)...)} +} + +func (_c *Transaction_UpdateAllColumn_Call) Run(run func(entity interface{}, clauses ...dal.Clause)) *Transaction_UpdateAllColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 1 { + variadicArgs = args[1].([]dal.Clause) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Transaction_UpdateAllColumn_Call) Return(error errors.Error) *Transaction_UpdateAllColumn_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_UpdateAllColumn_Call) RunAndReturn(run func(entity interface{}, clauses ...dal.Clause) errors.Error) *Transaction_UpdateAllColumn_Call { + _c.Call.Return(run) + return _c +} + +// UpdateColumn provides a mock function for the type Transaction +func (_mock *Transaction) UpdateColumn(entityOrTable interface{}, columnName string, value interface{}, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entityOrTable, columnName, value, clauses) + } else { + tmpRet = _mock.Called(entityOrTable, columnName, value) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for UpdateColumn") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, string, interface{}, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entityOrTable, columnName, value, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_UpdateColumn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateColumn' +type Transaction_UpdateColumn_Call struct { + *mock.Call +} + +// UpdateColumn is a helper method to define mock.On call +// - entityOrTable interface{} +// - columnName string +// - value interface{} +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) UpdateColumn(entityOrTable any, columnName any, value any, clauses ...any) *Transaction_UpdateColumn_Call { + return &Transaction_UpdateColumn_Call{Call: _e.mock.On("UpdateColumn", + append([]any{entityOrTable, columnName, value}, clauses...)...)} +} + +func (_c *Transaction_UpdateColumn_Call) Run(run func(entityOrTable interface{}, columnName string, value interface{}, clauses ...dal.Clause)) *Transaction_UpdateColumn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 interface{} + if args[2] != nil { + arg2 = args[2].(interface{}) + } + var arg3 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 3 { + variadicArgs = args[3].([]dal.Clause) + } + arg3 = variadicArgs + run( + arg0, + arg1, + arg2, + arg3..., + ) + }) + return _c +} + +func (_c *Transaction_UpdateColumn_Call) Return(error errors.Error) *Transaction_UpdateColumn_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_UpdateColumn_Call) RunAndReturn(run func(entityOrTable interface{}, columnName string, value interface{}, clauses ...dal.Clause) errors.Error) *Transaction_UpdateColumn_Call { + _c.Call.Return(run) + return _c +} + +// UpdateColumns provides a mock function for the type Transaction +func (_mock *Transaction) UpdateColumns(entityOrTable interface{}, set []dal.DalSet, clauses ...dal.Clause) errors.Error { + var tmpRet mock.Arguments + if len(clauses) > 0 { + tmpRet = _mock.Called(entityOrTable, set, clauses) + } else { + tmpRet = _mock.Called(entityOrTable, set) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for UpdateColumns") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, []dal.DalSet, ...dal.Clause) errors.Error); ok { + r0 = returnFunc(entityOrTable, set, clauses...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Transaction_UpdateColumns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateColumns' +type Transaction_UpdateColumns_Call struct { + *mock.Call +} + +// UpdateColumns is a helper method to define mock.On call +// - entityOrTable interface{} +// - set []dal.DalSet +// - clauses ...dal.Clause +func (_e *Transaction_Expecter) UpdateColumns(entityOrTable any, set any, clauses ...any) *Transaction_UpdateColumns_Call { + return &Transaction_UpdateColumns_Call{Call: _e.mock.On("UpdateColumns", + append([]any{entityOrTable, set}, clauses...)...)} +} + +func (_c *Transaction_UpdateColumns_Call) Run(run func(entityOrTable interface{}, set []dal.DalSet, clauses ...dal.Clause)) *Transaction_UpdateColumns_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 []dal.DalSet + if args[1] != nil { + arg1 = args[1].([]dal.DalSet) + } + var arg2 []dal.Clause + var variadicArgs []dal.Clause + if len(args) > 2 { + variadicArgs = args[2].([]dal.Clause) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *Transaction_UpdateColumns_Call) Return(error errors.Error) *Transaction_UpdateColumns_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Transaction_UpdateColumns_Call) RunAndReturn(run func(entityOrTable interface{}, set []dal.DalSet, clauses ...dal.Clause) errors.Error) *Transaction_UpdateColumns_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/errors/Error.go b/backend/mocks/core/errors/Error.go new file mode 100644 index 00000000000..cb7f6e974ae --- /dev/null +++ b/backend/mocks/core/errors/Error.go @@ -0,0 +1,316 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewError creates a new instance of Error. 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 NewError(t interface { + mock.TestingT + Cleanup(func()) +}) *Error { + mock := &Error{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// Error is an autogenerated mock type for the Error type +type Error struct { + mock.Mock +} + +type Error_Expecter struct { + mock *mock.Mock +} + +func (_m *Error) EXPECT() *Error_Expecter { + return &Error_Expecter{mock: &_m.Mock} +} + +// As provides a mock function for the type Error +func (_mock *Error) As(typeParam *errors.Type) errors.Error { + ret := _mock.Called(typeParam) + + if len(ret) == 0 { + panic("no return value specified for As") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(*errors.Type) errors.Error); ok { + r0 = returnFunc(typeParam) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Error_As_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'As' +type Error_As_Call struct { + *mock.Call +} + +// As is a helper method to define mock.On call +// - typeParam *errors.Type +func (_e *Error_Expecter) As(typeParam any) *Error_As_Call { + return &Error_As_Call{Call: _e.mock.On("As", typeParam)} +} + +func (_c *Error_As_Call) Run(run func(typeParam *errors.Type)) *Error_As_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *errors.Type + if args[0] != nil { + arg0 = args[0].(*errors.Type) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Error_As_Call) Return(error errors.Error) *Error_As_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Error_As_Call) RunAndReturn(run func(typeParam *errors.Type) errors.Error) *Error_As_Call { + _c.Call.Return(run) + return _c +} + +// Error provides a mock function for the type Error +func (_mock *Error) Error() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Error") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// Error_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type Error_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +func (_e *Error_Expecter) Error() *Error_Error_Call { + return &Error_Error_Call{Call: _e.mock.On("Error")} +} + +func (_c *Error_Error_Call) Run(run func()) *Error_Error_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Error_Error_Call) Return(s string) *Error_Error_Call { + _c.Call.Return(s) + return _c +} + +func (_c *Error_Error_Call) RunAndReturn(run func() string) *Error_Error_Call { + _c.Call.Return(run) + return _c +} + +// GetData provides a mock function for the type Error +func (_mock *Error) GetData() interface{} { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetData") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func() interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// Error_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData' +type Error_GetData_Call struct { + *mock.Call +} + +// GetData is a helper method to define mock.On call +func (_e *Error_Expecter) GetData() *Error_GetData_Call { + return &Error_GetData_Call{Call: _e.mock.On("GetData")} +} + +func (_c *Error_GetData_Call) Run(run func()) *Error_GetData_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Error_GetData_Call) Return(ifaceVal interface{}) *Error_GetData_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *Error_GetData_Call) RunAndReturn(run func() interface{}) *Error_GetData_Call { + _c.Call.Return(run) + return _c +} + +// GetType provides a mock function for the type Error +func (_mock *Error) GetType() *errors.Type { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetType") + } + + var r0 *errors.Type + if returnFunc, ok := ret.Get(0).(func() *errors.Type); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*errors.Type) + } + } + return r0 +} + +// Error_GetType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetType' +type Error_GetType_Call struct { + *mock.Call +} + +// GetType is a helper method to define mock.On call +func (_e *Error_Expecter) GetType() *Error_GetType_Call { + return &Error_GetType_Call{Call: _e.mock.On("GetType")} +} + +func (_c *Error_GetType_Call) Run(run func()) *Error_GetType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Error_GetType_Call) Return(typeParam *errors.Type) *Error_GetType_Call { + _c.Call.Return(typeParam) + return _c +} + +func (_c *Error_GetType_Call) RunAndReturn(run func() *errors.Type) *Error_GetType_Call { + _c.Call.Return(run) + return _c +} + +// Messages provides a mock function for the type Error +func (_mock *Error) Messages() errors.Messages { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Messages") + } + + var r0 errors.Messages + if returnFunc, ok := ret.Get(0).(func() errors.Messages); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Messages) + } + } + return r0 +} + +// Error_Messages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Messages' +type Error_Messages_Call struct { + *mock.Call +} + +// Messages is a helper method to define mock.On call +func (_e *Error_Expecter) Messages() *Error_Messages_Call { + return &Error_Messages_Call{Call: _e.mock.On("Messages")} +} + +func (_c *Error_Messages_Call) Run(run func()) *Error_Messages_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Error_Messages_Call) Return(messages errors.Messages) *Error_Messages_Call { + _c.Call.Return(messages) + return _c +} + +func (_c *Error_Messages_Call) RunAndReturn(run func() errors.Messages) *Error_Messages_Call { + _c.Call.Return(run) + return _c +} + +// Unwrap provides a mock function for the type Error +func (_mock *Error) Unwrap() error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Unwrap") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() + } else { + r0 = ret.Error(0) + } + return r0 +} + +// Error_Unwrap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unwrap' +type Error_Unwrap_Call struct { + *mock.Call +} + +// Unwrap is a helper method to define mock.On call +func (_e *Error_Expecter) Unwrap() *Error_Unwrap_Call { + return &Error_Unwrap_Call{Call: _e.mock.On("Unwrap")} +} + +func (_c *Error_Unwrap_Call) Run(run func()) *Error_Unwrap_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Error_Unwrap_Call) Return(err error) *Error_Unwrap_Call { + _c.Call.Return(err) + return _c +} + +func (_c *Error_Unwrap_Call) RunAndReturn(run func() error) *Error_Unwrap_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/errors/requiredSupertype.go b/backend/mocks/core/errors/requiredSupertype.go new file mode 100644 index 00000000000..ed078c480e7 --- /dev/null +++ b/backend/mocks/core/errors/requiredSupertype.go @@ -0,0 +1,124 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// newRequiredSupertype creates a new instance of requiredSupertype. 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 newRequiredSupertype(t interface { + mock.TestingT + Cleanup(func()) +}) *requiredSupertype { + mock := &requiredSupertype{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// requiredSupertype is an autogenerated mock type for the requiredSupertype type +type requiredSupertype struct { + mock.Mock +} + +type requiredSupertype_Expecter struct { + mock *mock.Mock +} + +func (_m *requiredSupertype) EXPECT() *requiredSupertype_Expecter { + return &requiredSupertype_Expecter{mock: &_m.Mock} +} + +// Error provides a mock function for the type requiredSupertype +func (_mock *requiredSupertype) Error() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Error") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// requiredSupertype_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type requiredSupertype_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +func (_e *requiredSupertype_Expecter) Error() *requiredSupertype_Error_Call { + return &requiredSupertype_Error_Call{Call: _e.mock.On("Error")} +} + +func (_c *requiredSupertype_Error_Call) Run(run func()) *requiredSupertype_Error_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *requiredSupertype_Error_Call) Return(s string) *requiredSupertype_Error_Call { + _c.Call.Return(s) + return _c +} + +func (_c *requiredSupertype_Error_Call) RunAndReturn(run func() string) *requiredSupertype_Error_Call { + _c.Call.Return(run) + return _c +} + +// Unwrap provides a mock function for the type requiredSupertype +func (_mock *requiredSupertype) Unwrap() error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Unwrap") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() + } else { + r0 = ret.Error(0) + } + return r0 +} + +// requiredSupertype_Unwrap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unwrap' +type requiredSupertype_Unwrap_Call struct { + *mock.Call +} + +// Unwrap is a helper method to define mock.On call +func (_e *requiredSupertype_Expecter) Unwrap() *requiredSupertype_Unwrap_Call { + return &requiredSupertype_Unwrap_Call{Call: _e.mock.On("Unwrap")} +} + +func (_c *requiredSupertype_Unwrap_Call) Run(run func()) *requiredSupertype_Unwrap_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *requiredSupertype_Unwrap_Call) Return(err error) *requiredSupertype_Unwrap_Call { + _c.Call.Return(err) + return _c +} + +func (_c *requiredSupertype_Unwrap_Call) RunAndReturn(run func() error) *requiredSupertype_Unwrap_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/log/Logger.go b/backend/mocks/core/log/Logger.go new file mode 100644 index 00000000000..248757898bd --- /dev/null +++ b/backend/mocks/core/log/Logger.go @@ -0,0 +1,569 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/log" + mock "github.com/stretchr/testify/mock" +) + +// NewLogger creates a new instance of Logger. 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 NewLogger(t interface { + mock.TestingT + Cleanup(func()) +}) *Logger { + mock := &Logger{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// Logger is an autogenerated mock type for the Logger type +type Logger struct { + mock.Mock +} + +type Logger_Expecter struct { + mock *mock.Mock +} + +func (_m *Logger) EXPECT() *Logger_Expecter { + return &Logger_Expecter{mock: &_m.Mock} +} + +// Debug provides a mock function for the type Logger +func (_mock *Logger) Debug(format string, a ...interface{}) { + if len(a) > 0 { + _mock.Called(format, a) + } else { + _mock.Called(format) + } + + return +} + +// Logger_Debug_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Debug' +type Logger_Debug_Call struct { + *mock.Call +} + +// Debug is a helper method to define mock.On call +// - format string +// - a ...interface{} +func (_e *Logger_Expecter) Debug(format any, a ...any) *Logger_Debug_Call { + return &Logger_Debug_Call{Call: _e.mock.On("Debug", + append([]any{format}, a...)...)} +} + +func (_c *Logger_Debug_Call) Run(run func(format string, a ...interface{})) *Logger_Debug_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []interface{} + var variadicArgs []interface{} + if len(args) > 1 { + variadicArgs = args[1].([]interface{}) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Logger_Debug_Call) Return() *Logger_Debug_Call { + _c.Call.Return() + return _c +} + +func (_c *Logger_Debug_Call) RunAndReturn(run func(format string, a ...interface{})) *Logger_Debug_Call { + _c.Run(run) + return _c +} + +// Error provides a mock function for the type Logger +func (_mock *Logger) Error(err error, format string, a ...interface{}) { + if len(a) > 0 { + _mock.Called(err, format, a) + } else { + _mock.Called(err, format) + } + + return +} + +// Logger_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type Logger_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +// - err error +// - format string +// - a ...interface{} +func (_e *Logger_Expecter) Error(err any, format any, a ...any) *Logger_Error_Call { + return &Logger_Error_Call{Call: _e.mock.On("Error", + append([]any{err, format}, a...)...)} +} + +func (_c *Logger_Error_Call) Run(run func(err error, format string, a ...interface{})) *Logger_Error_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 error + if args[0] != nil { + arg0 = args[0].(error) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []interface{} + var variadicArgs []interface{} + if len(args) > 2 { + variadicArgs = args[2].([]interface{}) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *Logger_Error_Call) Return() *Logger_Error_Call { + _c.Call.Return() + return _c +} + +func (_c *Logger_Error_Call) RunAndReturn(run func(err error, format string, a ...interface{})) *Logger_Error_Call { + _c.Run(run) + return _c +} + +// GetConfig provides a mock function for the type Logger +func (_mock *Logger) GetConfig() *log.LoggerConfig { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetConfig") + } + + var r0 *log.LoggerConfig + if returnFunc, ok := ret.Get(0).(func() *log.LoggerConfig); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*log.LoggerConfig) + } + } + return r0 +} + +// Logger_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig' +type Logger_GetConfig_Call struct { + *mock.Call +} + +// GetConfig is a helper method to define mock.On call +func (_e *Logger_Expecter) GetConfig() *Logger_GetConfig_Call { + return &Logger_GetConfig_Call{Call: _e.mock.On("GetConfig")} +} + +func (_c *Logger_GetConfig_Call) Run(run func()) *Logger_GetConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Logger_GetConfig_Call) Return(loggerConfig *log.LoggerConfig) *Logger_GetConfig_Call { + _c.Call.Return(loggerConfig) + return _c +} + +func (_c *Logger_GetConfig_Call) RunAndReturn(run func() *log.LoggerConfig) *Logger_GetConfig_Call { + _c.Call.Return(run) + return _c +} + +// Info provides a mock function for the type Logger +func (_mock *Logger) Info(format string, a ...interface{}) { + if len(a) > 0 { + _mock.Called(format, a) + } else { + _mock.Called(format) + } + + return +} + +// Logger_Info_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Info' +type Logger_Info_Call struct { + *mock.Call +} + +// Info is a helper method to define mock.On call +// - format string +// - a ...interface{} +func (_e *Logger_Expecter) Info(format any, a ...any) *Logger_Info_Call { + return &Logger_Info_Call{Call: _e.mock.On("Info", + append([]any{format}, a...)...)} +} + +func (_c *Logger_Info_Call) Run(run func(format string, a ...interface{})) *Logger_Info_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []interface{} + var variadicArgs []interface{} + if len(args) > 1 { + variadicArgs = args[1].([]interface{}) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Logger_Info_Call) Return() *Logger_Info_Call { + _c.Call.Return() + return _c +} + +func (_c *Logger_Info_Call) RunAndReturn(run func(format string, a ...interface{})) *Logger_Info_Call { + _c.Run(run) + return _c +} + +// IsLevelEnabled provides a mock function for the type Logger +func (_mock *Logger) IsLevelEnabled(level log.LogLevel) bool { + ret := _mock.Called(level) + + if len(ret) == 0 { + panic("no return value specified for IsLevelEnabled") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func(log.LogLevel) bool); ok { + r0 = returnFunc(level) + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Logger_IsLevelEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsLevelEnabled' +type Logger_IsLevelEnabled_Call struct { + *mock.Call +} + +// IsLevelEnabled is a helper method to define mock.On call +// - level log.LogLevel +func (_e *Logger_Expecter) IsLevelEnabled(level any) *Logger_IsLevelEnabled_Call { + return &Logger_IsLevelEnabled_Call{Call: _e.mock.On("IsLevelEnabled", level)} +} + +func (_c *Logger_IsLevelEnabled_Call) Run(run func(level log.LogLevel)) *Logger_IsLevelEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 log.LogLevel + if args[0] != nil { + arg0 = args[0].(log.LogLevel) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Logger_IsLevelEnabled_Call) Return(b bool) *Logger_IsLevelEnabled_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Logger_IsLevelEnabled_Call) RunAndReturn(run func(level log.LogLevel) bool) *Logger_IsLevelEnabled_Call { + _c.Call.Return(run) + return _c +} + +// Log provides a mock function for the type Logger +func (_mock *Logger) Log(level log.LogLevel, format string, a ...interface{}) { + if len(a) > 0 { + _mock.Called(level, format, a) + } else { + _mock.Called(level, format) + } + + return +} + +// Logger_Log_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Log' +type Logger_Log_Call struct { + *mock.Call +} + +// Log is a helper method to define mock.On call +// - level log.LogLevel +// - format string +// - a ...interface{} +func (_e *Logger_Expecter) Log(level any, format any, a ...any) *Logger_Log_Call { + return &Logger_Log_Call{Call: _e.mock.On("Log", + append([]any{level, format}, a...)...)} +} + +func (_c *Logger_Log_Call) Run(run func(level log.LogLevel, format string, a ...interface{})) *Logger_Log_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 log.LogLevel + if args[0] != nil { + arg0 = args[0].(log.LogLevel) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []interface{} + var variadicArgs []interface{} + if len(args) > 2 { + variadicArgs = args[2].([]interface{}) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *Logger_Log_Call) Return() *Logger_Log_Call { + _c.Call.Return() + return _c +} + +func (_c *Logger_Log_Call) RunAndReturn(run func(level log.LogLevel, format string, a ...interface{})) *Logger_Log_Call { + _c.Run(run) + return _c +} + +// Nested provides a mock function for the type Logger +func (_mock *Logger) Nested(name string) log.Logger { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for Nested") + } + + var r0 log.Logger + if returnFunc, ok := ret.Get(0).(func(string) log.Logger); ok { + r0 = returnFunc(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(log.Logger) + } + } + return r0 +} + +// Logger_Nested_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Nested' +type Logger_Nested_Call struct { + *mock.Call +} + +// Nested is a helper method to define mock.On call +// - name string +func (_e *Logger_Expecter) Nested(name any) *Logger_Nested_Call { + return &Logger_Nested_Call{Call: _e.mock.On("Nested", name)} +} + +func (_c *Logger_Nested_Call) Run(run func(name string)) *Logger_Nested_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Logger_Nested_Call) Return(logger log.Logger) *Logger_Nested_Call { + _c.Call.Return(logger) + return _c +} + +func (_c *Logger_Nested_Call) RunAndReturn(run func(name string) log.Logger) *Logger_Nested_Call { + _c.Call.Return(run) + return _c +} + +// Printf provides a mock function for the type Logger +func (_mock *Logger) Printf(format string, a ...interface{}) { + if len(a) > 0 { + _mock.Called(format, a) + } else { + _mock.Called(format) + } + + return +} + +// Logger_Printf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Printf' +type Logger_Printf_Call struct { + *mock.Call +} + +// Printf is a helper method to define mock.On call +// - format string +// - a ...interface{} +func (_e *Logger_Expecter) Printf(format any, a ...any) *Logger_Printf_Call { + return &Logger_Printf_Call{Call: _e.mock.On("Printf", + append([]any{format}, a...)...)} +} + +func (_c *Logger_Printf_Call) Run(run func(format string, a ...interface{})) *Logger_Printf_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []interface{} + var variadicArgs []interface{} + if len(args) > 1 { + variadicArgs = args[1].([]interface{}) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *Logger_Printf_Call) Return() *Logger_Printf_Call { + _c.Call.Return() + return _c +} + +func (_c *Logger_Printf_Call) RunAndReturn(run func(format string, a ...interface{})) *Logger_Printf_Call { + _c.Run(run) + return _c +} + +// SetStream provides a mock function for the type Logger +func (_mock *Logger) SetStream(config *log.LoggerStreamConfig) { + _mock.Called(config) + return +} + +// Logger_SetStream_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStream' +type Logger_SetStream_Call struct { + *mock.Call +} + +// SetStream is a helper method to define mock.On call +// - config *log.LoggerStreamConfig +func (_e *Logger_Expecter) SetStream(config any) *Logger_SetStream_Call { + return &Logger_SetStream_Call{Call: _e.mock.On("SetStream", config)} +} + +func (_c *Logger_SetStream_Call) Run(run func(config *log.LoggerStreamConfig)) *Logger_SetStream_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *log.LoggerStreamConfig + if args[0] != nil { + arg0 = args[0].(*log.LoggerStreamConfig) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *Logger_SetStream_Call) Return() *Logger_SetStream_Call { + _c.Call.Return() + return _c +} + +func (_c *Logger_SetStream_Call) RunAndReturn(run func(config *log.LoggerStreamConfig)) *Logger_SetStream_Call { + _c.Run(run) + return _c +} + +// Warn provides a mock function for the type Logger +func (_mock *Logger) Warn(err error, format string, a ...interface{}) { + if len(a) > 0 { + _mock.Called(err, format, a) + } else { + _mock.Called(err, format) + } + + return +} + +// Logger_Warn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Warn' +type Logger_Warn_Call struct { + *mock.Call +} + +// Warn is a helper method to define mock.On call +// - err error +// - format string +// - a ...interface{} +func (_e *Logger_Expecter) Warn(err any, format any, a ...any) *Logger_Warn_Call { + return &Logger_Warn_Call{Call: _e.mock.On("Warn", + append([]any{err, format}, a...)...)} +} + +func (_c *Logger_Warn_Call) Run(run func(err error, format string, a ...interface{})) *Logger_Warn_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 error + if args[0] != nil { + arg0 = args[0].(error) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 []interface{} + var variadicArgs []interface{} + if len(args) > 2 { + variadicArgs = args[2].([]interface{}) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) + }) + return _c +} + +func (_c *Logger_Warn_Call) Return() *Logger_Warn_Call { + _c.Call.Return() + return _c +} + +func (_c *Logger_Warn_Call) RunAndReturn(run func(err error, format string, a ...interface{})) *Logger_Warn_Call { + _c.Run(run) + return _c +} diff --git a/backend/mocks/core/models/DynamicTabler.go b/backend/mocks/core/models/DynamicTabler.go new file mode 100644 index 00000000000..fe0bc80c053 --- /dev/null +++ b/backend/mocks/core/models/DynamicTabler.go @@ -0,0 +1,570 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/models" + mock "github.com/stretchr/testify/mock" +) + +// NewDynamicTabler creates a new instance of DynamicTabler. 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 NewDynamicTabler(t interface { + mock.TestingT + Cleanup(func()) +}) *DynamicTabler { + mock := &DynamicTabler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// DynamicTabler is an autogenerated mock type for the DynamicTabler type +type DynamicTabler struct { + mock.Mock +} + +type DynamicTabler_Expecter struct { + mock *mock.Mock +} + +func (_m *DynamicTabler) EXPECT() *DynamicTabler_Expecter { + return &DynamicTabler_Expecter{mock: &_m.Mock} +} + +// From provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) From(src any) errors.Error { + ret := _mock.Called(src) + + if len(ret) == 0 { + panic("no return value specified for From") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(any) errors.Error); ok { + r0 = returnFunc(src) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// DynamicTabler_From_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'From' +type DynamicTabler_From_Call struct { + *mock.Call +} + +// From is a helper method to define mock.On call +// - src any +func (_e *DynamicTabler_Expecter) From(src any) *DynamicTabler_From_Call { + return &DynamicTabler_From_Call{Call: _e.mock.On("From", src)} +} + +func (_c *DynamicTabler_From_Call) Run(run func(src any)) *DynamicTabler_From_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 any + if args[0] != nil { + arg0 = args[0].(any) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *DynamicTabler_From_Call) Return(error errors.Error) *DynamicTabler_From_Call { + _c.Call.Return(error) + return _c +} + +func (_c *DynamicTabler_From_Call) RunAndReturn(run func(src any) errors.Error) *DynamicTabler_From_Call { + _c.Call.Return(run) + return _c +} + +// MarshalJSON provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) MarshalJSON() ([]byte, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for MarshalJSON") + } + + var r0 []byte + var r1 error + if returnFunc, ok := ret.Get(0).(func() ([]byte, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []byte); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// DynamicTabler_MarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalJSON' +type DynamicTabler_MarshalJSON_Call struct { + *mock.Call +} + +// MarshalJSON is a helper method to define mock.On call +func (_e *DynamicTabler_Expecter) MarshalJSON() *DynamicTabler_MarshalJSON_Call { + return &DynamicTabler_MarshalJSON_Call{Call: _e.mock.On("MarshalJSON")} +} + +func (_c *DynamicTabler_MarshalJSON_Call) Run(run func()) *DynamicTabler_MarshalJSON_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DynamicTabler_MarshalJSON_Call) Return(bytes []byte, err error) *DynamicTabler_MarshalJSON_Call { + _c.Call.Return(bytes, err) + return _c +} + +func (_c *DynamicTabler_MarshalJSON_Call) RunAndReturn(run func() ([]byte, error)) *DynamicTabler_MarshalJSON_Call { + _c.Call.Return(run) + return _c +} + +// New provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) New() models.DynamicTabler { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for New") + } + + var r0 models.DynamicTabler + if returnFunc, ok := ret.Get(0).(func() models.DynamicTabler); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.DynamicTabler) + } + } + return r0 +} + +// DynamicTabler_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' +type DynamicTabler_New_Call struct { + *mock.Call +} + +// New is a helper method to define mock.On call +func (_e *DynamicTabler_Expecter) New() *DynamicTabler_New_Call { + return &DynamicTabler_New_Call{Call: _e.mock.On("New")} +} + +func (_c *DynamicTabler_New_Call) Run(run func()) *DynamicTabler_New_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DynamicTabler_New_Call) Return(dynamicTabler models.DynamicTabler) *DynamicTabler_New_Call { + _c.Call.Return(dynamicTabler) + return _c +} + +func (_c *DynamicTabler_New_Call) RunAndReturn(run func() models.DynamicTabler) *DynamicTabler_New_Call { + _c.Call.Return(run) + return _c +} + +// NewSlice provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) NewSlice() models.DynamicTabler { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for NewSlice") + } + + var r0 models.DynamicTabler + if returnFunc, ok := ret.Get(0).(func() models.DynamicTabler); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.DynamicTabler) + } + } + return r0 +} + +// DynamicTabler_NewSlice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSlice' +type DynamicTabler_NewSlice_Call struct { + *mock.Call +} + +// NewSlice is a helper method to define mock.On call +func (_e *DynamicTabler_Expecter) NewSlice() *DynamicTabler_NewSlice_Call { + return &DynamicTabler_NewSlice_Call{Call: _e.mock.On("NewSlice")} +} + +func (_c *DynamicTabler_NewSlice_Call) Run(run func()) *DynamicTabler_NewSlice_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DynamicTabler_NewSlice_Call) Return(dynamicTabler models.DynamicTabler) *DynamicTabler_NewSlice_Call { + _c.Call.Return(dynamicTabler) + return _c +} + +func (_c *DynamicTabler_NewSlice_Call) RunAndReturn(run func() models.DynamicTabler) *DynamicTabler_NewSlice_Call { + _c.Call.Return(run) + return _c +} + +// NewValue provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) NewValue() any { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for NewValue") + } + + var r0 any + if returnFunc, ok := ret.Get(0).(func() any); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(any) + } + } + return r0 +} + +// DynamicTabler_NewValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewValue' +type DynamicTabler_NewValue_Call struct { + *mock.Call +} + +// NewValue is a helper method to define mock.On call +func (_e *DynamicTabler_Expecter) NewValue() *DynamicTabler_NewValue_Call { + return &DynamicTabler_NewValue_Call{Call: _e.mock.On("NewValue")} +} + +func (_c *DynamicTabler_NewValue_Call) Run(run func()) *DynamicTabler_NewValue_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DynamicTabler_NewValue_Call) Return(anyMoqParam any) *DynamicTabler_NewValue_Call { + _c.Call.Return(anyMoqParam) + return _c +} + +func (_c *DynamicTabler_NewValue_Call) RunAndReturn(run func() any) *DynamicTabler_NewValue_Call { + _c.Call.Return(run) + return _c +} + +// TableName provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) TableName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for TableName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// DynamicTabler_TableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TableName' +type DynamicTabler_TableName_Call struct { + *mock.Call +} + +// TableName is a helper method to define mock.On call +func (_e *DynamicTabler_Expecter) TableName() *DynamicTabler_TableName_Call { + return &DynamicTabler_TableName_Call{Call: _e.mock.On("TableName")} +} + +func (_c *DynamicTabler_TableName_Call) Run(run func()) *DynamicTabler_TableName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DynamicTabler_TableName_Call) Return(s string) *DynamicTabler_TableName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *DynamicTabler_TableName_Call) RunAndReturn(run func() string) *DynamicTabler_TableName_Call { + _c.Call.Return(run) + return _c +} + +// To provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) To(target any) errors.Error { + ret := _mock.Called(target) + + if len(ret) == 0 { + panic("no return value specified for To") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(any) errors.Error); ok { + r0 = returnFunc(target) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// DynamicTabler_To_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'To' +type DynamicTabler_To_Call struct { + *mock.Call +} + +// To is a helper method to define mock.On call +// - target any +func (_e *DynamicTabler_Expecter) To(target any) *DynamicTabler_To_Call { + return &DynamicTabler_To_Call{Call: _e.mock.On("To", target)} +} + +func (_c *DynamicTabler_To_Call) Run(run func(target any)) *DynamicTabler_To_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 any + if args[0] != nil { + arg0 = args[0].(any) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *DynamicTabler_To_Call) Return(error errors.Error) *DynamicTabler_To_Call { + _c.Call.Return(error) + return _c +} + +func (_c *DynamicTabler_To_Call) RunAndReturn(run func(target any) errors.Error) *DynamicTabler_To_Call { + _c.Call.Return(run) + return _c +} + +// UnmarshalJSON provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) UnmarshalJSON(bytes []byte) error { + ret := _mock.Called(bytes) + + if len(ret) == 0 { + panic("no return value specified for UnmarshalJSON") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func([]byte) error); ok { + r0 = returnFunc(bytes) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// DynamicTabler_UnmarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalJSON' +type DynamicTabler_UnmarshalJSON_Call struct { + *mock.Call +} + +// UnmarshalJSON is a helper method to define mock.On call +// - bytes []byte +func (_e *DynamicTabler_Expecter) UnmarshalJSON(bytes any) *DynamicTabler_UnmarshalJSON_Call { + return &DynamicTabler_UnmarshalJSON_Call{Call: _e.mock.On("UnmarshalJSON", bytes)} +} + +func (_c *DynamicTabler_UnmarshalJSON_Call) Run(run func(bytes []byte)) *DynamicTabler_UnmarshalJSON_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []byte + if args[0] != nil { + arg0 = args[0].([]byte) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *DynamicTabler_UnmarshalJSON_Call) Return(err error) *DynamicTabler_UnmarshalJSON_Call { + _c.Call.Return(err) + return _c +} + +func (_c *DynamicTabler_UnmarshalJSON_Call) RunAndReturn(run func(bytes []byte) error) *DynamicTabler_UnmarshalJSON_Call { + _c.Call.Return(run) + return _c +} + +// Unwrap provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) Unwrap() any { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Unwrap") + } + + var r0 any + if returnFunc, ok := ret.Get(0).(func() any); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(any) + } + } + return r0 +} + +// DynamicTabler_Unwrap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unwrap' +type DynamicTabler_Unwrap_Call struct { + *mock.Call +} + +// Unwrap is a helper method to define mock.On call +func (_e *DynamicTabler_Expecter) Unwrap() *DynamicTabler_Unwrap_Call { + return &DynamicTabler_Unwrap_Call{Call: _e.mock.On("Unwrap")} +} + +func (_c *DynamicTabler_Unwrap_Call) Run(run func()) *DynamicTabler_Unwrap_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DynamicTabler_Unwrap_Call) Return(anyMoqParam any) *DynamicTabler_Unwrap_Call { + _c.Call.Return(anyMoqParam) + return _c +} + +func (_c *DynamicTabler_Unwrap_Call) RunAndReturn(run func() any) *DynamicTabler_Unwrap_Call { + _c.Call.Return(run) + return _c +} + +// UnwrapPtr provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) UnwrapPtr() *any { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for UnwrapPtr") + } + + var r0 *any + if returnFunc, ok := ret.Get(0).(func() *any); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*any) + } + } + return r0 +} + +// DynamicTabler_UnwrapPtr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnwrapPtr' +type DynamicTabler_UnwrapPtr_Call struct { + *mock.Call +} + +// UnwrapPtr is a helper method to define mock.On call +func (_e *DynamicTabler_Expecter) UnwrapPtr() *DynamicTabler_UnwrapPtr_Call { + return &DynamicTabler_UnwrapPtr_Call{Call: _e.mock.On("UnwrapPtr")} +} + +func (_c *DynamicTabler_UnwrapPtr_Call) Run(run func()) *DynamicTabler_UnwrapPtr_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DynamicTabler_UnwrapPtr_Call) Return(anyMoqParam *any) *DynamicTabler_UnwrapPtr_Call { + _c.Call.Return(anyMoqParam) + return _c +} + +func (_c *DynamicTabler_UnwrapPtr_Call) RunAndReturn(run func() *any) *DynamicTabler_UnwrapPtr_Call { + _c.Call.Return(run) + return _c +} + +// UnwrapSlice provides a mock function for the type DynamicTabler +func (_mock *DynamicTabler) UnwrapSlice() []any { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for UnwrapSlice") + } + + var r0 []any + if returnFunc, ok := ret.Get(0).(func() []any); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]any) + } + } + return r0 +} + +// DynamicTabler_UnwrapSlice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnwrapSlice' +type DynamicTabler_UnwrapSlice_Call struct { + *mock.Call +} + +// UnwrapSlice is a helper method to define mock.On call +func (_e *DynamicTabler_Expecter) UnwrapSlice() *DynamicTabler_UnwrapSlice_Call { + return &DynamicTabler_UnwrapSlice_Call{Call: _e.mock.On("UnwrapSlice")} +} + +func (_c *DynamicTabler_UnwrapSlice_Call) Run(run func()) *DynamicTabler_UnwrapSlice_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DynamicTabler_UnwrapSlice_Call) Return(anyMoqParams []any) *DynamicTabler_UnwrapSlice_Call { + _c.Call.Return(anyMoqParams) + return _c +} + +func (_c *DynamicTabler_UnwrapSlice_Call) RunAndReturn(run func() []any) *DynamicTabler_UnwrapSlice_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/models/common/GetRawDataOrigin.go b/backend/mocks/core/models/common/GetRawDataOrigin.go new file mode 100644 index 00000000000..e5f3e91a91d --- /dev/null +++ b/backend/mocks/core/models/common/GetRawDataOrigin.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/models/common" + mock "github.com/stretchr/testify/mock" +) + +// NewGetRawDataOrigin creates a new instance of GetRawDataOrigin. 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 NewGetRawDataOrigin(t interface { + mock.TestingT + Cleanup(func()) +}) *GetRawDataOrigin { + mock := &GetRawDataOrigin{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// GetRawDataOrigin is an autogenerated mock type for the GetRawDataOrigin type +type GetRawDataOrigin struct { + mock.Mock +} + +type GetRawDataOrigin_Expecter struct { + mock *mock.Mock +} + +func (_m *GetRawDataOrigin) EXPECT() *GetRawDataOrigin_Expecter { + return &GetRawDataOrigin_Expecter{mock: &_m.Mock} +} + +// GetRawDataOrigin provides a mock function for the type GetRawDataOrigin +func (_mock *GetRawDataOrigin) GetRawDataOrigin() *common.RawDataOrigin { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRawDataOrigin") + } + + var r0 *common.RawDataOrigin + if returnFunc, ok := ret.Get(0).(func() *common.RawDataOrigin); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*common.RawDataOrigin) + } + } + return r0 +} + +// GetRawDataOrigin_GetRawDataOrigin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRawDataOrigin' +type GetRawDataOrigin_GetRawDataOrigin_Call struct { + *mock.Call +} + +// GetRawDataOrigin is a helper method to define mock.On call +func (_e *GetRawDataOrigin_Expecter) GetRawDataOrigin() *GetRawDataOrigin_GetRawDataOrigin_Call { + return &GetRawDataOrigin_GetRawDataOrigin_Call{Call: _e.mock.On("GetRawDataOrigin")} +} + +func (_c *GetRawDataOrigin_GetRawDataOrigin_Call) Run(run func()) *GetRawDataOrigin_GetRawDataOrigin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GetRawDataOrigin_GetRawDataOrigin_Call) Return(rawDataOrigin *common.RawDataOrigin) *GetRawDataOrigin_GetRawDataOrigin_Call { + _c.Call.Return(rawDataOrigin) + return _c +} + +func (_c *GetRawDataOrigin_GetRawDataOrigin_Call) RunAndReturn(run func() *common.RawDataOrigin) *GetRawDataOrigin_GetRawDataOrigin_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/models/common/ScopeConfigOperator.go b/backend/mocks/core/models/common/ScopeConfigOperator.go new file mode 100644 index 00000000000..1af60527522 --- /dev/null +++ b/backend/mocks/core/models/common/ScopeConfigOperator.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/dal" + mock "github.com/stretchr/testify/mock" +) + +// NewScopeConfigOperator creates a new instance of ScopeConfigOperator. 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 NewScopeConfigOperator[T dal.Tabler](t interface { + mock.TestingT + Cleanup(func()) +}) *ScopeConfigOperator[T] { + mock := &ScopeConfigOperator[T]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ScopeConfigOperator is an autogenerated mock type for the ScopeConfigOperator type +type ScopeConfigOperator[T dal.Tabler] struct { + mock.Mock +} + +type ScopeConfigOperator_Expecter[T dal.Tabler] struct { + mock *mock.Mock +} + +func (_m *ScopeConfigOperator[T]) EXPECT() *ScopeConfigOperator_Expecter[T] { + return &ScopeConfigOperator_Expecter[T]{mock: &_m.Mock} +} + +// SetConnectionId provides a mock function for the type ScopeConfigOperator +func (_mock *ScopeConfigOperator[T]) SetConnectionId(t *T, connectionId uint64) { + _mock.Called(t, connectionId) + return +} + +// ScopeConfigOperator_SetConnectionId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetConnectionId' +type ScopeConfigOperator_SetConnectionId_Call[T dal.Tabler] struct { + *mock.Call +} + +// SetConnectionId is a helper method to define mock.On call +// - t *T +// - connectionId uint64 +func (_e *ScopeConfigOperator_Expecter[T]) SetConnectionId(t any, connectionId any) *ScopeConfigOperator_SetConnectionId_Call[T] { + return &ScopeConfigOperator_SetConnectionId_Call[T]{Call: _e.mock.On("SetConnectionId", t, connectionId)} +} + +func (_c *ScopeConfigOperator_SetConnectionId_Call[T]) Run(run func(t *T, connectionId uint64)) *ScopeConfigOperator_SetConnectionId_Call[T] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *T + if args[0] != nil { + arg0 = args[0].(*T) + } + var arg1 uint64 + if args[1] != nil { + arg1 = args[1].(uint64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *ScopeConfigOperator_SetConnectionId_Call[T]) Return() *ScopeConfigOperator_SetConnectionId_Call[T] { + _c.Call.Return() + return _c +} + +func (_c *ScopeConfigOperator_SetConnectionId_Call[T]) RunAndReturn(run func(t *T, connectionId uint64)) *ScopeConfigOperator_SetConnectionId_Call[T] { + _c.Run(run) + return _c +} diff --git a/backend/mocks/core/plugin/AccessTokenAuthenticator.go b/backend/mocks/core/plugin/AccessTokenAuthenticator.go new file mode 100644 index 00000000000..b5642f35f1e --- /dev/null +++ b/backend/mocks/core/plugin/AccessTokenAuthenticator.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewAccessTokenAuthenticator creates a new instance of AccessTokenAuthenticator. 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 NewAccessTokenAuthenticator(t interface { + mock.TestingT + Cleanup(func()) +}) *AccessTokenAuthenticator { + mock := &AccessTokenAuthenticator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// AccessTokenAuthenticator is an autogenerated mock type for the AccessTokenAuthenticator type +type AccessTokenAuthenticator struct { + mock.Mock +} + +type AccessTokenAuthenticator_Expecter struct { + mock *mock.Mock +} + +func (_m *AccessTokenAuthenticator) EXPECT() *AccessTokenAuthenticator_Expecter { + return &AccessTokenAuthenticator_Expecter{mock: &_m.Mock} +} + +// GetAccessTokenAuthenticator provides a mock function for the type AccessTokenAuthenticator +func (_mock *AccessTokenAuthenticator) GetAccessTokenAuthenticator() plugin.ApiAuthenticator { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAccessTokenAuthenticator") + } + + var r0 plugin.ApiAuthenticator + if returnFunc, ok := ret.Get(0).(func() plugin.ApiAuthenticator); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.ApiAuthenticator) + } + } + return r0 +} + +// AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAccessTokenAuthenticator' +type AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call struct { + *mock.Call +} + +// GetAccessTokenAuthenticator is a helper method to define mock.On call +func (_e *AccessTokenAuthenticator_Expecter) GetAccessTokenAuthenticator() *AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call { + return &AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call{Call: _e.mock.On("GetAccessTokenAuthenticator")} +} + +func (_c *AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call) Run(run func()) *AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call) Return(apiAuthenticator plugin.ApiAuthenticator) *AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call { + _c.Call.Return(apiAuthenticator) + return _c +} + +func (_c *AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call) RunAndReturn(run func() plugin.ApiAuthenticator) *AccessTokenAuthenticator_GetAccessTokenAuthenticator_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ApiAuthenticator.go b/backend/mocks/core/plugin/ApiAuthenticator.go new file mode 100644 index 00000000000..da5be48fb49 --- /dev/null +++ b/backend/mocks/core/plugin/ApiAuthenticator.go @@ -0,0 +1,92 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "net/http" + + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewApiAuthenticator creates a new instance of ApiAuthenticator. 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 NewApiAuthenticator(t interface { + mock.TestingT + Cleanup(func()) +}) *ApiAuthenticator { + mock := &ApiAuthenticator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ApiAuthenticator is an autogenerated mock type for the ApiAuthenticator type +type ApiAuthenticator struct { + mock.Mock +} + +type ApiAuthenticator_Expecter struct { + mock *mock.Mock +} + +func (_m *ApiAuthenticator) EXPECT() *ApiAuthenticator_Expecter { + return &ApiAuthenticator_Expecter{mock: &_m.Mock} +} + +// SetupAuthentication provides a mock function for the type ApiAuthenticator +func (_mock *ApiAuthenticator) SetupAuthentication(request *http.Request) errors.Error { + ret := _mock.Called(request) + + if len(ret) == 0 { + panic("no return value specified for SetupAuthentication") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(*http.Request) errors.Error); ok { + r0 = returnFunc(request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// ApiAuthenticator_SetupAuthentication_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetupAuthentication' +type ApiAuthenticator_SetupAuthentication_Call struct { + *mock.Call +} + +// SetupAuthentication is a helper method to define mock.On call +// - request *http.Request +func (_e *ApiAuthenticator_Expecter) SetupAuthentication(request any) *ApiAuthenticator_SetupAuthentication_Call { + return &ApiAuthenticator_SetupAuthentication_Call{Call: _e.mock.On("SetupAuthentication", request)} +} + +func (_c *ApiAuthenticator_SetupAuthentication_Call) Run(run func(request *http.Request)) *ApiAuthenticator_SetupAuthentication_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *http.Request + if args[0] != nil { + arg0 = args[0].(*http.Request) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ApiAuthenticator_SetupAuthentication_Call) Return(error errors.Error) *ApiAuthenticator_SetupAuthentication_Call { + _c.Call.Return(error) + return _c +} + +func (_c *ApiAuthenticator_SetupAuthentication_Call) RunAndReturn(run func(request *http.Request) errors.Error) *ApiAuthenticator_SetupAuthentication_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ApiClient.go b/backend/mocks/core/plugin/ApiClient.go new file mode 100644 index 00000000000..5e5b923bf4f --- /dev/null +++ b/backend/mocks/core/plugin/ApiClient.go @@ -0,0 +1,510 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "net/http" + "net/url" + + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewApiClient creates a new instance of ApiClient. 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 NewApiClient(t interface { + mock.TestingT + Cleanup(func()) +}) *ApiClient { + mock := &ApiClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ApiClient is an autogenerated mock type for the ApiClient type +type ApiClient struct { + mock.Mock +} + +type ApiClient_Expecter struct { + mock *mock.Mock +} + +func (_m *ApiClient) EXPECT() *ApiClient_Expecter { + return &ApiClient_Expecter{mock: &_m.Mock} +} + +// Get provides a mock function for the type ApiClient +func (_mock *ApiClient) Get(path string, query url.Values, headers http.Header) (*http.Response, errors.Error) { + ret := _mock.Called(path, query, headers) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *http.Response + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, url.Values, http.Header) (*http.Response, errors.Error)); ok { + return returnFunc(path, query, headers) + } + if returnFunc, ok := ret.Get(0).(func(string, url.Values, http.Header) *http.Response); ok { + r0 = returnFunc(path, query, headers) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + if returnFunc, ok := ret.Get(1).(func(string, url.Values, http.Header) errors.Error); ok { + r1 = returnFunc(path, query, headers) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// ApiClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type ApiClient_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - path string +// - query url.Values +// - headers http.Header +func (_e *ApiClient_Expecter) Get(path any, query any, headers any) *ApiClient_Get_Call { + return &ApiClient_Get_Call{Call: _e.mock.On("Get", path, query, headers)} +} + +func (_c *ApiClient_Get_Call) Run(run func(path string, query url.Values, headers http.Header)) *ApiClient_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 url.Values + if args[1] != nil { + arg1 = args[1].(url.Values) + } + var arg2 http.Header + if args[2] != nil { + arg2 = args[2].(http.Header) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *ApiClient_Get_Call) Return(response *http.Response, error errors.Error) *ApiClient_Get_Call { + _c.Call.Return(response, error) + return _c +} + +func (_c *ApiClient_Get_Call) RunAndReturn(run func(path string, query url.Values, headers http.Header) (*http.Response, errors.Error)) *ApiClient_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetAfterFunction provides a mock function for the type ApiClient +func (_mock *ApiClient) GetAfterFunction() plugin.ApiClientAfterResponse { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAfterFunction") + } + + var r0 plugin.ApiClientAfterResponse + if returnFunc, ok := ret.Get(0).(func() plugin.ApiClientAfterResponse); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.ApiClientAfterResponse) + } + } + return r0 +} + +// ApiClient_GetAfterFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAfterFunction' +type ApiClient_GetAfterFunction_Call struct { + *mock.Call +} + +// GetAfterFunction is a helper method to define mock.On call +func (_e *ApiClient_Expecter) GetAfterFunction() *ApiClient_GetAfterFunction_Call { + return &ApiClient_GetAfterFunction_Call{Call: _e.mock.On("GetAfterFunction")} +} + +func (_c *ApiClient_GetAfterFunction_Call) Run(run func()) *ApiClient_GetAfterFunction_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ApiClient_GetAfterFunction_Call) Return(apiClientAfterResponse plugin.ApiClientAfterResponse) *ApiClient_GetAfterFunction_Call { + _c.Call.Return(apiClientAfterResponse) + return _c +} + +func (_c *ApiClient_GetAfterFunction_Call) RunAndReturn(run func() plugin.ApiClientAfterResponse) *ApiClient_GetAfterFunction_Call { + _c.Call.Return(run) + return _c +} + +// GetBeforeFunction provides a mock function for the type ApiClient +func (_mock *ApiClient) GetBeforeFunction() plugin.ApiClientBeforeRequest { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBeforeFunction") + } + + var r0 plugin.ApiClientBeforeRequest + if returnFunc, ok := ret.Get(0).(func() plugin.ApiClientBeforeRequest); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.ApiClientBeforeRequest) + } + } + return r0 +} + +// ApiClient_GetBeforeFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBeforeFunction' +type ApiClient_GetBeforeFunction_Call struct { + *mock.Call +} + +// GetBeforeFunction is a helper method to define mock.On call +func (_e *ApiClient_Expecter) GetBeforeFunction() *ApiClient_GetBeforeFunction_Call { + return &ApiClient_GetBeforeFunction_Call{Call: _e.mock.On("GetBeforeFunction")} +} + +func (_c *ApiClient_GetBeforeFunction_Call) Run(run func()) *ApiClient_GetBeforeFunction_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ApiClient_GetBeforeFunction_Call) Return(apiClientBeforeRequest plugin.ApiClientBeforeRequest) *ApiClient_GetBeforeFunction_Call { + _c.Call.Return(apiClientBeforeRequest) + return _c +} + +func (_c *ApiClient_GetBeforeFunction_Call) RunAndReturn(run func() plugin.ApiClientBeforeRequest) *ApiClient_GetBeforeFunction_Call { + _c.Call.Return(run) + return _c +} + +// GetData provides a mock function for the type ApiClient +func (_mock *ApiClient) GetData(name string) interface{} { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetData") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func(string) interface{}); ok { + r0 = returnFunc(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// ApiClient_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData' +type ApiClient_GetData_Call struct { + *mock.Call +} + +// GetData is a helper method to define mock.On call +// - name string +func (_e *ApiClient_Expecter) GetData(name any) *ApiClient_GetData_Call { + return &ApiClient_GetData_Call{Call: _e.mock.On("GetData", name)} +} + +func (_c *ApiClient_GetData_Call) Run(run func(name string)) *ApiClient_GetData_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ApiClient_GetData_Call) Return(ifaceVal interface{}) *ApiClient_GetData_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *ApiClient_GetData_Call) RunAndReturn(run func(name string) interface{}) *ApiClient_GetData_Call { + _c.Call.Return(run) + return _c +} + +// Post provides a mock function for the type ApiClient +func (_mock *ApiClient) Post(path string, query url.Values, body interface{}, headers http.Header) (*http.Response, errors.Error) { + ret := _mock.Called(path, query, body, headers) + + if len(ret) == 0 { + panic("no return value specified for Post") + } + + var r0 *http.Response + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, url.Values, interface{}, http.Header) (*http.Response, errors.Error)); ok { + return returnFunc(path, query, body, headers) + } + if returnFunc, ok := ret.Get(0).(func(string, url.Values, interface{}, http.Header) *http.Response); ok { + r0 = returnFunc(path, query, body, headers) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + if returnFunc, ok := ret.Get(1).(func(string, url.Values, interface{}, http.Header) errors.Error); ok { + r1 = returnFunc(path, query, body, headers) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// ApiClient_Post_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Post' +type ApiClient_Post_Call struct { + *mock.Call +} + +// Post is a helper method to define mock.On call +// - path string +// - query url.Values +// - body interface{} +// - headers http.Header +func (_e *ApiClient_Expecter) Post(path any, query any, body any, headers any) *ApiClient_Post_Call { + return &ApiClient_Post_Call{Call: _e.mock.On("Post", path, query, body, headers)} +} + +func (_c *ApiClient_Post_Call) Run(run func(path string, query url.Values, body interface{}, headers http.Header)) *ApiClient_Post_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 url.Values + if args[1] != nil { + arg1 = args[1].(url.Values) + } + var arg2 interface{} + if args[2] != nil { + arg2 = args[2].(interface{}) + } + var arg3 http.Header + if args[3] != nil { + arg3 = args[3].(http.Header) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *ApiClient_Post_Call) Return(response *http.Response, error errors.Error) *ApiClient_Post_Call { + _c.Call.Return(response, error) + return _c +} + +func (_c *ApiClient_Post_Call) RunAndReturn(run func(path string, query url.Values, body interface{}, headers http.Header) (*http.Response, errors.Error)) *ApiClient_Post_Call { + _c.Call.Return(run) + return _c +} + +// SetAfterFunction provides a mock function for the type ApiClient +func (_mock *ApiClient) SetAfterFunction(callback plugin.ApiClientAfterResponse) { + _mock.Called(callback) + return +} + +// ApiClient_SetAfterFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAfterFunction' +type ApiClient_SetAfterFunction_Call struct { + *mock.Call +} + +// SetAfterFunction is a helper method to define mock.On call +// - callback plugin.ApiClientAfterResponse +func (_e *ApiClient_Expecter) SetAfterFunction(callback any) *ApiClient_SetAfterFunction_Call { + return &ApiClient_SetAfterFunction_Call{Call: _e.mock.On("SetAfterFunction", callback)} +} + +func (_c *ApiClient_SetAfterFunction_Call) Run(run func(callback plugin.ApiClientAfterResponse)) *ApiClient_SetAfterFunction_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 plugin.ApiClientAfterResponse + if args[0] != nil { + arg0 = args[0].(plugin.ApiClientAfterResponse) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ApiClient_SetAfterFunction_Call) Return() *ApiClient_SetAfterFunction_Call { + _c.Call.Return() + return _c +} + +func (_c *ApiClient_SetAfterFunction_Call) RunAndReturn(run func(callback plugin.ApiClientAfterResponse)) *ApiClient_SetAfterFunction_Call { + _c.Run(run) + return _c +} + +// SetBeforeFunction provides a mock function for the type ApiClient +func (_mock *ApiClient) SetBeforeFunction(callback plugin.ApiClientBeforeRequest) { + _mock.Called(callback) + return +} + +// ApiClient_SetBeforeFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBeforeFunction' +type ApiClient_SetBeforeFunction_Call struct { + *mock.Call +} + +// SetBeforeFunction is a helper method to define mock.On call +// - callback plugin.ApiClientBeforeRequest +func (_e *ApiClient_Expecter) SetBeforeFunction(callback any) *ApiClient_SetBeforeFunction_Call { + return &ApiClient_SetBeforeFunction_Call{Call: _e.mock.On("SetBeforeFunction", callback)} +} + +func (_c *ApiClient_SetBeforeFunction_Call) Run(run func(callback plugin.ApiClientBeforeRequest)) *ApiClient_SetBeforeFunction_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 plugin.ApiClientBeforeRequest + if args[0] != nil { + arg0 = args[0].(plugin.ApiClientBeforeRequest) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ApiClient_SetBeforeFunction_Call) Return() *ApiClient_SetBeforeFunction_Call { + _c.Call.Return() + return _c +} + +func (_c *ApiClient_SetBeforeFunction_Call) RunAndReturn(run func(callback plugin.ApiClientBeforeRequest)) *ApiClient_SetBeforeFunction_Call { + _c.Run(run) + return _c +} + +// SetData provides a mock function for the type ApiClient +func (_mock *ApiClient) SetData(name string, data interface{}) { + _mock.Called(name, data) + return +} + +// ApiClient_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' +type ApiClient_SetData_Call struct { + *mock.Call +} + +// SetData is a helper method to define mock.On call +// - name string +// - data interface{} +func (_e *ApiClient_Expecter) SetData(name any, data any) *ApiClient_SetData_Call { + return &ApiClient_SetData_Call{Call: _e.mock.On("SetData", name, data)} +} + +func (_c *ApiClient_SetData_Call) Run(run func(name string, data interface{})) *ApiClient_SetData_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 interface{} + if args[1] != nil { + arg1 = args[1].(interface{}) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *ApiClient_SetData_Call) Return() *ApiClient_SetData_Call { + _c.Call.Return() + return _c +} + +func (_c *ApiClient_SetData_Call) RunAndReturn(run func(name string, data interface{})) *ApiClient_SetData_Call { + _c.Run(run) + return _c +} + +// SetHeaders provides a mock function for the type ApiClient +func (_mock *ApiClient) SetHeaders(headers map[string]string) { + _mock.Called(headers) + return +} + +// ApiClient_SetHeaders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHeaders' +type ApiClient_SetHeaders_Call struct { + *mock.Call +} + +// SetHeaders is a helper method to define mock.On call +// - headers map[string]string +func (_e *ApiClient_Expecter) SetHeaders(headers any) *ApiClient_SetHeaders_Call { + return &ApiClient_SetHeaders_Call{Call: _e.mock.On("SetHeaders", headers)} +} + +func (_c *ApiClient_SetHeaders_Call) Run(run func(headers map[string]string)) *ApiClient_SetHeaders_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 map[string]string + if args[0] != nil { + arg0 = args[0].(map[string]string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ApiClient_SetHeaders_Call) Return() *ApiClient_SetHeaders_Call { + _c.Call.Return() + return _c +} + +func (_c *ApiClient_SetHeaders_Call) RunAndReturn(run func(headers map[string]string)) *ApiClient_SetHeaders_Call { + _c.Run(run) + return _c +} diff --git a/backend/mocks/core/plugin/ApiConnection.go b/backend/mocks/core/plugin/ApiConnection.go new file mode 100644 index 00000000000..ad43c7f7369 --- /dev/null +++ b/backend/mocks/core/plugin/ApiConnection.go @@ -0,0 +1,168 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewApiConnection creates a new instance of ApiConnection. 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 NewApiConnection(t interface { + mock.TestingT + Cleanup(func()) +}) *ApiConnection { + mock := &ApiConnection{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ApiConnection is an autogenerated mock type for the ApiConnection type +type ApiConnection struct { + mock.Mock +} + +type ApiConnection_Expecter struct { + mock *mock.Mock +} + +func (_m *ApiConnection) EXPECT() *ApiConnection_Expecter { + return &ApiConnection_Expecter{mock: &_m.Mock} +} + +// GetEndpoint provides a mock function for the type ApiConnection +func (_mock *ApiConnection) GetEndpoint() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEndpoint") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ApiConnection_GetEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEndpoint' +type ApiConnection_GetEndpoint_Call struct { + *mock.Call +} + +// GetEndpoint is a helper method to define mock.On call +func (_e *ApiConnection_Expecter) GetEndpoint() *ApiConnection_GetEndpoint_Call { + return &ApiConnection_GetEndpoint_Call{Call: _e.mock.On("GetEndpoint")} +} + +func (_c *ApiConnection_GetEndpoint_Call) Run(run func()) *ApiConnection_GetEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ApiConnection_GetEndpoint_Call) Return(s string) *ApiConnection_GetEndpoint_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ApiConnection_GetEndpoint_Call) RunAndReturn(run func() string) *ApiConnection_GetEndpoint_Call { + _c.Call.Return(run) + return _c +} + +// GetProxy provides a mock function for the type ApiConnection +func (_mock *ApiConnection) GetProxy() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProxy") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ApiConnection_GetProxy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProxy' +type ApiConnection_GetProxy_Call struct { + *mock.Call +} + +// GetProxy is a helper method to define mock.On call +func (_e *ApiConnection_Expecter) GetProxy() *ApiConnection_GetProxy_Call { + return &ApiConnection_GetProxy_Call{Call: _e.mock.On("GetProxy")} +} + +func (_c *ApiConnection_GetProxy_Call) Run(run func()) *ApiConnection_GetProxy_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ApiConnection_GetProxy_Call) Return(s string) *ApiConnection_GetProxy_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ApiConnection_GetProxy_Call) RunAndReturn(run func() string) *ApiConnection_GetProxy_Call { + _c.Call.Return(run) + return _c +} + +// GetRateLimitPerHour provides a mock function for the type ApiConnection +func (_mock *ApiConnection) GetRateLimitPerHour() int { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRateLimitPerHour") + } + + var r0 int + if returnFunc, ok := ret.Get(0).(func() int); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int) + } + return r0 +} + +// ApiConnection_GetRateLimitPerHour_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRateLimitPerHour' +type ApiConnection_GetRateLimitPerHour_Call struct { + *mock.Call +} + +// GetRateLimitPerHour is a helper method to define mock.On call +func (_e *ApiConnection_Expecter) GetRateLimitPerHour() *ApiConnection_GetRateLimitPerHour_Call { + return &ApiConnection_GetRateLimitPerHour_Call{Call: _e.mock.On("GetRateLimitPerHour")} +} + +func (_c *ApiConnection_GetRateLimitPerHour_Call) Run(run func()) *ApiConnection_GetRateLimitPerHour_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ApiConnection_GetRateLimitPerHour_Call) Return(n int) *ApiConnection_GetRateLimitPerHour_Call { + _c.Call.Return(n) + return _c +} + +func (_c *ApiConnection_GetRateLimitPerHour_Call) RunAndReturn(run func() int) *ApiConnection_GetRateLimitPerHour_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ApiGroup.go b/backend/mocks/core/plugin/ApiGroup.go new file mode 100644 index 00000000000..87d0b395c96 --- /dev/null +++ b/backend/mocks/core/plugin/ApiGroup.go @@ -0,0 +1,124 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewApiGroup creates a new instance of ApiGroup. 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 NewApiGroup(t interface { + mock.TestingT + Cleanup(func()) +}) *ApiGroup { + mock := &ApiGroup{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ApiGroup is an autogenerated mock type for the ApiGroup type +type ApiGroup struct { + mock.Mock +} + +type ApiGroup_Expecter struct { + mock *mock.Mock +} + +func (_m *ApiGroup) EXPECT() *ApiGroup_Expecter { + return &ApiGroup_Expecter{mock: &_m.Mock} +} + +// GroupId provides a mock function for the type ApiGroup +func (_mock *ApiGroup) GroupId() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GroupId") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ApiGroup_GroupId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GroupId' +type ApiGroup_GroupId_Call struct { + *mock.Call +} + +// GroupId is a helper method to define mock.On call +func (_e *ApiGroup_Expecter) GroupId() *ApiGroup_GroupId_Call { + return &ApiGroup_GroupId_Call{Call: _e.mock.On("GroupId")} +} + +func (_c *ApiGroup_GroupId_Call) Run(run func()) *ApiGroup_GroupId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ApiGroup_GroupId_Call) Return(s string) *ApiGroup_GroupId_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ApiGroup_GroupId_Call) RunAndReturn(run func() string) *ApiGroup_GroupId_Call { + _c.Call.Return(run) + return _c +} + +// GroupName provides a mock function for the type ApiGroup +func (_mock *ApiGroup) GroupName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GroupName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ApiGroup_GroupName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GroupName' +type ApiGroup_GroupName_Call struct { + *mock.Call +} + +// GroupName is a helper method to define mock.On call +func (_e *ApiGroup_Expecter) GroupName() *ApiGroup_GroupName_Call { + return &ApiGroup_GroupName_Call{Call: _e.mock.On("GroupName")} +} + +func (_c *ApiGroup_GroupName_Call) Run(run func()) *ApiGroup_GroupName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ApiGroup_GroupName_Call) Return(s string) *ApiGroup_GroupName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ApiGroup_GroupName_Call) RunAndReturn(run func() string) *ApiGroup_GroupName_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ApiScope.go b/backend/mocks/core/plugin/ApiScope.go new file mode 100644 index 00000000000..8c6e08cd5f6 --- /dev/null +++ b/backend/mocks/core/plugin/ApiScope.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewApiScope creates a new instance of ApiScope. 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 NewApiScope(t interface { + mock.TestingT + Cleanup(func()) +}) *ApiScope { + mock := &ApiScope{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ApiScope is an autogenerated mock type for the ApiScope type +type ApiScope struct { + mock.Mock +} + +type ApiScope_Expecter struct { + mock *mock.Mock +} + +func (_m *ApiScope) EXPECT() *ApiScope_Expecter { + return &ApiScope_Expecter{mock: &_m.Mock} +} + +// ConvertApiScope provides a mock function for the type ApiScope +func (_mock *ApiScope) ConvertApiScope() plugin.ToolLayerScope { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ConvertApiScope") + } + + var r0 plugin.ToolLayerScope + if returnFunc, ok := ret.Get(0).(func() plugin.ToolLayerScope); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.ToolLayerScope) + } + } + return r0 +} + +// ApiScope_ConvertApiScope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConvertApiScope' +type ApiScope_ConvertApiScope_Call struct { + *mock.Call +} + +// ConvertApiScope is a helper method to define mock.On call +func (_e *ApiScope_Expecter) ConvertApiScope() *ApiScope_ConvertApiScope_Call { + return &ApiScope_ConvertApiScope_Call{Call: _e.mock.On("ConvertApiScope")} +} + +func (_c *ApiScope_ConvertApiScope_Call) Run(run func()) *ApiScope_ConvertApiScope_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ApiScope_ConvertApiScope_Call) Return(toolLayerScope plugin.ToolLayerScope) *ApiScope_ConvertApiScope_Call { + _c.Call.Return(toolLayerScope) + return _c +} + +func (_c *ApiScope_ConvertApiScope_Call) RunAndReturn(run func() plugin.ToolLayerScope) *ApiScope_ConvertApiScope_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/AppKeyAuthenticator.go b/backend/mocks/core/plugin/AppKeyAuthenticator.go new file mode 100644 index 00000000000..af26b71c75e --- /dev/null +++ b/backend/mocks/core/plugin/AppKeyAuthenticator.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewAppKeyAuthenticator creates a new instance of AppKeyAuthenticator. 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 NewAppKeyAuthenticator(t interface { + mock.TestingT + Cleanup(func()) +}) *AppKeyAuthenticator { + mock := &AppKeyAuthenticator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// AppKeyAuthenticator is an autogenerated mock type for the AppKeyAuthenticator type +type AppKeyAuthenticator struct { + mock.Mock +} + +type AppKeyAuthenticator_Expecter struct { + mock *mock.Mock +} + +func (_m *AppKeyAuthenticator) EXPECT() *AppKeyAuthenticator_Expecter { + return &AppKeyAuthenticator_Expecter{mock: &_m.Mock} +} + +// GetAppKeyAuthenticator provides a mock function for the type AppKeyAuthenticator +func (_mock *AppKeyAuthenticator) GetAppKeyAuthenticator() plugin.ApiAuthenticator { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAppKeyAuthenticator") + } + + var r0 plugin.ApiAuthenticator + if returnFunc, ok := ret.Get(0).(func() plugin.ApiAuthenticator); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.ApiAuthenticator) + } + } + return r0 +} + +// AppKeyAuthenticator_GetAppKeyAuthenticator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAppKeyAuthenticator' +type AppKeyAuthenticator_GetAppKeyAuthenticator_Call struct { + *mock.Call +} + +// GetAppKeyAuthenticator is a helper method to define mock.On call +func (_e *AppKeyAuthenticator_Expecter) GetAppKeyAuthenticator() *AppKeyAuthenticator_GetAppKeyAuthenticator_Call { + return &AppKeyAuthenticator_GetAppKeyAuthenticator_Call{Call: _e.mock.On("GetAppKeyAuthenticator")} +} + +func (_c *AppKeyAuthenticator_GetAppKeyAuthenticator_Call) Run(run func()) *AppKeyAuthenticator_GetAppKeyAuthenticator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *AppKeyAuthenticator_GetAppKeyAuthenticator_Call) Return(apiAuthenticator plugin.ApiAuthenticator) *AppKeyAuthenticator_GetAppKeyAuthenticator_Call { + _c.Call.Return(apiAuthenticator) + return _c +} + +func (_c *AppKeyAuthenticator_GetAppKeyAuthenticator_Call) RunAndReturn(run func() plugin.ApiAuthenticator) *AppKeyAuthenticator_GetAppKeyAuthenticator_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/BasicAuthenticator.go b/backend/mocks/core/plugin/BasicAuthenticator.go new file mode 100644 index 00000000000..797703db5fd --- /dev/null +++ b/backend/mocks/core/plugin/BasicAuthenticator.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewBasicAuthenticator creates a new instance of BasicAuthenticator. 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 NewBasicAuthenticator(t interface { + mock.TestingT + Cleanup(func()) +}) *BasicAuthenticator { + mock := &BasicAuthenticator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// BasicAuthenticator is an autogenerated mock type for the BasicAuthenticator type +type BasicAuthenticator struct { + mock.Mock +} + +type BasicAuthenticator_Expecter struct { + mock *mock.Mock +} + +func (_m *BasicAuthenticator) EXPECT() *BasicAuthenticator_Expecter { + return &BasicAuthenticator_Expecter{mock: &_m.Mock} +} + +// GetBasicAuthenticator provides a mock function for the type BasicAuthenticator +func (_mock *BasicAuthenticator) GetBasicAuthenticator() plugin.ApiAuthenticator { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBasicAuthenticator") + } + + var r0 plugin.ApiAuthenticator + if returnFunc, ok := ret.Get(0).(func() plugin.ApiAuthenticator); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.ApiAuthenticator) + } + } + return r0 +} + +// BasicAuthenticator_GetBasicAuthenticator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBasicAuthenticator' +type BasicAuthenticator_GetBasicAuthenticator_Call struct { + *mock.Call +} + +// GetBasicAuthenticator is a helper method to define mock.On call +func (_e *BasicAuthenticator_Expecter) GetBasicAuthenticator() *BasicAuthenticator_GetBasicAuthenticator_Call { + return &BasicAuthenticator_GetBasicAuthenticator_Call{Call: _e.mock.On("GetBasicAuthenticator")} +} + +func (_c *BasicAuthenticator_GetBasicAuthenticator_Call) Run(run func()) *BasicAuthenticator_GetBasicAuthenticator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BasicAuthenticator_GetBasicAuthenticator_Call) Return(apiAuthenticator plugin.ApiAuthenticator) *BasicAuthenticator_GetBasicAuthenticator_Call { + _c.Call.Return(apiAuthenticator) + return _c +} + +func (_c *BasicAuthenticator_GetBasicAuthenticator_Call) RunAndReturn(run func() plugin.ApiAuthenticator) *BasicAuthenticator_GetBasicAuthenticator_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/CacheableConnection.go b/backend/mocks/core/plugin/CacheableConnection.go new file mode 100644 index 00000000000..5cfe06b097c --- /dev/null +++ b/backend/mocks/core/plugin/CacheableConnection.go @@ -0,0 +1,212 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewCacheableConnection creates a new instance of CacheableConnection. 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 NewCacheableConnection(t interface { + mock.TestingT + Cleanup(func()) +}) *CacheableConnection { + mock := &CacheableConnection{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// CacheableConnection is an autogenerated mock type for the CacheableConnection type +type CacheableConnection struct { + mock.Mock +} + +type CacheableConnection_Expecter struct { + mock *mock.Mock +} + +func (_m *CacheableConnection) EXPECT() *CacheableConnection_Expecter { + return &CacheableConnection_Expecter{mock: &_m.Mock} +} + +// GetEndpoint provides a mock function for the type CacheableConnection +func (_mock *CacheableConnection) GetEndpoint() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEndpoint") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CacheableConnection_GetEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEndpoint' +type CacheableConnection_GetEndpoint_Call struct { + *mock.Call +} + +// GetEndpoint is a helper method to define mock.On call +func (_e *CacheableConnection_Expecter) GetEndpoint() *CacheableConnection_GetEndpoint_Call { + return &CacheableConnection_GetEndpoint_Call{Call: _e.mock.On("GetEndpoint")} +} + +func (_c *CacheableConnection_GetEndpoint_Call) Run(run func()) *CacheableConnection_GetEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CacheableConnection_GetEndpoint_Call) Return(s string) *CacheableConnection_GetEndpoint_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CacheableConnection_GetEndpoint_Call) RunAndReturn(run func() string) *CacheableConnection_GetEndpoint_Call { + _c.Call.Return(run) + return _c +} + +// GetHash provides a mock function for the type CacheableConnection +func (_mock *CacheableConnection) GetHash() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetHash") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CacheableConnection_GetHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHash' +type CacheableConnection_GetHash_Call struct { + *mock.Call +} + +// GetHash is a helper method to define mock.On call +func (_e *CacheableConnection_Expecter) GetHash() *CacheableConnection_GetHash_Call { + return &CacheableConnection_GetHash_Call{Call: _e.mock.On("GetHash")} +} + +func (_c *CacheableConnection_GetHash_Call) Run(run func()) *CacheableConnection_GetHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CacheableConnection_GetHash_Call) Return(s string) *CacheableConnection_GetHash_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CacheableConnection_GetHash_Call) RunAndReturn(run func() string) *CacheableConnection_GetHash_Call { + _c.Call.Return(run) + return _c +} + +// GetProxy provides a mock function for the type CacheableConnection +func (_mock *CacheableConnection) GetProxy() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProxy") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CacheableConnection_GetProxy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProxy' +type CacheableConnection_GetProxy_Call struct { + *mock.Call +} + +// GetProxy is a helper method to define mock.On call +func (_e *CacheableConnection_Expecter) GetProxy() *CacheableConnection_GetProxy_Call { + return &CacheableConnection_GetProxy_Call{Call: _e.mock.On("GetProxy")} +} + +func (_c *CacheableConnection_GetProxy_Call) Run(run func()) *CacheableConnection_GetProxy_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CacheableConnection_GetProxy_Call) Return(s string) *CacheableConnection_GetProxy_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CacheableConnection_GetProxy_Call) RunAndReturn(run func() string) *CacheableConnection_GetProxy_Call { + _c.Call.Return(run) + return _c +} + +// GetRateLimitPerHour provides a mock function for the type CacheableConnection +func (_mock *CacheableConnection) GetRateLimitPerHour() int { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRateLimitPerHour") + } + + var r0 int + if returnFunc, ok := ret.Get(0).(func() int); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int) + } + return r0 +} + +// CacheableConnection_GetRateLimitPerHour_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRateLimitPerHour' +type CacheableConnection_GetRateLimitPerHour_Call struct { + *mock.Call +} + +// GetRateLimitPerHour is a helper method to define mock.On call +func (_e *CacheableConnection_Expecter) GetRateLimitPerHour() *CacheableConnection_GetRateLimitPerHour_Call { + return &CacheableConnection_GetRateLimitPerHour_Call{Call: _e.mock.On("GetRateLimitPerHour")} +} + +func (_c *CacheableConnection_GetRateLimitPerHour_Call) Run(run func()) *CacheableConnection_GetRateLimitPerHour_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CacheableConnection_GetRateLimitPerHour_Call) Return(n int) *CacheableConnection_GetRateLimitPerHour_Call { + _c.Call.Return(n) + return _c +} + +func (_c *CacheableConnection_GetRateLimitPerHour_Call) RunAndReturn(run func() int) *CacheableConnection_GetRateLimitPerHour_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/CloseablePluginTask.go b/backend/mocks/core/plugin/CloseablePluginTask.go new file mode 100644 index 00000000000..99d02d41719 --- /dev/null +++ b/backend/mocks/core/plugin/CloseablePluginTask.go @@ -0,0 +1,207 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewCloseablePluginTask creates a new instance of CloseablePluginTask. 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 NewCloseablePluginTask(t interface { + mock.TestingT + Cleanup(func()) +}) *CloseablePluginTask { + mock := &CloseablePluginTask{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// CloseablePluginTask is an autogenerated mock type for the CloseablePluginTask type +type CloseablePluginTask struct { + mock.Mock +} + +type CloseablePluginTask_Expecter struct { + mock *mock.Mock +} + +func (_m *CloseablePluginTask) EXPECT() *CloseablePluginTask_Expecter { + return &CloseablePluginTask_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function for the type CloseablePluginTask +func (_mock *CloseablePluginTask) Close(taskCtx plugin.TaskContext) errors.Error { + ret := _mock.Called(taskCtx) + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(plugin.TaskContext) errors.Error); ok { + r0 = returnFunc(taskCtx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// CloseablePluginTask_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type CloseablePluginTask_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +// - taskCtx plugin.TaskContext +func (_e *CloseablePluginTask_Expecter) Close(taskCtx any) *CloseablePluginTask_Close_Call { + return &CloseablePluginTask_Close_Call{Call: _e.mock.On("Close", taskCtx)} +} + +func (_c *CloseablePluginTask_Close_Call) Run(run func(taskCtx plugin.TaskContext)) *CloseablePluginTask_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 plugin.TaskContext + if args[0] != nil { + arg0 = args[0].(plugin.TaskContext) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *CloseablePluginTask_Close_Call) Return(error errors.Error) *CloseablePluginTask_Close_Call { + _c.Call.Return(error) + return _c +} + +func (_c *CloseablePluginTask_Close_Call) RunAndReturn(run func(taskCtx plugin.TaskContext) errors.Error) *CloseablePluginTask_Close_Call { + _c.Call.Return(run) + return _c +} + +// PrepareTaskData provides a mock function for the type CloseablePluginTask +func (_mock *CloseablePluginTask) PrepareTaskData(taskCtx plugin.TaskContext, options map[string]interface{}) (interface{}, errors.Error) { + ret := _mock.Called(taskCtx, options) + + if len(ret) == 0 { + panic("no return value specified for PrepareTaskData") + } + + var r0 interface{} + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(plugin.TaskContext, map[string]interface{}) (interface{}, errors.Error)); ok { + return returnFunc(taskCtx, options) + } + if returnFunc, ok := ret.Get(0).(func(plugin.TaskContext, map[string]interface{}) interface{}); ok { + r0 = returnFunc(taskCtx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + if returnFunc, ok := ret.Get(1).(func(plugin.TaskContext, map[string]interface{}) errors.Error); ok { + r1 = returnFunc(taskCtx, options) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// CloseablePluginTask_PrepareTaskData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareTaskData' +type CloseablePluginTask_PrepareTaskData_Call struct { + *mock.Call +} + +// PrepareTaskData is a helper method to define mock.On call +// - taskCtx plugin.TaskContext +// - options map[string]interface{} +func (_e *CloseablePluginTask_Expecter) PrepareTaskData(taskCtx any, options any) *CloseablePluginTask_PrepareTaskData_Call { + return &CloseablePluginTask_PrepareTaskData_Call{Call: _e.mock.On("PrepareTaskData", taskCtx, options)} +} + +func (_c *CloseablePluginTask_PrepareTaskData_Call) Run(run func(taskCtx plugin.TaskContext, options map[string]interface{})) *CloseablePluginTask_PrepareTaskData_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 plugin.TaskContext + if args[0] != nil { + arg0 = args[0].(plugin.TaskContext) + } + var arg1 map[string]interface{} + if args[1] != nil { + arg1 = args[1].(map[string]interface{}) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *CloseablePluginTask_PrepareTaskData_Call) Return(ifaceVal interface{}, error errors.Error) *CloseablePluginTask_PrepareTaskData_Call { + _c.Call.Return(ifaceVal, error) + return _c +} + +func (_c *CloseablePluginTask_PrepareTaskData_Call) RunAndReturn(run func(taskCtx plugin.TaskContext, options map[string]interface{}) (interface{}, errors.Error)) *CloseablePluginTask_PrepareTaskData_Call { + _c.Call.Return(run) + return _c +} + +// SubTaskMetas provides a mock function for the type CloseablePluginTask +func (_mock *CloseablePluginTask) SubTaskMetas() []plugin.SubTaskMeta { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for SubTaskMetas") + } + + var r0 []plugin.SubTaskMeta + if returnFunc, ok := ret.Get(0).(func() []plugin.SubTaskMeta); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]plugin.SubTaskMeta) + } + } + return r0 +} + +// CloseablePluginTask_SubTaskMetas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubTaskMetas' +type CloseablePluginTask_SubTaskMetas_Call struct { + *mock.Call +} + +// SubTaskMetas is a helper method to define mock.On call +func (_e *CloseablePluginTask_Expecter) SubTaskMetas() *CloseablePluginTask_SubTaskMetas_Call { + return &CloseablePluginTask_SubTaskMetas_Call{Call: _e.mock.On("SubTaskMetas")} +} + +func (_c *CloseablePluginTask_SubTaskMetas_Call) Run(run func()) *CloseablePluginTask_SubTaskMetas_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CloseablePluginTask_SubTaskMetas_Call) Return(subTaskMetas []plugin.SubTaskMeta) *CloseablePluginTask_SubTaskMetas_Call { + _c.Call.Return(subTaskMetas) + return _c +} + +func (_c *CloseablePluginTask_SubTaskMetas_Call) RunAndReturn(run func() []plugin.SubTaskMeta) *CloseablePluginTask_SubTaskMetas_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/CompositeDataSourcePluginBlueprintV200.go b/backend/mocks/core/plugin/CompositeDataSourcePluginBlueprintV200.go new file mode 100644 index 00000000000..b766dbe31da --- /dev/null +++ b/backend/mocks/core/plugin/CompositeDataSourcePluginBlueprintV200.go @@ -0,0 +1,249 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/models" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewCompositeDataSourcePluginBlueprintV200 creates a new instance of CompositeDataSourcePluginBlueprintV200. 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 NewCompositeDataSourcePluginBlueprintV200(t interface { + mock.TestingT + Cleanup(func()) +}) *CompositeDataSourcePluginBlueprintV200 { + mock := &CompositeDataSourcePluginBlueprintV200{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// CompositeDataSourcePluginBlueprintV200 is an autogenerated mock type for the CompositeDataSourcePluginBlueprintV200 type +type CompositeDataSourcePluginBlueprintV200 struct { + mock.Mock +} + +type CompositeDataSourcePluginBlueprintV200_Expecter struct { + mock *mock.Mock +} + +func (_m *CompositeDataSourcePluginBlueprintV200) EXPECT() *CompositeDataSourcePluginBlueprintV200_Expecter { + return &CompositeDataSourcePluginBlueprintV200_Expecter{mock: &_m.Mock} +} + +// Description provides a mock function for the type CompositeDataSourcePluginBlueprintV200 +func (_mock *CompositeDataSourcePluginBlueprintV200) Description() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositeDataSourcePluginBlueprintV200_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type CompositeDataSourcePluginBlueprintV200_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *CompositeDataSourcePluginBlueprintV200_Expecter) Description() *CompositeDataSourcePluginBlueprintV200_Description_Call { + return &CompositeDataSourcePluginBlueprintV200_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *CompositeDataSourcePluginBlueprintV200_Description_Call) Run(run func()) *CompositeDataSourcePluginBlueprintV200_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositeDataSourcePluginBlueprintV200_Description_Call) Return(s string) *CompositeDataSourcePluginBlueprintV200_Description_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositeDataSourcePluginBlueprintV200_Description_Call) RunAndReturn(run func() string) *CompositeDataSourcePluginBlueprintV200_Description_Call { + _c.Call.Return(run) + return _c +} + +// MakeDataSourcePipelinePlanV200 provides a mock function for the type CompositeDataSourcePluginBlueprintV200 +func (_mock *CompositeDataSourcePluginBlueprintV200) MakeDataSourcePipelinePlanV200(connectionId uint64, scopes []*models.BlueprintScope) (models.PipelinePlan, []plugin.Scope, errors.Error) { + ret := _mock.Called(connectionId, scopes) + + if len(ret) == 0 { + panic("no return value specified for MakeDataSourcePipelinePlanV200") + } + + var r0 models.PipelinePlan + var r1 []plugin.Scope + var r2 errors.Error + if returnFunc, ok := ret.Get(0).(func(uint64, []*models.BlueprintScope) (models.PipelinePlan, []plugin.Scope, errors.Error)); ok { + return returnFunc(connectionId, scopes) + } + if returnFunc, ok := ret.Get(0).(func(uint64, []*models.BlueprintScope) models.PipelinePlan); ok { + r0 = returnFunc(connectionId, scopes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.PipelinePlan) + } + } + if returnFunc, ok := ret.Get(1).(func(uint64, []*models.BlueprintScope) []plugin.Scope); ok { + r1 = returnFunc(connectionId, scopes) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]plugin.Scope) + } + } + if returnFunc, ok := ret.Get(2).(func(uint64, []*models.BlueprintScope) errors.Error); ok { + r2 = returnFunc(connectionId, scopes) + } else { + if ret.Get(2) != nil { + r2 = ret.Get(2).(errors.Error) + } + } + return r0, r1, r2 +} + +// CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeDataSourcePipelinePlanV200' +type CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call struct { + *mock.Call +} + +// MakeDataSourcePipelinePlanV200 is a helper method to define mock.On call +// - connectionId uint64 +// - scopes []*models.BlueprintScope +func (_e *CompositeDataSourcePluginBlueprintV200_Expecter) MakeDataSourcePipelinePlanV200(connectionId any, scopes any) *CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + return &CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call{Call: _e.mock.On("MakeDataSourcePipelinePlanV200", connectionId, scopes)} +} + +func (_c *CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call) Run(run func(connectionId uint64, scopes []*models.BlueprintScope)) *CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 uint64 + if args[0] != nil { + arg0 = args[0].(uint64) + } + var arg1 []*models.BlueprintScope + if args[1] != nil { + arg1 = args[1].([]*models.BlueprintScope) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call) Return(pipelinePlan models.PipelinePlan, scopes1 []plugin.Scope, error errors.Error) *CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + _c.Call.Return(pipelinePlan, scopes1, error) + return _c +} + +func (_c *CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call) RunAndReturn(run func(connectionId uint64, scopes []*models.BlueprintScope) (models.PipelinePlan, []plugin.Scope, errors.Error)) *CompositeDataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function for the type CompositeDataSourcePluginBlueprintV200 +func (_mock *CompositeDataSourcePluginBlueprintV200) Name() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositeDataSourcePluginBlueprintV200_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type CompositeDataSourcePluginBlueprintV200_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *CompositeDataSourcePluginBlueprintV200_Expecter) Name() *CompositeDataSourcePluginBlueprintV200_Name_Call { + return &CompositeDataSourcePluginBlueprintV200_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *CompositeDataSourcePluginBlueprintV200_Name_Call) Run(run func()) *CompositeDataSourcePluginBlueprintV200_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositeDataSourcePluginBlueprintV200_Name_Call) Return(s string) *CompositeDataSourcePluginBlueprintV200_Name_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositeDataSourcePluginBlueprintV200_Name_Call) RunAndReturn(run func() string) *CompositeDataSourcePluginBlueprintV200_Name_Call { + _c.Call.Return(run) + return _c +} + +// RootPkgPath provides a mock function for the type CompositeDataSourcePluginBlueprintV200 +func (_mock *CompositeDataSourcePluginBlueprintV200) RootPkgPath() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for RootPkgPath") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RootPkgPath' +type CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call struct { + *mock.Call +} + +// RootPkgPath is a helper method to define mock.On call +func (_e *CompositeDataSourcePluginBlueprintV200_Expecter) RootPkgPath() *CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call { + return &CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call{Call: _e.mock.On("RootPkgPath")} +} + +func (_c *CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call) Run(run func()) *CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call) Return(s string) *CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call) RunAndReturn(run func() string) *CompositeDataSourcePluginBlueprintV200_RootPkgPath_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/CompositeMetricPluginBlueprintV200.go b/backend/mocks/core/plugin/CompositeMetricPluginBlueprintV200.go new file mode 100644 index 00000000000..e60ea65784b --- /dev/null +++ b/backend/mocks/core/plugin/CompositeMetricPluginBlueprintV200.go @@ -0,0 +1,242 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "encoding/json" + + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/models" + mock "github.com/stretchr/testify/mock" +) + +// NewCompositeMetricPluginBlueprintV200 creates a new instance of CompositeMetricPluginBlueprintV200. 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 NewCompositeMetricPluginBlueprintV200(t interface { + mock.TestingT + Cleanup(func()) +}) *CompositeMetricPluginBlueprintV200 { + mock := &CompositeMetricPluginBlueprintV200{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// CompositeMetricPluginBlueprintV200 is an autogenerated mock type for the CompositeMetricPluginBlueprintV200 type +type CompositeMetricPluginBlueprintV200 struct { + mock.Mock +} + +type CompositeMetricPluginBlueprintV200_Expecter struct { + mock *mock.Mock +} + +func (_m *CompositeMetricPluginBlueprintV200) EXPECT() *CompositeMetricPluginBlueprintV200_Expecter { + return &CompositeMetricPluginBlueprintV200_Expecter{mock: &_m.Mock} +} + +// Description provides a mock function for the type CompositeMetricPluginBlueprintV200 +func (_mock *CompositeMetricPluginBlueprintV200) Description() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositeMetricPluginBlueprintV200_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type CompositeMetricPluginBlueprintV200_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *CompositeMetricPluginBlueprintV200_Expecter) Description() *CompositeMetricPluginBlueprintV200_Description_Call { + return &CompositeMetricPluginBlueprintV200_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *CompositeMetricPluginBlueprintV200_Description_Call) Run(run func()) *CompositeMetricPluginBlueprintV200_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositeMetricPluginBlueprintV200_Description_Call) Return(s string) *CompositeMetricPluginBlueprintV200_Description_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositeMetricPluginBlueprintV200_Description_Call) RunAndReturn(run func() string) *CompositeMetricPluginBlueprintV200_Description_Call { + _c.Call.Return(run) + return _c +} + +// MakeMetricPluginPipelinePlanV200 provides a mock function for the type CompositeMetricPluginBlueprintV200 +func (_mock *CompositeMetricPluginBlueprintV200) MakeMetricPluginPipelinePlanV200(projectName string, options json.RawMessage) (models.PipelinePlan, errors.Error) { + ret := _mock.Called(projectName, options) + + if len(ret) == 0 { + panic("no return value specified for MakeMetricPluginPipelinePlanV200") + } + + var r0 models.PipelinePlan + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, json.RawMessage) (models.PipelinePlan, errors.Error)); ok { + return returnFunc(projectName, options) + } + if returnFunc, ok := ret.Get(0).(func(string, json.RawMessage) models.PipelinePlan); ok { + r0 = returnFunc(projectName, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.PipelinePlan) + } + } + if returnFunc, ok := ret.Get(1).(func(string, json.RawMessage) errors.Error); ok { + r1 = returnFunc(projectName, options) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeMetricPluginPipelinePlanV200' +type CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call struct { + *mock.Call +} + +// MakeMetricPluginPipelinePlanV200 is a helper method to define mock.On call +// - projectName string +// - options json.RawMessage +func (_e *CompositeMetricPluginBlueprintV200_Expecter) MakeMetricPluginPipelinePlanV200(projectName any, options any) *CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + return &CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call{Call: _e.mock.On("MakeMetricPluginPipelinePlanV200", projectName, options)} +} + +func (_c *CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call) Run(run func(projectName string, options json.RawMessage)) *CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 json.RawMessage + if args[1] != nil { + arg1 = args[1].(json.RawMessage) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call) Return(pipelinePlan models.PipelinePlan, error errors.Error) *CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + _c.Call.Return(pipelinePlan, error) + return _c +} + +func (_c *CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call) RunAndReturn(run func(projectName string, options json.RawMessage) (models.PipelinePlan, errors.Error)) *CompositeMetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function for the type CompositeMetricPluginBlueprintV200 +func (_mock *CompositeMetricPluginBlueprintV200) Name() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositeMetricPluginBlueprintV200_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type CompositeMetricPluginBlueprintV200_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *CompositeMetricPluginBlueprintV200_Expecter) Name() *CompositeMetricPluginBlueprintV200_Name_Call { + return &CompositeMetricPluginBlueprintV200_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *CompositeMetricPluginBlueprintV200_Name_Call) Run(run func()) *CompositeMetricPluginBlueprintV200_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositeMetricPluginBlueprintV200_Name_Call) Return(s string) *CompositeMetricPluginBlueprintV200_Name_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositeMetricPluginBlueprintV200_Name_Call) RunAndReturn(run func() string) *CompositeMetricPluginBlueprintV200_Name_Call { + _c.Call.Return(run) + return _c +} + +// RootPkgPath provides a mock function for the type CompositeMetricPluginBlueprintV200 +func (_mock *CompositeMetricPluginBlueprintV200) RootPkgPath() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for RootPkgPath") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositeMetricPluginBlueprintV200_RootPkgPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RootPkgPath' +type CompositeMetricPluginBlueprintV200_RootPkgPath_Call struct { + *mock.Call +} + +// RootPkgPath is a helper method to define mock.On call +func (_e *CompositeMetricPluginBlueprintV200_Expecter) RootPkgPath() *CompositeMetricPluginBlueprintV200_RootPkgPath_Call { + return &CompositeMetricPluginBlueprintV200_RootPkgPath_Call{Call: _e.mock.On("RootPkgPath")} +} + +func (_c *CompositeMetricPluginBlueprintV200_RootPkgPath_Call) Run(run func()) *CompositeMetricPluginBlueprintV200_RootPkgPath_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositeMetricPluginBlueprintV200_RootPkgPath_Call) Return(s string) *CompositeMetricPluginBlueprintV200_RootPkgPath_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositeMetricPluginBlueprintV200_RootPkgPath_Call) RunAndReturn(run func() string) *CompositeMetricPluginBlueprintV200_RootPkgPath_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/CompositePluginBlueprintV200.go b/backend/mocks/core/plugin/CompositePluginBlueprintV200.go new file mode 100644 index 00000000000..55e8ecee82a --- /dev/null +++ b/backend/mocks/core/plugin/CompositePluginBlueprintV200.go @@ -0,0 +1,321 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "encoding/json" + + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/models" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewCompositePluginBlueprintV200 creates a new instance of CompositePluginBlueprintV200. 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 NewCompositePluginBlueprintV200(t interface { + mock.TestingT + Cleanup(func()) +}) *CompositePluginBlueprintV200 { + mock := &CompositePluginBlueprintV200{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// CompositePluginBlueprintV200 is an autogenerated mock type for the CompositePluginBlueprintV200 type +type CompositePluginBlueprintV200 struct { + mock.Mock +} + +type CompositePluginBlueprintV200_Expecter struct { + mock *mock.Mock +} + +func (_m *CompositePluginBlueprintV200) EXPECT() *CompositePluginBlueprintV200_Expecter { + return &CompositePluginBlueprintV200_Expecter{mock: &_m.Mock} +} + +// Description provides a mock function for the type CompositePluginBlueprintV200 +func (_mock *CompositePluginBlueprintV200) Description() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositePluginBlueprintV200_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type CompositePluginBlueprintV200_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *CompositePluginBlueprintV200_Expecter) Description() *CompositePluginBlueprintV200_Description_Call { + return &CompositePluginBlueprintV200_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *CompositePluginBlueprintV200_Description_Call) Run(run func()) *CompositePluginBlueprintV200_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositePluginBlueprintV200_Description_Call) Return(s string) *CompositePluginBlueprintV200_Description_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositePluginBlueprintV200_Description_Call) RunAndReturn(run func() string) *CompositePluginBlueprintV200_Description_Call { + _c.Call.Return(run) + return _c +} + +// MakeDataSourcePipelinePlanV200 provides a mock function for the type CompositePluginBlueprintV200 +func (_mock *CompositePluginBlueprintV200) MakeDataSourcePipelinePlanV200(connectionId uint64, scopes []*models.BlueprintScope) (models.PipelinePlan, []plugin.Scope, errors.Error) { + ret := _mock.Called(connectionId, scopes) + + if len(ret) == 0 { + panic("no return value specified for MakeDataSourcePipelinePlanV200") + } + + var r0 models.PipelinePlan + var r1 []plugin.Scope + var r2 errors.Error + if returnFunc, ok := ret.Get(0).(func(uint64, []*models.BlueprintScope) (models.PipelinePlan, []plugin.Scope, errors.Error)); ok { + return returnFunc(connectionId, scopes) + } + if returnFunc, ok := ret.Get(0).(func(uint64, []*models.BlueprintScope) models.PipelinePlan); ok { + r0 = returnFunc(connectionId, scopes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.PipelinePlan) + } + } + if returnFunc, ok := ret.Get(1).(func(uint64, []*models.BlueprintScope) []plugin.Scope); ok { + r1 = returnFunc(connectionId, scopes) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]plugin.Scope) + } + } + if returnFunc, ok := ret.Get(2).(func(uint64, []*models.BlueprintScope) errors.Error); ok { + r2 = returnFunc(connectionId, scopes) + } else { + if ret.Get(2) != nil { + r2 = ret.Get(2).(errors.Error) + } + } + return r0, r1, r2 +} + +// CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeDataSourcePipelinePlanV200' +type CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call struct { + *mock.Call +} + +// MakeDataSourcePipelinePlanV200 is a helper method to define mock.On call +// - connectionId uint64 +// - scopes []*models.BlueprintScope +func (_e *CompositePluginBlueprintV200_Expecter) MakeDataSourcePipelinePlanV200(connectionId any, scopes any) *CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + return &CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call{Call: _e.mock.On("MakeDataSourcePipelinePlanV200", connectionId, scopes)} +} + +func (_c *CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call) Run(run func(connectionId uint64, scopes []*models.BlueprintScope)) *CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 uint64 + if args[0] != nil { + arg0 = args[0].(uint64) + } + var arg1 []*models.BlueprintScope + if args[1] != nil { + arg1 = args[1].([]*models.BlueprintScope) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call) Return(pipelinePlan models.PipelinePlan, scopes1 []plugin.Scope, error errors.Error) *CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + _c.Call.Return(pipelinePlan, scopes1, error) + return _c +} + +func (_c *CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call) RunAndReturn(run func(connectionId uint64, scopes []*models.BlueprintScope) (models.PipelinePlan, []plugin.Scope, errors.Error)) *CompositePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + _c.Call.Return(run) + return _c +} + +// MakeMetricPluginPipelinePlanV200 provides a mock function for the type CompositePluginBlueprintV200 +func (_mock *CompositePluginBlueprintV200) MakeMetricPluginPipelinePlanV200(projectName string, options json.RawMessage) (models.PipelinePlan, errors.Error) { + ret := _mock.Called(projectName, options) + + if len(ret) == 0 { + panic("no return value specified for MakeMetricPluginPipelinePlanV200") + } + + var r0 models.PipelinePlan + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, json.RawMessage) (models.PipelinePlan, errors.Error)); ok { + return returnFunc(projectName, options) + } + if returnFunc, ok := ret.Get(0).(func(string, json.RawMessage) models.PipelinePlan); ok { + r0 = returnFunc(projectName, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.PipelinePlan) + } + } + if returnFunc, ok := ret.Get(1).(func(string, json.RawMessage) errors.Error); ok { + r1 = returnFunc(projectName, options) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeMetricPluginPipelinePlanV200' +type CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call struct { + *mock.Call +} + +// MakeMetricPluginPipelinePlanV200 is a helper method to define mock.On call +// - projectName string +// - options json.RawMessage +func (_e *CompositePluginBlueprintV200_Expecter) MakeMetricPluginPipelinePlanV200(projectName any, options any) *CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + return &CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call{Call: _e.mock.On("MakeMetricPluginPipelinePlanV200", projectName, options)} +} + +func (_c *CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call) Run(run func(projectName string, options json.RawMessage)) *CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 json.RawMessage + if args[1] != nil { + arg1 = args[1].(json.RawMessage) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call) Return(pipelinePlan models.PipelinePlan, error errors.Error) *CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + _c.Call.Return(pipelinePlan, error) + return _c +} + +func (_c *CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call) RunAndReturn(run func(projectName string, options json.RawMessage) (models.PipelinePlan, errors.Error)) *CompositePluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function for the type CompositePluginBlueprintV200 +func (_mock *CompositePluginBlueprintV200) Name() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositePluginBlueprintV200_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type CompositePluginBlueprintV200_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *CompositePluginBlueprintV200_Expecter) Name() *CompositePluginBlueprintV200_Name_Call { + return &CompositePluginBlueprintV200_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *CompositePluginBlueprintV200_Name_Call) Run(run func()) *CompositePluginBlueprintV200_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositePluginBlueprintV200_Name_Call) Return(s string) *CompositePluginBlueprintV200_Name_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositePluginBlueprintV200_Name_Call) RunAndReturn(run func() string) *CompositePluginBlueprintV200_Name_Call { + _c.Call.Return(run) + return _c +} + +// RootPkgPath provides a mock function for the type CompositePluginBlueprintV200 +func (_mock *CompositePluginBlueprintV200) RootPkgPath() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for RootPkgPath") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositePluginBlueprintV200_RootPkgPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RootPkgPath' +type CompositePluginBlueprintV200_RootPkgPath_Call struct { + *mock.Call +} + +// RootPkgPath is a helper method to define mock.On call +func (_e *CompositePluginBlueprintV200_Expecter) RootPkgPath() *CompositePluginBlueprintV200_RootPkgPath_Call { + return &CompositePluginBlueprintV200_RootPkgPath_Call{Call: _e.mock.On("RootPkgPath")} +} + +func (_c *CompositePluginBlueprintV200_RootPkgPath_Call) Run(run func()) *CompositePluginBlueprintV200_RootPkgPath_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositePluginBlueprintV200_RootPkgPath_Call) Return(s string) *CompositePluginBlueprintV200_RootPkgPath_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositePluginBlueprintV200_RootPkgPath_Call) RunAndReturn(run func() string) *CompositePluginBlueprintV200_RootPkgPath_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/CompositeProjectMapper.go b/backend/mocks/core/plugin/CompositeProjectMapper.go new file mode 100644 index 00000000000..7c0be7333dc --- /dev/null +++ b/backend/mocks/core/plugin/CompositeProjectMapper.go @@ -0,0 +1,241 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/models" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewCompositeProjectMapper creates a new instance of CompositeProjectMapper. 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 NewCompositeProjectMapper(t interface { + mock.TestingT + Cleanup(func()) +}) *CompositeProjectMapper { + mock := &CompositeProjectMapper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// CompositeProjectMapper is an autogenerated mock type for the CompositeProjectMapper type +type CompositeProjectMapper struct { + mock.Mock +} + +type CompositeProjectMapper_Expecter struct { + mock *mock.Mock +} + +func (_m *CompositeProjectMapper) EXPECT() *CompositeProjectMapper_Expecter { + return &CompositeProjectMapper_Expecter{mock: &_m.Mock} +} + +// Description provides a mock function for the type CompositeProjectMapper +func (_mock *CompositeProjectMapper) Description() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositeProjectMapper_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type CompositeProjectMapper_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *CompositeProjectMapper_Expecter) Description() *CompositeProjectMapper_Description_Call { + return &CompositeProjectMapper_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *CompositeProjectMapper_Description_Call) Run(run func()) *CompositeProjectMapper_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositeProjectMapper_Description_Call) Return(s string) *CompositeProjectMapper_Description_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositeProjectMapper_Description_Call) RunAndReturn(run func() string) *CompositeProjectMapper_Description_Call { + _c.Call.Return(run) + return _c +} + +// MapProject provides a mock function for the type CompositeProjectMapper +func (_mock *CompositeProjectMapper) MapProject(projectName string, scopes []plugin.Scope) (models.PipelinePlan, errors.Error) { + ret := _mock.Called(projectName, scopes) + + if len(ret) == 0 { + panic("no return value specified for MapProject") + } + + var r0 models.PipelinePlan + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, []plugin.Scope) (models.PipelinePlan, errors.Error)); ok { + return returnFunc(projectName, scopes) + } + if returnFunc, ok := ret.Get(0).(func(string, []plugin.Scope) models.PipelinePlan); ok { + r0 = returnFunc(projectName, scopes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.PipelinePlan) + } + } + if returnFunc, ok := ret.Get(1).(func(string, []plugin.Scope) errors.Error); ok { + r1 = returnFunc(projectName, scopes) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// CompositeProjectMapper_MapProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MapProject' +type CompositeProjectMapper_MapProject_Call struct { + *mock.Call +} + +// MapProject is a helper method to define mock.On call +// - projectName string +// - scopes []plugin.Scope +func (_e *CompositeProjectMapper_Expecter) MapProject(projectName any, scopes any) *CompositeProjectMapper_MapProject_Call { + return &CompositeProjectMapper_MapProject_Call{Call: _e.mock.On("MapProject", projectName, scopes)} +} + +func (_c *CompositeProjectMapper_MapProject_Call) Run(run func(projectName string, scopes []plugin.Scope)) *CompositeProjectMapper_MapProject_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []plugin.Scope + if args[1] != nil { + arg1 = args[1].([]plugin.Scope) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *CompositeProjectMapper_MapProject_Call) Return(pipelinePlan models.PipelinePlan, error errors.Error) *CompositeProjectMapper_MapProject_Call { + _c.Call.Return(pipelinePlan, error) + return _c +} + +func (_c *CompositeProjectMapper_MapProject_Call) RunAndReturn(run func(projectName string, scopes []plugin.Scope) (models.PipelinePlan, errors.Error)) *CompositeProjectMapper_MapProject_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function for the type CompositeProjectMapper +func (_mock *CompositeProjectMapper) Name() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositeProjectMapper_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type CompositeProjectMapper_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *CompositeProjectMapper_Expecter) Name() *CompositeProjectMapper_Name_Call { + return &CompositeProjectMapper_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *CompositeProjectMapper_Name_Call) Run(run func()) *CompositeProjectMapper_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositeProjectMapper_Name_Call) Return(s string) *CompositeProjectMapper_Name_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositeProjectMapper_Name_Call) RunAndReturn(run func() string) *CompositeProjectMapper_Name_Call { + _c.Call.Return(run) + return _c +} + +// RootPkgPath provides a mock function for the type CompositeProjectMapper +func (_mock *CompositeProjectMapper) RootPkgPath() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for RootPkgPath") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// CompositeProjectMapper_RootPkgPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RootPkgPath' +type CompositeProjectMapper_RootPkgPath_Call struct { + *mock.Call +} + +// RootPkgPath is a helper method to define mock.On call +func (_e *CompositeProjectMapper_Expecter) RootPkgPath() *CompositeProjectMapper_RootPkgPath_Call { + return &CompositeProjectMapper_RootPkgPath_Call{Call: _e.mock.On("RootPkgPath")} +} + +func (_c *CompositeProjectMapper_RootPkgPath_Call) Run(run func()) *CompositeProjectMapper_RootPkgPath_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *CompositeProjectMapper_RootPkgPath_Call) Return(s string) *CompositeProjectMapper_RootPkgPath_Call { + _c.Call.Return(s) + return _c +} + +func (_c *CompositeProjectMapper_RootPkgPath_Call) RunAndReturn(run func() string) *CompositeProjectMapper_RootPkgPath_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ConnectionValidator.go b/backend/mocks/core/plugin/ConnectionValidator.go new file mode 100644 index 00000000000..bd7baeabd9b --- /dev/null +++ b/backend/mocks/core/plugin/ConnectionValidator.go @@ -0,0 +1,97 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/go-playground/validator/v10" + mock "github.com/stretchr/testify/mock" +) + +// NewConnectionValidator creates a new instance of ConnectionValidator. 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 NewConnectionValidator(t interface { + mock.TestingT + Cleanup(func()) +}) *ConnectionValidator { + mock := &ConnectionValidator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ConnectionValidator is an autogenerated mock type for the ConnectionValidator type +type ConnectionValidator struct { + mock.Mock +} + +type ConnectionValidator_Expecter struct { + mock *mock.Mock +} + +func (_m *ConnectionValidator) EXPECT() *ConnectionValidator_Expecter { + return &ConnectionValidator_Expecter{mock: &_m.Mock} +} + +// ValidateConnection provides a mock function for the type ConnectionValidator +func (_mock *ConnectionValidator) ValidateConnection(connection interface{}, validator1 *validator.Validate) errors.Error { + ret := _mock.Called(connection, validator1) + + if len(ret) == 0 { + panic("no return value specified for ValidateConnection") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, *validator.Validate) errors.Error); ok { + r0 = returnFunc(connection, validator1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// ConnectionValidator_ValidateConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateConnection' +type ConnectionValidator_ValidateConnection_Call struct { + *mock.Call +} + +// ValidateConnection is a helper method to define mock.On call +// - connection interface{} +// - validator1 *validator.Validate +func (_e *ConnectionValidator_Expecter) ValidateConnection(connection any, validator1 any) *ConnectionValidator_ValidateConnection_Call { + return &ConnectionValidator_ValidateConnection_Call{Call: _e.mock.On("ValidateConnection", connection, validator1)} +} + +func (_c *ConnectionValidator_ValidateConnection_Call) Run(run func(connection interface{}, validator1 *validator.Validate)) *ConnectionValidator_ValidateConnection_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 *validator.Validate + if args[1] != nil { + arg1 = args[1].(*validator.Validate) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *ConnectionValidator_ValidateConnection_Call) Return(error errors.Error) *ConnectionValidator_ValidateConnection_Call { + _c.Call.Return(error) + return _c +} + +func (_c *ConnectionValidator_ValidateConnection_Call) RunAndReturn(run func(connection interface{}, validator1 *validator.Validate) errors.Error) *ConnectionValidator_ValidateConnection_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/DataSourcePluginBlueprintV200.go b/backend/mocks/core/plugin/DataSourcePluginBlueprintV200.go new file mode 100644 index 00000000000..c92871cccfe --- /dev/null +++ b/backend/mocks/core/plugin/DataSourcePluginBlueprintV200.go @@ -0,0 +1,117 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/models" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewDataSourcePluginBlueprintV200 creates a new instance of DataSourcePluginBlueprintV200. 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 NewDataSourcePluginBlueprintV200(t interface { + mock.TestingT + Cleanup(func()) +}) *DataSourcePluginBlueprintV200 { + mock := &DataSourcePluginBlueprintV200{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// DataSourcePluginBlueprintV200 is an autogenerated mock type for the DataSourcePluginBlueprintV200 type +type DataSourcePluginBlueprintV200 struct { + mock.Mock +} + +type DataSourcePluginBlueprintV200_Expecter struct { + mock *mock.Mock +} + +func (_m *DataSourcePluginBlueprintV200) EXPECT() *DataSourcePluginBlueprintV200_Expecter { + return &DataSourcePluginBlueprintV200_Expecter{mock: &_m.Mock} +} + +// MakeDataSourcePipelinePlanV200 provides a mock function for the type DataSourcePluginBlueprintV200 +func (_mock *DataSourcePluginBlueprintV200) MakeDataSourcePipelinePlanV200(connectionId uint64, scopes []*models.BlueprintScope) (models.PipelinePlan, []plugin.Scope, errors.Error) { + ret := _mock.Called(connectionId, scopes) + + if len(ret) == 0 { + panic("no return value specified for MakeDataSourcePipelinePlanV200") + } + + var r0 models.PipelinePlan + var r1 []plugin.Scope + var r2 errors.Error + if returnFunc, ok := ret.Get(0).(func(uint64, []*models.BlueprintScope) (models.PipelinePlan, []plugin.Scope, errors.Error)); ok { + return returnFunc(connectionId, scopes) + } + if returnFunc, ok := ret.Get(0).(func(uint64, []*models.BlueprintScope) models.PipelinePlan); ok { + r0 = returnFunc(connectionId, scopes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.PipelinePlan) + } + } + if returnFunc, ok := ret.Get(1).(func(uint64, []*models.BlueprintScope) []plugin.Scope); ok { + r1 = returnFunc(connectionId, scopes) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]plugin.Scope) + } + } + if returnFunc, ok := ret.Get(2).(func(uint64, []*models.BlueprintScope) errors.Error); ok { + r2 = returnFunc(connectionId, scopes) + } else { + if ret.Get(2) != nil { + r2 = ret.Get(2).(errors.Error) + } + } + return r0, r1, r2 +} + +// DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeDataSourcePipelinePlanV200' +type DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call struct { + *mock.Call +} + +// MakeDataSourcePipelinePlanV200 is a helper method to define mock.On call +// - connectionId uint64 +// - scopes []*models.BlueprintScope +func (_e *DataSourcePluginBlueprintV200_Expecter) MakeDataSourcePipelinePlanV200(connectionId any, scopes any) *DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + return &DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call{Call: _e.mock.On("MakeDataSourcePipelinePlanV200", connectionId, scopes)} +} + +func (_c *DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call) Run(run func(connectionId uint64, scopes []*models.BlueprintScope)) *DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 uint64 + if args[0] != nil { + arg0 = args[0].(uint64) + } + var arg1 []*models.BlueprintScope + if args[1] != nil { + arg1 = args[1].([]*models.BlueprintScope) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call) Return(pipelinePlan models.PipelinePlan, scopes1 []plugin.Scope, error errors.Error) *DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + _c.Call.Return(pipelinePlan, scopes1, error) + return _c +} + +func (_c *DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call) RunAndReturn(run func(connectionId uint64, scopes []*models.BlueprintScope) (models.PipelinePlan, []plugin.Scope, errors.Error)) *DataSourcePluginBlueprintV200_MakeDataSourcePipelinePlanV200_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ExecContext.go b/backend/mocks/core/plugin/ExecContext.go new file mode 100644 index 00000000000..a80ad2c997e --- /dev/null +++ b/backend/mocks/core/plugin/ExecContext.go @@ -0,0 +1,603 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "context" + + "github.com/apache/devlake/core/config" + context0 "github.com/apache/devlake/core/context" + "github.com/apache/devlake/core/dal" + "github.com/apache/devlake/core/log" + mock "github.com/stretchr/testify/mock" +) + +// NewExecContext creates a new instance of ExecContext. 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 NewExecContext(t interface { + mock.TestingT + Cleanup(func()) +}) *ExecContext { + mock := &ExecContext{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ExecContext is an autogenerated mock type for the ExecContext type +type ExecContext struct { + mock.Mock +} + +type ExecContext_Expecter struct { + mock *mock.Mock +} + +func (_m *ExecContext) EXPECT() *ExecContext_Expecter { + return &ExecContext_Expecter{mock: &_m.Mock} +} + +// GetConfig provides a mock function for the type ExecContext +func (_mock *ExecContext) GetConfig(name string) string { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetConfig") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func(string) string); ok { + r0 = returnFunc(name) + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ExecContext_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig' +type ExecContext_GetConfig_Call struct { + *mock.Call +} + +// GetConfig is a helper method to define mock.On call +// - name string +func (_e *ExecContext_Expecter) GetConfig(name any) *ExecContext_GetConfig_Call { + return &ExecContext_GetConfig_Call{Call: _e.mock.On("GetConfig", name)} +} + +func (_c *ExecContext_GetConfig_Call) Run(run func(name string)) *ExecContext_GetConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ExecContext_GetConfig_Call) Return(s string) *ExecContext_GetConfig_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ExecContext_GetConfig_Call) RunAndReturn(run func(name string) string) *ExecContext_GetConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetConfigReader provides a mock function for the type ExecContext +func (_mock *ExecContext) GetConfigReader() config.ConfigReader { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetConfigReader") + } + + var r0 config.ConfigReader + if returnFunc, ok := ret.Get(0).(func() config.ConfigReader); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.ConfigReader) + } + } + return r0 +} + +// ExecContext_GetConfigReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfigReader' +type ExecContext_GetConfigReader_Call struct { + *mock.Call +} + +// GetConfigReader is a helper method to define mock.On call +func (_e *ExecContext_Expecter) GetConfigReader() *ExecContext_GetConfigReader_Call { + return &ExecContext_GetConfigReader_Call{Call: _e.mock.On("GetConfigReader")} +} + +func (_c *ExecContext_GetConfigReader_Call) Run(run func()) *ExecContext_GetConfigReader_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecContext_GetConfigReader_Call) Return(configReader config.ConfigReader) *ExecContext_GetConfigReader_Call { + _c.Call.Return(configReader) + return _c +} + +func (_c *ExecContext_GetConfigReader_Call) RunAndReturn(run func() config.ConfigReader) *ExecContext_GetConfigReader_Call { + _c.Call.Return(run) + return _c +} + +// GetContext provides a mock function for the type ExecContext +func (_mock *ExecContext) GetContext() context.Context { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetContext") + } + + var r0 context.Context + if returnFunc, ok := ret.Get(0).(func() context.Context); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context.Context) + } + } + return r0 +} + +// ExecContext_GetContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContext' +type ExecContext_GetContext_Call struct { + *mock.Call +} + +// GetContext is a helper method to define mock.On call +func (_e *ExecContext_Expecter) GetContext() *ExecContext_GetContext_Call { + return &ExecContext_GetContext_Call{Call: _e.mock.On("GetContext")} +} + +func (_c *ExecContext_GetContext_Call) Run(run func()) *ExecContext_GetContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecContext_GetContext_Call) Return(context1 context.Context) *ExecContext_GetContext_Call { + _c.Call.Return(context1) + return _c +} + +func (_c *ExecContext_GetContext_Call) RunAndReturn(run func() context.Context) *ExecContext_GetContext_Call { + _c.Call.Return(run) + return _c +} + +// GetDal provides a mock function for the type ExecContext +func (_mock *ExecContext) GetDal() dal.Dal { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDal") + } + + var r0 dal.Dal + if returnFunc, ok := ret.Get(0).(func() dal.Dal); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Dal) + } + } + return r0 +} + +// ExecContext_GetDal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDal' +type ExecContext_GetDal_Call struct { + *mock.Call +} + +// GetDal is a helper method to define mock.On call +func (_e *ExecContext_Expecter) GetDal() *ExecContext_GetDal_Call { + return &ExecContext_GetDal_Call{Call: _e.mock.On("GetDal")} +} + +func (_c *ExecContext_GetDal_Call) Run(run func()) *ExecContext_GetDal_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecContext_GetDal_Call) Return(dal1 dal.Dal) *ExecContext_GetDal_Call { + _c.Call.Return(dal1) + return _c +} + +func (_c *ExecContext_GetDal_Call) RunAndReturn(run func() dal.Dal) *ExecContext_GetDal_Call { + _c.Call.Return(run) + return _c +} + +// GetData provides a mock function for the type ExecContext +func (_mock *ExecContext) GetData() interface{} { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetData") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func() interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// ExecContext_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData' +type ExecContext_GetData_Call struct { + *mock.Call +} + +// GetData is a helper method to define mock.On call +func (_e *ExecContext_Expecter) GetData() *ExecContext_GetData_Call { + return &ExecContext_GetData_Call{Call: _e.mock.On("GetData")} +} + +func (_c *ExecContext_GetData_Call) Run(run func()) *ExecContext_GetData_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecContext_GetData_Call) Return(ifaceVal interface{}) *ExecContext_GetData_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *ExecContext_GetData_Call) RunAndReturn(run func() interface{}) *ExecContext_GetData_Call { + _c.Call.Return(run) + return _c +} + +// GetLogger provides a mock function for the type ExecContext +func (_mock *ExecContext) GetLogger() log.Logger { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLogger") + } + + var r0 log.Logger + if returnFunc, ok := ret.Get(0).(func() log.Logger); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(log.Logger) + } + } + return r0 +} + +// ExecContext_GetLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogger' +type ExecContext_GetLogger_Call struct { + *mock.Call +} + +// GetLogger is a helper method to define mock.On call +func (_e *ExecContext_Expecter) GetLogger() *ExecContext_GetLogger_Call { + return &ExecContext_GetLogger_Call{Call: _e.mock.On("GetLogger")} +} + +func (_c *ExecContext_GetLogger_Call) Run(run func()) *ExecContext_GetLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecContext_GetLogger_Call) Return(logger log.Logger) *ExecContext_GetLogger_Call { + _c.Call.Return(logger) + return _c +} + +func (_c *ExecContext_GetLogger_Call) RunAndReturn(run func() log.Logger) *ExecContext_GetLogger_Call { + _c.Call.Return(run) + return _c +} + +// GetName provides a mock function for the type ExecContext +func (_mock *ExecContext) GetName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ExecContext_GetName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetName' +type ExecContext_GetName_Call struct { + *mock.Call +} + +// GetName is a helper method to define mock.On call +func (_e *ExecContext_Expecter) GetName() *ExecContext_GetName_Call { + return &ExecContext_GetName_Call{Call: _e.mock.On("GetName")} +} + +func (_c *ExecContext_GetName_Call) Run(run func()) *ExecContext_GetName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecContext_GetName_Call) Return(s string) *ExecContext_GetName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ExecContext_GetName_Call) RunAndReturn(run func() string) *ExecContext_GetName_Call { + _c.Call.Return(run) + return _c +} + +// GetProgress provides a mock function for the type ExecContext +func (_mock *ExecContext) GetProgress() int { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProgress") + } + + var r0 int + if returnFunc, ok := ret.Get(0).(func() int); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int) + } + return r0 +} + +// ExecContext_GetProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProgress' +type ExecContext_GetProgress_Call struct { + *mock.Call +} + +// GetProgress is a helper method to define mock.On call +func (_e *ExecContext_Expecter) GetProgress() *ExecContext_GetProgress_Call { + return &ExecContext_GetProgress_Call{Call: _e.mock.On("GetProgress")} +} + +func (_c *ExecContext_GetProgress_Call) Run(run func()) *ExecContext_GetProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecContext_GetProgress_Call) Return(n int) *ExecContext_GetProgress_Call { + _c.Call.Return(n) + return _c +} + +func (_c *ExecContext_GetProgress_Call) RunAndReturn(run func() int) *ExecContext_GetProgress_Call { + _c.Call.Return(run) + return _c +} + +// IncProgress provides a mock function for the type ExecContext +func (_mock *ExecContext) IncProgress(quantity int) { + _mock.Called(quantity) + return +} + +// ExecContext_IncProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncProgress' +type ExecContext_IncProgress_Call struct { + *mock.Call +} + +// IncProgress is a helper method to define mock.On call +// - quantity int +func (_e *ExecContext_Expecter) IncProgress(quantity any) *ExecContext_IncProgress_Call { + return &ExecContext_IncProgress_Call{Call: _e.mock.On("IncProgress", quantity)} +} + +func (_c *ExecContext_IncProgress_Call) Run(run func(quantity int)) *ExecContext_IncProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int + if args[0] != nil { + arg0 = args[0].(int) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ExecContext_IncProgress_Call) Return() *ExecContext_IncProgress_Call { + _c.Call.Return() + return _c +} + +func (_c *ExecContext_IncProgress_Call) RunAndReturn(run func(quantity int)) *ExecContext_IncProgress_Call { + _c.Run(run) + return _c +} + +// NestedLogger provides a mock function for the type ExecContext +func (_mock *ExecContext) NestedLogger(name string) context0.BasicRes { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for NestedLogger") + } + + var r0 context0.BasicRes + if returnFunc, ok := ret.Get(0).(func(string) context0.BasicRes); ok { + r0 = returnFunc(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context0.BasicRes) + } + } + return r0 +} + +// ExecContext_NestedLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NestedLogger' +type ExecContext_NestedLogger_Call struct { + *mock.Call +} + +// NestedLogger is a helper method to define mock.On call +// - name string +func (_e *ExecContext_Expecter) NestedLogger(name any) *ExecContext_NestedLogger_Call { + return &ExecContext_NestedLogger_Call{Call: _e.mock.On("NestedLogger", name)} +} + +func (_c *ExecContext_NestedLogger_Call) Run(run func(name string)) *ExecContext_NestedLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ExecContext_NestedLogger_Call) Return(basicRes context0.BasicRes) *ExecContext_NestedLogger_Call { + _c.Call.Return(basicRes) + return _c +} + +func (_c *ExecContext_NestedLogger_Call) RunAndReturn(run func(name string) context0.BasicRes) *ExecContext_NestedLogger_Call { + _c.Call.Return(run) + return _c +} + +// ReplaceLogger provides a mock function for the type ExecContext +func (_mock *ExecContext) ReplaceLogger(logger log.Logger) context0.BasicRes { + ret := _mock.Called(logger) + + if len(ret) == 0 { + panic("no return value specified for ReplaceLogger") + } + + var r0 context0.BasicRes + if returnFunc, ok := ret.Get(0).(func(log.Logger) context0.BasicRes); ok { + r0 = returnFunc(logger) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context0.BasicRes) + } + } + return r0 +} + +// ExecContext_ReplaceLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplaceLogger' +type ExecContext_ReplaceLogger_Call struct { + *mock.Call +} + +// ReplaceLogger is a helper method to define mock.On call +// - logger log.Logger +func (_e *ExecContext_Expecter) ReplaceLogger(logger any) *ExecContext_ReplaceLogger_Call { + return &ExecContext_ReplaceLogger_Call{Call: _e.mock.On("ReplaceLogger", logger)} +} + +func (_c *ExecContext_ReplaceLogger_Call) Run(run func(logger log.Logger)) *ExecContext_ReplaceLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 log.Logger + if args[0] != nil { + arg0 = args[0].(log.Logger) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ExecContext_ReplaceLogger_Call) Return(basicRes context0.BasicRes) *ExecContext_ReplaceLogger_Call { + _c.Call.Return(basicRes) + return _c +} + +func (_c *ExecContext_ReplaceLogger_Call) RunAndReturn(run func(logger log.Logger) context0.BasicRes) *ExecContext_ReplaceLogger_Call { + _c.Call.Return(run) + return _c +} + +// SetProgress provides a mock function for the type ExecContext +func (_mock *ExecContext) SetProgress(current int, total int) { + _mock.Called(current, total) + return +} + +// ExecContext_SetProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetProgress' +type ExecContext_SetProgress_Call struct { + *mock.Call +} + +// SetProgress is a helper method to define mock.On call +// - current int +// - total int +func (_e *ExecContext_Expecter) SetProgress(current any, total any) *ExecContext_SetProgress_Call { + return &ExecContext_SetProgress_Call{Call: _e.mock.On("SetProgress", current, total)} +} + +func (_c *ExecContext_SetProgress_Call) Run(run func(current int, total int)) *ExecContext_SetProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int + if args[0] != nil { + arg0 = args[0].(int) + } + var arg1 int + if args[1] != nil { + arg1 = args[1].(int) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *ExecContext_SetProgress_Call) Return() *ExecContext_SetProgress_Call { + _c.Call.Return() + return _c +} + +func (_c *ExecContext_SetProgress_Call) RunAndReturn(run func(current int, total int)) *ExecContext_SetProgress_Call { + _c.Run(run) + return _c +} diff --git a/backend/mocks/core/plugin/MetricPluginBlueprintV200.go b/backend/mocks/core/plugin/MetricPluginBlueprintV200.go new file mode 100644 index 00000000000..d91e484696f --- /dev/null +++ b/backend/mocks/core/plugin/MetricPluginBlueprintV200.go @@ -0,0 +1,110 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "encoding/json" + + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/models" + mock "github.com/stretchr/testify/mock" +) + +// NewMetricPluginBlueprintV200 creates a new instance of MetricPluginBlueprintV200. 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 NewMetricPluginBlueprintV200(t interface { + mock.TestingT + Cleanup(func()) +}) *MetricPluginBlueprintV200 { + mock := &MetricPluginBlueprintV200{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MetricPluginBlueprintV200 is an autogenerated mock type for the MetricPluginBlueprintV200 type +type MetricPluginBlueprintV200 struct { + mock.Mock +} + +type MetricPluginBlueprintV200_Expecter struct { + mock *mock.Mock +} + +func (_m *MetricPluginBlueprintV200) EXPECT() *MetricPluginBlueprintV200_Expecter { + return &MetricPluginBlueprintV200_Expecter{mock: &_m.Mock} +} + +// MakeMetricPluginPipelinePlanV200 provides a mock function for the type MetricPluginBlueprintV200 +func (_mock *MetricPluginBlueprintV200) MakeMetricPluginPipelinePlanV200(projectName string, options json.RawMessage) (models.PipelinePlan, errors.Error) { + ret := _mock.Called(projectName, options) + + if len(ret) == 0 { + panic("no return value specified for MakeMetricPluginPipelinePlanV200") + } + + var r0 models.PipelinePlan + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, json.RawMessage) (models.PipelinePlan, errors.Error)); ok { + return returnFunc(projectName, options) + } + if returnFunc, ok := ret.Get(0).(func(string, json.RawMessage) models.PipelinePlan); ok { + r0 = returnFunc(projectName, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.PipelinePlan) + } + } + if returnFunc, ok := ret.Get(1).(func(string, json.RawMessage) errors.Error); ok { + r1 = returnFunc(projectName, options) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeMetricPluginPipelinePlanV200' +type MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call struct { + *mock.Call +} + +// MakeMetricPluginPipelinePlanV200 is a helper method to define mock.On call +// - projectName string +// - options json.RawMessage +func (_e *MetricPluginBlueprintV200_Expecter) MakeMetricPluginPipelinePlanV200(projectName any, options any) *MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + return &MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call{Call: _e.mock.On("MakeMetricPluginPipelinePlanV200", projectName, options)} +} + +func (_c *MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call) Run(run func(projectName string, options json.RawMessage)) *MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 json.RawMessage + if args[1] != nil { + arg1 = args[1].(json.RawMessage) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call) Return(pipelinePlan models.PipelinePlan, error errors.Error) *MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + _c.Call.Return(pipelinePlan, error) + return _c +} + +func (_c *MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call) RunAndReturn(run func(projectName string, options json.RawMessage) (models.PipelinePlan, errors.Error)) *MetricPluginBlueprintV200_MakeMetricPluginPipelinePlanV200_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/MigrationScript.go b/backend/mocks/core/plugin/MigrationScript.go new file mode 100644 index 00000000000..35592d7e995 --- /dev/null +++ b/backend/mocks/core/plugin/MigrationScript.go @@ -0,0 +1,179 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/context" + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewMigrationScript creates a new instance of MigrationScript. 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 NewMigrationScript(t interface { + mock.TestingT + Cleanup(func()) +}) *MigrationScript { + mock := &MigrationScript{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MigrationScript is an autogenerated mock type for the MigrationScript type +type MigrationScript struct { + mock.Mock +} + +type MigrationScript_Expecter struct { + mock *mock.Mock +} + +func (_m *MigrationScript) EXPECT() *MigrationScript_Expecter { + return &MigrationScript_Expecter{mock: &_m.Mock} +} + +// Name provides a mock function for the type MigrationScript +func (_mock *MigrationScript) Name() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// MigrationScript_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type MigrationScript_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *MigrationScript_Expecter) Name() *MigrationScript_Name_Call { + return &MigrationScript_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *MigrationScript_Name_Call) Run(run func()) *MigrationScript_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MigrationScript_Name_Call) Return(s string) *MigrationScript_Name_Call { + _c.Call.Return(s) + return _c +} + +func (_c *MigrationScript_Name_Call) RunAndReturn(run func() string) *MigrationScript_Name_Call { + _c.Call.Return(run) + return _c +} + +// Up provides a mock function for the type MigrationScript +func (_mock *MigrationScript) Up(basicRes context.BasicRes) errors.Error { + ret := _mock.Called(basicRes) + + if len(ret) == 0 { + panic("no return value specified for Up") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(context.BasicRes) errors.Error); ok { + r0 = returnFunc(basicRes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// MigrationScript_Up_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Up' +type MigrationScript_Up_Call struct { + *mock.Call +} + +// Up is a helper method to define mock.On call +// - basicRes context.BasicRes +func (_e *MigrationScript_Expecter) Up(basicRes any) *MigrationScript_Up_Call { + return &MigrationScript_Up_Call{Call: _e.mock.On("Up", basicRes)} +} + +func (_c *MigrationScript_Up_Call) Run(run func(basicRes context.BasicRes)) *MigrationScript_Up_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.BasicRes + if args[0] != nil { + arg0 = args[0].(context.BasicRes) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MigrationScript_Up_Call) Return(error errors.Error) *MigrationScript_Up_Call { + _c.Call.Return(error) + return _c +} + +func (_c *MigrationScript_Up_Call) RunAndReturn(run func(basicRes context.BasicRes) errors.Error) *MigrationScript_Up_Call { + _c.Call.Return(run) + return _c +} + +// Version provides a mock function for the type MigrationScript +func (_mock *MigrationScript) Version() uint64 { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Version") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// MigrationScript_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type MigrationScript_Version_Call struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +func (_e *MigrationScript_Expecter) Version() *MigrationScript_Version_Call { + return &MigrationScript_Version_Call{Call: _e.mock.On("Version")} +} + +func (_c *MigrationScript_Version_Call) Run(run func()) *MigrationScript_Version_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MigrationScript_Version_Call) Return(v uint64) *MigrationScript_Version_Call { + _c.Call.Return(v) + return _c +} + +func (_c *MigrationScript_Version_Call) RunAndReturn(run func() uint64) *MigrationScript_Version_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/Migrator.go b/backend/mocks/core/plugin/Migrator.go new file mode 100644 index 00000000000..464c04ca56f --- /dev/null +++ b/backend/mocks/core/plugin/Migrator.go @@ -0,0 +1,174 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewMigrator creates a new instance of Migrator. 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 NewMigrator(t interface { + mock.TestingT + Cleanup(func()) +}) *Migrator { + mock := &Migrator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// Migrator is an autogenerated mock type for the Migrator type +type Migrator struct { + mock.Mock +} + +type Migrator_Expecter struct { + mock *mock.Mock +} + +func (_m *Migrator) EXPECT() *Migrator_Expecter { + return &Migrator_Expecter{mock: &_m.Mock} +} + +// Execute provides a mock function for the type Migrator +func (_mock *Migrator) Execute() errors.Error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Execute") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func() errors.Error); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Migrator_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' +type Migrator_Execute_Call struct { + *mock.Call +} + +// Execute is a helper method to define mock.On call +func (_e *Migrator_Expecter) Execute() *Migrator_Execute_Call { + return &Migrator_Execute_Call{Call: _e.mock.On("Execute")} +} + +func (_c *Migrator_Execute_Call) Run(run func()) *Migrator_Execute_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Migrator_Execute_Call) Return(error errors.Error) *Migrator_Execute_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Migrator_Execute_Call) RunAndReturn(run func() errors.Error) *Migrator_Execute_Call { + _c.Call.Return(run) + return _c +} + +// HasPendingScripts provides a mock function for the type Migrator +func (_mock *Migrator) HasPendingScripts() bool { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for HasPendingScripts") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Migrator_HasPendingScripts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasPendingScripts' +type Migrator_HasPendingScripts_Call struct { + *mock.Call +} + +// HasPendingScripts is a helper method to define mock.On call +func (_e *Migrator_Expecter) HasPendingScripts() *Migrator_HasPendingScripts_Call { + return &Migrator_HasPendingScripts_Call{Call: _e.mock.On("HasPendingScripts")} +} + +func (_c *Migrator_HasPendingScripts_Call) Run(run func()) *Migrator_HasPendingScripts_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Migrator_HasPendingScripts_Call) Return(b bool) *Migrator_HasPendingScripts_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Migrator_HasPendingScripts_Call) RunAndReturn(run func() bool) *Migrator_HasPendingScripts_Call { + _c.Call.Return(run) + return _c +} + +// Register provides a mock function for the type Migrator +func (_mock *Migrator) Register(scripts []plugin.MigrationScript, comment string) { + _mock.Called(scripts, comment) + return +} + +// Migrator_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register' +type Migrator_Register_Call struct { + *mock.Call +} + +// Register is a helper method to define mock.On call +// - scripts []plugin.MigrationScript +// - comment string +func (_e *Migrator_Expecter) Register(scripts any, comment any) *Migrator_Register_Call { + return &Migrator_Register_Call{Call: _e.mock.On("Register", scripts, comment)} +} + +func (_c *Migrator_Register_Call) Run(run func(scripts []plugin.MigrationScript, comment string)) *Migrator_Register_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []plugin.MigrationScript + if args[0] != nil { + arg0 = args[0].([]plugin.MigrationScript) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *Migrator_Register_Call) Return() *Migrator_Register_Call { + _c.Call.Return() + return _c +} + +func (_c *Migrator_Register_Call) RunAndReturn(run func(scripts []plugin.MigrationScript, comment string)) *Migrator_Register_Call { + _c.Run(run) + return _c +} diff --git a/backend/mocks/core/plugin/MultiAuthenticator.go b/backend/mocks/core/plugin/MultiAuthenticator.go new file mode 100644 index 00000000000..5cf980a18bb --- /dev/null +++ b/backend/mocks/core/plugin/MultiAuthenticator.go @@ -0,0 +1,80 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewMultiAuthenticator creates a new instance of MultiAuthenticator. 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 NewMultiAuthenticator(t interface { + mock.TestingT + Cleanup(func()) +}) *MultiAuthenticator { + mock := &MultiAuthenticator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MultiAuthenticator is an autogenerated mock type for the MultiAuthenticator type +type MultiAuthenticator struct { + mock.Mock +} + +type MultiAuthenticator_Expecter struct { + mock *mock.Mock +} + +func (_m *MultiAuthenticator) EXPECT() *MultiAuthenticator_Expecter { + return &MultiAuthenticator_Expecter{mock: &_m.Mock} +} + +// GetAuthMethod provides a mock function for the type MultiAuthenticator +func (_mock *MultiAuthenticator) GetAuthMethod() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAuthMethod") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// MultiAuthenticator_GetAuthMethod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAuthMethod' +type MultiAuthenticator_GetAuthMethod_Call struct { + *mock.Call +} + +// GetAuthMethod is a helper method to define mock.On call +func (_e *MultiAuthenticator_Expecter) GetAuthMethod() *MultiAuthenticator_GetAuthMethod_Call { + return &MultiAuthenticator_GetAuthMethod_Call{Call: _e.mock.On("GetAuthMethod")} +} + +func (_c *MultiAuthenticator_GetAuthMethod_Call) Run(run func()) *MultiAuthenticator_GetAuthMethod_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MultiAuthenticator_GetAuthMethod_Call) Return(s string) *MultiAuthenticator_GetAuthMethod_Call { + _c.Call.Return(s) + return _c +} + +func (_c *MultiAuthenticator_GetAuthMethod_Call) RunAndReturn(run func() string) *MultiAuthenticator_GetAuthMethod_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginApi.go b/backend/mocks/core/plugin/PluginApi.go new file mode 100644 index 00000000000..3864dfa5d84 --- /dev/null +++ b/backend/mocks/core/plugin/PluginApi.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewPluginApi creates a new instance of PluginApi. 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 NewPluginApi(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginApi { + mock := &PluginApi{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginApi is an autogenerated mock type for the PluginApi type +type PluginApi struct { + mock.Mock +} + +type PluginApi_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginApi) EXPECT() *PluginApi_Expecter { + return &PluginApi_Expecter{mock: &_m.Mock} +} + +// ApiResources provides a mock function for the type PluginApi +func (_mock *PluginApi) ApiResources() map[string]map[string]plugin.ApiResourceHandler { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ApiResources") + } + + var r0 map[string]map[string]plugin.ApiResourceHandler + if returnFunc, ok := ret.Get(0).(func() map[string]map[string]plugin.ApiResourceHandler); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[string]map[string]plugin.ApiResourceHandler) + } + } + return r0 +} + +// PluginApi_ApiResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApiResources' +type PluginApi_ApiResources_Call struct { + *mock.Call +} + +// ApiResources is a helper method to define mock.On call +func (_e *PluginApi_Expecter) ApiResources() *PluginApi_ApiResources_Call { + return &PluginApi_ApiResources_Call{Call: _e.mock.On("ApiResources")} +} + +func (_c *PluginApi_ApiResources_Call) Run(run func()) *PluginApi_ApiResources_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginApi_ApiResources_Call) Return(stringToStringToApiResourceHandler map[string]map[string]plugin.ApiResourceHandler) *PluginApi_ApiResources_Call { + _c.Call.Return(stringToStringToApiResourceHandler) + return _c +} + +func (_c *PluginApi_ApiResources_Call) RunAndReturn(run func() map[string]map[string]plugin.ApiResourceHandler) *PluginApi_ApiResources_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginDashboard.go b/backend/mocks/core/plugin/PluginDashboard.go new file mode 100644 index 00000000000..b5d3130a36a --- /dev/null +++ b/backend/mocks/core/plugin/PluginDashboard.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewPluginDashboard creates a new instance of PluginDashboard. 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 NewPluginDashboard(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginDashboard { + mock := &PluginDashboard{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginDashboard is an autogenerated mock type for the PluginDashboard type +type PluginDashboard struct { + mock.Mock +} + +type PluginDashboard_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginDashboard) EXPECT() *PluginDashboard_Expecter { + return &PluginDashboard_Expecter{mock: &_m.Mock} +} + +// Dashboards provides a mock function for the type PluginDashboard +func (_mock *PluginDashboard) Dashboards() []plugin.GrafanaDashboard { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Dashboards") + } + + var r0 []plugin.GrafanaDashboard + if returnFunc, ok := ret.Get(0).(func() []plugin.GrafanaDashboard); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]plugin.GrafanaDashboard) + } + } + return r0 +} + +// PluginDashboard_Dashboards_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dashboards' +type PluginDashboard_Dashboards_Call struct { + *mock.Call +} + +// Dashboards is a helper method to define mock.On call +func (_e *PluginDashboard_Expecter) Dashboards() *PluginDashboard_Dashboards_Call { + return &PluginDashboard_Dashboards_Call{Call: _e.mock.On("Dashboards")} +} + +func (_c *PluginDashboard_Dashboards_Call) Run(run func()) *PluginDashboard_Dashboards_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginDashboard_Dashboards_Call) Return(grafanaDashboards []plugin.GrafanaDashboard) *PluginDashboard_Dashboards_Call { + _c.Call.Return(grafanaDashboards) + return _c +} + +func (_c *PluginDashboard_Dashboards_Call) RunAndReturn(run func() []plugin.GrafanaDashboard) *PluginDashboard_Dashboards_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginDeprecation.go b/backend/mocks/core/plugin/PluginDeprecation.go new file mode 100644 index 00000000000..f3b57bd13be --- /dev/null +++ b/backend/mocks/core/plugin/PluginDeprecation.go @@ -0,0 +1,80 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewPluginDeprecation creates a new instance of PluginDeprecation. 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 NewPluginDeprecation(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginDeprecation { + mock := &PluginDeprecation{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginDeprecation is an autogenerated mock type for the PluginDeprecation type +type PluginDeprecation struct { + mock.Mock +} + +type PluginDeprecation_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginDeprecation) EXPECT() *PluginDeprecation_Expecter { + return &PluginDeprecation_Expecter{mock: &_m.Mock} +} + +// DeprecationMessage provides a mock function for the type PluginDeprecation +func (_mock *PluginDeprecation) DeprecationMessage() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for DeprecationMessage") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// PluginDeprecation_DeprecationMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeprecationMessage' +type PluginDeprecation_DeprecationMessage_Call struct { + *mock.Call +} + +// DeprecationMessage is a helper method to define mock.On call +func (_e *PluginDeprecation_Expecter) DeprecationMessage() *PluginDeprecation_DeprecationMessage_Call { + return &PluginDeprecation_DeprecationMessage_Call{Call: _e.mock.On("DeprecationMessage")} +} + +func (_c *PluginDeprecation_DeprecationMessage_Call) Run(run func()) *PluginDeprecation_DeprecationMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginDeprecation_DeprecationMessage_Call) Return(s string) *PluginDeprecation_DeprecationMessage_Call { + _c.Call.Return(s) + return _c +} + +func (_c *PluginDeprecation_DeprecationMessage_Call) RunAndReturn(run func() string) *PluginDeprecation_DeprecationMessage_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginIcon.go b/backend/mocks/core/plugin/PluginIcon.go new file mode 100644 index 00000000000..e045abce449 --- /dev/null +++ b/backend/mocks/core/plugin/PluginIcon.go @@ -0,0 +1,80 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewPluginIcon creates a new instance of PluginIcon. 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 NewPluginIcon(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginIcon { + mock := &PluginIcon{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginIcon is an autogenerated mock type for the PluginIcon type +type PluginIcon struct { + mock.Mock +} + +type PluginIcon_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginIcon) EXPECT() *PluginIcon_Expecter { + return &PluginIcon_Expecter{mock: &_m.Mock} +} + +// SvgIcon provides a mock function for the type PluginIcon +func (_mock *PluginIcon) SvgIcon() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for SvgIcon") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// PluginIcon_SvgIcon_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SvgIcon' +type PluginIcon_SvgIcon_Call struct { + *mock.Call +} + +// SvgIcon is a helper method to define mock.On call +func (_e *PluginIcon_Expecter) SvgIcon() *PluginIcon_SvgIcon_Call { + return &PluginIcon_SvgIcon_Call{Call: _e.mock.On("SvgIcon")} +} + +func (_c *PluginIcon_SvgIcon_Call) Run(run func()) *PluginIcon_SvgIcon_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginIcon_SvgIcon_Call) Return(s string) *PluginIcon_SvgIcon_Call { + _c.Call.Return(s) + return _c +} + +func (_c *PluginIcon_SvgIcon_Call) RunAndReturn(run func() string) *PluginIcon_SvgIcon_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginInit.go b/backend/mocks/core/plugin/PluginInit.go new file mode 100644 index 00000000000..1089369fa60 --- /dev/null +++ b/backend/mocks/core/plugin/PluginInit.go @@ -0,0 +1,91 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/context" + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewPluginInit creates a new instance of PluginInit. 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 NewPluginInit(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginInit { + mock := &PluginInit{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginInit is an autogenerated mock type for the PluginInit type +type PluginInit struct { + mock.Mock +} + +type PluginInit_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginInit) EXPECT() *PluginInit_Expecter { + return &PluginInit_Expecter{mock: &_m.Mock} +} + +// Init provides a mock function for the type PluginInit +func (_mock *PluginInit) Init(basicRes context.BasicRes) errors.Error { + ret := _mock.Called(basicRes) + + if len(ret) == 0 { + panic("no return value specified for Init") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(context.BasicRes) errors.Error); ok { + r0 = returnFunc(basicRes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// PluginInit_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init' +type PluginInit_Init_Call struct { + *mock.Call +} + +// Init is a helper method to define mock.On call +// - basicRes context.BasicRes +func (_e *PluginInit_Expecter) Init(basicRes any) *PluginInit_Init_Call { + return &PluginInit_Init_Call{Call: _e.mock.On("Init", basicRes)} +} + +func (_c *PluginInit_Init_Call) Run(run func(basicRes context.BasicRes)) *PluginInit_Init_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.BasicRes + if args[0] != nil { + arg0 = args[0].(context.BasicRes) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *PluginInit_Init_Call) Return(error errors.Error) *PluginInit_Init_Call { + _c.Call.Return(error) + return _c +} + +func (_c *PluginInit_Init_Call) RunAndReturn(run func(basicRes context.BasicRes) errors.Error) *PluginInit_Init_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginMeta.go b/backend/mocks/core/plugin/PluginMeta.go new file mode 100644 index 00000000000..149890112d3 --- /dev/null +++ b/backend/mocks/core/plugin/PluginMeta.go @@ -0,0 +1,168 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewPluginMeta creates a new instance of PluginMeta. 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 NewPluginMeta(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginMeta { + mock := &PluginMeta{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginMeta is an autogenerated mock type for the PluginMeta type +type PluginMeta struct { + mock.Mock +} + +type PluginMeta_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginMeta) EXPECT() *PluginMeta_Expecter { + return &PluginMeta_Expecter{mock: &_m.Mock} +} + +// Description provides a mock function for the type PluginMeta +func (_mock *PluginMeta) Description() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// PluginMeta_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type PluginMeta_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *PluginMeta_Expecter) Description() *PluginMeta_Description_Call { + return &PluginMeta_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *PluginMeta_Description_Call) Run(run func()) *PluginMeta_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginMeta_Description_Call) Return(s string) *PluginMeta_Description_Call { + _c.Call.Return(s) + return _c +} + +func (_c *PluginMeta_Description_Call) RunAndReturn(run func() string) *PluginMeta_Description_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function for the type PluginMeta +func (_mock *PluginMeta) Name() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// PluginMeta_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type PluginMeta_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *PluginMeta_Expecter) Name() *PluginMeta_Name_Call { + return &PluginMeta_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *PluginMeta_Name_Call) Run(run func()) *PluginMeta_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginMeta_Name_Call) Return(s string) *PluginMeta_Name_Call { + _c.Call.Return(s) + return _c +} + +func (_c *PluginMeta_Name_Call) RunAndReturn(run func() string) *PluginMeta_Name_Call { + _c.Call.Return(run) + return _c +} + +// RootPkgPath provides a mock function for the type PluginMeta +func (_mock *PluginMeta) RootPkgPath() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for RootPkgPath") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// PluginMeta_RootPkgPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RootPkgPath' +type PluginMeta_RootPkgPath_Call struct { + *mock.Call +} + +// RootPkgPath is a helper method to define mock.On call +func (_e *PluginMeta_Expecter) RootPkgPath() *PluginMeta_RootPkgPath_Call { + return &PluginMeta_RootPkgPath_Call{Call: _e.mock.On("RootPkgPath")} +} + +func (_c *PluginMeta_RootPkgPath_Call) Run(run func()) *PluginMeta_RootPkgPath_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginMeta_RootPkgPath_Call) Return(s string) *PluginMeta_RootPkgPath_Call { + _c.Call.Return(s) + return _c +} + +func (_c *PluginMeta_RootPkgPath_Call) RunAndReturn(run func() string) *PluginMeta_RootPkgPath_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginMetric.go b/backend/mocks/core/plugin/PluginMetric.go new file mode 100644 index 00000000000..f156fc67c10 --- /dev/null +++ b/backend/mocks/core/plugin/PluginMetric.go @@ -0,0 +1,241 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewPluginMetric creates a new instance of PluginMetric. 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 NewPluginMetric(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginMetric { + mock := &PluginMetric{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginMetric is an autogenerated mock type for the PluginMetric type +type PluginMetric struct { + mock.Mock +} + +type PluginMetric_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginMetric) EXPECT() *PluginMetric_Expecter { + return &PluginMetric_Expecter{mock: &_m.Mock} +} + +// IsProjectMetric provides a mock function for the type PluginMetric +func (_mock *PluginMetric) IsProjectMetric() bool { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for IsProjectMetric") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// PluginMetric_IsProjectMetric_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsProjectMetric' +type PluginMetric_IsProjectMetric_Call struct { + *mock.Call +} + +// IsProjectMetric is a helper method to define mock.On call +func (_e *PluginMetric_Expecter) IsProjectMetric() *PluginMetric_IsProjectMetric_Call { + return &PluginMetric_IsProjectMetric_Call{Call: _e.mock.On("IsProjectMetric")} +} + +func (_c *PluginMetric_IsProjectMetric_Call) Run(run func()) *PluginMetric_IsProjectMetric_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginMetric_IsProjectMetric_Call) Return(b bool) *PluginMetric_IsProjectMetric_Call { + _c.Call.Return(b) + return _c +} + +func (_c *PluginMetric_IsProjectMetric_Call) RunAndReturn(run func() bool) *PluginMetric_IsProjectMetric_Call { + _c.Call.Return(run) + return _c +} + +// RequiredDataEntities provides a mock function for the type PluginMetric +func (_mock *PluginMetric) RequiredDataEntities() ([]map[string]interface{}, errors.Error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for RequiredDataEntities") + } + + var r0 []map[string]interface{} + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func() ([]map[string]interface{}, errors.Error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []map[string]interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]map[string]interface{}) + } + } + if returnFunc, ok := ret.Get(1).(func() errors.Error); ok { + r1 = returnFunc() + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// PluginMetric_RequiredDataEntities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequiredDataEntities' +type PluginMetric_RequiredDataEntities_Call struct { + *mock.Call +} + +// RequiredDataEntities is a helper method to define mock.On call +func (_e *PluginMetric_Expecter) RequiredDataEntities() *PluginMetric_RequiredDataEntities_Call { + return &PluginMetric_RequiredDataEntities_Call{Call: _e.mock.On("RequiredDataEntities")} +} + +func (_c *PluginMetric_RequiredDataEntities_Call) Run(run func()) *PluginMetric_RequiredDataEntities_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginMetric_RequiredDataEntities_Call) Return(data []map[string]interface{}, err errors.Error) *PluginMetric_RequiredDataEntities_Call { + _c.Call.Return(data, err) + return _c +} + +func (_c *PluginMetric_RequiredDataEntities_Call) RunAndReturn(run func() ([]map[string]interface{}, errors.Error)) *PluginMetric_RequiredDataEntities_Call { + _c.Call.Return(run) + return _c +} + +// RunAfter provides a mock function for the type PluginMetric +func (_mock *PluginMetric) RunAfter() ([]string, errors.Error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for RunAfter") + } + + var r0 []string + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func() ([]string, errors.Error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []string); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + if returnFunc, ok := ret.Get(1).(func() errors.Error); ok { + r1 = returnFunc() + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// PluginMetric_RunAfter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunAfter' +type PluginMetric_RunAfter_Call struct { + *mock.Call +} + +// RunAfter is a helper method to define mock.On call +func (_e *PluginMetric_Expecter) RunAfter() *PluginMetric_RunAfter_Call { + return &PluginMetric_RunAfter_Call{Call: _e.mock.On("RunAfter")} +} + +func (_c *PluginMetric_RunAfter_Call) Run(run func()) *PluginMetric_RunAfter_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginMetric_RunAfter_Call) Return(strings []string, error errors.Error) *PluginMetric_RunAfter_Call { + _c.Call.Return(strings, error) + return _c +} + +func (_c *PluginMetric_RunAfter_Call) RunAndReturn(run func() ([]string, errors.Error)) *PluginMetric_RunAfter_Call { + _c.Call.Return(run) + return _c +} + +// Settings provides a mock function for the type PluginMetric +func (_mock *PluginMetric) Settings() interface{} { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Settings") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func() interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// PluginMetric_Settings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Settings' +type PluginMetric_Settings_Call struct { + *mock.Call +} + +// Settings is a helper method to define mock.On call +func (_e *PluginMetric_Expecter) Settings() *PluginMetric_Settings_Call { + return &PluginMetric_Settings_Call{Call: _e.mock.On("Settings")} +} + +func (_c *PluginMetric_Settings_Call) Run(run func()) *PluginMetric_Settings_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginMetric_Settings_Call) Return(p interface{}) *PluginMetric_Settings_Call { + _c.Call.Return(p) + return _c +} + +func (_c *PluginMetric_Settings_Call) RunAndReturn(run func() interface{}) *PluginMetric_Settings_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginMigration.go b/backend/mocks/core/plugin/PluginMigration.go new file mode 100644 index 00000000000..48e6b74cd67 --- /dev/null +++ b/backend/mocks/core/plugin/PluginMigration.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewPluginMigration creates a new instance of PluginMigration. 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 NewPluginMigration(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginMigration { + mock := &PluginMigration{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginMigration is an autogenerated mock type for the PluginMigration type +type PluginMigration struct { + mock.Mock +} + +type PluginMigration_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginMigration) EXPECT() *PluginMigration_Expecter { + return &PluginMigration_Expecter{mock: &_m.Mock} +} + +// MigrationScripts provides a mock function for the type PluginMigration +func (_mock *PluginMigration) MigrationScripts() []plugin.MigrationScript { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for MigrationScripts") + } + + var r0 []plugin.MigrationScript + if returnFunc, ok := ret.Get(0).(func() []plugin.MigrationScript); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]plugin.MigrationScript) + } + } + return r0 +} + +// PluginMigration_MigrationScripts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MigrationScripts' +type PluginMigration_MigrationScripts_Call struct { + *mock.Call +} + +// MigrationScripts is a helper method to define mock.On call +func (_e *PluginMigration_Expecter) MigrationScripts() *PluginMigration_MigrationScripts_Call { + return &PluginMigration_MigrationScripts_Call{Call: _e.mock.On("MigrationScripts")} +} + +func (_c *PluginMigration_MigrationScripts_Call) Run(run func()) *PluginMigration_MigrationScripts_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginMigration_MigrationScripts_Call) Return(migrationScripts []plugin.MigrationScript) *PluginMigration_MigrationScripts_Call { + _c.Call.Return(migrationScripts) + return _c +} + +func (_c *PluginMigration_MigrationScripts_Call) RunAndReturn(run func() []plugin.MigrationScript) *PluginMigration_MigrationScripts_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginModel.go b/backend/mocks/core/plugin/PluginModel.go new file mode 100644 index 00000000000..ac5e84a187e --- /dev/null +++ b/backend/mocks/core/plugin/PluginModel.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/dal" + mock "github.com/stretchr/testify/mock" +) + +// NewPluginModel creates a new instance of PluginModel. 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 NewPluginModel(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginModel { + mock := &PluginModel{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginModel is an autogenerated mock type for the PluginModel type +type PluginModel struct { + mock.Mock +} + +type PluginModel_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginModel) EXPECT() *PluginModel_Expecter { + return &PluginModel_Expecter{mock: &_m.Mock} +} + +// GetTablesInfo provides a mock function for the type PluginModel +func (_mock *PluginModel) GetTablesInfo() []dal.Tabler { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTablesInfo") + } + + var r0 []dal.Tabler + if returnFunc, ok := ret.Get(0).(func() []dal.Tabler); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]dal.Tabler) + } + } + return r0 +} + +// PluginModel_GetTablesInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTablesInfo' +type PluginModel_GetTablesInfo_Call struct { + *mock.Call +} + +// GetTablesInfo is a helper method to define mock.On call +func (_e *PluginModel_Expecter) GetTablesInfo() *PluginModel_GetTablesInfo_Call { + return &PluginModel_GetTablesInfo_Call{Call: _e.mock.On("GetTablesInfo")} +} + +func (_c *PluginModel_GetTablesInfo_Call) Run(run func()) *PluginModel_GetTablesInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginModel_GetTablesInfo_Call) Return(tablers []dal.Tabler) *PluginModel_GetTablesInfo_Call { + _c.Call.Return(tablers) + return _c +} + +func (_c *PluginModel_GetTablesInfo_Call) RunAndReturn(run func() []dal.Tabler) *PluginModel_GetTablesInfo_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginOpenApiSpec.go b/backend/mocks/core/plugin/PluginOpenApiSpec.go new file mode 100644 index 00000000000..9d300b82750 --- /dev/null +++ b/backend/mocks/core/plugin/PluginOpenApiSpec.go @@ -0,0 +1,80 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewPluginOpenApiSpec creates a new instance of PluginOpenApiSpec. 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 NewPluginOpenApiSpec(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginOpenApiSpec { + mock := &PluginOpenApiSpec{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginOpenApiSpec is an autogenerated mock type for the PluginOpenApiSpec type +type PluginOpenApiSpec struct { + mock.Mock +} + +type PluginOpenApiSpec_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginOpenApiSpec) EXPECT() *PluginOpenApiSpec_Expecter { + return &PluginOpenApiSpec_Expecter{mock: &_m.Mock} +} + +// OpenApiSpec provides a mock function for the type PluginOpenApiSpec +func (_mock *PluginOpenApiSpec) OpenApiSpec() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for OpenApiSpec") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// PluginOpenApiSpec_OpenApiSpec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenApiSpec' +type PluginOpenApiSpec_OpenApiSpec_Call struct { + *mock.Call +} + +// OpenApiSpec is a helper method to define mock.On call +func (_e *PluginOpenApiSpec_Expecter) OpenApiSpec() *PluginOpenApiSpec_OpenApiSpec_Call { + return &PluginOpenApiSpec_OpenApiSpec_Call{Call: _e.mock.On("OpenApiSpec")} +} + +func (_c *PluginOpenApiSpec_OpenApiSpec_Call) Run(run func()) *PluginOpenApiSpec_OpenApiSpec_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginOpenApiSpec_OpenApiSpec_Call) Return(s string) *PluginOpenApiSpec_OpenApiSpec_Call { + _c.Call.Return(s) + return _c +} + +func (_c *PluginOpenApiSpec_OpenApiSpec_Call) RunAndReturn(run func() string) *PluginOpenApiSpec_OpenApiSpec_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginSource.go b/backend/mocks/core/plugin/PluginSource.go new file mode 100644 index 00000000000..c61a8defea3 --- /dev/null +++ b/backend/mocks/core/plugin/PluginSource.go @@ -0,0 +1,176 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/dal" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewPluginSource creates a new instance of PluginSource. 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 NewPluginSource(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginSource { + mock := &PluginSource{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginSource is an autogenerated mock type for the PluginSource type +type PluginSource struct { + mock.Mock +} + +type PluginSource_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginSource) EXPECT() *PluginSource_Expecter { + return &PluginSource_Expecter{mock: &_m.Mock} +} + +// Connection provides a mock function for the type PluginSource +func (_mock *PluginSource) Connection() dal.Tabler { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Connection") + } + + var r0 dal.Tabler + if returnFunc, ok := ret.Get(0).(func() dal.Tabler); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Tabler) + } + } + return r0 +} + +// PluginSource_Connection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connection' +type PluginSource_Connection_Call struct { + *mock.Call +} + +// Connection is a helper method to define mock.On call +func (_e *PluginSource_Expecter) Connection() *PluginSource_Connection_Call { + return &PluginSource_Connection_Call{Call: _e.mock.On("Connection")} +} + +func (_c *PluginSource_Connection_Call) Run(run func()) *PluginSource_Connection_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginSource_Connection_Call) Return(tabler dal.Tabler) *PluginSource_Connection_Call { + _c.Call.Return(tabler) + return _c +} + +func (_c *PluginSource_Connection_Call) RunAndReturn(run func() dal.Tabler) *PluginSource_Connection_Call { + _c.Call.Return(run) + return _c +} + +// Scope provides a mock function for the type PluginSource +func (_mock *PluginSource) Scope() plugin.ToolLayerScope { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Scope") + } + + var r0 plugin.ToolLayerScope + if returnFunc, ok := ret.Get(0).(func() plugin.ToolLayerScope); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.ToolLayerScope) + } + } + return r0 +} + +// PluginSource_Scope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Scope' +type PluginSource_Scope_Call struct { + *mock.Call +} + +// Scope is a helper method to define mock.On call +func (_e *PluginSource_Expecter) Scope() *PluginSource_Scope_Call { + return &PluginSource_Scope_Call{Call: _e.mock.On("Scope")} +} + +func (_c *PluginSource_Scope_Call) Run(run func()) *PluginSource_Scope_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginSource_Scope_Call) Return(toolLayerScope plugin.ToolLayerScope) *PluginSource_Scope_Call { + _c.Call.Return(toolLayerScope) + return _c +} + +func (_c *PluginSource_Scope_Call) RunAndReturn(run func() plugin.ToolLayerScope) *PluginSource_Scope_Call { + _c.Call.Return(run) + return _c +} + +// ScopeConfig provides a mock function for the type PluginSource +func (_mock *PluginSource) ScopeConfig() dal.Tabler { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeConfig") + } + + var r0 dal.Tabler + if returnFunc, ok := ret.Get(0).(func() dal.Tabler); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Tabler) + } + } + return r0 +} + +// PluginSource_ScopeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeConfig' +type PluginSource_ScopeConfig_Call struct { + *mock.Call +} + +// ScopeConfig is a helper method to define mock.On call +func (_e *PluginSource_Expecter) ScopeConfig() *PluginSource_ScopeConfig_Call { + return &PluginSource_ScopeConfig_Call{Call: _e.mock.On("ScopeConfig")} +} + +func (_c *PluginSource_ScopeConfig_Call) Run(run func()) *PluginSource_ScopeConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginSource_ScopeConfig_Call) Return(tabler dal.Tabler) *PluginSource_ScopeConfig_Call { + _c.Call.Return(tabler) + return _c +} + +func (_c *PluginSource_ScopeConfig_Call) RunAndReturn(run func() dal.Tabler) *PluginSource_ScopeConfig_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PluginTask.go b/backend/mocks/core/plugin/PluginTask.go new file mode 100644 index 00000000000..ff81fddb1bd --- /dev/null +++ b/backend/mocks/core/plugin/PluginTask.go @@ -0,0 +1,154 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewPluginTask creates a new instance of PluginTask. 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 NewPluginTask(t interface { + mock.TestingT + Cleanup(func()) +}) *PluginTask { + mock := &PluginTask{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PluginTask is an autogenerated mock type for the PluginTask type +type PluginTask struct { + mock.Mock +} + +type PluginTask_Expecter struct { + mock *mock.Mock +} + +func (_m *PluginTask) EXPECT() *PluginTask_Expecter { + return &PluginTask_Expecter{mock: &_m.Mock} +} + +// PrepareTaskData provides a mock function for the type PluginTask +func (_mock *PluginTask) PrepareTaskData(taskCtx plugin.TaskContext, options map[string]interface{}) (interface{}, errors.Error) { + ret := _mock.Called(taskCtx, options) + + if len(ret) == 0 { + panic("no return value specified for PrepareTaskData") + } + + var r0 interface{} + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(plugin.TaskContext, map[string]interface{}) (interface{}, errors.Error)); ok { + return returnFunc(taskCtx, options) + } + if returnFunc, ok := ret.Get(0).(func(plugin.TaskContext, map[string]interface{}) interface{}); ok { + r0 = returnFunc(taskCtx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + if returnFunc, ok := ret.Get(1).(func(plugin.TaskContext, map[string]interface{}) errors.Error); ok { + r1 = returnFunc(taskCtx, options) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// PluginTask_PrepareTaskData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareTaskData' +type PluginTask_PrepareTaskData_Call struct { + *mock.Call +} + +// PrepareTaskData is a helper method to define mock.On call +// - taskCtx plugin.TaskContext +// - options map[string]interface{} +func (_e *PluginTask_Expecter) PrepareTaskData(taskCtx any, options any) *PluginTask_PrepareTaskData_Call { + return &PluginTask_PrepareTaskData_Call{Call: _e.mock.On("PrepareTaskData", taskCtx, options)} +} + +func (_c *PluginTask_PrepareTaskData_Call) Run(run func(taskCtx plugin.TaskContext, options map[string]interface{})) *PluginTask_PrepareTaskData_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 plugin.TaskContext + if args[0] != nil { + arg0 = args[0].(plugin.TaskContext) + } + var arg1 map[string]interface{} + if args[1] != nil { + arg1 = args[1].(map[string]interface{}) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *PluginTask_PrepareTaskData_Call) Return(ifaceVal interface{}, error errors.Error) *PluginTask_PrepareTaskData_Call { + _c.Call.Return(ifaceVal, error) + return _c +} + +func (_c *PluginTask_PrepareTaskData_Call) RunAndReturn(run func(taskCtx plugin.TaskContext, options map[string]interface{}) (interface{}, errors.Error)) *PluginTask_PrepareTaskData_Call { + _c.Call.Return(run) + return _c +} + +// SubTaskMetas provides a mock function for the type PluginTask +func (_mock *PluginTask) SubTaskMetas() []plugin.SubTaskMeta { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for SubTaskMetas") + } + + var r0 []plugin.SubTaskMeta + if returnFunc, ok := ret.Get(0).(func() []plugin.SubTaskMeta); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]plugin.SubTaskMeta) + } + } + return r0 +} + +// PluginTask_SubTaskMetas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubTaskMetas' +type PluginTask_SubTaskMetas_Call struct { + *mock.Call +} + +// SubTaskMetas is a helper method to define mock.On call +func (_e *PluginTask_Expecter) SubTaskMetas() *PluginTask_SubTaskMetas_Call { + return &PluginTask_SubTaskMetas_Call{Call: _e.mock.On("SubTaskMetas")} +} + +func (_c *PluginTask_SubTaskMetas_Call) Run(run func()) *PluginTask_SubTaskMetas_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PluginTask_SubTaskMetas_Call) Return(subTaskMetas []plugin.SubTaskMeta) *PluginTask_SubTaskMetas_Call { + _c.Call.Return(subTaskMetas) + return _c +} + +func (_c *PluginTask_SubTaskMetas_Call) RunAndReturn(run func() []plugin.SubTaskMeta) *PluginTask_SubTaskMetas_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/PrepareApiClient.go b/backend/mocks/core/plugin/PrepareApiClient.go new file mode 100644 index 00000000000..658454cda84 --- /dev/null +++ b/backend/mocks/core/plugin/PrepareApiClient.go @@ -0,0 +1,91 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewPrepareApiClient creates a new instance of PrepareApiClient. 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 NewPrepareApiClient(t interface { + mock.TestingT + Cleanup(func()) +}) *PrepareApiClient { + mock := &PrepareApiClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// PrepareApiClient is an autogenerated mock type for the PrepareApiClient type +type PrepareApiClient struct { + mock.Mock +} + +type PrepareApiClient_Expecter struct { + mock *mock.Mock +} + +func (_m *PrepareApiClient) EXPECT() *PrepareApiClient_Expecter { + return &PrepareApiClient_Expecter{mock: &_m.Mock} +} + +// PrepareApiClient provides a mock function for the type PrepareApiClient +func (_mock *PrepareApiClient) PrepareApiClient(apiClient plugin.ApiClient) errors.Error { + ret := _mock.Called(apiClient) + + if len(ret) == 0 { + panic("no return value specified for PrepareApiClient") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(plugin.ApiClient) errors.Error); ok { + r0 = returnFunc(apiClient) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// PrepareApiClient_PrepareApiClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareApiClient' +type PrepareApiClient_PrepareApiClient_Call struct { + *mock.Call +} + +// PrepareApiClient is a helper method to define mock.On call +// - apiClient plugin.ApiClient +func (_e *PrepareApiClient_Expecter) PrepareApiClient(apiClient any) *PrepareApiClient_PrepareApiClient_Call { + return &PrepareApiClient_PrepareApiClient_Call{Call: _e.mock.On("PrepareApiClient", apiClient)} +} + +func (_c *PrepareApiClient_PrepareApiClient_Call) Run(run func(apiClient plugin.ApiClient)) *PrepareApiClient_PrepareApiClient_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 plugin.ApiClient + if args[0] != nil { + arg0 = args[0].(plugin.ApiClient) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *PrepareApiClient_PrepareApiClient_Call) Return(error errors.Error) *PrepareApiClient_PrepareApiClient_Call { + _c.Call.Return(error) + return _c +} + +func (_c *PrepareApiClient_PrepareApiClient_Call) RunAndReturn(run func(apiClient plugin.ApiClient) errors.Error) *PrepareApiClient_PrepareApiClient_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ProjectMapper.go b/backend/mocks/core/plugin/ProjectMapper.go new file mode 100644 index 00000000000..fd6399f5866 --- /dev/null +++ b/backend/mocks/core/plugin/ProjectMapper.go @@ -0,0 +1,109 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/models" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewProjectMapper creates a new instance of ProjectMapper. 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 NewProjectMapper(t interface { + mock.TestingT + Cleanup(func()) +}) *ProjectMapper { + mock := &ProjectMapper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ProjectMapper is an autogenerated mock type for the ProjectMapper type +type ProjectMapper struct { + mock.Mock +} + +type ProjectMapper_Expecter struct { + mock *mock.Mock +} + +func (_m *ProjectMapper) EXPECT() *ProjectMapper_Expecter { + return &ProjectMapper_Expecter{mock: &_m.Mock} +} + +// MapProject provides a mock function for the type ProjectMapper +func (_mock *ProjectMapper) MapProject(projectName string, scopes []plugin.Scope) (models.PipelinePlan, errors.Error) { + ret := _mock.Called(projectName, scopes) + + if len(ret) == 0 { + panic("no return value specified for MapProject") + } + + var r0 models.PipelinePlan + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string, []plugin.Scope) (models.PipelinePlan, errors.Error)); ok { + return returnFunc(projectName, scopes) + } + if returnFunc, ok := ret.Get(0).(func(string, []plugin.Scope) models.PipelinePlan); ok { + r0 = returnFunc(projectName, scopes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(models.PipelinePlan) + } + } + if returnFunc, ok := ret.Get(1).(func(string, []plugin.Scope) errors.Error); ok { + r1 = returnFunc(projectName, scopes) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// ProjectMapper_MapProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MapProject' +type ProjectMapper_MapProject_Call struct { + *mock.Call +} + +// MapProject is a helper method to define mock.On call +// - projectName string +// - scopes []plugin.Scope +func (_e *ProjectMapper_Expecter) MapProject(projectName any, scopes any) *ProjectMapper_MapProject_Call { + return &ProjectMapper_MapProject_Call{Call: _e.mock.On("MapProject", projectName, scopes)} +} + +func (_c *ProjectMapper_MapProject_Call) Run(run func(projectName string, scopes []plugin.Scope)) *ProjectMapper_MapProject_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 []plugin.Scope + if args[1] != nil { + arg1 = args[1].([]plugin.Scope) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *ProjectMapper_MapProject_Call) Return(pipelinePlan models.PipelinePlan, error errors.Error) *ProjectMapper_MapProject_Call { + _c.Call.Return(pipelinePlan, error) + return _c +} + +func (_c *ProjectMapper_MapProject_Call) RunAndReturn(run func(projectName string, scopes []plugin.Scope) (models.PipelinePlan, errors.Error)) *ProjectMapper_MapProject_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/Scope.go b/backend/mocks/core/plugin/Scope.go new file mode 100644 index 00000000000..8f616b8ca24 --- /dev/null +++ b/backend/mocks/core/plugin/Scope.go @@ -0,0 +1,168 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewScope creates a new instance of Scope. 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 NewScope(t interface { + mock.TestingT + Cleanup(func()) +}) *Scope { + mock := &Scope{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// Scope is an autogenerated mock type for the Scope type +type Scope struct { + mock.Mock +} + +type Scope_Expecter struct { + mock *mock.Mock +} + +func (_m *Scope) EXPECT() *Scope_Expecter { + return &Scope_Expecter{mock: &_m.Mock} +} + +// ScopeId provides a mock function for the type Scope +func (_mock *Scope) ScopeId() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeId") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// Scope_ScopeId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeId' +type Scope_ScopeId_Call struct { + *mock.Call +} + +// ScopeId is a helper method to define mock.On call +func (_e *Scope_Expecter) ScopeId() *Scope_ScopeId_Call { + return &Scope_ScopeId_Call{Call: _e.mock.On("ScopeId")} +} + +func (_c *Scope_ScopeId_Call) Run(run func()) *Scope_ScopeId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Scope_ScopeId_Call) Return(s string) *Scope_ScopeId_Call { + _c.Call.Return(s) + return _c +} + +func (_c *Scope_ScopeId_Call) RunAndReturn(run func() string) *Scope_ScopeId_Call { + _c.Call.Return(run) + return _c +} + +// ScopeName provides a mock function for the type Scope +func (_mock *Scope) ScopeName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// Scope_ScopeName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeName' +type Scope_ScopeName_Call struct { + *mock.Call +} + +// ScopeName is a helper method to define mock.On call +func (_e *Scope_Expecter) ScopeName() *Scope_ScopeName_Call { + return &Scope_ScopeName_Call{Call: _e.mock.On("ScopeName")} +} + +func (_c *Scope_ScopeName_Call) Run(run func()) *Scope_ScopeName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Scope_ScopeName_Call) Return(s string) *Scope_ScopeName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *Scope_ScopeName_Call) RunAndReturn(run func() string) *Scope_ScopeName_Call { + _c.Call.Return(run) + return _c +} + +// TableName provides a mock function for the type Scope +func (_mock *Scope) TableName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for TableName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// Scope_TableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TableName' +type Scope_TableName_Call struct { + *mock.Call +} + +// TableName is a helper method to define mock.On call +func (_e *Scope_Expecter) TableName() *Scope_TableName_Call { + return &Scope_TableName_Call{Call: _e.mock.On("TableName")} +} + +func (_c *Scope_TableName_Call) Run(run func()) *Scope_TableName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Scope_TableName_Call) Return(s string) *Scope_TableName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *Scope_TableName_Call) RunAndReturn(run func() string) *Scope_TableName_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/SubTask.go b/backend/mocks/core/plugin/SubTask.go new file mode 100644 index 00000000000..a214f891884 --- /dev/null +++ b/backend/mocks/core/plugin/SubTask.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewSubTask creates a new instance of SubTask. 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 NewSubTask(t interface { + mock.TestingT + Cleanup(func()) +}) *SubTask { + mock := &SubTask{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// SubTask is an autogenerated mock type for the SubTask type +type SubTask struct { + mock.Mock +} + +type SubTask_Expecter struct { + mock *mock.Mock +} + +func (_m *SubTask) EXPECT() *SubTask_Expecter { + return &SubTask_Expecter{mock: &_m.Mock} +} + +// Execute provides a mock function for the type SubTask +func (_mock *SubTask) Execute() errors.Error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Execute") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func() errors.Error); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// SubTask_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' +type SubTask_Execute_Call struct { + *mock.Call +} + +// Execute is a helper method to define mock.On call +func (_e *SubTask_Expecter) Execute() *SubTask_Execute_Call { + return &SubTask_Execute_Call{Call: _e.mock.On("Execute")} +} + +func (_c *SubTask_Execute_Call) Run(run func()) *SubTask_Execute_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTask_Execute_Call) Return(error errors.Error) *SubTask_Execute_Call { + _c.Call.Return(error) + return _c +} + +func (_c *SubTask_Execute_Call) RunAndReturn(run func() errors.Error) *SubTask_Execute_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/SubTaskContext.go b/backend/mocks/core/plugin/SubTaskContext.go new file mode 100644 index 00000000000..2f8b3dcc85e --- /dev/null +++ b/backend/mocks/core/plugin/SubTaskContext.go @@ -0,0 +1,650 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "context" + + "github.com/apache/devlake/core/config" + context0 "github.com/apache/devlake/core/context" + "github.com/apache/devlake/core/dal" + "github.com/apache/devlake/core/log" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewSubTaskContext creates a new instance of SubTaskContext. 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 NewSubTaskContext(t interface { + mock.TestingT + Cleanup(func()) +}) *SubTaskContext { + mock := &SubTaskContext{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// SubTaskContext is an autogenerated mock type for the SubTaskContext type +type SubTaskContext struct { + mock.Mock +} + +type SubTaskContext_Expecter struct { + mock *mock.Mock +} + +func (_m *SubTaskContext) EXPECT() *SubTaskContext_Expecter { + return &SubTaskContext_Expecter{mock: &_m.Mock} +} + +// GetConfig provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) GetConfig(name string) string { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetConfig") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func(string) string); ok { + r0 = returnFunc(name) + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// SubTaskContext_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig' +type SubTaskContext_GetConfig_Call struct { + *mock.Call +} + +// GetConfig is a helper method to define mock.On call +// - name string +func (_e *SubTaskContext_Expecter) GetConfig(name any) *SubTaskContext_GetConfig_Call { + return &SubTaskContext_GetConfig_Call{Call: _e.mock.On("GetConfig", name)} +} + +func (_c *SubTaskContext_GetConfig_Call) Run(run func(name string)) *SubTaskContext_GetConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *SubTaskContext_GetConfig_Call) Return(s string) *SubTaskContext_GetConfig_Call { + _c.Call.Return(s) + return _c +} + +func (_c *SubTaskContext_GetConfig_Call) RunAndReturn(run func(name string) string) *SubTaskContext_GetConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetConfigReader provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) GetConfigReader() config.ConfigReader { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetConfigReader") + } + + var r0 config.ConfigReader + if returnFunc, ok := ret.Get(0).(func() config.ConfigReader); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.ConfigReader) + } + } + return r0 +} + +// SubTaskContext_GetConfigReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfigReader' +type SubTaskContext_GetConfigReader_Call struct { + *mock.Call +} + +// GetConfigReader is a helper method to define mock.On call +func (_e *SubTaskContext_Expecter) GetConfigReader() *SubTaskContext_GetConfigReader_Call { + return &SubTaskContext_GetConfigReader_Call{Call: _e.mock.On("GetConfigReader")} +} + +func (_c *SubTaskContext_GetConfigReader_Call) Run(run func()) *SubTaskContext_GetConfigReader_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTaskContext_GetConfigReader_Call) Return(configReader config.ConfigReader) *SubTaskContext_GetConfigReader_Call { + _c.Call.Return(configReader) + return _c +} + +func (_c *SubTaskContext_GetConfigReader_Call) RunAndReturn(run func() config.ConfigReader) *SubTaskContext_GetConfigReader_Call { + _c.Call.Return(run) + return _c +} + +// GetContext provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) GetContext() context.Context { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetContext") + } + + var r0 context.Context + if returnFunc, ok := ret.Get(0).(func() context.Context); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context.Context) + } + } + return r0 +} + +// SubTaskContext_GetContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContext' +type SubTaskContext_GetContext_Call struct { + *mock.Call +} + +// GetContext is a helper method to define mock.On call +func (_e *SubTaskContext_Expecter) GetContext() *SubTaskContext_GetContext_Call { + return &SubTaskContext_GetContext_Call{Call: _e.mock.On("GetContext")} +} + +func (_c *SubTaskContext_GetContext_Call) Run(run func()) *SubTaskContext_GetContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTaskContext_GetContext_Call) Return(context1 context.Context) *SubTaskContext_GetContext_Call { + _c.Call.Return(context1) + return _c +} + +func (_c *SubTaskContext_GetContext_Call) RunAndReturn(run func() context.Context) *SubTaskContext_GetContext_Call { + _c.Call.Return(run) + return _c +} + +// GetDal provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) GetDal() dal.Dal { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDal") + } + + var r0 dal.Dal + if returnFunc, ok := ret.Get(0).(func() dal.Dal); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Dal) + } + } + return r0 +} + +// SubTaskContext_GetDal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDal' +type SubTaskContext_GetDal_Call struct { + *mock.Call +} + +// GetDal is a helper method to define mock.On call +func (_e *SubTaskContext_Expecter) GetDal() *SubTaskContext_GetDal_Call { + return &SubTaskContext_GetDal_Call{Call: _e.mock.On("GetDal")} +} + +func (_c *SubTaskContext_GetDal_Call) Run(run func()) *SubTaskContext_GetDal_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTaskContext_GetDal_Call) Return(dal1 dal.Dal) *SubTaskContext_GetDal_Call { + _c.Call.Return(dal1) + return _c +} + +func (_c *SubTaskContext_GetDal_Call) RunAndReturn(run func() dal.Dal) *SubTaskContext_GetDal_Call { + _c.Call.Return(run) + return _c +} + +// GetData provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) GetData() interface{} { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetData") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func() interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// SubTaskContext_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData' +type SubTaskContext_GetData_Call struct { + *mock.Call +} + +// GetData is a helper method to define mock.On call +func (_e *SubTaskContext_Expecter) GetData() *SubTaskContext_GetData_Call { + return &SubTaskContext_GetData_Call{Call: _e.mock.On("GetData")} +} + +func (_c *SubTaskContext_GetData_Call) Run(run func()) *SubTaskContext_GetData_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTaskContext_GetData_Call) Return(ifaceVal interface{}) *SubTaskContext_GetData_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *SubTaskContext_GetData_Call) RunAndReturn(run func() interface{}) *SubTaskContext_GetData_Call { + _c.Call.Return(run) + return _c +} + +// GetLogger provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) GetLogger() log.Logger { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLogger") + } + + var r0 log.Logger + if returnFunc, ok := ret.Get(0).(func() log.Logger); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(log.Logger) + } + } + return r0 +} + +// SubTaskContext_GetLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogger' +type SubTaskContext_GetLogger_Call struct { + *mock.Call +} + +// GetLogger is a helper method to define mock.On call +func (_e *SubTaskContext_Expecter) GetLogger() *SubTaskContext_GetLogger_Call { + return &SubTaskContext_GetLogger_Call{Call: _e.mock.On("GetLogger")} +} + +func (_c *SubTaskContext_GetLogger_Call) Run(run func()) *SubTaskContext_GetLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTaskContext_GetLogger_Call) Return(logger log.Logger) *SubTaskContext_GetLogger_Call { + _c.Call.Return(logger) + return _c +} + +func (_c *SubTaskContext_GetLogger_Call) RunAndReturn(run func() log.Logger) *SubTaskContext_GetLogger_Call { + _c.Call.Return(run) + return _c +} + +// GetName provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) GetName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// SubTaskContext_GetName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetName' +type SubTaskContext_GetName_Call struct { + *mock.Call +} + +// GetName is a helper method to define mock.On call +func (_e *SubTaskContext_Expecter) GetName() *SubTaskContext_GetName_Call { + return &SubTaskContext_GetName_Call{Call: _e.mock.On("GetName")} +} + +func (_c *SubTaskContext_GetName_Call) Run(run func()) *SubTaskContext_GetName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTaskContext_GetName_Call) Return(s string) *SubTaskContext_GetName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *SubTaskContext_GetName_Call) RunAndReturn(run func() string) *SubTaskContext_GetName_Call { + _c.Call.Return(run) + return _c +} + +// GetProgress provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) GetProgress() int { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProgress") + } + + var r0 int + if returnFunc, ok := ret.Get(0).(func() int); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int) + } + return r0 +} + +// SubTaskContext_GetProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProgress' +type SubTaskContext_GetProgress_Call struct { + *mock.Call +} + +// GetProgress is a helper method to define mock.On call +func (_e *SubTaskContext_Expecter) GetProgress() *SubTaskContext_GetProgress_Call { + return &SubTaskContext_GetProgress_Call{Call: _e.mock.On("GetProgress")} +} + +func (_c *SubTaskContext_GetProgress_Call) Run(run func()) *SubTaskContext_GetProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTaskContext_GetProgress_Call) Return(n int) *SubTaskContext_GetProgress_Call { + _c.Call.Return(n) + return _c +} + +func (_c *SubTaskContext_GetProgress_Call) RunAndReturn(run func() int) *SubTaskContext_GetProgress_Call { + _c.Call.Return(run) + return _c +} + +// IncProgress provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) IncProgress(quantity int) { + _mock.Called(quantity) + return +} + +// SubTaskContext_IncProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncProgress' +type SubTaskContext_IncProgress_Call struct { + *mock.Call +} + +// IncProgress is a helper method to define mock.On call +// - quantity int +func (_e *SubTaskContext_Expecter) IncProgress(quantity any) *SubTaskContext_IncProgress_Call { + return &SubTaskContext_IncProgress_Call{Call: _e.mock.On("IncProgress", quantity)} +} + +func (_c *SubTaskContext_IncProgress_Call) Run(run func(quantity int)) *SubTaskContext_IncProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int + if args[0] != nil { + arg0 = args[0].(int) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *SubTaskContext_IncProgress_Call) Return() *SubTaskContext_IncProgress_Call { + _c.Call.Return() + return _c +} + +func (_c *SubTaskContext_IncProgress_Call) RunAndReturn(run func(quantity int)) *SubTaskContext_IncProgress_Call { + _c.Run(run) + return _c +} + +// NestedLogger provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) NestedLogger(name string) context0.BasicRes { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for NestedLogger") + } + + var r0 context0.BasicRes + if returnFunc, ok := ret.Get(0).(func(string) context0.BasicRes); ok { + r0 = returnFunc(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context0.BasicRes) + } + } + return r0 +} + +// SubTaskContext_NestedLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NestedLogger' +type SubTaskContext_NestedLogger_Call struct { + *mock.Call +} + +// NestedLogger is a helper method to define mock.On call +// - name string +func (_e *SubTaskContext_Expecter) NestedLogger(name any) *SubTaskContext_NestedLogger_Call { + return &SubTaskContext_NestedLogger_Call{Call: _e.mock.On("NestedLogger", name)} +} + +func (_c *SubTaskContext_NestedLogger_Call) Run(run func(name string)) *SubTaskContext_NestedLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *SubTaskContext_NestedLogger_Call) Return(basicRes context0.BasicRes) *SubTaskContext_NestedLogger_Call { + _c.Call.Return(basicRes) + return _c +} + +func (_c *SubTaskContext_NestedLogger_Call) RunAndReturn(run func(name string) context0.BasicRes) *SubTaskContext_NestedLogger_Call { + _c.Call.Return(run) + return _c +} + +// ReplaceLogger provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) ReplaceLogger(logger log.Logger) context0.BasicRes { + ret := _mock.Called(logger) + + if len(ret) == 0 { + panic("no return value specified for ReplaceLogger") + } + + var r0 context0.BasicRes + if returnFunc, ok := ret.Get(0).(func(log.Logger) context0.BasicRes); ok { + r0 = returnFunc(logger) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context0.BasicRes) + } + } + return r0 +} + +// SubTaskContext_ReplaceLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplaceLogger' +type SubTaskContext_ReplaceLogger_Call struct { + *mock.Call +} + +// ReplaceLogger is a helper method to define mock.On call +// - logger log.Logger +func (_e *SubTaskContext_Expecter) ReplaceLogger(logger any) *SubTaskContext_ReplaceLogger_Call { + return &SubTaskContext_ReplaceLogger_Call{Call: _e.mock.On("ReplaceLogger", logger)} +} + +func (_c *SubTaskContext_ReplaceLogger_Call) Run(run func(logger log.Logger)) *SubTaskContext_ReplaceLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 log.Logger + if args[0] != nil { + arg0 = args[0].(log.Logger) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *SubTaskContext_ReplaceLogger_Call) Return(basicRes context0.BasicRes) *SubTaskContext_ReplaceLogger_Call { + _c.Call.Return(basicRes) + return _c +} + +func (_c *SubTaskContext_ReplaceLogger_Call) RunAndReturn(run func(logger log.Logger) context0.BasicRes) *SubTaskContext_ReplaceLogger_Call { + _c.Call.Return(run) + return _c +} + +// SetProgress provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) SetProgress(current int, total int) { + _mock.Called(current, total) + return +} + +// SubTaskContext_SetProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetProgress' +type SubTaskContext_SetProgress_Call struct { + *mock.Call +} + +// SetProgress is a helper method to define mock.On call +// - current int +// - total int +func (_e *SubTaskContext_Expecter) SetProgress(current any, total any) *SubTaskContext_SetProgress_Call { + return &SubTaskContext_SetProgress_Call{Call: _e.mock.On("SetProgress", current, total)} +} + +func (_c *SubTaskContext_SetProgress_Call) Run(run func(current int, total int)) *SubTaskContext_SetProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int + if args[0] != nil { + arg0 = args[0].(int) + } + var arg1 int + if args[1] != nil { + arg1 = args[1].(int) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *SubTaskContext_SetProgress_Call) Return() *SubTaskContext_SetProgress_Call { + _c.Call.Return() + return _c +} + +func (_c *SubTaskContext_SetProgress_Call) RunAndReturn(run func(current int, total int)) *SubTaskContext_SetProgress_Call { + _c.Run(run) + return _c +} + +// TaskContext provides a mock function for the type SubTaskContext +func (_mock *SubTaskContext) TaskContext() plugin.TaskContext { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for TaskContext") + } + + var r0 plugin.TaskContext + if returnFunc, ok := ret.Get(0).(func() plugin.TaskContext); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.TaskContext) + } + } + return r0 +} + +// SubTaskContext_TaskContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TaskContext' +type SubTaskContext_TaskContext_Call struct { + *mock.Call +} + +// TaskContext is a helper method to define mock.On call +func (_e *SubTaskContext_Expecter) TaskContext() *SubTaskContext_TaskContext_Call { + return &SubTaskContext_TaskContext_Call{Call: _e.mock.On("TaskContext")} +} + +func (_c *SubTaskContext_TaskContext_Call) Run(run func()) *SubTaskContext_TaskContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTaskContext_TaskContext_Call) Return(taskContext plugin.TaskContext) *SubTaskContext_TaskContext_Call { + _c.Call.Return(taskContext) + return _c +} + +func (_c *SubTaskContext_TaskContext_Call) RunAndReturn(run func() plugin.TaskContext) *SubTaskContext_TaskContext_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/TaskContext.go b/backend/mocks/core/plugin/TaskContext.go new file mode 100644 index 00000000000..8f5d8e06794 --- /dev/null +++ b/backend/mocks/core/plugin/TaskContext.go @@ -0,0 +1,796 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "context" + + "github.com/apache/devlake/core/config" + context0 "github.com/apache/devlake/core/context" + "github.com/apache/devlake/core/dal" + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/log" + "github.com/apache/devlake/core/models" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewTaskContext creates a new instance of TaskContext. 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 NewTaskContext(t interface { + mock.TestingT + Cleanup(func()) +}) *TaskContext { + mock := &TaskContext{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// TaskContext is an autogenerated mock type for the TaskContext type +type TaskContext struct { + mock.Mock +} + +type TaskContext_Expecter struct { + mock *mock.Mock +} + +func (_m *TaskContext) EXPECT() *TaskContext_Expecter { + return &TaskContext_Expecter{mock: &_m.Mock} +} + +// GetConfig provides a mock function for the type TaskContext +func (_mock *TaskContext) GetConfig(name string) string { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for GetConfig") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func(string) string); ok { + r0 = returnFunc(name) + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// TaskContext_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig' +type TaskContext_GetConfig_Call struct { + *mock.Call +} + +// GetConfig is a helper method to define mock.On call +// - name string +func (_e *TaskContext_Expecter) GetConfig(name any) *TaskContext_GetConfig_Call { + return &TaskContext_GetConfig_Call{Call: _e.mock.On("GetConfig", name)} +} + +func (_c *TaskContext_GetConfig_Call) Run(run func(name string)) *TaskContext_GetConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *TaskContext_GetConfig_Call) Return(s string) *TaskContext_GetConfig_Call { + _c.Call.Return(s) + return _c +} + +func (_c *TaskContext_GetConfig_Call) RunAndReturn(run func(name string) string) *TaskContext_GetConfig_Call { + _c.Call.Return(run) + return _c +} + +// GetConfigReader provides a mock function for the type TaskContext +func (_mock *TaskContext) GetConfigReader() config.ConfigReader { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetConfigReader") + } + + var r0 config.ConfigReader + if returnFunc, ok := ret.Get(0).(func() config.ConfigReader); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.ConfigReader) + } + } + return r0 +} + +// TaskContext_GetConfigReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfigReader' +type TaskContext_GetConfigReader_Call struct { + *mock.Call +} + +// GetConfigReader is a helper method to define mock.On call +func (_e *TaskContext_Expecter) GetConfigReader() *TaskContext_GetConfigReader_Call { + return &TaskContext_GetConfigReader_Call{Call: _e.mock.On("GetConfigReader")} +} + +func (_c *TaskContext_GetConfigReader_Call) Run(run func()) *TaskContext_GetConfigReader_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TaskContext_GetConfigReader_Call) Return(configReader config.ConfigReader) *TaskContext_GetConfigReader_Call { + _c.Call.Return(configReader) + return _c +} + +func (_c *TaskContext_GetConfigReader_Call) RunAndReturn(run func() config.ConfigReader) *TaskContext_GetConfigReader_Call { + _c.Call.Return(run) + return _c +} + +// GetContext provides a mock function for the type TaskContext +func (_mock *TaskContext) GetContext() context.Context { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetContext") + } + + var r0 context.Context + if returnFunc, ok := ret.Get(0).(func() context.Context); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context.Context) + } + } + return r0 +} + +// TaskContext_GetContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContext' +type TaskContext_GetContext_Call struct { + *mock.Call +} + +// GetContext is a helper method to define mock.On call +func (_e *TaskContext_Expecter) GetContext() *TaskContext_GetContext_Call { + return &TaskContext_GetContext_Call{Call: _e.mock.On("GetContext")} +} + +func (_c *TaskContext_GetContext_Call) Run(run func()) *TaskContext_GetContext_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TaskContext_GetContext_Call) Return(context1 context.Context) *TaskContext_GetContext_Call { + _c.Call.Return(context1) + return _c +} + +func (_c *TaskContext_GetContext_Call) RunAndReturn(run func() context.Context) *TaskContext_GetContext_Call { + _c.Call.Return(run) + return _c +} + +// GetDal provides a mock function for the type TaskContext +func (_mock *TaskContext) GetDal() dal.Dal { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDal") + } + + var r0 dal.Dal + if returnFunc, ok := ret.Get(0).(func() dal.Dal); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(dal.Dal) + } + } + return r0 +} + +// TaskContext_GetDal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDal' +type TaskContext_GetDal_Call struct { + *mock.Call +} + +// GetDal is a helper method to define mock.On call +func (_e *TaskContext_Expecter) GetDal() *TaskContext_GetDal_Call { + return &TaskContext_GetDal_Call{Call: _e.mock.On("GetDal")} +} + +func (_c *TaskContext_GetDal_Call) Run(run func()) *TaskContext_GetDal_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TaskContext_GetDal_Call) Return(dal1 dal.Dal) *TaskContext_GetDal_Call { + _c.Call.Return(dal1) + return _c +} + +func (_c *TaskContext_GetDal_Call) RunAndReturn(run func() dal.Dal) *TaskContext_GetDal_Call { + _c.Call.Return(run) + return _c +} + +// GetData provides a mock function for the type TaskContext +func (_mock *TaskContext) GetData() interface{} { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetData") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func() interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// TaskContext_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData' +type TaskContext_GetData_Call struct { + *mock.Call +} + +// GetData is a helper method to define mock.On call +func (_e *TaskContext_Expecter) GetData() *TaskContext_GetData_Call { + return &TaskContext_GetData_Call{Call: _e.mock.On("GetData")} +} + +func (_c *TaskContext_GetData_Call) Run(run func()) *TaskContext_GetData_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TaskContext_GetData_Call) Return(ifaceVal interface{}) *TaskContext_GetData_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *TaskContext_GetData_Call) RunAndReturn(run func() interface{}) *TaskContext_GetData_Call { + _c.Call.Return(run) + return _c +} + +// GetLogger provides a mock function for the type TaskContext +func (_mock *TaskContext) GetLogger() log.Logger { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLogger") + } + + var r0 log.Logger + if returnFunc, ok := ret.Get(0).(func() log.Logger); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(log.Logger) + } + } + return r0 +} + +// TaskContext_GetLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogger' +type TaskContext_GetLogger_Call struct { + *mock.Call +} + +// GetLogger is a helper method to define mock.On call +func (_e *TaskContext_Expecter) GetLogger() *TaskContext_GetLogger_Call { + return &TaskContext_GetLogger_Call{Call: _e.mock.On("GetLogger")} +} + +func (_c *TaskContext_GetLogger_Call) Run(run func()) *TaskContext_GetLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TaskContext_GetLogger_Call) Return(logger log.Logger) *TaskContext_GetLogger_Call { + _c.Call.Return(logger) + return _c +} + +func (_c *TaskContext_GetLogger_Call) RunAndReturn(run func() log.Logger) *TaskContext_GetLogger_Call { + _c.Call.Return(run) + return _c +} + +// GetName provides a mock function for the type TaskContext +func (_mock *TaskContext) GetName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// TaskContext_GetName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetName' +type TaskContext_GetName_Call struct { + *mock.Call +} + +// GetName is a helper method to define mock.On call +func (_e *TaskContext_Expecter) GetName() *TaskContext_GetName_Call { + return &TaskContext_GetName_Call{Call: _e.mock.On("GetName")} +} + +func (_c *TaskContext_GetName_Call) Run(run func()) *TaskContext_GetName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TaskContext_GetName_Call) Return(s string) *TaskContext_GetName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *TaskContext_GetName_Call) RunAndReturn(run func() string) *TaskContext_GetName_Call { + _c.Call.Return(run) + return _c +} + +// GetProgress provides a mock function for the type TaskContext +func (_mock *TaskContext) GetProgress() int { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProgress") + } + + var r0 int + if returnFunc, ok := ret.Get(0).(func() int); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int) + } + return r0 +} + +// TaskContext_GetProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProgress' +type TaskContext_GetProgress_Call struct { + *mock.Call +} + +// GetProgress is a helper method to define mock.On call +func (_e *TaskContext_Expecter) GetProgress() *TaskContext_GetProgress_Call { + return &TaskContext_GetProgress_Call{Call: _e.mock.On("GetProgress")} +} + +func (_c *TaskContext_GetProgress_Call) Run(run func()) *TaskContext_GetProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TaskContext_GetProgress_Call) Return(n int) *TaskContext_GetProgress_Call { + _c.Call.Return(n) + return _c +} + +func (_c *TaskContext_GetProgress_Call) RunAndReturn(run func() int) *TaskContext_GetProgress_Call { + _c.Call.Return(run) + return _c +} + +// IncProgress provides a mock function for the type TaskContext +func (_mock *TaskContext) IncProgress(quantity int) { + _mock.Called(quantity) + return +} + +// TaskContext_IncProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncProgress' +type TaskContext_IncProgress_Call struct { + *mock.Call +} + +// IncProgress is a helper method to define mock.On call +// - quantity int +func (_e *TaskContext_Expecter) IncProgress(quantity any) *TaskContext_IncProgress_Call { + return &TaskContext_IncProgress_Call{Call: _e.mock.On("IncProgress", quantity)} +} + +func (_c *TaskContext_IncProgress_Call) Run(run func(quantity int)) *TaskContext_IncProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int + if args[0] != nil { + arg0 = args[0].(int) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *TaskContext_IncProgress_Call) Return() *TaskContext_IncProgress_Call { + _c.Call.Return() + return _c +} + +func (_c *TaskContext_IncProgress_Call) RunAndReturn(run func(quantity int)) *TaskContext_IncProgress_Call { + _c.Run(run) + return _c +} + +// NestedLogger provides a mock function for the type TaskContext +func (_mock *TaskContext) NestedLogger(name string) context0.BasicRes { + ret := _mock.Called(name) + + if len(ret) == 0 { + panic("no return value specified for NestedLogger") + } + + var r0 context0.BasicRes + if returnFunc, ok := ret.Get(0).(func(string) context0.BasicRes); ok { + r0 = returnFunc(name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context0.BasicRes) + } + } + return r0 +} + +// TaskContext_NestedLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NestedLogger' +type TaskContext_NestedLogger_Call struct { + *mock.Call +} + +// NestedLogger is a helper method to define mock.On call +// - name string +func (_e *TaskContext_Expecter) NestedLogger(name any) *TaskContext_NestedLogger_Call { + return &TaskContext_NestedLogger_Call{Call: _e.mock.On("NestedLogger", name)} +} + +func (_c *TaskContext_NestedLogger_Call) Run(run func(name string)) *TaskContext_NestedLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *TaskContext_NestedLogger_Call) Return(basicRes context0.BasicRes) *TaskContext_NestedLogger_Call { + _c.Call.Return(basicRes) + return _c +} + +func (_c *TaskContext_NestedLogger_Call) RunAndReturn(run func(name string) context0.BasicRes) *TaskContext_NestedLogger_Call { + _c.Call.Return(run) + return _c +} + +// ReplaceLogger provides a mock function for the type TaskContext +func (_mock *TaskContext) ReplaceLogger(logger log.Logger) context0.BasicRes { + ret := _mock.Called(logger) + + if len(ret) == 0 { + panic("no return value specified for ReplaceLogger") + } + + var r0 context0.BasicRes + if returnFunc, ok := ret.Get(0).(func(log.Logger) context0.BasicRes); ok { + r0 = returnFunc(logger) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context0.BasicRes) + } + } + return r0 +} + +// TaskContext_ReplaceLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplaceLogger' +type TaskContext_ReplaceLogger_Call struct { + *mock.Call +} + +// ReplaceLogger is a helper method to define mock.On call +// - logger log.Logger +func (_e *TaskContext_Expecter) ReplaceLogger(logger any) *TaskContext_ReplaceLogger_Call { + return &TaskContext_ReplaceLogger_Call{Call: _e.mock.On("ReplaceLogger", logger)} +} + +func (_c *TaskContext_ReplaceLogger_Call) Run(run func(logger log.Logger)) *TaskContext_ReplaceLogger_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 log.Logger + if args[0] != nil { + arg0 = args[0].(log.Logger) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *TaskContext_ReplaceLogger_Call) Return(basicRes context0.BasicRes) *TaskContext_ReplaceLogger_Call { + _c.Call.Return(basicRes) + return _c +} + +func (_c *TaskContext_ReplaceLogger_Call) RunAndReturn(run func(logger log.Logger) context0.BasicRes) *TaskContext_ReplaceLogger_Call { + _c.Call.Return(run) + return _c +} + +// SetData provides a mock function for the type TaskContext +func (_mock *TaskContext) SetData(data interface{}) { + _mock.Called(data) + return +} + +// TaskContext_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' +type TaskContext_SetData_Call struct { + *mock.Call +} + +// SetData is a helper method to define mock.On call +// - data interface{} +func (_e *TaskContext_Expecter) SetData(data any) *TaskContext_SetData_Call { + return &TaskContext_SetData_Call{Call: _e.mock.On("SetData", data)} +} + +func (_c *TaskContext_SetData_Call) Run(run func(data interface{})) *TaskContext_SetData_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *TaskContext_SetData_Call) Return() *TaskContext_SetData_Call { + _c.Call.Return() + return _c +} + +func (_c *TaskContext_SetData_Call) RunAndReturn(run func(data interface{})) *TaskContext_SetData_Call { + _c.Run(run) + return _c +} + +// SetProgress provides a mock function for the type TaskContext +func (_mock *TaskContext) SetProgress(current int, total int) { + _mock.Called(current, total) + return +} + +// TaskContext_SetProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetProgress' +type TaskContext_SetProgress_Call struct { + *mock.Call +} + +// SetProgress is a helper method to define mock.On call +// - current int +// - total int +func (_e *TaskContext_Expecter) SetProgress(current any, total any) *TaskContext_SetProgress_Call { + return &TaskContext_SetProgress_Call{Call: _e.mock.On("SetProgress", current, total)} +} + +func (_c *TaskContext_SetProgress_Call) Run(run func(current int, total int)) *TaskContext_SetProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int + if args[0] != nil { + arg0 = args[0].(int) + } + var arg1 int + if args[1] != nil { + arg1 = args[1].(int) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *TaskContext_SetProgress_Call) Return() *TaskContext_SetProgress_Call { + _c.Call.Return() + return _c +} + +func (_c *TaskContext_SetProgress_Call) RunAndReturn(run func(current int, total int)) *TaskContext_SetProgress_Call { + _c.Run(run) + return _c +} + +// SetSyncPolicy provides a mock function for the type TaskContext +func (_mock *TaskContext) SetSyncPolicy(syncPolicy *models.SyncPolicy) { + _mock.Called(syncPolicy) + return +} + +// TaskContext_SetSyncPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSyncPolicy' +type TaskContext_SetSyncPolicy_Call struct { + *mock.Call +} + +// SetSyncPolicy is a helper method to define mock.On call +// - syncPolicy *models.SyncPolicy +func (_e *TaskContext_Expecter) SetSyncPolicy(syncPolicy any) *TaskContext_SetSyncPolicy_Call { + return &TaskContext_SetSyncPolicy_Call{Call: _e.mock.On("SetSyncPolicy", syncPolicy)} +} + +func (_c *TaskContext_SetSyncPolicy_Call) Run(run func(syncPolicy *models.SyncPolicy)) *TaskContext_SetSyncPolicy_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *models.SyncPolicy + if args[0] != nil { + arg0 = args[0].(*models.SyncPolicy) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *TaskContext_SetSyncPolicy_Call) Return() *TaskContext_SetSyncPolicy_Call { + _c.Call.Return() + return _c +} + +func (_c *TaskContext_SetSyncPolicy_Call) RunAndReturn(run func(syncPolicy *models.SyncPolicy)) *TaskContext_SetSyncPolicy_Call { + _c.Run(run) + return _c +} + +// SubTaskContext provides a mock function for the type TaskContext +func (_mock *TaskContext) SubTaskContext(subtask string) (plugin.SubTaskContext, errors.Error) { + ret := _mock.Called(subtask) + + if len(ret) == 0 { + panic("no return value specified for SubTaskContext") + } + + var r0 plugin.SubTaskContext + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(string) (plugin.SubTaskContext, errors.Error)); ok { + return returnFunc(subtask) + } + if returnFunc, ok := ret.Get(0).(func(string) plugin.SubTaskContext); ok { + r0 = returnFunc(subtask) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.SubTaskContext) + } + } + if returnFunc, ok := ret.Get(1).(func(string) errors.Error); ok { + r1 = returnFunc(subtask) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// TaskContext_SubTaskContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubTaskContext' +type TaskContext_SubTaskContext_Call struct { + *mock.Call +} + +// SubTaskContext is a helper method to define mock.On call +// - subtask string +func (_e *TaskContext_Expecter) SubTaskContext(subtask any) *TaskContext_SubTaskContext_Call { + return &TaskContext_SubTaskContext_Call{Call: _e.mock.On("SubTaskContext", subtask)} +} + +func (_c *TaskContext_SubTaskContext_Call) Run(run func(subtask string)) *TaskContext_SubTaskContext_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *TaskContext_SubTaskContext_Call) Return(subTaskContext plugin.SubTaskContext, error errors.Error) *TaskContext_SubTaskContext_Call { + _c.Call.Return(subTaskContext, error) + return _c +} + +func (_c *TaskContext_SubTaskContext_Call) RunAndReturn(run func(subtask string) (plugin.SubTaskContext, errors.Error)) *TaskContext_SubTaskContext_Call { + _c.Call.Return(run) + return _c +} + +// SyncPolicy provides a mock function for the type TaskContext +func (_mock *TaskContext) SyncPolicy() *models.SyncPolicy { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for SyncPolicy") + } + + var r0 *models.SyncPolicy + if returnFunc, ok := ret.Get(0).(func() *models.SyncPolicy); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*models.SyncPolicy) + } + } + return r0 +} + +// TaskContext_SyncPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncPolicy' +type TaskContext_SyncPolicy_Call struct { + *mock.Call +} + +// SyncPolicy is a helper method to define mock.On call +func (_e *TaskContext_Expecter) SyncPolicy() *TaskContext_SyncPolicy_Call { + return &TaskContext_SyncPolicy_Call{Call: _e.mock.On("SyncPolicy")} +} + +func (_c *TaskContext_SyncPolicy_Call) Run(run func()) *TaskContext_SyncPolicy_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TaskContext_SyncPolicy_Call) Return(syncPolicy *models.SyncPolicy) *TaskContext_SyncPolicy_Call { + _c.Call.Return(syncPolicy) + return _c +} + +func (_c *TaskContext_SyncPolicy_Call) RunAndReturn(run func() *models.SyncPolicy) *TaskContext_SyncPolicy_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ToolLayerApiConnection.go b/backend/mocks/core/plugin/ToolLayerApiConnection.go new file mode 100644 index 00000000000..017e0b52703 --- /dev/null +++ b/backend/mocks/core/plugin/ToolLayerApiConnection.go @@ -0,0 +1,256 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewToolLayerApiConnection creates a new instance of ToolLayerApiConnection. 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 NewToolLayerApiConnection(t interface { + mock.TestingT + Cleanup(func()) +}) *ToolLayerApiConnection { + mock := &ToolLayerApiConnection{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ToolLayerApiConnection is an autogenerated mock type for the ToolLayerApiConnection type +type ToolLayerApiConnection struct { + mock.Mock +} + +type ToolLayerApiConnection_Expecter struct { + mock *mock.Mock +} + +func (_m *ToolLayerApiConnection) EXPECT() *ToolLayerApiConnection_Expecter { + return &ToolLayerApiConnection_Expecter{mock: &_m.Mock} +} + +// ConnectionId provides a mock function for the type ToolLayerApiConnection +func (_mock *ToolLayerApiConnection) ConnectionId() uint64 { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ConnectionId") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// ToolLayerApiConnection_ConnectionId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConnectionId' +type ToolLayerApiConnection_ConnectionId_Call struct { + *mock.Call +} + +// ConnectionId is a helper method to define mock.On call +func (_e *ToolLayerApiConnection_Expecter) ConnectionId() *ToolLayerApiConnection_ConnectionId_Call { + return &ToolLayerApiConnection_ConnectionId_Call{Call: _e.mock.On("ConnectionId")} +} + +func (_c *ToolLayerApiConnection_ConnectionId_Call) Run(run func()) *ToolLayerApiConnection_ConnectionId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerApiConnection_ConnectionId_Call) Return(v uint64) *ToolLayerApiConnection_ConnectionId_Call { + _c.Call.Return(v) + return _c +} + +func (_c *ToolLayerApiConnection_ConnectionId_Call) RunAndReturn(run func() uint64) *ToolLayerApiConnection_ConnectionId_Call { + _c.Call.Return(run) + return _c +} + +// GetEndpoint provides a mock function for the type ToolLayerApiConnection +func (_mock *ToolLayerApiConnection) GetEndpoint() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEndpoint") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ToolLayerApiConnection_GetEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEndpoint' +type ToolLayerApiConnection_GetEndpoint_Call struct { + *mock.Call +} + +// GetEndpoint is a helper method to define mock.On call +func (_e *ToolLayerApiConnection_Expecter) GetEndpoint() *ToolLayerApiConnection_GetEndpoint_Call { + return &ToolLayerApiConnection_GetEndpoint_Call{Call: _e.mock.On("GetEndpoint")} +} + +func (_c *ToolLayerApiConnection_GetEndpoint_Call) Run(run func()) *ToolLayerApiConnection_GetEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerApiConnection_GetEndpoint_Call) Return(s string) *ToolLayerApiConnection_GetEndpoint_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ToolLayerApiConnection_GetEndpoint_Call) RunAndReturn(run func() string) *ToolLayerApiConnection_GetEndpoint_Call { + _c.Call.Return(run) + return _c +} + +// GetProxy provides a mock function for the type ToolLayerApiConnection +func (_mock *ToolLayerApiConnection) GetProxy() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProxy") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ToolLayerApiConnection_GetProxy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProxy' +type ToolLayerApiConnection_GetProxy_Call struct { + *mock.Call +} + +// GetProxy is a helper method to define mock.On call +func (_e *ToolLayerApiConnection_Expecter) GetProxy() *ToolLayerApiConnection_GetProxy_Call { + return &ToolLayerApiConnection_GetProxy_Call{Call: _e.mock.On("GetProxy")} +} + +func (_c *ToolLayerApiConnection_GetProxy_Call) Run(run func()) *ToolLayerApiConnection_GetProxy_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerApiConnection_GetProxy_Call) Return(s string) *ToolLayerApiConnection_GetProxy_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ToolLayerApiConnection_GetProxy_Call) RunAndReturn(run func() string) *ToolLayerApiConnection_GetProxy_Call { + _c.Call.Return(run) + return _c +} + +// GetRateLimitPerHour provides a mock function for the type ToolLayerApiConnection +func (_mock *ToolLayerApiConnection) GetRateLimitPerHour() int { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRateLimitPerHour") + } + + var r0 int + if returnFunc, ok := ret.Get(0).(func() int); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int) + } + return r0 +} + +// ToolLayerApiConnection_GetRateLimitPerHour_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRateLimitPerHour' +type ToolLayerApiConnection_GetRateLimitPerHour_Call struct { + *mock.Call +} + +// GetRateLimitPerHour is a helper method to define mock.On call +func (_e *ToolLayerApiConnection_Expecter) GetRateLimitPerHour() *ToolLayerApiConnection_GetRateLimitPerHour_Call { + return &ToolLayerApiConnection_GetRateLimitPerHour_Call{Call: _e.mock.On("GetRateLimitPerHour")} +} + +func (_c *ToolLayerApiConnection_GetRateLimitPerHour_Call) Run(run func()) *ToolLayerApiConnection_GetRateLimitPerHour_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerApiConnection_GetRateLimitPerHour_Call) Return(n int) *ToolLayerApiConnection_GetRateLimitPerHour_Call { + _c.Call.Return(n) + return _c +} + +func (_c *ToolLayerApiConnection_GetRateLimitPerHour_Call) RunAndReturn(run func() int) *ToolLayerApiConnection_GetRateLimitPerHour_Call { + _c.Call.Return(run) + return _c +} + +// TableName provides a mock function for the type ToolLayerApiConnection +func (_mock *ToolLayerApiConnection) TableName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for TableName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ToolLayerApiConnection_TableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TableName' +type ToolLayerApiConnection_TableName_Call struct { + *mock.Call +} + +// TableName is a helper method to define mock.On call +func (_e *ToolLayerApiConnection_Expecter) TableName() *ToolLayerApiConnection_TableName_Call { + return &ToolLayerApiConnection_TableName_Call{Call: _e.mock.On("TableName")} +} + +func (_c *ToolLayerApiConnection_TableName_Call) Run(run func()) *ToolLayerApiConnection_TableName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerApiConnection_TableName_Call) Return(s string) *ToolLayerApiConnection_TableName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ToolLayerApiConnection_TableName_Call) RunAndReturn(run func() string) *ToolLayerApiConnection_TableName_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ToolLayerConnection.go b/backend/mocks/core/plugin/ToolLayerConnection.go new file mode 100644 index 00000000000..f61c133d883 --- /dev/null +++ b/backend/mocks/core/plugin/ToolLayerConnection.go @@ -0,0 +1,124 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewToolLayerConnection creates a new instance of ToolLayerConnection. 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 NewToolLayerConnection(t interface { + mock.TestingT + Cleanup(func()) +}) *ToolLayerConnection { + mock := &ToolLayerConnection{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ToolLayerConnection is an autogenerated mock type for the ToolLayerConnection type +type ToolLayerConnection struct { + mock.Mock +} + +type ToolLayerConnection_Expecter struct { + mock *mock.Mock +} + +func (_m *ToolLayerConnection) EXPECT() *ToolLayerConnection_Expecter { + return &ToolLayerConnection_Expecter{mock: &_m.Mock} +} + +// ConnectionId provides a mock function for the type ToolLayerConnection +func (_mock *ToolLayerConnection) ConnectionId() uint64 { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ConnectionId") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// ToolLayerConnection_ConnectionId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConnectionId' +type ToolLayerConnection_ConnectionId_Call struct { + *mock.Call +} + +// ConnectionId is a helper method to define mock.On call +func (_e *ToolLayerConnection_Expecter) ConnectionId() *ToolLayerConnection_ConnectionId_Call { + return &ToolLayerConnection_ConnectionId_Call{Call: _e.mock.On("ConnectionId")} +} + +func (_c *ToolLayerConnection_ConnectionId_Call) Run(run func()) *ToolLayerConnection_ConnectionId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerConnection_ConnectionId_Call) Return(v uint64) *ToolLayerConnection_ConnectionId_Call { + _c.Call.Return(v) + return _c +} + +func (_c *ToolLayerConnection_ConnectionId_Call) RunAndReturn(run func() uint64) *ToolLayerConnection_ConnectionId_Call { + _c.Call.Return(run) + return _c +} + +// TableName provides a mock function for the type ToolLayerConnection +func (_mock *ToolLayerConnection) TableName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for TableName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ToolLayerConnection_TableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TableName' +type ToolLayerConnection_TableName_Call struct { + *mock.Call +} + +// TableName is a helper method to define mock.On call +func (_e *ToolLayerConnection_Expecter) TableName() *ToolLayerConnection_TableName_Call { + return &ToolLayerConnection_TableName_Call{Call: _e.mock.On("TableName")} +} + +func (_c *ToolLayerConnection_TableName_Call) Run(run func()) *ToolLayerConnection_TableName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerConnection_TableName_Call) Return(s string) *ToolLayerConnection_TableName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ToolLayerConnection_TableName_Call) RunAndReturn(run func() string) *ToolLayerConnection_TableName_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ToolLayerScope.go b/backend/mocks/core/plugin/ToolLayerScope.go new file mode 100644 index 00000000000..27500e3cfc4 --- /dev/null +++ b/backend/mocks/core/plugin/ToolLayerScope.go @@ -0,0 +1,346 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewToolLayerScope creates a new instance of ToolLayerScope. 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 NewToolLayerScope(t interface { + mock.TestingT + Cleanup(func()) +}) *ToolLayerScope { + mock := &ToolLayerScope{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ToolLayerScope is an autogenerated mock type for the ToolLayerScope type +type ToolLayerScope struct { + mock.Mock +} + +type ToolLayerScope_Expecter struct { + mock *mock.Mock +} + +func (_m *ToolLayerScope) EXPECT() *ToolLayerScope_Expecter { + return &ToolLayerScope_Expecter{mock: &_m.Mock} +} + +// ScopeConnectionId provides a mock function for the type ToolLayerScope +func (_mock *ToolLayerScope) ScopeConnectionId() uint64 { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeConnectionId") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// ToolLayerScope_ScopeConnectionId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeConnectionId' +type ToolLayerScope_ScopeConnectionId_Call struct { + *mock.Call +} + +// ScopeConnectionId is a helper method to define mock.On call +func (_e *ToolLayerScope_Expecter) ScopeConnectionId() *ToolLayerScope_ScopeConnectionId_Call { + return &ToolLayerScope_ScopeConnectionId_Call{Call: _e.mock.On("ScopeConnectionId")} +} + +func (_c *ToolLayerScope_ScopeConnectionId_Call) Run(run func()) *ToolLayerScope_ScopeConnectionId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScope_ScopeConnectionId_Call) Return(v uint64) *ToolLayerScope_ScopeConnectionId_Call { + _c.Call.Return(v) + return _c +} + +func (_c *ToolLayerScope_ScopeConnectionId_Call) RunAndReturn(run func() uint64) *ToolLayerScope_ScopeConnectionId_Call { + _c.Call.Return(run) + return _c +} + +// ScopeFullName provides a mock function for the type ToolLayerScope +func (_mock *ToolLayerScope) ScopeFullName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeFullName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ToolLayerScope_ScopeFullName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeFullName' +type ToolLayerScope_ScopeFullName_Call struct { + *mock.Call +} + +// ScopeFullName is a helper method to define mock.On call +func (_e *ToolLayerScope_Expecter) ScopeFullName() *ToolLayerScope_ScopeFullName_Call { + return &ToolLayerScope_ScopeFullName_Call{Call: _e.mock.On("ScopeFullName")} +} + +func (_c *ToolLayerScope_ScopeFullName_Call) Run(run func()) *ToolLayerScope_ScopeFullName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScope_ScopeFullName_Call) Return(s string) *ToolLayerScope_ScopeFullName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ToolLayerScope_ScopeFullName_Call) RunAndReturn(run func() string) *ToolLayerScope_ScopeFullName_Call { + _c.Call.Return(run) + return _c +} + +// ScopeId provides a mock function for the type ToolLayerScope +func (_mock *ToolLayerScope) ScopeId() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeId") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ToolLayerScope_ScopeId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeId' +type ToolLayerScope_ScopeId_Call struct { + *mock.Call +} + +// ScopeId is a helper method to define mock.On call +func (_e *ToolLayerScope_Expecter) ScopeId() *ToolLayerScope_ScopeId_Call { + return &ToolLayerScope_ScopeId_Call{Call: _e.mock.On("ScopeId")} +} + +func (_c *ToolLayerScope_ScopeId_Call) Run(run func()) *ToolLayerScope_ScopeId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScope_ScopeId_Call) Return(s string) *ToolLayerScope_ScopeId_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ToolLayerScope_ScopeId_Call) RunAndReturn(run func() string) *ToolLayerScope_ScopeId_Call { + _c.Call.Return(run) + return _c +} + +// ScopeName provides a mock function for the type ToolLayerScope +func (_mock *ToolLayerScope) ScopeName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ToolLayerScope_ScopeName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeName' +type ToolLayerScope_ScopeName_Call struct { + *mock.Call +} + +// ScopeName is a helper method to define mock.On call +func (_e *ToolLayerScope_Expecter) ScopeName() *ToolLayerScope_ScopeName_Call { + return &ToolLayerScope_ScopeName_Call{Call: _e.mock.On("ScopeName")} +} + +func (_c *ToolLayerScope_ScopeName_Call) Run(run func()) *ToolLayerScope_ScopeName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScope_ScopeName_Call) Return(s string) *ToolLayerScope_ScopeName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ToolLayerScope_ScopeName_Call) RunAndReturn(run func() string) *ToolLayerScope_ScopeName_Call { + _c.Call.Return(run) + return _c +} + +// ScopeParams provides a mock function for the type ToolLayerScope +func (_mock *ToolLayerScope) ScopeParams() interface{} { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeParams") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func() interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// ToolLayerScope_ScopeParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeParams' +type ToolLayerScope_ScopeParams_Call struct { + *mock.Call +} + +// ScopeParams is a helper method to define mock.On call +func (_e *ToolLayerScope_Expecter) ScopeParams() *ToolLayerScope_ScopeParams_Call { + return &ToolLayerScope_ScopeParams_Call{Call: _e.mock.On("ScopeParams")} +} + +func (_c *ToolLayerScope_ScopeParams_Call) Run(run func()) *ToolLayerScope_ScopeParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScope_ScopeParams_Call) Return(ifaceVal interface{}) *ToolLayerScope_ScopeParams_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *ToolLayerScope_ScopeParams_Call) RunAndReturn(run func() interface{}) *ToolLayerScope_ScopeParams_Call { + _c.Call.Return(run) + return _c +} + +// ScopeScopeConfigId provides a mock function for the type ToolLayerScope +func (_mock *ToolLayerScope) ScopeScopeConfigId() uint64 { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeScopeConfigId") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// ToolLayerScope_ScopeScopeConfigId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeScopeConfigId' +type ToolLayerScope_ScopeScopeConfigId_Call struct { + *mock.Call +} + +// ScopeScopeConfigId is a helper method to define mock.On call +func (_e *ToolLayerScope_Expecter) ScopeScopeConfigId() *ToolLayerScope_ScopeScopeConfigId_Call { + return &ToolLayerScope_ScopeScopeConfigId_Call{Call: _e.mock.On("ScopeScopeConfigId")} +} + +func (_c *ToolLayerScope_ScopeScopeConfigId_Call) Run(run func()) *ToolLayerScope_ScopeScopeConfigId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScope_ScopeScopeConfigId_Call) Return(v uint64) *ToolLayerScope_ScopeScopeConfigId_Call { + _c.Call.Return(v) + return _c +} + +func (_c *ToolLayerScope_ScopeScopeConfigId_Call) RunAndReturn(run func() uint64) *ToolLayerScope_ScopeScopeConfigId_Call { + _c.Call.Return(run) + return _c +} + +// TableName provides a mock function for the type ToolLayerScope +func (_mock *ToolLayerScope) TableName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for TableName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ToolLayerScope_TableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TableName' +type ToolLayerScope_TableName_Call struct { + *mock.Call +} + +// TableName is a helper method to define mock.On call +func (_e *ToolLayerScope_Expecter) TableName() *ToolLayerScope_TableName_Call { + return &ToolLayerScope_TableName_Call{Call: _e.mock.On("TableName")} +} + +func (_c *ToolLayerScope_TableName_Call) Run(run func()) *ToolLayerScope_TableName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScope_TableName_Call) Return(s string) *ToolLayerScope_TableName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ToolLayerScope_TableName_Call) RunAndReturn(run func() string) *ToolLayerScope_TableName_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/plugin/ToolLayerScopeConfig.go b/backend/mocks/core/plugin/ToolLayerScopeConfig.go new file mode 100644 index 00000000000..4d59175662d --- /dev/null +++ b/backend/mocks/core/plugin/ToolLayerScopeConfig.go @@ -0,0 +1,168 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewToolLayerScopeConfig creates a new instance of ToolLayerScopeConfig. 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 NewToolLayerScopeConfig(t interface { + mock.TestingT + Cleanup(func()) +}) *ToolLayerScopeConfig { + mock := &ToolLayerScopeConfig{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ToolLayerScopeConfig is an autogenerated mock type for the ToolLayerScopeConfig type +type ToolLayerScopeConfig struct { + mock.Mock +} + +type ToolLayerScopeConfig_Expecter struct { + mock *mock.Mock +} + +func (_m *ToolLayerScopeConfig) EXPECT() *ToolLayerScopeConfig_Expecter { + return &ToolLayerScopeConfig_Expecter{mock: &_m.Mock} +} + +// ScopeConfigConnectionId provides a mock function for the type ToolLayerScopeConfig +func (_mock *ToolLayerScopeConfig) ScopeConfigConnectionId() uint64 { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeConfigConnectionId") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// ToolLayerScopeConfig_ScopeConfigConnectionId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeConfigConnectionId' +type ToolLayerScopeConfig_ScopeConfigConnectionId_Call struct { + *mock.Call +} + +// ScopeConfigConnectionId is a helper method to define mock.On call +func (_e *ToolLayerScopeConfig_Expecter) ScopeConfigConnectionId() *ToolLayerScopeConfig_ScopeConfigConnectionId_Call { + return &ToolLayerScopeConfig_ScopeConfigConnectionId_Call{Call: _e.mock.On("ScopeConfigConnectionId")} +} + +func (_c *ToolLayerScopeConfig_ScopeConfigConnectionId_Call) Run(run func()) *ToolLayerScopeConfig_ScopeConfigConnectionId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScopeConfig_ScopeConfigConnectionId_Call) Return(v uint64) *ToolLayerScopeConfig_ScopeConfigConnectionId_Call { + _c.Call.Return(v) + return _c +} + +func (_c *ToolLayerScopeConfig_ScopeConfigConnectionId_Call) RunAndReturn(run func() uint64) *ToolLayerScopeConfig_ScopeConfigConnectionId_Call { + _c.Call.Return(run) + return _c +} + +// ScopeConfigId provides a mock function for the type ToolLayerScopeConfig +func (_mock *ToolLayerScopeConfig) ScopeConfigId() uint64 { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for ScopeConfigId") + } + + var r0 uint64 + if returnFunc, ok := ret.Get(0).(func() uint64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(uint64) + } + return r0 +} + +// ToolLayerScopeConfig_ScopeConfigId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeConfigId' +type ToolLayerScopeConfig_ScopeConfigId_Call struct { + *mock.Call +} + +// ScopeConfigId is a helper method to define mock.On call +func (_e *ToolLayerScopeConfig_Expecter) ScopeConfigId() *ToolLayerScopeConfig_ScopeConfigId_Call { + return &ToolLayerScopeConfig_ScopeConfigId_Call{Call: _e.mock.On("ScopeConfigId")} +} + +func (_c *ToolLayerScopeConfig_ScopeConfigId_Call) Run(run func()) *ToolLayerScopeConfig_ScopeConfigId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScopeConfig_ScopeConfigId_Call) Return(v uint64) *ToolLayerScopeConfig_ScopeConfigId_Call { + _c.Call.Return(v) + return _c +} + +func (_c *ToolLayerScopeConfig_ScopeConfigId_Call) RunAndReturn(run func() uint64) *ToolLayerScopeConfig_ScopeConfigId_Call { + _c.Call.Return(run) + return _c +} + +// TableName provides a mock function for the type ToolLayerScopeConfig +func (_mock *ToolLayerScopeConfig) TableName() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for TableName") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// ToolLayerScopeConfig_TableName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TableName' +type ToolLayerScopeConfig_TableName_Call struct { + *mock.Call +} + +// TableName is a helper method to define mock.On call +func (_e *ToolLayerScopeConfig_Expecter) TableName() *ToolLayerScopeConfig_TableName_Call { + return &ToolLayerScopeConfig_TableName_Call{Call: _e.mock.On("TableName")} +} + +func (_c *ToolLayerScopeConfig_TableName_Call) Run(run func()) *ToolLayerScopeConfig_TableName_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ToolLayerScopeConfig_TableName_Call) Return(s string) *ToolLayerScopeConfig_TableName_Call { + _c.Call.Return(s) + return _c +} + +func (_c *ToolLayerScopeConfig_TableName_Call) RunAndReturn(run func() string) *ToolLayerScopeConfig_TableName_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/core/runner/mysqlMigratorInternals.go b/backend/mocks/core/runner/mysqlMigratorInternals.go new file mode 100644 index 00000000000..47103c1ec61 --- /dev/null +++ b/backend/mocks/core/runner/mysqlMigratorInternals.go @@ -0,0 +1,200 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" +) + +// newMysqlMigratorInternals creates a new instance of mysqlMigratorInternals. 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 newMysqlMigratorInternals(t interface { + mock.TestingT + Cleanup(func()) +}) *mysqlMigratorInternals { + mock := &mysqlMigratorInternals{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// mysqlMigratorInternals is an autogenerated mock type for the mysqlMigratorInternals type +type mysqlMigratorInternals struct { + mock.Mock +} + +type mysqlMigratorInternals_Expecter struct { + mock *mock.Mock +} + +func (_m *mysqlMigratorInternals) EXPECT() *mysqlMigratorInternals_Expecter { + return &mysqlMigratorInternals_Expecter{mock: &_m.Mock} +} + +// CurrentTable provides a mock function for the type mysqlMigratorInternals +func (_mock *mysqlMigratorInternals) CurrentTable(stmt *gorm.Statement) interface{} { + ret := _mock.Called(stmt) + + if len(ret) == 0 { + panic("no return value specified for CurrentTable") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func(*gorm.Statement) interface{}); ok { + r0 = returnFunc(stmt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// mysqlMigratorInternals_CurrentTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentTable' +type mysqlMigratorInternals_CurrentTable_Call struct { + *mock.Call +} + +// CurrentTable is a helper method to define mock.On call +// - stmt *gorm.Statement +func (_e *mysqlMigratorInternals_Expecter) CurrentTable(stmt any) *mysqlMigratorInternals_CurrentTable_Call { + return &mysqlMigratorInternals_CurrentTable_Call{Call: _e.mock.On("CurrentTable", stmt)} +} + +func (_c *mysqlMigratorInternals_CurrentTable_Call) Run(run func(stmt *gorm.Statement)) *mysqlMigratorInternals_CurrentTable_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *gorm.Statement + if args[0] != nil { + arg0 = args[0].(*gorm.Statement) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *mysqlMigratorInternals_CurrentTable_Call) Return(ifaceVal interface{}) *mysqlMigratorInternals_CurrentTable_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *mysqlMigratorInternals_CurrentTable_Call) RunAndReturn(run func(stmt *gorm.Statement) interface{}) *mysqlMigratorInternals_CurrentTable_Call { + _c.Call.Return(run) + return _c +} + +// FullDataTypeOf provides a mock function for the type mysqlMigratorInternals +func (_mock *mysqlMigratorInternals) FullDataTypeOf(field *schema.Field) clause.Expr { + ret := _mock.Called(field) + + if len(ret) == 0 { + panic("no return value specified for FullDataTypeOf") + } + + var r0 clause.Expr + if returnFunc, ok := ret.Get(0).(func(*schema.Field) clause.Expr); ok { + r0 = returnFunc(field) + } else { + r0 = ret.Get(0).(clause.Expr) + } + return r0 +} + +// mysqlMigratorInternals_FullDataTypeOf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FullDataTypeOf' +type mysqlMigratorInternals_FullDataTypeOf_Call struct { + *mock.Call +} + +// FullDataTypeOf is a helper method to define mock.On call +// - field *schema.Field +func (_e *mysqlMigratorInternals_Expecter) FullDataTypeOf(field any) *mysqlMigratorInternals_FullDataTypeOf_Call { + return &mysqlMigratorInternals_FullDataTypeOf_Call{Call: _e.mock.On("FullDataTypeOf", field)} +} + +func (_c *mysqlMigratorInternals_FullDataTypeOf_Call) Run(run func(field *schema.Field)) *mysqlMigratorInternals_FullDataTypeOf_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *schema.Field + if args[0] != nil { + arg0 = args[0].(*schema.Field) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *mysqlMigratorInternals_FullDataTypeOf_Call) Return(expr clause.Expr) *mysqlMigratorInternals_FullDataTypeOf_Call { + _c.Call.Return(expr) + return _c +} + +func (_c *mysqlMigratorInternals_FullDataTypeOf_Call) RunAndReturn(run func(field *schema.Field) clause.Expr) *mysqlMigratorInternals_FullDataTypeOf_Call { + _c.Call.Return(run) + return _c +} + +// RunWithValue provides a mock function for the type mysqlMigratorInternals +func (_mock *mysqlMigratorInternals) RunWithValue(value interface{}, fc func(*gorm.Statement) error) error { + ret := _mock.Called(value, fc) + + if len(ret) == 0 { + panic("no return value specified for RunWithValue") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(interface{}, func(*gorm.Statement) error) error); ok { + r0 = returnFunc(value, fc) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// mysqlMigratorInternals_RunWithValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunWithValue' +type mysqlMigratorInternals_RunWithValue_Call struct { + *mock.Call +} + +// RunWithValue is a helper method to define mock.On call +// - value interface{} +// - fc func(*gorm.Statement) error +func (_e *mysqlMigratorInternals_Expecter) RunWithValue(value any, fc any) *mysqlMigratorInternals_RunWithValue_Call { + return &mysqlMigratorInternals_RunWithValue_Call{Call: _e.mock.On("RunWithValue", value, fc)} +} + +func (_c *mysqlMigratorInternals_RunWithValue_Call) Run(run func(value interface{}, fc func(*gorm.Statement) error)) *mysqlMigratorInternals_RunWithValue_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 func(*gorm.Statement) error + if args[1] != nil { + arg1 = args[1].(func(*gorm.Statement) error) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *mysqlMigratorInternals_RunWithValue_Call) Return(err error) *mysqlMigratorInternals_RunWithValue_Call { + _c.Call.Return(err) + return _c +} + +func (_c *mysqlMigratorInternals_RunWithValue_Call) RunAndReturn(run func(value interface{}, fc func(*gorm.Statement) error) error) *mysqlMigratorInternals_RunWithValue_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/helpers/pluginhelper/api/CustomMerge.go b/backend/mocks/helpers/pluginhelper/api/CustomMerge.go new file mode 100644 index 00000000000..dc809004797 --- /dev/null +++ b/backend/mocks/helpers/pluginhelper/api/CustomMerge.go @@ -0,0 +1,94 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/dal" + mock "github.com/stretchr/testify/mock" +) + +// NewCustomMerge creates a new instance of CustomMerge. 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 NewCustomMerge[M dal.Tabler](t interface { + mock.TestingT + Cleanup(func()) +}) *CustomMerge[M] { + mock := &CustomMerge[M]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// CustomMerge is an autogenerated mock type for the CustomMerge type +type CustomMerge[M dal.Tabler] struct { + mock.Mock +} + +type CustomMerge_Expecter[M dal.Tabler] struct { + mock *mock.Mock +} + +func (_m *CustomMerge[M]) EXPECT() *CustomMerge_Expecter[M] { + return &CustomMerge_Expecter[M]{mock: &_m.Mock} +} + +// MergeFromRequest provides a mock function for the type CustomMerge +func (_mock *CustomMerge[M]) MergeFromRequest(target *M, body map[string]interface{}) error { + ret := _mock.Called(target, body) + + if len(ret) == 0 { + panic("no return value specified for MergeFromRequest") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*M, map[string]interface{}) error); ok { + r0 = returnFunc(target, body) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// CustomMerge_MergeFromRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MergeFromRequest' +type CustomMerge_MergeFromRequest_Call[M dal.Tabler] struct { + *mock.Call +} + +// MergeFromRequest is a helper method to define mock.On call +// - target *M +// - body map[string]interface{} +func (_e *CustomMerge_Expecter[M]) MergeFromRequest(target any, body any) *CustomMerge_MergeFromRequest_Call[M] { + return &CustomMerge_MergeFromRequest_Call[M]{Call: _e.mock.On("MergeFromRequest", target, body)} +} + +func (_c *CustomMerge_MergeFromRequest_Call[M]) Run(run func(target *M, body map[string]interface{})) *CustomMerge_MergeFromRequest_Call[M] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *M + if args[0] != nil { + arg0 = args[0].(*M) + } + var arg1 map[string]interface{} + if args[1] != nil { + arg1 = args[1].(map[string]interface{}) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *CustomMerge_MergeFromRequest_Call[M]) Return(err error) *CustomMerge_MergeFromRequest_Call[M] { + _c.Call.Return(err) + return _c +} + +func (_c *CustomMerge_MergeFromRequest_Call[M]) RunAndReturn(run func(target *M, body map[string]interface{}) error) *CustomMerge_MergeFromRequest_Call[M] { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/helpers/pluginhelper/api/Iterator.go b/backend/mocks/helpers/pluginhelper/api/Iterator.go new file mode 100644 index 00000000000..8449577bbed --- /dev/null +++ b/backend/mocks/helpers/pluginhelper/api/Iterator.go @@ -0,0 +1,184 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewIterator creates a new instance of Iterator. 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 NewIterator(t interface { + mock.TestingT + Cleanup(func()) +}) *Iterator { + mock := &Iterator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// Iterator is an autogenerated mock type for the Iterator type +type Iterator struct { + mock.Mock +} + +type Iterator_Expecter struct { + mock *mock.Mock +} + +func (_m *Iterator) EXPECT() *Iterator_Expecter { + return &Iterator_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function for the type Iterator +func (_mock *Iterator) Close() errors.Error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func() errors.Error); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// Iterator_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Iterator_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Iterator_Expecter) Close() *Iterator_Close_Call { + return &Iterator_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Iterator_Close_Call) Run(run func()) *Iterator_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Iterator_Close_Call) Return(error errors.Error) *Iterator_Close_Call { + _c.Call.Return(error) + return _c +} + +func (_c *Iterator_Close_Call) RunAndReturn(run func() errors.Error) *Iterator_Close_Call { + _c.Call.Return(run) + return _c +} + +// Fetch provides a mock function for the type Iterator +func (_mock *Iterator) Fetch() (interface{}, errors.Error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Fetch") + } + + var r0 interface{} + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func() (interface{}, errors.Error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + if returnFunc, ok := ret.Get(1).(func() errors.Error); ok { + r1 = returnFunc() + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// Iterator_Fetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fetch' +type Iterator_Fetch_Call struct { + *mock.Call +} + +// Fetch is a helper method to define mock.On call +func (_e *Iterator_Expecter) Fetch() *Iterator_Fetch_Call { + return &Iterator_Fetch_Call{Call: _e.mock.On("Fetch")} +} + +func (_c *Iterator_Fetch_Call) Run(run func()) *Iterator_Fetch_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Iterator_Fetch_Call) Return(ifaceVal interface{}, error errors.Error) *Iterator_Fetch_Call { + _c.Call.Return(ifaceVal, error) + return _c +} + +func (_c *Iterator_Fetch_Call) RunAndReturn(run func() (interface{}, errors.Error)) *Iterator_Fetch_Call { + _c.Call.Return(run) + return _c +} + +// HasNext provides a mock function for the type Iterator +func (_mock *Iterator) HasNext() bool { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for HasNext") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// Iterator_HasNext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasNext' +type Iterator_HasNext_Call struct { + *mock.Call +} + +// HasNext is a helper method to define mock.On call +func (_e *Iterator_Expecter) HasNext() *Iterator_HasNext_Call { + return &Iterator_HasNext_Call{Call: _e.mock.On("HasNext")} +} + +func (_c *Iterator_HasNext_Call) Run(run func()) *Iterator_HasNext_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Iterator_HasNext_Call) Return(b bool) *Iterator_HasNext_Call { + _c.Call.Return(b) + return _c +} + +func (_c *Iterator_HasNext_Call) RunAndReturn(run func() bool) *Iterator_HasNext_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/helpers/pluginhelper/api/QueueNode.go b/backend/mocks/helpers/pluginhelper/api/QueueNode.go new file mode 100644 index 00000000000..26e44061398 --- /dev/null +++ b/backend/mocks/helpers/pluginhelper/api/QueueNode.go @@ -0,0 +1,168 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewQueueNode creates a new instance of QueueNode. 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 NewQueueNode(t interface { + mock.TestingT + Cleanup(func()) +}) *QueueNode { + mock := &QueueNode{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// QueueNode is an autogenerated mock type for the QueueNode type +type QueueNode struct { + mock.Mock +} + +type QueueNode_Expecter struct { + mock *mock.Mock +} + +func (_m *QueueNode) EXPECT() *QueueNode_Expecter { + return &QueueNode_Expecter{mock: &_m.Mock} +} + +// Data provides a mock function for the type QueueNode +func (_mock *QueueNode) Data() interface{} { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Data") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func() interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// QueueNode_Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Data' +type QueueNode_Data_Call struct { + *mock.Call +} + +// Data is a helper method to define mock.On call +func (_e *QueueNode_Expecter) Data() *QueueNode_Data_Call { + return &QueueNode_Data_Call{Call: _e.mock.On("Data")} +} + +func (_c *QueueNode_Data_Call) Run(run func()) *QueueNode_Data_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *QueueNode_Data_Call) Return(ifaceVal interface{}) *QueueNode_Data_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *QueueNode_Data_Call) RunAndReturn(run func() interface{}) *QueueNode_Data_Call { + _c.Call.Return(run) + return _c +} + +// Next provides a mock function for the type QueueNode +func (_mock *QueueNode) Next() interface{} { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Next") + } + + var r0 interface{} + if returnFunc, ok := ret.Get(0).(func() interface{}); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + return r0 +} + +// QueueNode_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next' +type QueueNode_Next_Call struct { + *mock.Call +} + +// Next is a helper method to define mock.On call +func (_e *QueueNode_Expecter) Next() *QueueNode_Next_Call { + return &QueueNode_Next_Call{Call: _e.mock.On("Next")} +} + +func (_c *QueueNode_Next_Call) Run(run func()) *QueueNode_Next_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *QueueNode_Next_Call) Return(ifaceVal interface{}) *QueueNode_Next_Call { + _c.Call.Return(ifaceVal) + return _c +} + +func (_c *QueueNode_Next_Call) RunAndReturn(run func() interface{}) *QueueNode_Next_Call { + _c.Call.Return(run) + return _c +} + +// SetNext provides a mock function for the type QueueNode +func (_mock *QueueNode) SetNext(next interface{}) { + _mock.Called(next) + return +} + +// QueueNode_SetNext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNext' +type QueueNode_SetNext_Call struct { + *mock.Call +} + +// SetNext is a helper method to define mock.On call +// - next interface{} +func (_e *QueueNode_Expecter) SetNext(next any) *QueueNode_SetNext_Call { + return &QueueNode_SetNext_Call{Call: _e.mock.On("SetNext", next)} +} + +func (_c *QueueNode_SetNext_Call) Run(run func(next interface{})) *QueueNode_SetNext_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *QueueNode_SetNext_Call) Return() *QueueNode_SetNext_Call { + _c.Call.Return() + return _c +} + +func (_c *QueueNode_SetNext_Call) RunAndReturn(run func(next interface{})) *QueueNode_SetNext_Call { + _c.Run(run) + return _c +} diff --git a/backend/mocks/helpers/pluginhelper/api/RateLimitedApiClient.go b/backend/mocks/helpers/pluginhelper/api/RateLimitedApiClient.go new file mode 100644 index 00000000000..2d6d2b9ad54 --- /dev/null +++ b/backend/mocks/helpers/pluginhelper/api/RateLimitedApiClient.go @@ -0,0 +1,541 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "net/http" + "net/url" + "time" + + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewRateLimitedApiClient creates a new instance of RateLimitedApiClient. 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 NewRateLimitedApiClient(t interface { + mock.TestingT + Cleanup(func()) +}) *RateLimitedApiClient { + mock := &RateLimitedApiClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// RateLimitedApiClient is an autogenerated mock type for the RateLimitedApiClient type +type RateLimitedApiClient struct { + mock.Mock +} + +type RateLimitedApiClient_Expecter struct { + mock *mock.Mock +} + +func (_m *RateLimitedApiClient) EXPECT() *RateLimitedApiClient_Expecter { + return &RateLimitedApiClient_Expecter{mock: &_m.Mock} +} + +// DoGetAsync provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) DoGetAsync(path string, query url.Values, header http.Header, handler plugin.ApiAsyncCallback) { + _mock.Called(path, query, header, handler) + return +} + +// RateLimitedApiClient_DoGetAsync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoGetAsync' +type RateLimitedApiClient_DoGetAsync_Call struct { + *mock.Call +} + +// DoGetAsync is a helper method to define mock.On call +// - path string +// - query url.Values +// - header http.Header +// - handler plugin.ApiAsyncCallback +func (_e *RateLimitedApiClient_Expecter) DoGetAsync(path any, query any, header any, handler any) *RateLimitedApiClient_DoGetAsync_Call { + return &RateLimitedApiClient_DoGetAsync_Call{Call: _e.mock.On("DoGetAsync", path, query, header, handler)} +} + +func (_c *RateLimitedApiClient_DoGetAsync_Call) Run(run func(path string, query url.Values, header http.Header, handler plugin.ApiAsyncCallback)) *RateLimitedApiClient_DoGetAsync_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 url.Values + if args[1] != nil { + arg1 = args[1].(url.Values) + } + var arg2 http.Header + if args[2] != nil { + arg2 = args[2].(http.Header) + } + var arg3 plugin.ApiAsyncCallback + if args[3] != nil { + arg3 = args[3].(plugin.ApiAsyncCallback) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *RateLimitedApiClient_DoGetAsync_Call) Return() *RateLimitedApiClient_DoGetAsync_Call { + _c.Call.Return() + return _c +} + +func (_c *RateLimitedApiClient_DoGetAsync_Call) RunAndReturn(run func(path string, query url.Values, header http.Header, handler plugin.ApiAsyncCallback)) *RateLimitedApiClient_DoGetAsync_Call { + _c.Run(run) + return _c +} + +// DoPostAsync provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) DoPostAsync(path string, query url.Values, body interface{}, header http.Header, handler plugin.ApiAsyncCallback) { + _mock.Called(path, query, body, header, handler) + return +} + +// RateLimitedApiClient_DoPostAsync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoPostAsync' +type RateLimitedApiClient_DoPostAsync_Call struct { + *mock.Call +} + +// DoPostAsync is a helper method to define mock.On call +// - path string +// - query url.Values +// - body interface{} +// - header http.Header +// - handler plugin.ApiAsyncCallback +func (_e *RateLimitedApiClient_Expecter) DoPostAsync(path any, query any, body any, header any, handler any) *RateLimitedApiClient_DoPostAsync_Call { + return &RateLimitedApiClient_DoPostAsync_Call{Call: _e.mock.On("DoPostAsync", path, query, body, header, handler)} +} + +func (_c *RateLimitedApiClient_DoPostAsync_Call) Run(run func(path string, query url.Values, body interface{}, header http.Header, handler plugin.ApiAsyncCallback)) *RateLimitedApiClient_DoPostAsync_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 url.Values + if args[1] != nil { + arg1 = args[1].(url.Values) + } + var arg2 interface{} + if args[2] != nil { + arg2 = args[2].(interface{}) + } + var arg3 http.Header + if args[3] != nil { + arg3 = args[3].(http.Header) + } + var arg4 plugin.ApiAsyncCallback + if args[4] != nil { + arg4 = args[4].(plugin.ApiAsyncCallback) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) + }) + return _c +} + +func (_c *RateLimitedApiClient_DoPostAsync_Call) Return() *RateLimitedApiClient_DoPostAsync_Call { + _c.Call.Return() + return _c +} + +func (_c *RateLimitedApiClient_DoPostAsync_Call) RunAndReturn(run func(path string, query url.Values, body interface{}, header http.Header, handler plugin.ApiAsyncCallback)) *RateLimitedApiClient_DoPostAsync_Call { + _c.Run(run) + return _c +} + +// GetAfterFunction provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) GetAfterFunction() plugin.ApiClientAfterResponse { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAfterFunction") + } + + var r0 plugin.ApiClientAfterResponse + if returnFunc, ok := ret.Get(0).(func() plugin.ApiClientAfterResponse); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(plugin.ApiClientAfterResponse) + } + } + return r0 +} + +// RateLimitedApiClient_GetAfterFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAfterFunction' +type RateLimitedApiClient_GetAfterFunction_Call struct { + *mock.Call +} + +// GetAfterFunction is a helper method to define mock.On call +func (_e *RateLimitedApiClient_Expecter) GetAfterFunction() *RateLimitedApiClient_GetAfterFunction_Call { + return &RateLimitedApiClient_GetAfterFunction_Call{Call: _e.mock.On("GetAfterFunction")} +} + +func (_c *RateLimitedApiClient_GetAfterFunction_Call) Run(run func()) *RateLimitedApiClient_GetAfterFunction_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RateLimitedApiClient_GetAfterFunction_Call) Return(apiClientAfterResponse plugin.ApiClientAfterResponse) *RateLimitedApiClient_GetAfterFunction_Call { + _c.Call.Return(apiClientAfterResponse) + return _c +} + +func (_c *RateLimitedApiClient_GetAfterFunction_Call) RunAndReturn(run func() plugin.ApiClientAfterResponse) *RateLimitedApiClient_GetAfterFunction_Call { + _c.Call.Return(run) + return _c +} + +// GetNumOfWorkers provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) GetNumOfWorkers() int { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNumOfWorkers") + } + + var r0 int + if returnFunc, ok := ret.Get(0).(func() int); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int) + } + return r0 +} + +// RateLimitedApiClient_GetNumOfWorkers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNumOfWorkers' +type RateLimitedApiClient_GetNumOfWorkers_Call struct { + *mock.Call +} + +// GetNumOfWorkers is a helper method to define mock.On call +func (_e *RateLimitedApiClient_Expecter) GetNumOfWorkers() *RateLimitedApiClient_GetNumOfWorkers_Call { + return &RateLimitedApiClient_GetNumOfWorkers_Call{Call: _e.mock.On("GetNumOfWorkers")} +} + +func (_c *RateLimitedApiClient_GetNumOfWorkers_Call) Run(run func()) *RateLimitedApiClient_GetNumOfWorkers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RateLimitedApiClient_GetNumOfWorkers_Call) Return(n int) *RateLimitedApiClient_GetNumOfWorkers_Call { + _c.Call.Return(n) + return _c +} + +func (_c *RateLimitedApiClient_GetNumOfWorkers_Call) RunAndReturn(run func() int) *RateLimitedApiClient_GetNumOfWorkers_Call { + _c.Call.Return(run) + return _c +} + +// GetTickInterval provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) GetTickInterval() time.Duration { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTickInterval") + } + + var r0 time.Duration + if returnFunc, ok := ret.Get(0).(func() time.Duration); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(time.Duration) + } + return r0 +} + +// RateLimitedApiClient_GetTickInterval_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTickInterval' +type RateLimitedApiClient_GetTickInterval_Call struct { + *mock.Call +} + +// GetTickInterval is a helper method to define mock.On call +func (_e *RateLimitedApiClient_Expecter) GetTickInterval() *RateLimitedApiClient_GetTickInterval_Call { + return &RateLimitedApiClient_GetTickInterval_Call{Call: _e.mock.On("GetTickInterval")} +} + +func (_c *RateLimitedApiClient_GetTickInterval_Call) Run(run func()) *RateLimitedApiClient_GetTickInterval_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RateLimitedApiClient_GetTickInterval_Call) Return(duration time.Duration) *RateLimitedApiClient_GetTickInterval_Call { + _c.Call.Return(duration) + return _c +} + +func (_c *RateLimitedApiClient_GetTickInterval_Call) RunAndReturn(run func() time.Duration) *RateLimitedApiClient_GetTickInterval_Call { + _c.Call.Return(run) + return _c +} + +// HasError provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) HasError() bool { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for HasError") + } + + var r0 bool + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(bool) + } + return r0 +} + +// RateLimitedApiClient_HasError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasError' +type RateLimitedApiClient_HasError_Call struct { + *mock.Call +} + +// HasError is a helper method to define mock.On call +func (_e *RateLimitedApiClient_Expecter) HasError() *RateLimitedApiClient_HasError_Call { + return &RateLimitedApiClient_HasError_Call{Call: _e.mock.On("HasError")} +} + +func (_c *RateLimitedApiClient_HasError_Call) Run(run func()) *RateLimitedApiClient_HasError_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RateLimitedApiClient_HasError_Call) Return(b bool) *RateLimitedApiClient_HasError_Call { + _c.Call.Return(b) + return _c +} + +func (_c *RateLimitedApiClient_HasError_Call) RunAndReturn(run func() bool) *RateLimitedApiClient_HasError_Call { + _c.Call.Return(run) + return _c +} + +// NextTick provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) NextTick(task func() errors.Error) { + _mock.Called(task) + return +} + +// RateLimitedApiClient_NextTick_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextTick' +type RateLimitedApiClient_NextTick_Call struct { + *mock.Call +} + +// NextTick is a helper method to define mock.On call +// - task func() errors.Error +func (_e *RateLimitedApiClient_Expecter) NextTick(task any) *RateLimitedApiClient_NextTick_Call { + return &RateLimitedApiClient_NextTick_Call{Call: _e.mock.On("NextTick", task)} +} + +func (_c *RateLimitedApiClient_NextTick_Call) Run(run func(task func() errors.Error)) *RateLimitedApiClient_NextTick_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 func() errors.Error + if args[0] != nil { + arg0 = args[0].(func() errors.Error) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *RateLimitedApiClient_NextTick_Call) Return() *RateLimitedApiClient_NextTick_Call { + _c.Call.Return() + return _c +} + +func (_c *RateLimitedApiClient_NextTick_Call) RunAndReturn(run func(task func() errors.Error)) *RateLimitedApiClient_NextTick_Call { + _c.Run(run) + return _c +} + +// Release provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) Release() { + _mock.Called() + return +} + +// RateLimitedApiClient_Release_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Release' +type RateLimitedApiClient_Release_Call struct { + *mock.Call +} + +// Release is a helper method to define mock.On call +func (_e *RateLimitedApiClient_Expecter) Release() *RateLimitedApiClient_Release_Call { + return &RateLimitedApiClient_Release_Call{Call: _e.mock.On("Release")} +} + +func (_c *RateLimitedApiClient_Release_Call) Run(run func()) *RateLimitedApiClient_Release_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RateLimitedApiClient_Release_Call) Return() *RateLimitedApiClient_Release_Call { + _c.Call.Return() + return _c +} + +func (_c *RateLimitedApiClient_Release_Call) RunAndReturn(run func()) *RateLimitedApiClient_Release_Call { + _c.Run(run) + return _c +} + +// Reset provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) Reset(d time.Duration) { + _mock.Called(d) + return +} + +// RateLimitedApiClient_Reset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reset' +type RateLimitedApiClient_Reset_Call struct { + *mock.Call +} + +// Reset is a helper method to define mock.On call +// - d time.Duration +func (_e *RateLimitedApiClient_Expecter) Reset(d any) *RateLimitedApiClient_Reset_Call { + return &RateLimitedApiClient_Reset_Call{Call: _e.mock.On("Reset", d)} +} + +func (_c *RateLimitedApiClient_Reset_Call) Run(run func(d time.Duration)) *RateLimitedApiClient_Reset_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 time.Duration + if args[0] != nil { + arg0 = args[0].(time.Duration) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *RateLimitedApiClient_Reset_Call) Return() *RateLimitedApiClient_Reset_Call { + _c.Call.Return() + return _c +} + +func (_c *RateLimitedApiClient_Reset_Call) RunAndReturn(run func(d time.Duration)) *RateLimitedApiClient_Reset_Call { + _c.Run(run) + return _c +} + +// SetAfterFunction provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) SetAfterFunction(callback plugin.ApiClientAfterResponse) { + _mock.Called(callback) + return +} + +// RateLimitedApiClient_SetAfterFunction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAfterFunction' +type RateLimitedApiClient_SetAfterFunction_Call struct { + *mock.Call +} + +// SetAfterFunction is a helper method to define mock.On call +// - callback plugin.ApiClientAfterResponse +func (_e *RateLimitedApiClient_Expecter) SetAfterFunction(callback any) *RateLimitedApiClient_SetAfterFunction_Call { + return &RateLimitedApiClient_SetAfterFunction_Call{Call: _e.mock.On("SetAfterFunction", callback)} +} + +func (_c *RateLimitedApiClient_SetAfterFunction_Call) Run(run func(callback plugin.ApiClientAfterResponse)) *RateLimitedApiClient_SetAfterFunction_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 plugin.ApiClientAfterResponse + if args[0] != nil { + arg0 = args[0].(plugin.ApiClientAfterResponse) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *RateLimitedApiClient_SetAfterFunction_Call) Return() *RateLimitedApiClient_SetAfterFunction_Call { + _c.Call.Return() + return _c +} + +func (_c *RateLimitedApiClient_SetAfterFunction_Call) RunAndReturn(run func(callback plugin.ApiClientAfterResponse)) *RateLimitedApiClient_SetAfterFunction_Call { + _c.Run(run) + return _c +} + +// WaitAsync provides a mock function for the type RateLimitedApiClient +func (_mock *RateLimitedApiClient) WaitAsync() errors.Error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for WaitAsync") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func() errors.Error); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// RateLimitedApiClient_WaitAsync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitAsync' +type RateLimitedApiClient_WaitAsync_Call struct { + *mock.Call +} + +// WaitAsync is a helper method to define mock.On call +func (_e *RateLimitedApiClient_Expecter) WaitAsync() *RateLimitedApiClient_WaitAsync_Call { + return &RateLimitedApiClient_WaitAsync_Call{Call: _e.mock.On("WaitAsync")} +} + +func (_c *RateLimitedApiClient_WaitAsync_Call) Run(run func()) *RateLimitedApiClient_WaitAsync_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RateLimitedApiClient_WaitAsync_Call) Return(error errors.Error) *RateLimitedApiClient_WaitAsync_Call { + _c.Call.Return(error) + return _c +} + +func (_c *RateLimitedApiClient_WaitAsync_Call) RunAndReturn(run func() errors.Error) *RateLimitedApiClient_WaitAsync_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/helpers/pluginhelper/api/ScopeDatabaseHelper.go b/backend/mocks/helpers/pluginhelper/api/ScopeDatabaseHelper.go new file mode 100644 index 00000000000..0ec15cf1e83 --- /dev/null +++ b/backend/mocks/helpers/pluginhelper/api/ScopeDatabaseHelper.go @@ -0,0 +1,602 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewScopeDatabaseHelper creates a new instance of ScopeDatabaseHelper. 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 NewScopeDatabaseHelper[Conn any, Scope plugin.ToolLayerScope, Tr any](t interface { + mock.TestingT + Cleanup(func()) +}) *ScopeDatabaseHelper[Conn, Scope, Tr] { + mock := &ScopeDatabaseHelper[Conn, Scope, Tr]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ScopeDatabaseHelper is an autogenerated mock type for the ScopeDatabaseHelper type +type ScopeDatabaseHelper[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + mock.Mock +} + +type ScopeDatabaseHelper_Expecter[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + mock *mock.Mock +} + +func (_m *ScopeDatabaseHelper[Conn, Scope, Tr]) EXPECT() *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]{mock: &_m.Mock} +} + +// DeleteScope provides a mock function for the type ScopeDatabaseHelper +func (_mock *ScopeDatabaseHelper[Conn, Scope, Tr]) DeleteScope(scope *Scope) errors.Error { + ret := _mock.Called(scope) + + if len(ret) == 0 { + panic("no return value specified for DeleteScope") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(*Scope) errors.Error); ok { + r0 = returnFunc(scope) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// ScopeDatabaseHelper_DeleteScope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteScope' +type ScopeDatabaseHelper_DeleteScope_Call[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + *mock.Call +} + +// DeleteScope is a helper method to define mock.On call +// - scope *Scope +func (_e *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]) DeleteScope(scope any) *ScopeDatabaseHelper_DeleteScope_Call[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_DeleteScope_Call[Conn, Scope, Tr]{Call: _e.mock.On("DeleteScope", scope)} +} + +func (_c *ScopeDatabaseHelper_DeleteScope_Call[Conn, Scope, Tr]) Run(run func(scope *Scope)) *ScopeDatabaseHelper_DeleteScope_Call[Conn, Scope, Tr] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *Scope + if args[0] != nil { + arg0 = args[0].(*Scope) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ScopeDatabaseHelper_DeleteScope_Call[Conn, Scope, Tr]) Return(error errors.Error) *ScopeDatabaseHelper_DeleteScope_Call[Conn, Scope, Tr] { + _c.Call.Return(error) + return _c +} + +func (_c *ScopeDatabaseHelper_DeleteScope_Call[Conn, Scope, Tr]) RunAndReturn(run func(scope *Scope) errors.Error) *ScopeDatabaseHelper_DeleteScope_Call[Conn, Scope, Tr] { + _c.Call.Return(run) + return _c +} + +// GetScope provides a mock function for the type ScopeDatabaseHelper +func (_mock *ScopeDatabaseHelper[Conn, Scope, Tr]) GetScope(connectionId uint64, scopeId string) (*Scope, errors.Error) { + ret := _mock.Called(connectionId, scopeId) + + if len(ret) == 0 { + panic("no return value specified for GetScope") + } + + var r0 *Scope + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(uint64, string) (*Scope, errors.Error)); ok { + return returnFunc(connectionId, scopeId) + } + if returnFunc, ok := ret.Get(0).(func(uint64, string) *Scope); ok { + r0 = returnFunc(connectionId, scopeId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*Scope) + } + } + if returnFunc, ok := ret.Get(1).(func(uint64, string) errors.Error); ok { + r1 = returnFunc(connectionId, scopeId) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// ScopeDatabaseHelper_GetScope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetScope' +type ScopeDatabaseHelper_GetScope_Call[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + *mock.Call +} + +// GetScope is a helper method to define mock.On call +// - connectionId uint64 +// - scopeId string +func (_e *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]) GetScope(connectionId any, scopeId any) *ScopeDatabaseHelper_GetScope_Call[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_GetScope_Call[Conn, Scope, Tr]{Call: _e.mock.On("GetScope", connectionId, scopeId)} +} + +func (_c *ScopeDatabaseHelper_GetScope_Call[Conn, Scope, Tr]) Run(run func(connectionId uint64, scopeId string)) *ScopeDatabaseHelper_GetScope_Call[Conn, Scope, Tr] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 uint64 + if args[0] != nil { + arg0 = args[0].(uint64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *ScopeDatabaseHelper_GetScope_Call[Conn, Scope, Tr]) Return(v *Scope, error errors.Error) *ScopeDatabaseHelper_GetScope_Call[Conn, Scope, Tr] { + _c.Call.Return(v, error) + return _c +} + +func (_c *ScopeDatabaseHelper_GetScope_Call[Conn, Scope, Tr]) RunAndReturn(run func(connectionId uint64, scopeId string) (*Scope, errors.Error)) *ScopeDatabaseHelper_GetScope_Call[Conn, Scope, Tr] { + _c.Call.Return(run) + return _c +} + +// GetScopeAndConfig provides a mock function for the type ScopeDatabaseHelper +func (_mock *ScopeDatabaseHelper[Conn, Scope, Tr]) GetScopeAndConfig(connectionId uint64, scopeId string) (*Scope, *Tr, errors.Error) { + ret := _mock.Called(connectionId, scopeId) + + if len(ret) == 0 { + panic("no return value specified for GetScopeAndConfig") + } + + var r0 *Scope + var r1 *Tr + var r2 errors.Error + if returnFunc, ok := ret.Get(0).(func(uint64, string) (*Scope, *Tr, errors.Error)); ok { + return returnFunc(connectionId, scopeId) + } + if returnFunc, ok := ret.Get(0).(func(uint64, string) *Scope); ok { + r0 = returnFunc(connectionId, scopeId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*Scope) + } + } + if returnFunc, ok := ret.Get(1).(func(uint64, string) *Tr); ok { + r1 = returnFunc(connectionId, scopeId) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*Tr) + } + } + if returnFunc, ok := ret.Get(2).(func(uint64, string) errors.Error); ok { + r2 = returnFunc(connectionId, scopeId) + } else { + if ret.Get(2) != nil { + r2 = ret.Get(2).(errors.Error) + } + } + return r0, r1, r2 +} + +// ScopeDatabaseHelper_GetScopeAndConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetScopeAndConfig' +type ScopeDatabaseHelper_GetScopeAndConfig_Call[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + *mock.Call +} + +// GetScopeAndConfig is a helper method to define mock.On call +// - connectionId uint64 +// - scopeId string +func (_e *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]) GetScopeAndConfig(connectionId any, scopeId any) *ScopeDatabaseHelper_GetScopeAndConfig_Call[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_GetScopeAndConfig_Call[Conn, Scope, Tr]{Call: _e.mock.On("GetScopeAndConfig", connectionId, scopeId)} +} + +func (_c *ScopeDatabaseHelper_GetScopeAndConfig_Call[Conn, Scope, Tr]) Run(run func(connectionId uint64, scopeId string)) *ScopeDatabaseHelper_GetScopeAndConfig_Call[Conn, Scope, Tr] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 uint64 + if args[0] != nil { + arg0 = args[0].(uint64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *ScopeDatabaseHelper_GetScopeAndConfig_Call[Conn, Scope, Tr]) Return(v *Scope, v1 *Tr, error errors.Error) *ScopeDatabaseHelper_GetScopeAndConfig_Call[Conn, Scope, Tr] { + _c.Call.Return(v, v1, error) + return _c +} + +func (_c *ScopeDatabaseHelper_GetScopeAndConfig_Call[Conn, Scope, Tr]) RunAndReturn(run func(connectionId uint64, scopeId string) (*Scope, *Tr, errors.Error)) *ScopeDatabaseHelper_GetScopeAndConfig_Call[Conn, Scope, Tr] { + _c.Call.Return(run) + return _c +} + +// GetScopeConfig provides a mock function for the type ScopeDatabaseHelper +func (_mock *ScopeDatabaseHelper[Conn, Scope, Tr]) GetScopeConfig(ruleId uint64) (*Tr, errors.Error) { + ret := _mock.Called(ruleId) + + if len(ret) == 0 { + panic("no return value specified for GetScopeConfig") + } + + var r0 *Tr + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func(uint64) (*Tr, errors.Error)); ok { + return returnFunc(ruleId) + } + if returnFunc, ok := ret.Get(0).(func(uint64) *Tr); ok { + r0 = returnFunc(ruleId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*Tr) + } + } + if returnFunc, ok := ret.Get(1).(func(uint64) errors.Error); ok { + r1 = returnFunc(ruleId) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// ScopeDatabaseHelper_GetScopeConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetScopeConfig' +type ScopeDatabaseHelper_GetScopeConfig_Call[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + *mock.Call +} + +// GetScopeConfig is a helper method to define mock.On call +// - ruleId uint64 +func (_e *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]) GetScopeConfig(ruleId any) *ScopeDatabaseHelper_GetScopeConfig_Call[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_GetScopeConfig_Call[Conn, Scope, Tr]{Call: _e.mock.On("GetScopeConfig", ruleId)} +} + +func (_c *ScopeDatabaseHelper_GetScopeConfig_Call[Conn, Scope, Tr]) Run(run func(ruleId uint64)) *ScopeDatabaseHelper_GetScopeConfig_Call[Conn, Scope, Tr] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 uint64 + if args[0] != nil { + arg0 = args[0].(uint64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ScopeDatabaseHelper_GetScopeConfig_Call[Conn, Scope, Tr]) Return(v *Tr, error errors.Error) *ScopeDatabaseHelper_GetScopeConfig_Call[Conn, Scope, Tr] { + _c.Call.Return(v, error) + return _c +} + +func (_c *ScopeDatabaseHelper_GetScopeConfig_Call[Conn, Scope, Tr]) RunAndReturn(run func(ruleId uint64) (*Tr, errors.Error)) *ScopeDatabaseHelper_GetScopeConfig_Call[Conn, Scope, Tr] { + _c.Call.Return(run) + return _c +} + +// ListScopeConfigs provides a mock function for the type ScopeDatabaseHelper +func (_mock *ScopeDatabaseHelper[Conn, Scope, Tr]) ListScopeConfigs(ruleIds []uint64) ([]*Tr, errors.Error) { + ret := _mock.Called(ruleIds) + + if len(ret) == 0 { + panic("no return value specified for ListScopeConfigs") + } + + var r0 []*Tr + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func([]uint64) ([]*Tr, errors.Error)); ok { + return returnFunc(ruleIds) + } + if returnFunc, ok := ret.Get(0).(func([]uint64) []*Tr); ok { + r0 = returnFunc(ruleIds) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*Tr) + } + } + if returnFunc, ok := ret.Get(1).(func([]uint64) errors.Error); ok { + r1 = returnFunc(ruleIds) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// ScopeDatabaseHelper_ListScopeConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListScopeConfigs' +type ScopeDatabaseHelper_ListScopeConfigs_Call[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + *mock.Call +} + +// ListScopeConfigs is a helper method to define mock.On call +// - ruleIds []uint64 +func (_e *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]) ListScopeConfigs(ruleIds any) *ScopeDatabaseHelper_ListScopeConfigs_Call[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_ListScopeConfigs_Call[Conn, Scope, Tr]{Call: _e.mock.On("ListScopeConfigs", ruleIds)} +} + +func (_c *ScopeDatabaseHelper_ListScopeConfigs_Call[Conn, Scope, Tr]) Run(run func(ruleIds []uint64)) *ScopeDatabaseHelper_ListScopeConfigs_Call[Conn, Scope, Tr] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []uint64 + if args[0] != nil { + arg0 = args[0].([]uint64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ScopeDatabaseHelper_ListScopeConfigs_Call[Conn, Scope, Tr]) Return(vs []*Tr, error errors.Error) *ScopeDatabaseHelper_ListScopeConfigs_Call[Conn, Scope, Tr] { + _c.Call.Return(vs, error) + return _c +} + +func (_c *ScopeDatabaseHelper_ListScopeConfigs_Call[Conn, Scope, Tr]) RunAndReturn(run func(ruleIds []uint64) ([]*Tr, errors.Error)) *ScopeDatabaseHelper_ListScopeConfigs_Call[Conn, Scope, Tr] { + _c.Call.Return(run) + return _c +} + +// ListScopes provides a mock function for the type ScopeDatabaseHelper +func (_mock *ScopeDatabaseHelper[Conn, Scope, Tr]) ListScopes(input *plugin.ApiResourceInput, connectionId uint64) ([]*Scope, int64, errors.Error) { + ret := _mock.Called(input, connectionId) + + if len(ret) == 0 { + panic("no return value specified for ListScopes") + } + + var r0 []*Scope + var r1 int64 + var r2 errors.Error + if returnFunc, ok := ret.Get(0).(func(*plugin.ApiResourceInput, uint64) ([]*Scope, int64, errors.Error)); ok { + return returnFunc(input, connectionId) + } + if returnFunc, ok := ret.Get(0).(func(*plugin.ApiResourceInput, uint64) []*Scope); ok { + r0 = returnFunc(input, connectionId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*Scope) + } + } + if returnFunc, ok := ret.Get(1).(func(*plugin.ApiResourceInput, uint64) int64); ok { + r1 = returnFunc(input, connectionId) + } else { + r1 = ret.Get(1).(int64) + } + if returnFunc, ok := ret.Get(2).(func(*plugin.ApiResourceInput, uint64) errors.Error); ok { + r2 = returnFunc(input, connectionId) + } else { + if ret.Get(2) != nil { + r2 = ret.Get(2).(errors.Error) + } + } + return r0, r1, r2 +} + +// ScopeDatabaseHelper_ListScopes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListScopes' +type ScopeDatabaseHelper_ListScopes_Call[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + *mock.Call +} + +// ListScopes is a helper method to define mock.On call +// - input *plugin.ApiResourceInput +// - connectionId uint64 +func (_e *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]) ListScopes(input any, connectionId any) *ScopeDatabaseHelper_ListScopes_Call[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_ListScopes_Call[Conn, Scope, Tr]{Call: _e.mock.On("ListScopes", input, connectionId)} +} + +func (_c *ScopeDatabaseHelper_ListScopes_Call[Conn, Scope, Tr]) Run(run func(input *plugin.ApiResourceInput, connectionId uint64)) *ScopeDatabaseHelper_ListScopes_Call[Conn, Scope, Tr] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *plugin.ApiResourceInput + if args[0] != nil { + arg0 = args[0].(*plugin.ApiResourceInput) + } + var arg1 uint64 + if args[1] != nil { + arg1 = args[1].(uint64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *ScopeDatabaseHelper_ListScopes_Call[Conn, Scope, Tr]) Return(vs []*Scope, n int64, error errors.Error) *ScopeDatabaseHelper_ListScopes_Call[Conn, Scope, Tr] { + _c.Call.Return(vs, n, error) + return _c +} + +func (_c *ScopeDatabaseHelper_ListScopes_Call[Conn, Scope, Tr]) RunAndReturn(run func(input *plugin.ApiResourceInput, connectionId uint64) ([]*Scope, int64, errors.Error)) *ScopeDatabaseHelper_ListScopes_Call[Conn, Scope, Tr] { + _c.Call.Return(run) + return _c +} + +// SaveScope provides a mock function for the type ScopeDatabaseHelper +func (_mock *ScopeDatabaseHelper[Conn, Scope, Tr]) SaveScope(scopes []*Scope) errors.Error { + ret := _mock.Called(scopes) + + if len(ret) == 0 { + panic("no return value specified for SaveScope") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func([]*Scope) errors.Error); ok { + r0 = returnFunc(scopes) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// ScopeDatabaseHelper_SaveScope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveScope' +type ScopeDatabaseHelper_SaveScope_Call[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + *mock.Call +} + +// SaveScope is a helper method to define mock.On call +// - scopes []*Scope +func (_e *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]) SaveScope(scopes any) *ScopeDatabaseHelper_SaveScope_Call[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_SaveScope_Call[Conn, Scope, Tr]{Call: _e.mock.On("SaveScope", scopes)} +} + +func (_c *ScopeDatabaseHelper_SaveScope_Call[Conn, Scope, Tr]) Run(run func(scopes []*Scope)) *ScopeDatabaseHelper_SaveScope_Call[Conn, Scope, Tr] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []*Scope + if args[0] != nil { + arg0 = args[0].([]*Scope) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ScopeDatabaseHelper_SaveScope_Call[Conn, Scope, Tr]) Return(error errors.Error) *ScopeDatabaseHelper_SaveScope_Call[Conn, Scope, Tr] { + _c.Call.Return(error) + return _c +} + +func (_c *ScopeDatabaseHelper_SaveScope_Call[Conn, Scope, Tr]) RunAndReturn(run func(scopes []*Scope) errors.Error) *ScopeDatabaseHelper_SaveScope_Call[Conn, Scope, Tr] { + _c.Call.Return(run) + return _c +} + +// UpdateScope provides a mock function for the type ScopeDatabaseHelper +func (_mock *ScopeDatabaseHelper[Conn, Scope, Tr]) UpdateScope(scope *Scope) errors.Error { + ret := _mock.Called(scope) + + if len(ret) == 0 { + panic("no return value specified for UpdateScope") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(*Scope) errors.Error); ok { + r0 = returnFunc(scope) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// ScopeDatabaseHelper_UpdateScope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateScope' +type ScopeDatabaseHelper_UpdateScope_Call[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + *mock.Call +} + +// UpdateScope is a helper method to define mock.On call +// - scope *Scope +func (_e *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]) UpdateScope(scope any) *ScopeDatabaseHelper_UpdateScope_Call[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_UpdateScope_Call[Conn, Scope, Tr]{Call: _e.mock.On("UpdateScope", scope)} +} + +func (_c *ScopeDatabaseHelper_UpdateScope_Call[Conn, Scope, Tr]) Run(run func(scope *Scope)) *ScopeDatabaseHelper_UpdateScope_Call[Conn, Scope, Tr] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *Scope + if args[0] != nil { + arg0 = args[0].(*Scope) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ScopeDatabaseHelper_UpdateScope_Call[Conn, Scope, Tr]) Return(error errors.Error) *ScopeDatabaseHelper_UpdateScope_Call[Conn, Scope, Tr] { + _c.Call.Return(error) + return _c +} + +func (_c *ScopeDatabaseHelper_UpdateScope_Call[Conn, Scope, Tr]) RunAndReturn(run func(scope *Scope) errors.Error) *ScopeDatabaseHelper_UpdateScope_Call[Conn, Scope, Tr] { + _c.Call.Return(run) + return _c +} + +// VerifyConnection provides a mock function for the type ScopeDatabaseHelper +func (_mock *ScopeDatabaseHelper[Conn, Scope, Tr]) VerifyConnection(connectionId uint64) errors.Error { + ret := _mock.Called(connectionId) + + if len(ret) == 0 { + panic("no return value specified for VerifyConnection") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(uint64) errors.Error); ok { + r0 = returnFunc(connectionId) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// ScopeDatabaseHelper_VerifyConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyConnection' +type ScopeDatabaseHelper_VerifyConnection_Call[Conn any, Scope plugin.ToolLayerScope, Tr any] struct { + *mock.Call +} + +// VerifyConnection is a helper method to define mock.On call +// - connectionId uint64 +func (_e *ScopeDatabaseHelper_Expecter[Conn, Scope, Tr]) VerifyConnection(connectionId any) *ScopeDatabaseHelper_VerifyConnection_Call[Conn, Scope, Tr] { + return &ScopeDatabaseHelper_VerifyConnection_Call[Conn, Scope, Tr]{Call: _e.mock.On("VerifyConnection", connectionId)} +} + +func (_c *ScopeDatabaseHelper_VerifyConnection_Call[Conn, Scope, Tr]) Run(run func(connectionId uint64)) *ScopeDatabaseHelper_VerifyConnection_Call[Conn, Scope, Tr] { + _c.Call.Run(func(args mock.Arguments) { + var arg0 uint64 + if args[0] != nil { + arg0 = args[0].(uint64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *ScopeDatabaseHelper_VerifyConnection_Call[Conn, Scope, Tr]) Return(error errors.Error) *ScopeDatabaseHelper_VerifyConnection_Call[Conn, Scope, Tr] { + _c.Call.Return(error) + return _c +} + +func (_c *ScopeDatabaseHelper_VerifyConnection_Call[Conn, Scope, Tr]) RunAndReturn(run func(connectionId uint64) errors.Error) *ScopeDatabaseHelper_VerifyConnection_Call[Conn, Scope, Tr] { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/helpers/pluginhelper/api/TaskOptions.go b/backend/mocks/helpers/pluginhelper/api/TaskOptions.go new file mode 100644 index 00000000000..6dd82a82e5b --- /dev/null +++ b/backend/mocks/helpers/pluginhelper/api/TaskOptions.go @@ -0,0 +1,82 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewTaskOptions creates a new instance of TaskOptions. 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 NewTaskOptions(t interface { + mock.TestingT + Cleanup(func()) +}) *TaskOptions { + mock := &TaskOptions{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// TaskOptions is an autogenerated mock type for the TaskOptions type +type TaskOptions struct { + mock.Mock +} + +type TaskOptions_Expecter struct { + mock *mock.Mock +} + +func (_m *TaskOptions) EXPECT() *TaskOptions_Expecter { + return &TaskOptions_Expecter{mock: &_m.Mock} +} + +// GetParams provides a mock function for the type TaskOptions +func (_mock *TaskOptions) GetParams() any { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetParams") + } + + var r0 any + if returnFunc, ok := ret.Get(0).(func() any); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(any) + } + } + return r0 +} + +// TaskOptions_GetParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParams' +type TaskOptions_GetParams_Call struct { + *mock.Call +} + +// GetParams is a helper method to define mock.On call +func (_e *TaskOptions_Expecter) GetParams() *TaskOptions_GetParams_Call { + return &TaskOptions_GetParams_Call{Call: _e.mock.On("GetParams")} +} + +func (_c *TaskOptions_GetParams_Call) Run(run func()) *TaskOptions_GetParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *TaskOptions_GetParams_Call) Return(anyMoqParam any) *TaskOptions_GetParams_Call { + _c.Call.Return(anyMoqParam) + return _c +} + +func (_c *TaskOptions_GetParams_Call) RunAndReturn(run func() any) *TaskOptions_GetParams_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/helpers/pluginhelper/api/apihelperabstract/ComplexValidate.go b/backend/mocks/helpers/pluginhelper/api/apihelperabstract/ComplexValidate.go new file mode 100644 index 00000000000..ba770bbb121 --- /dev/null +++ b/backend/mocks/helpers/pluginhelper/api/apihelperabstract/ComplexValidate.go @@ -0,0 +1,83 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + mock "github.com/stretchr/testify/mock" +) + +// NewComplexValidate creates a new instance of ComplexValidate. 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 NewComplexValidate(t interface { + mock.TestingT + Cleanup(func()) +}) *ComplexValidate { + mock := &ComplexValidate{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// ComplexValidate is an autogenerated mock type for the ComplexValidate type +type ComplexValidate struct { + mock.Mock +} + +type ComplexValidate_Expecter struct { + mock *mock.Mock +} + +func (_m *ComplexValidate) EXPECT() *ComplexValidate_Expecter { + return &ComplexValidate_Expecter{mock: &_m.Mock} +} + +// Validate provides a mock function for the type ComplexValidate +func (_mock *ComplexValidate) Validate() errors.Error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Validate") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func() errors.Error); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// ComplexValidate_Validate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Validate' +type ComplexValidate_Validate_Call struct { + *mock.Call +} + +// Validate is a helper method to define mock.On call +func (_e *ComplexValidate_Expecter) Validate() *ComplexValidate_Validate_Call { + return &ComplexValidate_Validate_Call{Call: _e.mock.On("Validate")} +} + +func (_c *ComplexValidate_Validate_Call) Run(run func()) *ComplexValidate_Validate_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ComplexValidate_Validate_Call) Return(error errors.Error) *ComplexValidate_Validate_Call { + _c.Call.Return(error) + return _c +} + +func (_c *ComplexValidate_Validate_Call) RunAndReturn(run func() errors.Error) *ComplexValidate_Validate_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/helpers/pluginhelper/subtaskmeta/sorter/SubTaskMetaSorter.go b/backend/mocks/helpers/pluginhelper/subtaskmeta/sorter/SubTaskMetaSorter.go new file mode 100644 index 00000000000..50af9ced6af --- /dev/null +++ b/backend/mocks/helpers/pluginhelper/subtaskmeta/sorter/SubTaskMetaSorter.go @@ -0,0 +1,95 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/apache/devlake/core/plugin" + mock "github.com/stretchr/testify/mock" +) + +// NewSubTaskMetaSorter creates a new instance of SubTaskMetaSorter. 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 NewSubTaskMetaSorter(t interface { + mock.TestingT + Cleanup(func()) +}) *SubTaskMetaSorter { + mock := &SubTaskMetaSorter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// SubTaskMetaSorter is an autogenerated mock type for the SubTaskMetaSorter type +type SubTaskMetaSorter struct { + mock.Mock +} + +type SubTaskMetaSorter_Expecter struct { + mock *mock.Mock +} + +func (_m *SubTaskMetaSorter) EXPECT() *SubTaskMetaSorter_Expecter { + return &SubTaskMetaSorter_Expecter{mock: &_m.Mock} +} + +// Sort provides a mock function for the type SubTaskMetaSorter +func (_mock *SubTaskMetaSorter) Sort() ([]plugin.SubTaskMeta, errors.Error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Sort") + } + + var r0 []plugin.SubTaskMeta + var r1 errors.Error + if returnFunc, ok := ret.Get(0).(func() ([]plugin.SubTaskMeta, errors.Error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []plugin.SubTaskMeta); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]plugin.SubTaskMeta) + } + } + if returnFunc, ok := ret.Get(1).(func() errors.Error); ok { + r1 = returnFunc() + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(errors.Error) + } + } + return r0, r1 +} + +// SubTaskMetaSorter_Sort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sort' +type SubTaskMetaSorter_Sort_Call struct { + *mock.Call +} + +// Sort is a helper method to define mock.On call +func (_e *SubTaskMetaSorter_Expecter) Sort() *SubTaskMetaSorter_Sort_Call { + return &SubTaskMetaSorter_Sort_Call{Call: _e.mock.On("Sort")} +} + +func (_c *SubTaskMetaSorter_Sort_Call) Run(run func()) *SubTaskMetaSorter_Sort_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SubTaskMetaSorter_Sort_Call) Return(subTaskMetas []plugin.SubTaskMeta, error errors.Error) *SubTaskMetaSorter_Sort_Call { + _c.Call.Return(subTaskMetas, error) + return _c +} + +func (_c *SubTaskMetaSorter_Sort_Call) RunAndReturn(run func() ([]plugin.SubTaskMeta, errors.Error)) *SubTaskMetaSorter_Sort_Call { + _c.Call.Return(run) + return _c +} diff --git a/backend/mocks/helpers/srvhelper/CustomValidator.go b/backend/mocks/helpers/srvhelper/CustomValidator.go new file mode 100644 index 00000000000..674b2b23190 --- /dev/null +++ b/backend/mocks/helpers/srvhelper/CustomValidator.go @@ -0,0 +1,97 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "github.com/apache/devlake/core/errors" + "github.com/go-playground/validator/v10" + mock "github.com/stretchr/testify/mock" +) + +// NewCustomValidator creates a new instance of CustomValidator. 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 NewCustomValidator(t interface { + mock.TestingT + Cleanup(func()) +}) *CustomValidator { + mock := &CustomValidator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// CustomValidator is an autogenerated mock type for the CustomValidator type +type CustomValidator struct { + mock.Mock +} + +type CustomValidator_Expecter struct { + mock *mock.Mock +} + +func (_m *CustomValidator) EXPECT() *CustomValidator_Expecter { + return &CustomValidator_Expecter{mock: &_m.Mock} +} + +// CustomValidate provides a mock function for the type CustomValidator +func (_mock *CustomValidator) CustomValidate(entity interface{}, validate *validator.Validate) errors.Error { + ret := _mock.Called(entity, validate) + + if len(ret) == 0 { + panic("no return value specified for CustomValidate") + } + + var r0 errors.Error + if returnFunc, ok := ret.Get(0).(func(interface{}, *validator.Validate) errors.Error); ok { + r0 = returnFunc(entity, validate) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(errors.Error) + } + } + return r0 +} + +// CustomValidator_CustomValidate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CustomValidate' +type CustomValidator_CustomValidate_Call struct { + *mock.Call +} + +// CustomValidate is a helper method to define mock.On call +// - entity interface{} +// - validate *validator.Validate +func (_e *CustomValidator_Expecter) CustomValidate(entity any, validate any) *CustomValidator_CustomValidate_Call { + return &CustomValidator_CustomValidate_Call{Call: _e.mock.On("CustomValidate", entity, validate)} +} + +func (_c *CustomValidator_CustomValidate_Call) Run(run func(entity interface{}, validate *validator.Validate)) *CustomValidator_CustomValidate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + var arg1 *validator.Validate + if args[1] != nil { + arg1 = args[1].(*validator.Validate) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *CustomValidator_CustomValidate_Call) Return(error errors.Error) *CustomValidator_CustomValidate_Call { + _c.Call.Return(error) + return _c +} + +func (_c *CustomValidator_CustomValidate_Call) RunAndReturn(run func(entity interface{}, validate *validator.Validate) errors.Error) *CustomValidator_CustomValidate_Call { + _c.Call.Return(run) + return _c +}