e4b79e2fc8
* WIP: mutator added, start working on validator * first validator iteration * second validator iteration * wip: working on integration tests * re-working mutation and validation, using Connection interface * fixing some rebase things * fixing integration tests * formatting * fixing unit tests * k8s codegen * linting * moving tests which are available only for enterprise * addressing comments: using repo config for connections, updating tests * addressing comments: adding some more info in the app and installation * fixing app data * addressing comments: updating connection implementation * addressing comments * formatting * fixing tests
144 lines
3.8 KiB
Go
144 lines
3.8 KiB
Go
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
|
|
|
package connection
|
|
|
|
import (
|
|
context "context"
|
|
|
|
v0alpha1 "github.com/grafana/grafana/apps/provisioning/pkg/apis/provisioning/v0alpha1"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockFactory is an autogenerated mock type for the Factory type
|
|
type MockFactory struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockFactory_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockFactory) EXPECT() *MockFactory_Expecter {
|
|
return &MockFactory_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Build provides a mock function with given fields: ctx, r
|
|
func (_m *MockFactory) Build(ctx context.Context, r *v0alpha1.Connection) (Connection, error) {
|
|
ret := _m.Called(ctx, r)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Build")
|
|
}
|
|
|
|
var r0 Connection
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *v0alpha1.Connection) (Connection, error)); ok {
|
|
return rf(ctx, r)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *v0alpha1.Connection) Connection); ok {
|
|
r0 = rf(ctx, r)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(Connection)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *v0alpha1.Connection) error); ok {
|
|
r1 = rf(ctx, r)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockFactory_Build_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Build'
|
|
type MockFactory_Build_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Build is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - r *v0alpha1.Connection
|
|
func (_e *MockFactory_Expecter) Build(ctx interface{}, r interface{}) *MockFactory_Build_Call {
|
|
return &MockFactory_Build_Call{Call: _e.mock.On("Build", ctx, r)}
|
|
}
|
|
|
|
func (_c *MockFactory_Build_Call) Run(run func(ctx context.Context, r *v0alpha1.Connection)) *MockFactory_Build_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(*v0alpha1.Connection))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockFactory_Build_Call) Return(_a0 Connection, _a1 error) *MockFactory_Build_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockFactory_Build_Call) RunAndReturn(run func(context.Context, *v0alpha1.Connection) (Connection, error)) *MockFactory_Build_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Types provides a mock function with no fields
|
|
func (_m *MockFactory) Types() []v0alpha1.ConnectionType {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Types")
|
|
}
|
|
|
|
var r0 []v0alpha1.ConnectionType
|
|
if rf, ok := ret.Get(0).(func() []v0alpha1.ConnectionType); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]v0alpha1.ConnectionType)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// MockFactory_Types_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Types'
|
|
type MockFactory_Types_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Types is a helper method to define mock.On call
|
|
func (_e *MockFactory_Expecter) Types() *MockFactory_Types_Call {
|
|
return &MockFactory_Types_Call{Call: _e.mock.On("Types")}
|
|
}
|
|
|
|
func (_c *MockFactory_Types_Call) Run(run func()) *MockFactory_Types_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockFactory_Types_Call) Return(_a0 []v0alpha1.ConnectionType) *MockFactory_Types_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockFactory_Types_Call) RunAndReturn(run func() []v0alpha1.ConnectionType) *MockFactory_Types_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewMockFactory creates a new instance of MockFactory. 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 NewMockFactory(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockFactory {
|
|
mock := &MockFactory{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|