// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package executors

import (
	"context"
	"net"

	mock "github.com/stretchr/testify/mock"
	"gitlab.com/gitlab-org/gitlab-runner/common"
	"gitlab.com/gitlab-org/gitlab-runner/common/buildlogger"
)

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

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

	return mock
}

// MockEnvironment is an autogenerated mock type for the Environment type
type MockEnvironment struct {
	mock.Mock
}

type MockEnvironment_Expecter struct {
	mock *mock.Mock
}

func (_m *MockEnvironment) EXPECT() *MockEnvironment_Expecter {
	return &MockEnvironment_Expecter{mock: &_m.Mock}
}

// Prepare provides a mock function for the type MockEnvironment
func (_mock *MockEnvironment) Prepare(context1 context.Context, logger buildlogger.Logger, executorPrepareOptions common.ExecutorPrepareOptions) (Client, error) {
	ret := _mock.Called(context1, logger, executorPrepareOptions)

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

	var r0 Client
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, buildlogger.Logger, common.ExecutorPrepareOptions) (Client, error)); ok {
		return returnFunc(context1, logger, executorPrepareOptions)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, buildlogger.Logger, common.ExecutorPrepareOptions) Client); ok {
		r0 = returnFunc(context1, logger, executorPrepareOptions)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(Client)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, buildlogger.Logger, common.ExecutorPrepareOptions) error); ok {
		r1 = returnFunc(context1, logger, executorPrepareOptions)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Prepare is a helper method to define mock.On call
//   - context1 context.Context
//   - logger buildlogger.Logger
//   - executorPrepareOptions common.ExecutorPrepareOptions
func (_e *MockEnvironment_Expecter) Prepare(context1 interface{}, logger interface{}, executorPrepareOptions interface{}) *MockEnvironment_Prepare_Call {
	return &MockEnvironment_Prepare_Call{Call: _e.mock.On("Prepare", context1, logger, executorPrepareOptions)}
}

func (_c *MockEnvironment_Prepare_Call) Run(run func(context1 context.Context, logger buildlogger.Logger, executorPrepareOptions common.ExecutorPrepareOptions)) *MockEnvironment_Prepare_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 buildlogger.Logger
		if args[1] != nil {
			arg1 = args[1].(buildlogger.Logger)
		}
		var arg2 common.ExecutorPrepareOptions
		if args[2] != nil {
			arg2 = args[2].(common.ExecutorPrepareOptions)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *MockEnvironment_Prepare_Call) Return(client Client, err error) *MockEnvironment_Prepare_Call {
	_c.Call.Return(client, err)
	return _c
}

func (_c *MockEnvironment_Prepare_Call) RunAndReturn(run func(context1 context.Context, logger buildlogger.Logger, executorPrepareOptions common.ExecutorPrepareOptions) (Client, error)) *MockEnvironment_Prepare_Call {
	_c.Call.Return(run)
	return _c
}

// WithContext provides a mock function for the type MockEnvironment
func (_mock *MockEnvironment) WithContext(context1 context.Context) (context.Context, context.CancelFunc) {
	ret := _mock.Called(context1)

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

	var r0 context.Context
	var r1 context.CancelFunc
	if returnFunc, ok := ret.Get(0).(func(context.Context) (context.Context, context.CancelFunc)); ok {
		return returnFunc(context1)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context) context.Context); ok {
		r0 = returnFunc(context1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(context.Context)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context) context.CancelFunc); ok {
		r1 = returnFunc(context1)
	} else {
		if ret.Get(1) != nil {
			r1 = ret.Get(1).(context.CancelFunc)
		}
	}
	return r0, r1
}

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

// WithContext is a helper method to define mock.On call
//   - context1 context.Context
func (_e *MockEnvironment_Expecter) WithContext(context1 interface{}) *MockEnvironment_WithContext_Call {
	return &MockEnvironment_WithContext_Call{Call: _e.mock.On("WithContext", context1)}
}

func (_c *MockEnvironment_WithContext_Call) Run(run func(context1 context.Context)) *MockEnvironment_WithContext_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *MockEnvironment_WithContext_Call) Return(context11 context.Context, cancelFunc context.CancelFunc) *MockEnvironment_WithContext_Call {
	_c.Call.Return(context11, cancelFunc)
	return _c
}

func (_c *MockEnvironment_WithContext_Call) RunAndReturn(run func(context1 context.Context) (context.Context, context.CancelFunc)) *MockEnvironment_WithContext_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}

// MockClient is an autogenerated mock type for the Client type
type MockClient struct {
	mock.Mock
}

type MockClient_Expecter struct {
	mock *mock.Mock
}

func (_m *MockClient) EXPECT() *MockClient_Expecter {
	return &MockClient_Expecter{mock: &_m.Mock}
}

// Close provides a mock function for the type MockClient
func (_mock *MockClient) 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
}

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

// Close is a helper method to define mock.On call
func (_e *MockClient_Expecter) Close() *MockClient_Close_Call {
	return &MockClient_Close_Call{Call: _e.mock.On("Close")}
}

func (_c *MockClient_Close_Call) Run(run func()) *MockClient_Close_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockClient_Close_Call) Return(err error) *MockClient_Close_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *MockClient_Close_Call) RunAndReturn(run func() error) *MockClient_Close_Call {
	_c.Call.Return(run)
	return _c
}

// Dial provides a mock function for the type MockClient
func (_mock *MockClient) Dial(n string, addr string) (net.Conn, error) {
	ret := _mock.Called(n, addr)

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

	var r0 net.Conn
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(string, string) (net.Conn, error)); ok {
		return returnFunc(n, addr)
	}
	if returnFunc, ok := ret.Get(0).(func(string, string) net.Conn); ok {
		r0 = returnFunc(n, addr)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(net.Conn)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(string, string) error); ok {
		r1 = returnFunc(n, addr)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Dial is a helper method to define mock.On call
//   - n string
//   - addr string
func (_e *MockClient_Expecter) Dial(n interface{}, addr interface{}) *MockClient_Dial_Call {
	return &MockClient_Dial_Call{Call: _e.mock.On("Dial", n, addr)}
}

func (_c *MockClient_Dial_Call) Run(run func(n string, addr string)) *MockClient_Dial_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 *MockClient_Dial_Call) Return(conn net.Conn, err error) *MockClient_Dial_Call {
	_c.Call.Return(conn, err)
	return _c
}

func (_c *MockClient_Dial_Call) RunAndReturn(run func(n string, addr string) (net.Conn, error)) *MockClient_Dial_Call {
	_c.Call.Return(run)
	return _c
}

// DialRun provides a mock function for the type MockClient
func (_mock *MockClient) DialRun(context1 context.Context, s string) (net.Conn, error) {
	ret := _mock.Called(context1, s)

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

	var r0 net.Conn
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (net.Conn, error)); ok {
		return returnFunc(context1, s)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) net.Conn); ok {
		r0 = returnFunc(context1, s)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(net.Conn)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(context1, s)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// DialRun is a helper method to define mock.On call
//   - context1 context.Context
//   - s string
func (_e *MockClient_Expecter) DialRun(context1 interface{}, s interface{}) *MockClient_DialRun_Call {
	return &MockClient_DialRun_Call{Call: _e.mock.On("DialRun", context1, s)}
}

func (_c *MockClient_DialRun_Call) Run(run func(context1 context.Context, s string)) *MockClient_DialRun_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *MockClient_DialRun_Call) Return(conn net.Conn, err error) *MockClient_DialRun_Call {
	_c.Call.Return(conn, err)
	return _c
}

func (_c *MockClient_DialRun_Call) RunAndReturn(run func(context1 context.Context, s string) (net.Conn, error)) *MockClient_DialRun_Call {
	_c.Call.Return(run)
	return _c
}

// Run provides a mock function for the type MockClient
func (_mock *MockClient) Run(context1 context.Context, runOptions RunOptions) error {
	ret := _mock.Called(context1, runOptions)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, RunOptions) error); ok {
		r0 = returnFunc(context1, runOptions)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Run is a helper method to define mock.On call
//   - context1 context.Context
//   - runOptions RunOptions
func (_e *MockClient_Expecter) Run(context1 interface{}, runOptions interface{}) *MockClient_Run_Call {
	return &MockClient_Run_Call{Call: _e.mock.On("Run", context1, runOptions)}
}

func (_c *MockClient_Run_Call) Run(run func(context1 context.Context, runOptions RunOptions)) *MockClient_Run_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 RunOptions
		if args[1] != nil {
			arg1 = args[1].(RunOptions)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *MockClient_Run_Call) Return(err error) *MockClient_Run_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *MockClient_Run_Call) RunAndReturn(run func(context1 context.Context, runOptions RunOptions) error) *MockClient_Run_Call {
	_c.Call.Return(run)
	return _c
}
