common/mock_Executor.go (223 lines of code) (raw):
// Code generated by mockery v2.53.3. DO NOT EDIT.
package common
import mock "github.com/stretchr/testify/mock"
// MockExecutor is an autogenerated mock type for the Executor type
type MockExecutor struct {
mock.Mock
}
type MockExecutor_Expecter struct {
mock *mock.Mock
}
func (_m *MockExecutor) EXPECT() *MockExecutor_Expecter {
return &MockExecutor_Expecter{mock: &_m.Mock}
}
// Cleanup provides a mock function with no fields
func (_m *MockExecutor) Cleanup() {
_m.Called()
}
// MockExecutor_Cleanup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cleanup'
type MockExecutor_Cleanup_Call struct {
*mock.Call
}
// Cleanup is a helper method to define mock.On call
func (_e *MockExecutor_Expecter) Cleanup() *MockExecutor_Cleanup_Call {
return &MockExecutor_Cleanup_Call{Call: _e.mock.On("Cleanup")}
}
func (_c *MockExecutor_Cleanup_Call) Run(run func()) *MockExecutor_Cleanup_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockExecutor_Cleanup_Call) Return() *MockExecutor_Cleanup_Call {
_c.Call.Return()
return _c
}
func (_c *MockExecutor_Cleanup_Call) RunAndReturn(run func()) *MockExecutor_Cleanup_Call {
_c.Run(run)
return _c
}
// Finish provides a mock function with given fields: err
func (_m *MockExecutor) Finish(err error) {
_m.Called(err)
}
// MockExecutor_Finish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Finish'
type MockExecutor_Finish_Call struct {
*mock.Call
}
// Finish is a helper method to define mock.On call
// - err error
func (_e *MockExecutor_Expecter) Finish(err interface{}) *MockExecutor_Finish_Call {
return &MockExecutor_Finish_Call{Call: _e.mock.On("Finish", err)}
}
func (_c *MockExecutor_Finish_Call) Run(run func(err error)) *MockExecutor_Finish_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(error))
})
return _c
}
func (_c *MockExecutor_Finish_Call) Return() *MockExecutor_Finish_Call {
_c.Call.Return()
return _c
}
func (_c *MockExecutor_Finish_Call) RunAndReturn(run func(error)) *MockExecutor_Finish_Call {
_c.Run(run)
return _c
}
// GetCurrentStage provides a mock function with no fields
func (_m *MockExecutor) GetCurrentStage() ExecutorStage {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetCurrentStage")
}
var r0 ExecutorStage
if rf, ok := ret.Get(0).(func() ExecutorStage); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(ExecutorStage)
}
return r0
}
// MockExecutor_GetCurrentStage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCurrentStage'
type MockExecutor_GetCurrentStage_Call struct {
*mock.Call
}
// GetCurrentStage is a helper method to define mock.On call
func (_e *MockExecutor_Expecter) GetCurrentStage() *MockExecutor_GetCurrentStage_Call {
return &MockExecutor_GetCurrentStage_Call{Call: _e.mock.On("GetCurrentStage")}
}
func (_c *MockExecutor_GetCurrentStage_Call) Run(run func()) *MockExecutor_GetCurrentStage_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockExecutor_GetCurrentStage_Call) Return(_a0 ExecutorStage) *MockExecutor_GetCurrentStage_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockExecutor_GetCurrentStage_Call) RunAndReturn(run func() ExecutorStage) *MockExecutor_GetCurrentStage_Call {
_c.Call.Return(run)
return _c
}
// Prepare provides a mock function with given fields: options
func (_m *MockExecutor) Prepare(options ExecutorPrepareOptions) error {
ret := _m.Called(options)
if len(ret) == 0 {
panic("no return value specified for Prepare")
}
var r0 error
if rf, ok := ret.Get(0).(func(ExecutorPrepareOptions) error); ok {
r0 = rf(options)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockExecutor_Prepare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Prepare'
type MockExecutor_Prepare_Call struct {
*mock.Call
}
// Prepare is a helper method to define mock.On call
// - options ExecutorPrepareOptions
func (_e *MockExecutor_Expecter) Prepare(options interface{}) *MockExecutor_Prepare_Call {
return &MockExecutor_Prepare_Call{Call: _e.mock.On("Prepare", options)}
}
func (_c *MockExecutor_Prepare_Call) Run(run func(options ExecutorPrepareOptions)) *MockExecutor_Prepare_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(ExecutorPrepareOptions))
})
return _c
}
func (_c *MockExecutor_Prepare_Call) Return(_a0 error) *MockExecutor_Prepare_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockExecutor_Prepare_Call) RunAndReturn(run func(ExecutorPrepareOptions) error) *MockExecutor_Prepare_Call {
_c.Call.Return(run)
return _c
}
// Run provides a mock function with given fields: cmd
func (_m *MockExecutor) Run(cmd ExecutorCommand) error {
ret := _m.Called(cmd)
if len(ret) == 0 {
panic("no return value specified for Run")
}
var r0 error
if rf, ok := ret.Get(0).(func(ExecutorCommand) error); ok {
r0 = rf(cmd)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockExecutor_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run'
type MockExecutor_Run_Call struct {
*mock.Call
}
// Run is a helper method to define mock.On call
// - cmd ExecutorCommand
func (_e *MockExecutor_Expecter) Run(cmd interface{}) *MockExecutor_Run_Call {
return &MockExecutor_Run_Call{Call: _e.mock.On("Run", cmd)}
}
func (_c *MockExecutor_Run_Call) Run(run func(cmd ExecutorCommand)) *MockExecutor_Run_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(ExecutorCommand))
})
return _c
}
func (_c *MockExecutor_Run_Call) Return(_a0 error) *MockExecutor_Run_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockExecutor_Run_Call) RunAndReturn(run func(ExecutorCommand) error) *MockExecutor_Run_Call {
_c.Call.Return(run)
return _c
}
// SetCurrentStage provides a mock function with given fields: stage
func (_m *MockExecutor) SetCurrentStage(stage ExecutorStage) {
_m.Called(stage)
}
// MockExecutor_SetCurrentStage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCurrentStage'
type MockExecutor_SetCurrentStage_Call struct {
*mock.Call
}
// SetCurrentStage is a helper method to define mock.On call
// - stage ExecutorStage
func (_e *MockExecutor_Expecter) SetCurrentStage(stage interface{}) *MockExecutor_SetCurrentStage_Call {
return &MockExecutor_SetCurrentStage_Call{Call: _e.mock.On("SetCurrentStage", stage)}
}
func (_c *MockExecutor_SetCurrentStage_Call) Run(run func(stage ExecutorStage)) *MockExecutor_SetCurrentStage_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(ExecutorStage))
})
return _c
}
func (_c *MockExecutor_SetCurrentStage_Call) Return() *MockExecutor_SetCurrentStage_Call {
_c.Call.Return()
return _c
}
func (_c *MockExecutor_SetCurrentStage_Call) RunAndReturn(run func(ExecutorStage)) *MockExecutor_SetCurrentStage_Call {
_c.Run(run)
return _c
}
// Shell provides a mock function with no fields
func (_m *MockExecutor) Shell() *ShellScriptInfo {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Shell")
}
var r0 *ShellScriptInfo
if rf, ok := ret.Get(0).(func() *ShellScriptInfo); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*ShellScriptInfo)
}
}
return r0
}
// MockExecutor_Shell_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shell'
type MockExecutor_Shell_Call struct {
*mock.Call
}
// Shell is a helper method to define mock.On call
func (_e *MockExecutor_Expecter) Shell() *MockExecutor_Shell_Call {
return &MockExecutor_Shell_Call{Call: _e.mock.On("Shell")}
}
func (_c *MockExecutor_Shell_Call) Run(run func()) *MockExecutor_Shell_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockExecutor_Shell_Call) Return(_a0 *ShellScriptInfo) *MockExecutor_Shell_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockExecutor_Shell_Call) RunAndReturn(run func() *ShellScriptInfo) *MockExecutor_Shell_Call {
_c.Call.Return(run)
return _c
}
// NewMockExecutor creates a new instance of MockExecutor. 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 NewMockExecutor(t interface {
mock.TestingT
Cleanup(func())
}) *MockExecutor {
mock := &MockExecutor{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}