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

package exec

import (
	"context"
	"net"
	"time"

	mock "github.com/stretchr/testify/mock"
	"gitlab.com/gitlab-org/gitlab-runner/executors/docker/internal/wait"
)

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

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

	return mock
}

// mockConn is an autogenerated mock type for the conn type
type mockConn struct {
	mock.Mock
}

type mockConn_Expecter struct {
	mock *mock.Mock
}

func (_m *mockConn) EXPECT() *mockConn_Expecter {
	return &mockConn_Expecter{mock: &_m.Mock}
}

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

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

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

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

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

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

// LocalAddr provides a mock function for the type mockConn
func (_mock *mockConn) LocalAddr() net.Addr {
	ret := _mock.Called()

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

	var r0 net.Addr
	if returnFunc, ok := ret.Get(0).(func() net.Addr); ok {
		r0 = returnFunc()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(net.Addr)
		}
	}
	return r0
}

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

// LocalAddr is a helper method to define mock.On call
func (_e *mockConn_Expecter) LocalAddr() *mockConn_LocalAddr_Call {
	return &mockConn_LocalAddr_Call{Call: _e.mock.On("LocalAddr")}
}

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

func (_c *mockConn_LocalAddr_Call) Return(addr net.Addr) *mockConn_LocalAddr_Call {
	_c.Call.Return(addr)
	return _c
}

func (_c *mockConn_LocalAddr_Call) RunAndReturn(run func() net.Addr) *mockConn_LocalAddr_Call {
	_c.Call.Return(run)
	return _c
}

// Read provides a mock function for the type mockConn
func (_mock *mockConn) Read(b []byte) (int, error) {
	ret := _mock.Called(b)

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

	var r0 int
	var r1 error
	if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok {
		return returnFunc(b)
	}
	if returnFunc, ok := ret.Get(0).(func([]byte) int); ok {
		r0 = returnFunc(b)
	} else {
		r0 = ret.Get(0).(int)
	}
	if returnFunc, ok := ret.Get(1).(func([]byte) error); ok {
		r1 = returnFunc(b)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Read is a helper method to define mock.On call
//   - b []byte
func (_e *mockConn_Expecter) Read(b interface{}) *mockConn_Read_Call {
	return &mockConn_Read_Call{Call: _e.mock.On("Read", b)}
}

func (_c *mockConn_Read_Call) Run(run func(b []byte)) *mockConn_Read_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 []byte
		if args[0] != nil {
			arg0 = args[0].([]byte)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *mockConn_Read_Call) Return(n int, err error) *mockConn_Read_Call {
	_c.Call.Return(n, err)
	return _c
}

func (_c *mockConn_Read_Call) RunAndReturn(run func(b []byte) (int, error)) *mockConn_Read_Call {
	_c.Call.Return(run)
	return _c
}

// RemoteAddr provides a mock function for the type mockConn
func (_mock *mockConn) RemoteAddr() net.Addr {
	ret := _mock.Called()

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

	var r0 net.Addr
	if returnFunc, ok := ret.Get(0).(func() net.Addr); ok {
		r0 = returnFunc()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(net.Addr)
		}
	}
	return r0
}

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

// RemoteAddr is a helper method to define mock.On call
func (_e *mockConn_Expecter) RemoteAddr() *mockConn_RemoteAddr_Call {
	return &mockConn_RemoteAddr_Call{Call: _e.mock.On("RemoteAddr")}
}

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

func (_c *mockConn_RemoteAddr_Call) Return(addr net.Addr) *mockConn_RemoteAddr_Call {
	_c.Call.Return(addr)
	return _c
}

func (_c *mockConn_RemoteAddr_Call) RunAndReturn(run func() net.Addr) *mockConn_RemoteAddr_Call {
	_c.Call.Return(run)
	return _c
}

// SetDeadline provides a mock function for the type mockConn
func (_mock *mockConn) SetDeadline(t time.Time) error {
	ret := _mock.Called(t)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(time.Time) error); ok {
		r0 = returnFunc(t)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// SetDeadline is a helper method to define mock.On call
//   - t time.Time
func (_e *mockConn_Expecter) SetDeadline(t interface{}) *mockConn_SetDeadline_Call {
	return &mockConn_SetDeadline_Call{Call: _e.mock.On("SetDeadline", t)}
}

func (_c *mockConn_SetDeadline_Call) Run(run func(t time.Time)) *mockConn_SetDeadline_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 time.Time
		if args[0] != nil {
			arg0 = args[0].(time.Time)
		}
		run(
			arg0,
		)
	})
	return _c
}

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

func (_c *mockConn_SetDeadline_Call) RunAndReturn(run func(t time.Time) error) *mockConn_SetDeadline_Call {
	_c.Call.Return(run)
	return _c
}

// SetReadDeadline provides a mock function for the type mockConn
func (_mock *mockConn) SetReadDeadline(t time.Time) error {
	ret := _mock.Called(t)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(time.Time) error); ok {
		r0 = returnFunc(t)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// SetReadDeadline is a helper method to define mock.On call
//   - t time.Time
func (_e *mockConn_Expecter) SetReadDeadline(t interface{}) *mockConn_SetReadDeadline_Call {
	return &mockConn_SetReadDeadline_Call{Call: _e.mock.On("SetReadDeadline", t)}
}

func (_c *mockConn_SetReadDeadline_Call) Run(run func(t time.Time)) *mockConn_SetReadDeadline_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 time.Time
		if args[0] != nil {
			arg0 = args[0].(time.Time)
		}
		run(
			arg0,
		)
	})
	return _c
}

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

func (_c *mockConn_SetReadDeadline_Call) RunAndReturn(run func(t time.Time) error) *mockConn_SetReadDeadline_Call {
	_c.Call.Return(run)
	return _c
}

// SetWriteDeadline provides a mock function for the type mockConn
func (_mock *mockConn) SetWriteDeadline(t time.Time) error {
	ret := _mock.Called(t)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(time.Time) error); ok {
		r0 = returnFunc(t)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// SetWriteDeadline is a helper method to define mock.On call
//   - t time.Time
func (_e *mockConn_Expecter) SetWriteDeadline(t interface{}) *mockConn_SetWriteDeadline_Call {
	return &mockConn_SetWriteDeadline_Call{Call: _e.mock.On("SetWriteDeadline", t)}
}

func (_c *mockConn_SetWriteDeadline_Call) Run(run func(t time.Time)) *mockConn_SetWriteDeadline_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 time.Time
		if args[0] != nil {
			arg0 = args[0].(time.Time)
		}
		run(
			arg0,
		)
	})
	return _c
}

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

func (_c *mockConn_SetWriteDeadline_Call) RunAndReturn(run func(t time.Time) error) *mockConn_SetWriteDeadline_Call {
	_c.Call.Return(run)
	return _c
}

// Write provides a mock function for the type mockConn
func (_mock *mockConn) Write(b []byte) (int, error) {
	ret := _mock.Called(b)

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

	var r0 int
	var r1 error
	if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok {
		return returnFunc(b)
	}
	if returnFunc, ok := ret.Get(0).(func([]byte) int); ok {
		r0 = returnFunc(b)
	} else {
		r0 = ret.Get(0).(int)
	}
	if returnFunc, ok := ret.Get(1).(func([]byte) error); ok {
		r1 = returnFunc(b)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Write is a helper method to define mock.On call
//   - b []byte
func (_e *mockConn_Expecter) Write(b interface{}) *mockConn_Write_Call {
	return &mockConn_Write_Call{Call: _e.mock.On("Write", b)}
}

func (_c *mockConn_Write_Call) Run(run func(b []byte)) *mockConn_Write_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 []byte
		if args[0] != nil {
			arg0 = args[0].([]byte)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *mockConn_Write_Call) Return(n int, err error) *mockConn_Write_Call {
	_c.Call.Return(n, err)
	return _c
}

func (_c *mockConn_Write_Call) RunAndReturn(run func(b []byte) (int, error)) *mockConn_Write_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}

// mockReader is an autogenerated mock type for the reader type
type mockReader struct {
	mock.Mock
}

type mockReader_Expecter struct {
	mock *mock.Mock
}

func (_m *mockReader) EXPECT() *mockReader_Expecter {
	return &mockReader_Expecter{mock: &_m.Mock}
}

// Read provides a mock function for the type mockReader
func (_mock *mockReader) Read(p []byte) (int, error) {
	ret := _mock.Called(p)

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

	var r0 int
	var r1 error
	if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok {
		return returnFunc(p)
	}
	if returnFunc, ok := ret.Get(0).(func([]byte) int); ok {
		r0 = returnFunc(p)
	} else {
		r0 = ret.Get(0).(int)
	}
	if returnFunc, ok := ret.Get(1).(func([]byte) error); ok {
		r1 = returnFunc(p)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Read is a helper method to define mock.On call
//   - p []byte
func (_e *mockReader_Expecter) Read(p interface{}) *mockReader_Read_Call {
	return &mockReader_Read_Call{Call: _e.mock.On("Read", p)}
}

func (_c *mockReader_Read_Call) Run(run func(p []byte)) *mockReader_Read_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 []byte
		if args[0] != nil {
			arg0 = args[0].([]byte)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *mockReader_Read_Call) Return(n int, err error) *mockReader_Read_Call {
	_c.Call.Return(n, err)
	return _c
}

func (_c *mockReader_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *mockReader_Read_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}

// MockDocker is an autogenerated mock type for the Docker type
type MockDocker struct {
	mock.Mock
}

type MockDocker_Expecter struct {
	mock *mock.Mock
}

func (_m *MockDocker) EXPECT() *MockDocker_Expecter {
	return &MockDocker_Expecter{mock: &_m.Mock}
}

// Exec provides a mock function for the type MockDocker
func (_mock *MockDocker) Exec(ctx context.Context, containerID string, streams IOStreams, gracefulExitFunc wait.GracefulExitFunc) error {
	ret := _mock.Called(ctx, containerID, streams, gracefulExitFunc)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, IOStreams, wait.GracefulExitFunc) error); ok {
		r0 = returnFunc(ctx, containerID, streams, gracefulExitFunc)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Exec is a helper method to define mock.On call
//   - ctx context.Context
//   - containerID string
//   - streams IOStreams
//   - gracefulExitFunc wait.GracefulExitFunc
func (_e *MockDocker_Expecter) Exec(ctx interface{}, containerID interface{}, streams interface{}, gracefulExitFunc interface{}) *MockDocker_Exec_Call {
	return &MockDocker_Exec_Call{Call: _e.mock.On("Exec", ctx, containerID, streams, gracefulExitFunc)}
}

func (_c *MockDocker_Exec_Call) Run(run func(ctx context.Context, containerID string, streams IOStreams, gracefulExitFunc wait.GracefulExitFunc)) *MockDocker_Exec_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)
		}
		var arg2 IOStreams
		if args[2] != nil {
			arg2 = args[2].(IOStreams)
		}
		var arg3 wait.GracefulExitFunc
		if args[3] != nil {
			arg3 = args[3].(wait.GracefulExitFunc)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
		)
	})
	return _c
}

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

func (_c *MockDocker_Exec_Call) RunAndReturn(run func(ctx context.Context, containerID string, streams IOStreams, gracefulExitFunc wait.GracefulExitFunc) error) *MockDocker_Exec_Call {
	_c.Call.Return(run)
	return _c
}
