// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "github.com/bnema/dumber/internal/application/port" "github.com/bnema/dumber/internal/domain/entity" mock "github.com/stretchr/testify/mock" ) // NewMockUpdateChecker creates a new instance of MockUpdateChecker. 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 NewMockUpdateChecker(t interface { mock.TestingT Cleanup(func()) }) *MockUpdateChecker { mock := &MockUpdateChecker{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockUpdateChecker is an autogenerated mock type for the UpdateChecker type type MockUpdateChecker struct { mock.Mock } type MockUpdateChecker_Expecter struct { mock *mock.Mock } func (_m *MockUpdateChecker) EXPECT() *MockUpdateChecker_Expecter { return &MockUpdateChecker_Expecter{mock: &_m.Mock} } // CheckForUpdate provides a mock function for the type MockUpdateChecker func (_mock *MockUpdateChecker) CheckForUpdate(ctx context.Context, currentVersion string) (*entity.UpdateInfo, error) { ret := _mock.Called(ctx, currentVersion) if len(ret) == 0 { panic("no return value specified for CheckForUpdate") } var r0 *entity.UpdateInfo var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.UpdateInfo, error)); ok { return returnFunc(ctx, currentVersion) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.UpdateInfo); ok { r0 = returnFunc(ctx, currentVersion) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*entity.UpdateInfo) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = returnFunc(ctx, currentVersion) } else { r1 = ret.Error(1) } return r0, r1 } // MockUpdateChecker_CheckForUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckForUpdate' type MockUpdateChecker_CheckForUpdate_Call struct { *mock.Call } // CheckForUpdate is a helper method to define mock.On call // - ctx context.Context // - currentVersion string func (_e *MockUpdateChecker_Expecter) CheckForUpdate(ctx any, currentVersion any) *MockUpdateChecker_CheckForUpdate_Call { return &MockUpdateChecker_CheckForUpdate_Call{Call: _e.mock.On("CheckForUpdate", ctx, currentVersion)} } func (_c *MockUpdateChecker_CheckForUpdate_Call) Run(run func(ctx context.Context, currentVersion string)) *MockUpdateChecker_CheckForUpdate_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 *MockUpdateChecker_CheckForUpdate_Call) Return(updateInfo *entity.UpdateInfo, err error) *MockUpdateChecker_CheckForUpdate_Call { _c.Call.Return(updateInfo, err) return _c } func (_c *MockUpdateChecker_CheckForUpdate_Call) RunAndReturn(run func(ctx context.Context, currentVersion string) (*entity.UpdateInfo, error)) *MockUpdateChecker_CheckForUpdate_Call { _c.Call.Return(run) return _c } // NewMockUpdateDownloader creates a new instance of MockUpdateDownloader. 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 NewMockUpdateDownloader(t interface { mock.TestingT Cleanup(func()) }) *MockUpdateDownloader { mock := &MockUpdateDownloader{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockUpdateDownloader is an autogenerated mock type for the UpdateDownloader type type MockUpdateDownloader struct { mock.Mock } type MockUpdateDownloader_Expecter struct { mock *mock.Mock } func (_m *MockUpdateDownloader) EXPECT() *MockUpdateDownloader_Expecter { return &MockUpdateDownloader_Expecter{mock: &_m.Mock} } // Download provides a mock function for the type MockUpdateDownloader func (_mock *MockUpdateDownloader) Download(ctx context.Context, downloadURL string, destDir string) (string, error) { ret := _mock.Called(ctx, downloadURL, destDir) if len(ret) == 0 { panic("no return value specified for Download") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { return returnFunc(ctx, downloadURL, destDir) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) string); ok { r0 = returnFunc(ctx, downloadURL, destDir) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = returnFunc(ctx, downloadURL, destDir) } else { r1 = ret.Error(1) } return r0, r1 } // MockUpdateDownloader_Download_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Download' type MockUpdateDownloader_Download_Call struct { *mock.Call } // Download is a helper method to define mock.On call // - ctx context.Context // - downloadURL string // - destDir string func (_e *MockUpdateDownloader_Expecter) Download(ctx any, downloadURL any, destDir any) *MockUpdateDownloader_Download_Call { return &MockUpdateDownloader_Download_Call{Call: _e.mock.On("Download", ctx, downloadURL, destDir)} } func (_c *MockUpdateDownloader_Download_Call) Run(run func(ctx context.Context, downloadURL string, destDir string)) *MockUpdateDownloader_Download_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 string if args[2] != nil { arg2 = args[2].(string) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MockUpdateDownloader_Download_Call) Return(archivePath string, err error) *MockUpdateDownloader_Download_Call { _c.Call.Return(archivePath, err) return _c } func (_c *MockUpdateDownloader_Download_Call) RunAndReturn(run func(ctx context.Context, downloadURL string, destDir string) (string, error)) *MockUpdateDownloader_Download_Call { _c.Call.Return(run) return _c } // Extract provides a mock function for the type MockUpdateDownloader func (_mock *MockUpdateDownloader) Extract(ctx context.Context, archivePath string, destDir string) (string, error) { ret := _mock.Called(ctx, archivePath, destDir) if len(ret) == 0 { panic("no return value specified for Extract") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { return returnFunc(ctx, archivePath, destDir) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) string); ok { r0 = returnFunc(ctx, archivePath, destDir) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = returnFunc(ctx, archivePath, destDir) } else { r1 = ret.Error(1) } return r0, r1 } // MockUpdateDownloader_Extract_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Extract' type MockUpdateDownloader_Extract_Call struct { *mock.Call } // Extract is a helper method to define mock.On call // - ctx context.Context // - archivePath string // - destDir string func (_e *MockUpdateDownloader_Expecter) Extract(ctx any, archivePath any, destDir any) *MockUpdateDownloader_Extract_Call { return &MockUpdateDownloader_Extract_Call{Call: _e.mock.On("Extract", ctx, archivePath, destDir)} } func (_c *MockUpdateDownloader_Extract_Call) Run(run func(ctx context.Context, archivePath string, destDir string)) *MockUpdateDownloader_Extract_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 string if args[2] != nil { arg2 = args[2].(string) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MockUpdateDownloader_Extract_Call) Return(binaryPath string, err error) *MockUpdateDownloader_Extract_Call { _c.Call.Return(binaryPath, err) return _c } func (_c *MockUpdateDownloader_Extract_Call) RunAndReturn(run func(ctx context.Context, archivePath string, destDir string) (string, error)) *MockUpdateDownloader_Extract_Call { _c.Call.Return(run) return _c } // NewMockUpdateApplier creates a new instance of MockUpdateApplier. 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 NewMockUpdateApplier(t interface { mock.TestingT Cleanup(func()) }) *MockUpdateApplier { mock := &MockUpdateApplier{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockUpdateApplier is an autogenerated mock type for the UpdateApplier type type MockUpdateApplier struct { mock.Mock } type MockUpdateApplier_Expecter struct { mock *mock.Mock } func (_m *MockUpdateApplier) EXPECT() *MockUpdateApplier_Expecter { return &MockUpdateApplier_Expecter{mock: &_m.Mock} } // ApplyOnExit provides a mock function for the type MockUpdateApplier func (_mock *MockUpdateApplier) ApplyOnExit(ctx context.Context) (string, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for ApplyOnExit") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) (string, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) string); ok { r0 = returnFunc(ctx) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockUpdateApplier_ApplyOnExit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyOnExit' type MockUpdateApplier_ApplyOnExit_Call struct { *mock.Call } // ApplyOnExit is a helper method to define mock.On call // - ctx context.Context func (_e *MockUpdateApplier_Expecter) ApplyOnExit(ctx any) *MockUpdateApplier_ApplyOnExit_Call { return &MockUpdateApplier_ApplyOnExit_Call{Call: _e.mock.On("ApplyOnExit", ctx)} } func (_c *MockUpdateApplier_ApplyOnExit_Call) Run(run func(ctx context.Context)) *MockUpdateApplier_ApplyOnExit_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 *MockUpdateApplier_ApplyOnExit_Call) Return(backupPath string, err error) *MockUpdateApplier_ApplyOnExit_Call { _c.Call.Return(backupPath, err) return _c } func (_c *MockUpdateApplier_ApplyOnExit_Call) RunAndReturn(run func(ctx context.Context) (string, error)) *MockUpdateApplier_ApplyOnExit_Call { _c.Call.Return(run) return _c } // CanSelfUpdate provides a mock function for the type MockUpdateApplier func (_mock *MockUpdateApplier) CanSelfUpdate(ctx context.Context) bool { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for CanSelfUpdate") } var r0 bool if returnFunc, ok := ret.Get(0).(func(context.Context) bool); ok { r0 = returnFunc(ctx) } else { r0 = ret.Get(0).(bool) } return r0 } // MockUpdateApplier_CanSelfUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CanSelfUpdate' type MockUpdateApplier_CanSelfUpdate_Call struct { *mock.Call } // CanSelfUpdate is a helper method to define mock.On call // - ctx context.Context func (_e *MockUpdateApplier_Expecter) CanSelfUpdate(ctx any) *MockUpdateApplier_CanSelfUpdate_Call { return &MockUpdateApplier_CanSelfUpdate_Call{Call: _e.mock.On("CanSelfUpdate", ctx)} } func (_c *MockUpdateApplier_CanSelfUpdate_Call) Run(run func(ctx context.Context)) *MockUpdateApplier_CanSelfUpdate_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 *MockUpdateApplier_CanSelfUpdate_Call) Return(b bool) *MockUpdateApplier_CanSelfUpdate_Call { _c.Call.Return(b) return _c } func (_c *MockUpdateApplier_CanSelfUpdate_Call) RunAndReturn(run func(ctx context.Context) bool) *MockUpdateApplier_CanSelfUpdate_Call { _c.Call.Return(run) return _c } // ClearStagedUpdate provides a mock function for the type MockUpdateApplier func (_mock *MockUpdateApplier) ClearStagedUpdate(ctx context.Context) error { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for ClearStagedUpdate") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { r0 = returnFunc(ctx) } else { r0 = ret.Error(0) } return r0 } // MockUpdateApplier_ClearStagedUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClearStagedUpdate' type MockUpdateApplier_ClearStagedUpdate_Call struct { *mock.Call } // ClearStagedUpdate is a helper method to define mock.On call // - ctx context.Context func (_e *MockUpdateApplier_Expecter) ClearStagedUpdate(ctx any) *MockUpdateApplier_ClearStagedUpdate_Call { return &MockUpdateApplier_ClearStagedUpdate_Call{Call: _e.mock.On("ClearStagedUpdate", ctx)} } func (_c *MockUpdateApplier_ClearStagedUpdate_Call) Run(run func(ctx context.Context)) *MockUpdateApplier_ClearStagedUpdate_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 *MockUpdateApplier_ClearStagedUpdate_Call) Return(err error) *MockUpdateApplier_ClearStagedUpdate_Call { _c.Call.Return(err) return _c } func (_c *MockUpdateApplier_ClearStagedUpdate_Call) RunAndReturn(run func(ctx context.Context) error) *MockUpdateApplier_ClearStagedUpdate_Call { _c.Call.Return(run) return _c } // GetBinaryPath provides a mock function for the type MockUpdateApplier func (_mock *MockUpdateApplier) GetBinaryPath() (string, error) { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetBinaryPath") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func() (string, error)); ok { return returnFunc() } if returnFunc, ok := ret.Get(0).(func() string); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func() error); ok { r1 = returnFunc() } else { r1 = ret.Error(1) } return r0, r1 } // MockUpdateApplier_GetBinaryPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBinaryPath' type MockUpdateApplier_GetBinaryPath_Call struct { *mock.Call } // GetBinaryPath is a helper method to define mock.On call func (_e *MockUpdateApplier_Expecter) GetBinaryPath() *MockUpdateApplier_GetBinaryPath_Call { return &MockUpdateApplier_GetBinaryPath_Call{Call: _e.mock.On("GetBinaryPath")} } func (_c *MockUpdateApplier_GetBinaryPath_Call) Run(run func()) *MockUpdateApplier_GetBinaryPath_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockUpdateApplier_GetBinaryPath_Call) Return(s string, err error) *MockUpdateApplier_GetBinaryPath_Call { _c.Call.Return(s, err) return _c } func (_c *MockUpdateApplier_GetBinaryPath_Call) RunAndReturn(run func() (string, error)) *MockUpdateApplier_GetBinaryPath_Call { _c.Call.Return(run) return _c } // HasStagedUpdate provides a mock function for the type MockUpdateApplier func (_mock *MockUpdateApplier) HasStagedUpdate(ctx context.Context) bool { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for HasStagedUpdate") } var r0 bool if returnFunc, ok := ret.Get(0).(func(context.Context) bool); ok { r0 = returnFunc(ctx) } else { r0 = ret.Get(0).(bool) } return r0 } // MockUpdateApplier_HasStagedUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasStagedUpdate' type MockUpdateApplier_HasStagedUpdate_Call struct { *mock.Call } // HasStagedUpdate is a helper method to define mock.On call // - ctx context.Context func (_e *MockUpdateApplier_Expecter) HasStagedUpdate(ctx any) *MockUpdateApplier_HasStagedUpdate_Call { return &MockUpdateApplier_HasStagedUpdate_Call{Call: _e.mock.On("HasStagedUpdate", ctx)} } func (_c *MockUpdateApplier_HasStagedUpdate_Call) Run(run func(ctx context.Context)) *MockUpdateApplier_HasStagedUpdate_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 *MockUpdateApplier_HasStagedUpdate_Call) Return(b bool) *MockUpdateApplier_HasStagedUpdate_Call { _c.Call.Return(b) return _c } func (_c *MockUpdateApplier_HasStagedUpdate_Call) RunAndReturn(run func(ctx context.Context) bool) *MockUpdateApplier_HasStagedUpdate_Call { _c.Call.Return(run) return _c } // SelfUpdateBlockedReason provides a mock function for the type MockUpdateApplier func (_mock *MockUpdateApplier) SelfUpdateBlockedReason(ctx context.Context) port.SelfUpdateBlockedReason { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for SelfUpdateBlockedReason") } var r0 port.SelfUpdateBlockedReason if returnFunc, ok := ret.Get(0).(func(context.Context) port.SelfUpdateBlockedReason); ok { r0 = returnFunc(ctx) } else { r0 = ret.Get(0).(port.SelfUpdateBlockedReason) } return r0 } // MockUpdateApplier_SelfUpdateBlockedReason_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SelfUpdateBlockedReason' type MockUpdateApplier_SelfUpdateBlockedReason_Call struct { *mock.Call } // SelfUpdateBlockedReason is a helper method to define mock.On call // - ctx context.Context func (_e *MockUpdateApplier_Expecter) SelfUpdateBlockedReason(ctx any) *MockUpdateApplier_SelfUpdateBlockedReason_Call { return &MockUpdateApplier_SelfUpdateBlockedReason_Call{Call: _e.mock.On("SelfUpdateBlockedReason", ctx)} } func (_c *MockUpdateApplier_SelfUpdateBlockedReason_Call) Run(run func(ctx context.Context)) *MockUpdateApplier_SelfUpdateBlockedReason_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 *MockUpdateApplier_SelfUpdateBlockedReason_Call) Return(selfUpdateBlockedReason port.SelfUpdateBlockedReason) *MockUpdateApplier_SelfUpdateBlockedReason_Call { _c.Call.Return(selfUpdateBlockedReason) return _c } func (_c *MockUpdateApplier_SelfUpdateBlockedReason_Call) RunAndReturn(run func(ctx context.Context) port.SelfUpdateBlockedReason) *MockUpdateApplier_SelfUpdateBlockedReason_Call { _c.Call.Return(run) return _c } // StageUpdate provides a mock function for the type MockUpdateApplier func (_mock *MockUpdateApplier) StageUpdate(ctx context.Context, newBinaryPath string) error { ret := _mock.Called(ctx, newBinaryPath) if len(ret) == 0 { panic("no return value specified for StageUpdate") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { r0 = returnFunc(ctx, newBinaryPath) } else { r0 = ret.Error(0) } return r0 } // MockUpdateApplier_StageUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StageUpdate' type MockUpdateApplier_StageUpdate_Call struct { *mock.Call } // StageUpdate is a helper method to define mock.On call // - ctx context.Context // - newBinaryPath string func (_e *MockUpdateApplier_Expecter) StageUpdate(ctx any, newBinaryPath any) *MockUpdateApplier_StageUpdate_Call { return &MockUpdateApplier_StageUpdate_Call{Call: _e.mock.On("StageUpdate", ctx, newBinaryPath)} } func (_c *MockUpdateApplier_StageUpdate_Call) Run(run func(ctx context.Context, newBinaryPath string)) *MockUpdateApplier_StageUpdate_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 *MockUpdateApplier_StageUpdate_Call) Return(err error) *MockUpdateApplier_StageUpdate_Call { _c.Call.Return(err) return _c } func (_c *MockUpdateApplier_StageUpdate_Call) RunAndReturn(run func(ctx context.Context, newBinaryPath string) error) *MockUpdateApplier_StageUpdate_Call { _c.Call.Return(run) return _c }