diff --git a/pkg/sqlutil/mocks/data_source.go b/pkg/sqlutil/mocks/data_source.go index dbb15eab2..40cd9017a 100644 --- a/pkg/sqlutil/mocks/data_source.go +++ b/pkg/sqlutil/mocks/data_source.go @@ -1,762 +1,86 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. - package mocks import ( - context "context" - sql "database/sql" + "context" + "database/sql" + + "github.com/stretchr/testify/mock" - mock "github.com/stretchr/testify/mock" + "github.com/jmoiron/sqlx" - sqlx "github.com/jmoiron/sqlx" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" ) -// DataSource is an autogenerated mock type for the DataSource type +var _ sqlutil.DataSource = &DataSource{} + +// DataSource is a mocked DataSource type. Note: this will only work to satisfy +// the interface, don't expect any of the usual Mock methods such as On() to +// work on it. This is to avoid depending on any particular version of mockery +// (which could be different in different repos making use of this) type DataSource struct { mock.Mock } -type DataSource_Expecter struct { - mock *mock.Mock -} - -func (_m *DataSource) EXPECT() *DataSource_Expecter { - return &DataSource_Expecter{mock: &_m.Mock} -} - // BindNamed provides a mock function with given fields: _a0, _a1 -func (_m *DataSource) BindNamed(_a0 string, _a1 interface{}) (string, []interface{}, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for BindNamed") - } - - var r0 string - var r1 []interface{} - var r2 error - if rf, ok := ret.Get(0).(func(string, interface{}) (string, []interface{}, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(string, interface{}) string); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(string, interface{}) []interface{}); ok { - r1 = rf(_a0, _a1) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).([]interface{}) - } - } - - if rf, ok := ret.Get(2).(func(string, interface{}) error); ok { - r2 = rf(_a0, _a1) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// DataSource_BindNamed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BindNamed' -type DataSource_BindNamed_Call struct { - *mock.Call -} - -// BindNamed is a helper method to define mock.On call -// - _a0 string -// - _a1 interface{} -func (_e *DataSource_Expecter) BindNamed(_a0 interface{}, _a1 interface{}) *DataSource_BindNamed_Call { - return &DataSource_BindNamed_Call{Call: _e.mock.On("BindNamed", _a0, _a1)} -} - -func (_c *DataSource_BindNamed_Call) Run(run func(_a0 string, _a1 interface{})) *DataSource_BindNamed_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(interface{})) - }) - return _c -} - -func (_c *DataSource_BindNamed_Call) Return(_a0 string, _a1 []interface{}, _a2 error) *DataSource_BindNamed_Call { - _c.Call.Return(_a0, _a1, _a2) - return _c -} - -func (_c *DataSource_BindNamed_Call) RunAndReturn(run func(string, interface{}) (string, []interface{}, error)) *DataSource_BindNamed_Call { - _c.Call.Return(run) - return _c +func (ds *DataSource) BindNamed(_a0 string, _a1 interface{}) (string, []interface{}, error) { + return "", nil, nil } // DriverName provides a mock function with given fields: -func (_m *DataSource) DriverName() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DriverName") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// DataSource_DriverName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DriverName' -type DataSource_DriverName_Call struct { - *mock.Call -} - -// DriverName is a helper method to define mock.On call -func (_e *DataSource_Expecter) DriverName() *DataSource_DriverName_Call { - return &DataSource_DriverName_Call{Call: _e.mock.On("DriverName")} -} - -func (_c *DataSource_DriverName_Call) Run(run func()) *DataSource_DriverName_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DataSource_DriverName_Call) Return(_a0 string) *DataSource_DriverName_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DataSource_DriverName_Call) RunAndReturn(run func() string) *DataSource_DriverName_Call { - _c.Call.Return(run) - return _c +func (ds *DataSource) DriverName() string { + return "" } // ExecContext provides a mock function with given fields: ctx, query, args -func (_m *DataSource) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) { - var _ca []interface{} - _ca = append(_ca, ctx, query) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for ExecContext") - } - - var r0 sql.Result - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (sql.Result, error)); ok { - return rf(ctx, query, args...) - } - if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) sql.Result); ok { - r0 = rf(ctx, query, args...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(sql.Result) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { - r1 = rf(ctx, query, args...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DataSource_ExecContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecContext' -type DataSource_ExecContext_Call struct { - *mock.Call -} - -// ExecContext is a helper method to define mock.On call -// - ctx context.Context -// - query string -// - args ...interface{} -func (_e *DataSource_Expecter) ExecContext(ctx interface{}, query interface{}, args ...interface{}) *DataSource_ExecContext_Call { - return &DataSource_ExecContext_Call{Call: _e.mock.On("ExecContext", - append([]interface{}{ctx, query}, args...)...)} -} - -func (_c *DataSource_ExecContext_Call) Run(run func(ctx context.Context, query string, args ...interface{})) *DataSource_ExecContext_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]interface{}, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(interface{}) - } - } - run(args[0].(context.Context), args[1].(string), variadicArgs...) - }) - return _c -} - -func (_c *DataSource_ExecContext_Call) Return(_a0 sql.Result, _a1 error) *DataSource_ExecContext_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DataSource_ExecContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (sql.Result, error)) *DataSource_ExecContext_Call { - _c.Call.Return(run) - return _c +func (ds *DataSource) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) { + return nil, nil } // GetContext provides a mock function with given fields: ctx, dest, query, args -func (_m *DataSource) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error { - var _ca []interface{} - _ca = append(_ca, ctx, dest, query) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for GetContext") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, interface{}, string, ...interface{}) error); ok { - r0 = rf(ctx, dest, query, args...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DataSource_GetContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetContext' -type DataSource_GetContext_Call struct { - *mock.Call -} - -// GetContext is a helper method to define mock.On call -// - ctx context.Context -// - dest interface{} -// - query string -// - args ...interface{} -func (_e *DataSource_Expecter) GetContext(ctx interface{}, dest interface{}, query interface{}, args ...interface{}) *DataSource_GetContext_Call { - return &DataSource_GetContext_Call{Call: _e.mock.On("GetContext", - append([]interface{}{ctx, dest, query}, args...)...)} -} - -func (_c *DataSource_GetContext_Call) Run(run func(ctx context.Context, dest interface{}, query string, args ...interface{})) *DataSource_GetContext_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]interface{}, len(args)-3) - for i, a := range args[3:] { - if a != nil { - variadicArgs[i] = a.(interface{}) - } - } - run(args[0].(context.Context), args[1].(interface{}), args[2].(string), variadicArgs...) - }) - return _c -} - -func (_c *DataSource_GetContext_Call) Return(_a0 error) *DataSource_GetContext_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DataSource_GetContext_Call) RunAndReturn(run func(context.Context, interface{}, string, ...interface{}) error) *DataSource_GetContext_Call { - _c.Call.Return(run) - return _c +func (ds *DataSource) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error { + return nil } // NamedExecContext provides a mock function with given fields: ctx, query, arg -func (_m *DataSource) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) { - ret := _m.Called(ctx, query, arg) - - if len(ret) == 0 { - panic("no return value specified for NamedExecContext") - } - - var r0 sql.Result - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, interface{}) (sql.Result, error)); ok { - return rf(ctx, query, arg) - } - if rf, ok := ret.Get(0).(func(context.Context, string, interface{}) sql.Result); ok { - r0 = rf(ctx, query, arg) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(sql.Result) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, interface{}) error); ok { - r1 = rf(ctx, query, arg) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DataSource_NamedExecContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NamedExecContext' -type DataSource_NamedExecContext_Call struct { - *mock.Call -} - -// NamedExecContext is a helper method to define mock.On call -// - ctx context.Context -// - query string -// - arg interface{} -func (_e *DataSource_Expecter) NamedExecContext(ctx interface{}, query interface{}, arg interface{}) *DataSource_NamedExecContext_Call { - return &DataSource_NamedExecContext_Call{Call: _e.mock.On("NamedExecContext", ctx, query, arg)} -} - -func (_c *DataSource_NamedExecContext_Call) Run(run func(ctx context.Context, query string, arg interface{})) *DataSource_NamedExecContext_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(interface{})) - }) - return _c -} - -func (_c *DataSource_NamedExecContext_Call) Return(_a0 sql.Result, _a1 error) *DataSource_NamedExecContext_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DataSource_NamedExecContext_Call) RunAndReturn(run func(context.Context, string, interface{}) (sql.Result, error)) *DataSource_NamedExecContext_Call { - _c.Call.Return(run) - return _c +func (ds *DataSource) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) { + return nil, nil } // PrepareContext provides a mock function with given fields: ctx, query -func (_m *DataSource) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) { - ret := _m.Called(ctx, query) - - if len(ret) == 0 { - panic("no return value specified for PrepareContext") - } - - var r0 *sql.Stmt - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*sql.Stmt, error)); ok { - return rf(ctx, query) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *sql.Stmt); ok { - r0 = rf(ctx, query) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*sql.Stmt) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, query) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DataSource_PrepareContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareContext' -type DataSource_PrepareContext_Call struct { - *mock.Call +func (ds *DataSource) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) { + return nil, nil } -// PrepareContext is a helper method to define mock.On call -// - ctx context.Context -// - query string -func (_e *DataSource_Expecter) PrepareContext(ctx interface{}, query interface{}) *DataSource_PrepareContext_Call { - return &DataSource_PrepareContext_Call{Call: _e.mock.On("PrepareContext", ctx, query)} -} - -func (_c *DataSource_PrepareContext_Call) Run(run func(ctx context.Context, query string)) *DataSource_PrepareContext_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *DataSource_PrepareContext_Call) Return(_a0 *sql.Stmt, _a1 error) *DataSource_PrepareContext_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DataSource_PrepareContext_Call) RunAndReturn(run func(context.Context, string) (*sql.Stmt, error)) *DataSource_PrepareContext_Call { - _c.Call.Return(run) - return _c -} - -// PrepareNamedContext provides a mock function with given fields: ctx, query func (_m *DataSource) PrepareNamedContext(ctx context.Context, query string) (*sqlx.NamedStmt, error) { - ret := _m.Called(ctx, query) - - if len(ret) == 0 { - panic("no return value specified for PrepareNamedContext") - } - - var r0 *sqlx.NamedStmt - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*sqlx.NamedStmt, error)); ok { - return rf(ctx, query) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *sqlx.NamedStmt); ok { - r0 = rf(ctx, query) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*sqlx.NamedStmt) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, query) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DataSource_PrepareNamedContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareNamedContext' -type DataSource_PrepareNamedContext_Call struct { - *mock.Call -} - -// PrepareNamedContext is a helper method to define mock.On call -// - ctx context.Context -// - query string -func (_e *DataSource_Expecter) PrepareNamedContext(ctx interface{}, query interface{}) *DataSource_PrepareNamedContext_Call { - return &DataSource_PrepareNamedContext_Call{Call: _e.mock.On("PrepareNamedContext", ctx, query)} -} - -func (_c *DataSource_PrepareNamedContext_Call) Run(run func(ctx context.Context, query string)) *DataSource_PrepareNamedContext_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *DataSource_PrepareNamedContext_Call) Return(_a0 *sqlx.NamedStmt, _a1 error) *DataSource_PrepareNamedContext_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DataSource_PrepareNamedContext_Call) RunAndReturn(run func(context.Context, string) (*sqlx.NamedStmt, error)) *DataSource_PrepareNamedContext_Call { - _c.Call.Return(run) - return _c + return nil, nil } // QueryContext provides a mock function with given fields: ctx, query, args -func (_m *DataSource) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) { - var _ca []interface{} - _ca = append(_ca, ctx, query) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for QueryContext") - } - - var r0 *sql.Rows - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (*sql.Rows, error)); ok { - return rf(ctx, query, args...) - } - if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) *sql.Rows); ok { - r0 = rf(ctx, query, args...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*sql.Rows) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { - r1 = rf(ctx, query, args...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DataSource_QueryContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryContext' -type DataSource_QueryContext_Call struct { - *mock.Call -} - -// QueryContext is a helper method to define mock.On call -// - ctx context.Context -// - query string -// - args ...interface{} -func (_e *DataSource_Expecter) QueryContext(ctx interface{}, query interface{}, args ...interface{}) *DataSource_QueryContext_Call { - return &DataSource_QueryContext_Call{Call: _e.mock.On("QueryContext", - append([]interface{}{ctx, query}, args...)...)} -} - -func (_c *DataSource_QueryContext_Call) Run(run func(ctx context.Context, query string, args ...interface{})) *DataSource_QueryContext_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]interface{}, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(interface{}) - } - } - run(args[0].(context.Context), args[1].(string), variadicArgs...) - }) - return _c -} - -func (_c *DataSource_QueryContext_Call) Return(_a0 *sql.Rows, _a1 error) *DataSource_QueryContext_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DataSource_QueryContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (*sql.Rows, error)) *DataSource_QueryContext_Call { - _c.Call.Return(run) - return _c +func (ds *DataSource) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) { + return nil, nil } // QueryRowxContext provides a mock function with given fields: ctx, query, args -func (_m *DataSource) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row { - var _ca []interface{} - _ca = append(_ca, ctx, query) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for QueryRowxContext") - } - - var r0 *sqlx.Row - if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) *sqlx.Row); ok { - r0 = rf(ctx, query, args...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*sqlx.Row) - } - } - - return r0 -} - -// DataSource_QueryRowxContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryRowxContext' -type DataSource_QueryRowxContext_Call struct { - *mock.Call -} - -// QueryRowxContext is a helper method to define mock.On call -// - ctx context.Context -// - query string -// - args ...interface{} -func (_e *DataSource_Expecter) QueryRowxContext(ctx interface{}, query interface{}, args ...interface{}) *DataSource_QueryRowxContext_Call { - return &DataSource_QueryRowxContext_Call{Call: _e.mock.On("QueryRowxContext", - append([]interface{}{ctx, query}, args...)...)} -} - -func (_c *DataSource_QueryRowxContext_Call) Run(run func(ctx context.Context, query string, args ...interface{})) *DataSource_QueryRowxContext_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]interface{}, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(interface{}) - } - } - run(args[0].(context.Context), args[1].(string), variadicArgs...) - }) - return _c -} - -func (_c *DataSource_QueryRowxContext_Call) Return(_a0 *sqlx.Row) *DataSource_QueryRowxContext_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DataSource_QueryRowxContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) *sqlx.Row) *DataSource_QueryRowxContext_Call { - _c.Call.Return(run) - return _c +func (ds *DataSource) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row { + return nil } // QueryxContext provides a mock function with given fields: ctx, query, args -func (_m *DataSource) QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error) { - var _ca []interface{} - _ca = append(_ca, ctx, query) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for QueryxContext") - } - - var r0 *sqlx.Rows - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (*sqlx.Rows, error)); ok { - return rf(ctx, query, args...) - } - if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) *sqlx.Rows); ok { - r0 = rf(ctx, query, args...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*sqlx.Rows) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, ...interface{}) error); ok { - r1 = rf(ctx, query, args...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DataSource_QueryxContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryxContext' -type DataSource_QueryxContext_Call struct { - *mock.Call -} - -// QueryxContext is a helper method to define mock.On call -// - ctx context.Context -// - query string -// - args ...interface{} -func (_e *DataSource_Expecter) QueryxContext(ctx interface{}, query interface{}, args ...interface{}) *DataSource_QueryxContext_Call { - return &DataSource_QueryxContext_Call{Call: _e.mock.On("QueryxContext", - append([]interface{}{ctx, query}, args...)...)} -} - -func (_c *DataSource_QueryxContext_Call) Run(run func(ctx context.Context, query string, args ...interface{})) *DataSource_QueryxContext_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]interface{}, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(interface{}) - } - } - run(args[0].(context.Context), args[1].(string), variadicArgs...) - }) - return _c -} - -func (_c *DataSource_QueryxContext_Call) Return(_a0 *sqlx.Rows, _a1 error) *DataSource_QueryxContext_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DataSource_QueryxContext_Call) RunAndReturn(run func(context.Context, string, ...interface{}) (*sqlx.Rows, error)) *DataSource_QueryxContext_Call { - _c.Call.Return(run) - return _c +func (ds *DataSource) QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error) { + return nil, nil } // Rebind provides a mock function with given fields: _a0 -func (_m *DataSource) Rebind(_a0 string) string { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Rebind") - } - - var r0 string - if rf, ok := ret.Get(0).(func(string) string); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// DataSource_Rebind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rebind' -type DataSource_Rebind_Call struct { - *mock.Call -} - -// Rebind is a helper method to define mock.On call -// - _a0 string -func (_e *DataSource_Expecter) Rebind(_a0 interface{}) *DataSource_Rebind_Call { - return &DataSource_Rebind_Call{Call: _e.mock.On("Rebind", _a0)} -} - -func (_c *DataSource_Rebind_Call) Run(run func(_a0 string)) *DataSource_Rebind_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *DataSource_Rebind_Call) Return(_a0 string) *DataSource_Rebind_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DataSource_Rebind_Call) RunAndReturn(run func(string) string) *DataSource_Rebind_Call { - _c.Call.Return(run) - return _c +func (ds *DataSource) Rebind(_a0 string) string { + return "" } // SelectContext provides a mock function with given fields: ctx, dest, query, args -func (_m *DataSource) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error { - var _ca []interface{} - _ca = append(_ca, ctx, dest, query) - _ca = append(_ca, args...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for SelectContext") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, interface{}, string, ...interface{}) error); ok { - r0 = rf(ctx, dest, query, args...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DataSource_SelectContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SelectContext' -type DataSource_SelectContext_Call struct { - *mock.Call +func (ds *DataSource) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error { + return nil } -// SelectContext is a helper method to define mock.On call -// - ctx context.Context -// - dest interface{} -// - query string -// - args ...interface{} -func (_e *DataSource_Expecter) SelectContext(ctx interface{}, dest interface{}, query interface{}, args ...interface{}) *DataSource_SelectContext_Call { - return &DataSource_SelectContext_Call{Call: _e.mock.On("SelectContext", - append([]interface{}{ctx, dest, query}, args...)...)} -} - -func (_c *DataSource_SelectContext_Call) Run(run func(ctx context.Context, dest interface{}, query string, args ...interface{})) *DataSource_SelectContext_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]interface{}, len(args)-3) - for i, a := range args[3:] { - if a != nil { - variadicArgs[i] = a.(interface{}) - } - } - run(args[0].(context.Context), args[1].(interface{}), args[2].(string), variadicArgs...) - }) - return _c -} - -func (_c *DataSource_SelectContext_Call) Return(_a0 error) *DataSource_SelectContext_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DataSource_SelectContext_Call) RunAndReturn(run func(context.Context, interface{}, string, ...interface{}) error) *DataSource_SelectContext_Call { - _c.Call.Return(run) - return _c -} - -// NewDataSource creates a new instance of DataSource. 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 NewDataSource(t interface { - mock.TestingT - Cleanup(func()) -}) *DataSource { - mock := &DataSource{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock +// NewDataSource creates a new instance of DataSource. +func NewDataSource() *DataSource { + return &DataSource{} }