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

package executors

import (
	common "gitlab.com/gitlab-org/gitlab-runner/common"
	buildlogger "gitlab.com/gitlab-org/gitlab-runner/common/buildlogger"

	context "context"

	mock "github.com/stretchr/testify/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 with given fields: _a0, _a1, _a2
func (_m *MockEnvironment) Prepare(_a0 context.Context, _a1 buildlogger.Logger, _a2 common.ExecutorPrepareOptions) (Client, error) {
	ret := _m.Called(_a0, _a1, _a2)

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

	var r0 Client
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, buildlogger.Logger, common.ExecutorPrepareOptions) (Client, error)); ok {
		return rf(_a0, _a1, _a2)
	}
	if rf, ok := ret.Get(0).(func(context.Context, buildlogger.Logger, common.ExecutorPrepareOptions) Client); ok {
		r0 = rf(_a0, _a1, _a2)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(Client)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, buildlogger.Logger, common.ExecutorPrepareOptions) error); ok {
		r1 = rf(_a0, _a1, _a2)
	} 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
//   - _a0 context.Context
//   - _a1 buildlogger.Logger
//   - _a2 common.ExecutorPrepareOptions
func (_e *MockEnvironment_Expecter) Prepare(_a0 interface{}, _a1 interface{}, _a2 interface{}) *MockEnvironment_Prepare_Call {
	return &MockEnvironment_Prepare_Call{Call: _e.mock.On("Prepare", _a0, _a1, _a2)}
}

func (_c *MockEnvironment_Prepare_Call) Run(run func(_a0 context.Context, _a1 buildlogger.Logger, _a2 common.ExecutorPrepareOptions)) *MockEnvironment_Prepare_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(buildlogger.Logger), args[2].(common.ExecutorPrepareOptions))
	})
	return _c
}

func (_c *MockEnvironment_Prepare_Call) Return(_a0 Client, _a1 error) *MockEnvironment_Prepare_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

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

// WithContext provides a mock function with given fields: _a0
func (_m *MockEnvironment) WithContext(_a0 context.Context) (context.Context, context.CancelFunc) {
	ret := _m.Called(_a0)

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

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

	if rf, ok := ret.Get(1).(func(context.Context) context.CancelFunc); ok {
		r1 = rf(_a0)
	} 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
//   - _a0 context.Context
func (_e *MockEnvironment_Expecter) WithContext(_a0 interface{}) *MockEnvironment_WithContext_Call {
	return &MockEnvironment_WithContext_Call{Call: _e.mock.On("WithContext", _a0)}
}

func (_c *MockEnvironment_WithContext_Call) Run(run func(_a0 context.Context)) *MockEnvironment_WithContext_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context))
	})
	return _c
}

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

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

// 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
}
