// Code generated by mockery v2.53.4. DO NOT EDIT.

package controller

import (
	context "context"

	v0alpha1 "github.com/grafana/grafana/apps/provisioning/pkg/apis/provisioning/v0alpha1"
	mock "github.com/stretchr/testify/mock"
)

// MockConnectionTester is an autogenerated mock type for the ConnectionTester type
type MockConnectionTester struct {
	mock.Mock
}

type MockConnectionTester_Expecter struct {
	mock *mock.Mock
}

func (_m *MockConnectionTester) EXPECT() *MockConnectionTester_Expecter {
	return &MockConnectionTester_Expecter{mock: &_m.Mock}
}

// TestConnection provides a mock function with given fields: ctx, conn
func (_m *MockConnectionTester) TestConnection(ctx context.Context, conn *v0alpha1.Connection) (*v0alpha1.TestResults, error) {
	ret := _m.Called(ctx, conn)

	if len(ret) == 0 {
		panic("no return value specified for TestConnection")
	}

	var r0 *v0alpha1.TestResults
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *v0alpha1.Connection) (*v0alpha1.TestResults, error)); ok {
		return rf(ctx, conn)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *v0alpha1.Connection) *v0alpha1.TestResults); ok {
		r0 = rf(ctx, conn)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*v0alpha1.TestResults)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *v0alpha1.Connection) error); ok {
		r1 = rf(ctx, conn)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// MockConnectionTester_TestConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TestConnection'
type MockConnectionTester_TestConnection_Call struct {
	*mock.Call
}

// TestConnection is a helper method to define mock.On call
//   - ctx context.Context
//   - conn *v0alpha1.Connection
func (_e *MockConnectionTester_Expecter) TestConnection(ctx interface{}, conn interface{}) *MockConnectionTester_TestConnection_Call {
	return &MockConnectionTester_TestConnection_Call{Call: _e.mock.On("TestConnection", ctx, conn)}
}

func (_c *MockConnectionTester_TestConnection_Call) Run(run func(ctx context.Context, conn *v0alpha1.Connection)) *MockConnectionTester_TestConnection_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(*v0alpha1.Connection))
	})
	return _c
}

func (_c *MockConnectionTester_TestConnection_Call) Return(_a0 *v0alpha1.TestResults, _a1 error) *MockConnectionTester_TestConnection_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *MockConnectionTester_TestConnection_Call) RunAndReturn(run func(context.Context, *v0alpha1.Connection) (*v0alpha1.TestResults, error)) *MockConnectionTester_TestConnection_Call {
	_c.Call.Return(run)
	return _c
}

// NewMockConnectionTester creates a new instance of MockConnectionTester. 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 NewMockConnectionTester(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockConnectionTester {
	mock := &MockConnectionTester{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
