// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" "bnema.dev/ermite/internal/ports" mock "github.com/stretchr/testify/mock" ) // NewMirrorService creates a new instance of MirrorService. 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 NewMirrorService(t interface { mock.TestingT Cleanup(func()) }) *MirrorService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &MirrorService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // MirrorService is an autogenerated mock type for the MirrorService type type MirrorService struct { mock.Mock } type MirrorService_Expecter struct { mock *mock.Mock } func (_m *MirrorService) EXPECT() *MirrorService_Expecter { return &MirrorService_Expecter{mock: &_m.Mock} } // GetGlobalConfig provides a mock function for the type MirrorService func (_mock *MirrorService) GetGlobalConfig(ctx context.Context, p domain.Principal) (domain.MirrorGlobalConfig, error) { ret := _mock.Called(ctx, p) if len(ret) == 0 { panic("no return value specified for GetGlobalConfig") } var r0 domain.MirrorGlobalConfig var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) (domain.MirrorGlobalConfig, error)); ok { return returnFunc(ctx, p) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) domain.MirrorGlobalConfig); ok { r0 = returnFunc(ctx, p) } else { r0 = ret.Get(0).(domain.MirrorGlobalConfig) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal) error); ok { r1 = returnFunc(ctx, p) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_GetGlobalConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGlobalConfig' type MirrorService_GetGlobalConfig_Call struct { *mock.Call } // GetGlobalConfig is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal func (_e *MirrorService_Expecter) GetGlobalConfig(ctx any, p any) *MirrorService_GetGlobalConfig_Call { return &MirrorService_GetGlobalConfig_Call{Call: _e.mock.On("GetGlobalConfig", ctx, p)} } func (_c *MirrorService_GetGlobalConfig_Call) Run(run func(ctx context.Context, p domain.Principal)) *MirrorService_GetGlobalConfig_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } run( arg0, arg1, ) }) return _c } func (_c *MirrorService_GetGlobalConfig_Call) Return(mirrorGlobalConfig domain.MirrorGlobalConfig, err error) *MirrorService_GetGlobalConfig_Call { _c.Call.Return(mirrorGlobalConfig, err) return _c } func (_c *MirrorService_GetGlobalConfig_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal) (domain.MirrorGlobalConfig, error)) *MirrorService_GetGlobalConfig_Call { _c.Call.Return(run) return _c } // GetStatus provides a mock function for the type MirrorService func (_mock *MirrorService) GetStatus(ctx context.Context, p domain.Principal, repo domain.RepoName) (ports.MirrorStatusView, error) { ret := _mock.Called(ctx, p, repo) if len(ret) == 0 { panic("no return value specified for GetStatus") } var r0 ports.MirrorStatusView var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName) (ports.MirrorStatusView, error)); ok { return returnFunc(ctx, p, repo) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName) ports.MirrorStatusView); ok { r0 = returnFunc(ctx, p, repo) } else { r0 = ret.Get(0).(ports.MirrorStatusView) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName) error); ok { r1 = returnFunc(ctx, p, repo) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_GetStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStatus' type MirrorService_GetStatus_Call struct { *mock.Call } // GetStatus is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName func (_e *MirrorService_Expecter) GetStatus(ctx any, p any, repo any) *MirrorService_GetStatus_Call { return &MirrorService_GetStatus_Call{Call: _e.mock.On("GetStatus", ctx, p, repo)} } func (_c *MirrorService_GetStatus_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName)) *MirrorService_GetStatus_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MirrorService_GetStatus_Call) Return(mirrorStatusView ports.MirrorStatusView, err error) *MirrorService_GetStatus_Call { _c.Call.Return(mirrorStatusView, err) return _c } func (_c *MirrorService_GetStatus_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName) (ports.MirrorStatusView, error)) *MirrorService_GetStatus_Call { _c.Call.Return(run) return _c } // ListStatus provides a mock function for the type MirrorService func (_mock *MirrorService) ListStatus(ctx context.Context, p domain.Principal) ([]ports.MirrorStatusView, error) { ret := _mock.Called(ctx, p) if len(ret) == 0 { panic("no return value specified for ListStatus") } var r0 []ports.MirrorStatusView var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) ([]ports.MirrorStatusView, error)); ok { return returnFunc(ctx, p) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) []ports.MirrorStatusView); ok { r0 = returnFunc(ctx, p) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]ports.MirrorStatusView) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal) error); ok { r1 = returnFunc(ctx, p) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_ListStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListStatus' type MirrorService_ListStatus_Call struct { *mock.Call } // ListStatus is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal func (_e *MirrorService_Expecter) ListStatus(ctx any, p any) *MirrorService_ListStatus_Call { return &MirrorService_ListStatus_Call{Call: _e.mock.On("ListStatus", ctx, p)} } func (_c *MirrorService_ListStatus_Call) Run(run func(ctx context.Context, p domain.Principal)) *MirrorService_ListStatus_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } run( arg0, arg1, ) }) return _c } func (_c *MirrorService_ListStatus_Call) Return(mirrorStatusViews []ports.MirrorStatusView, err error) *MirrorService_ListStatus_Call { _c.Call.Return(mirrorStatusViews, err) return _c } func (_c *MirrorService_ListStatus_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal) ([]ports.MirrorStatusView, error)) *MirrorService_ListStatus_Call { _c.Call.Return(run) return _c } // RemoveRepoMirror provides a mock function for the type MirrorService func (_mock *MirrorService) RemoveRepoMirror(ctx context.Context, p domain.Principal, repo domain.RepoName) error { ret := _mock.Called(ctx, p, repo) if len(ret) == 0 { panic("no return value specified for RemoveRepoMirror") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName) error); ok { r0 = returnFunc(ctx, p, repo) } else { r0 = ret.Error(0) } return r0 } // MirrorService_RemoveRepoMirror_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRepoMirror' type MirrorService_RemoveRepoMirror_Call struct { *mock.Call } // RemoveRepoMirror is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName func (_e *MirrorService_Expecter) RemoveRepoMirror(ctx any, p any, repo any) *MirrorService_RemoveRepoMirror_Call { return &MirrorService_RemoveRepoMirror_Call{Call: _e.mock.On("RemoveRepoMirror", ctx, p, repo)} } func (_c *MirrorService_RemoveRepoMirror_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName)) *MirrorService_RemoveRepoMirror_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MirrorService_RemoveRepoMirror_Call) Return(err error) *MirrorService_RemoveRepoMirror_Call { _c.Call.Return(err) return _c } func (_c *MirrorService_RemoveRepoMirror_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName) error) *MirrorService_RemoveRepoMirror_Call { _c.Call.Return(run) return _c } // RotateKey provides a mock function for the type MirrorService func (_mock *MirrorService) RotateKey(ctx context.Context, p domain.Principal) (ports.MirrorKeyRotation, error) { ret := _mock.Called(ctx, p) if len(ret) == 0 { panic("no return value specified for RotateKey") } var r0 ports.MirrorKeyRotation var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) (ports.MirrorKeyRotation, error)); ok { return returnFunc(ctx, p) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) ports.MirrorKeyRotation); ok { r0 = returnFunc(ctx, p) } else { r0 = ret.Get(0).(ports.MirrorKeyRotation) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal) error); ok { r1 = returnFunc(ctx, p) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_RotateKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RotateKey' type MirrorService_RotateKey_Call struct { *mock.Call } // RotateKey is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal func (_e *MirrorService_Expecter) RotateKey(ctx any, p any) *MirrorService_RotateKey_Call { return &MirrorService_RotateKey_Call{Call: _e.mock.On("RotateKey", ctx, p)} } func (_c *MirrorService_RotateKey_Call) Run(run func(ctx context.Context, p domain.Principal)) *MirrorService_RotateKey_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } run( arg0, arg1, ) }) return _c } func (_c *MirrorService_RotateKey_Call) Return(mirrorKeyRotation ports.MirrorKeyRotation, err error) *MirrorService_RotateKey_Call { _c.Call.Return(mirrorKeyRotation, err) return _c } func (_c *MirrorService_RotateKey_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal) (ports.MirrorKeyRotation, error)) *MirrorService_RotateKey_Call { _c.Call.Return(run) return _c } // SetGlobalConfig provides a mock function for the type MirrorService func (_mock *MirrorService) SetGlobalConfig(ctx context.Context, p domain.Principal, patch ports.MirrorGlobalPatch) (domain.MirrorGlobalConfig, error) { ret := _mock.Called(ctx, p, patch) if len(ret) == 0 { panic("no return value specified for SetGlobalConfig") } var r0 domain.MirrorGlobalConfig var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.MirrorGlobalPatch) (domain.MirrorGlobalConfig, error)); ok { return returnFunc(ctx, p, patch) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, ports.MirrorGlobalPatch) domain.MirrorGlobalConfig); ok { r0 = returnFunc(ctx, p, patch) } else { r0 = ret.Get(0).(domain.MirrorGlobalConfig) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, ports.MirrorGlobalPatch) error); ok { r1 = returnFunc(ctx, p, patch) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_SetGlobalConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGlobalConfig' type MirrorService_SetGlobalConfig_Call struct { *mock.Call } // SetGlobalConfig is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - patch ports.MirrorGlobalPatch func (_e *MirrorService_Expecter) SetGlobalConfig(ctx any, p any, patch any) *MirrorService_SetGlobalConfig_Call { return &MirrorService_SetGlobalConfig_Call{Call: _e.mock.On("SetGlobalConfig", ctx, p, patch)} } func (_c *MirrorService_SetGlobalConfig_Call) Run(run func(ctx context.Context, p domain.Principal, patch ports.MirrorGlobalPatch)) *MirrorService_SetGlobalConfig_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 ports.MirrorGlobalPatch if args[2] != nil { arg2 = args[2].(ports.MirrorGlobalPatch) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MirrorService_SetGlobalConfig_Call) Return(mirrorGlobalConfig domain.MirrorGlobalConfig, err error) *MirrorService_SetGlobalConfig_Call { _c.Call.Return(mirrorGlobalConfig, err) return _c } func (_c *MirrorService_SetGlobalConfig_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, patch ports.MirrorGlobalPatch) (domain.MirrorGlobalConfig, error)) *MirrorService_SetGlobalConfig_Call { _c.Call.Return(run) return _c } // SetRepoExcluded provides a mock function for the type MirrorService func (_mock *MirrorService) SetRepoExcluded(ctx context.Context, p domain.Principal, repo domain.RepoName, excluded bool) (domain.MirrorTarget, error) { ret := _mock.Called(ctx, p, repo, excluded) if len(ret) == 0 { panic("no return value specified for SetRepoExcluded") } var r0 domain.MirrorTarget var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, bool) (domain.MirrorTarget, error)); ok { return returnFunc(ctx, p, repo, excluded) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, bool) domain.MirrorTarget); ok { r0 = returnFunc(ctx, p, repo, excluded) } else { r0 = ret.Get(0).(domain.MirrorTarget) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, bool) error); ok { r1 = returnFunc(ctx, p, repo, excluded) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_SetRepoExcluded_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRepoExcluded' type MirrorService_SetRepoExcluded_Call struct { *mock.Call } // SetRepoExcluded is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - excluded bool func (_e *MirrorService_Expecter) SetRepoExcluded(ctx any, p any, repo any, excluded any) *MirrorService_SetRepoExcluded_Call { return &MirrorService_SetRepoExcluded_Call{Call: _e.mock.On("SetRepoExcluded", ctx, p, repo, excluded)} } func (_c *MirrorService_SetRepoExcluded_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, excluded bool)) *MirrorService_SetRepoExcluded_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 bool if args[3] != nil { arg3 = args[3].(bool) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MirrorService_SetRepoExcluded_Call) Return(mirrorTarget domain.MirrorTarget, err error) *MirrorService_SetRepoExcluded_Call { _c.Call.Return(mirrorTarget, err) return _c } func (_c *MirrorService_SetRepoExcluded_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, excluded bool) (domain.MirrorTarget, error)) *MirrorService_SetRepoExcluded_Call { _c.Call.Return(run) return _c } // SetRepoMirror provides a mock function for the type MirrorService func (_mock *MirrorService) SetRepoMirror(ctx context.Context, p domain.Principal, c domain.MirrorRepoConfig) (domain.MirrorTarget, error) { ret := _mock.Called(ctx, p, c) if len(ret) == 0 { panic("no return value specified for SetRepoMirror") } var r0 domain.MirrorTarget var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.MirrorRepoConfig) (domain.MirrorTarget, error)); ok { return returnFunc(ctx, p, c) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.MirrorRepoConfig) domain.MirrorTarget); ok { r0 = returnFunc(ctx, p, c) } else { r0 = ret.Get(0).(domain.MirrorTarget) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.MirrorRepoConfig) error); ok { r1 = returnFunc(ctx, p, c) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_SetRepoMirror_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRepoMirror' type MirrorService_SetRepoMirror_Call struct { *mock.Call } // SetRepoMirror is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - c domain.MirrorRepoConfig func (_e *MirrorService_Expecter) SetRepoMirror(ctx any, p any, c any) *MirrorService_SetRepoMirror_Call { return &MirrorService_SetRepoMirror_Call{Call: _e.mock.On("SetRepoMirror", ctx, p, c)} } func (_c *MirrorService_SetRepoMirror_Call) Run(run func(ctx context.Context, p domain.Principal, c domain.MirrorRepoConfig)) *MirrorService_SetRepoMirror_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.MirrorRepoConfig if args[2] != nil { arg2 = args[2].(domain.MirrorRepoConfig) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MirrorService_SetRepoMirror_Call) Return(mirrorTarget domain.MirrorTarget, err error) *MirrorService_SetRepoMirror_Call { _c.Call.Return(mirrorTarget, err) return _c } func (_c *MirrorService_SetRepoMirror_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, c domain.MirrorRepoConfig) (domain.MirrorTarget, error)) *MirrorService_SetRepoMirror_Call { _c.Call.Return(run) return _c } // ShowKey provides a mock function for the type MirrorService func (_mock *MirrorService) ShowKey(ctx context.Context, p domain.Principal) (domain.MirrorPublicKey, error) { ret := _mock.Called(ctx, p) if len(ret) == 0 { panic("no return value specified for ShowKey") } var r0 domain.MirrorPublicKey var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) (domain.MirrorPublicKey, error)); ok { return returnFunc(ctx, p) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal) domain.MirrorPublicKey); ok { r0 = returnFunc(ctx, p) } else { r0 = ret.Get(0).(domain.MirrorPublicKey) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal) error); ok { r1 = returnFunc(ctx, p) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_ShowKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ShowKey' type MirrorService_ShowKey_Call struct { *mock.Call } // ShowKey is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal func (_e *MirrorService_Expecter) ShowKey(ctx any, p any) *MirrorService_ShowKey_Call { return &MirrorService_ShowKey_Call{Call: _e.mock.On("ShowKey", ctx, p)} } func (_c *MirrorService_ShowKey_Call) Run(run func(ctx context.Context, p domain.Principal)) *MirrorService_ShowKey_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } run( arg0, arg1, ) }) return _c } func (_c *MirrorService_ShowKey_Call) Return(mirrorPublicKey domain.MirrorPublicKey, err error) *MirrorService_ShowKey_Call { _c.Call.Return(mirrorPublicKey, err) return _c } func (_c *MirrorService_ShowKey_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal) (domain.MirrorPublicKey, error)) *MirrorService_ShowKey_Call { _c.Call.Return(run) return _c } // Sync provides a mock function for the type MirrorService func (_mock *MirrorService) Sync(ctx context.Context, p domain.Principal, repo domain.RepoName, force bool) (ports.MirrorSyncResult, error) { ret := _mock.Called(ctx, p, repo, force) if len(ret) == 0 { panic("no return value specified for Sync") } var r0 ports.MirrorSyncResult var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, bool) (ports.MirrorSyncResult, error)); ok { return returnFunc(ctx, p, repo, force) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, bool) ports.MirrorSyncResult); ok { r0 = returnFunc(ctx, p, repo, force) } else { r0 = ret.Get(0).(ports.MirrorSyncResult) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, bool) error); ok { r1 = returnFunc(ctx, p, repo, force) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_Sync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sync' type MirrorService_Sync_Call struct { *mock.Call } // Sync is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - repo domain.RepoName // - force bool func (_e *MirrorService_Expecter) Sync(ctx any, p any, repo any, force any) *MirrorService_Sync_Call { return &MirrorService_Sync_Call{Call: _e.mock.On("Sync", ctx, p, repo, force)} } func (_c *MirrorService_Sync_Call) Run(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, force bool)) *MirrorService_Sync_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 domain.RepoName if args[2] != nil { arg2 = args[2].(domain.RepoName) } var arg3 bool if args[3] != nil { arg3 = args[3].(bool) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MirrorService_Sync_Call) Return(mirrorSyncResult ports.MirrorSyncResult, err error) *MirrorService_Sync_Call { _c.Call.Return(mirrorSyncResult, err) return _c } func (_c *MirrorService_Sync_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, repo domain.RepoName, force bool) (ports.MirrorSyncResult, error)) *MirrorService_Sync_Call { _c.Call.Return(run) return _c } // SyncAll provides a mock function for the type MirrorService func (_mock *MirrorService) SyncAll(ctx context.Context, p domain.Principal, force bool) ([]ports.MirrorSyncResult, error) { ret := _mock.Called(ctx, p, force) if len(ret) == 0 { panic("no return value specified for SyncAll") } var r0 []ports.MirrorSyncResult var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, bool) ([]ports.MirrorSyncResult, error)); ok { return returnFunc(ctx, p, force) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, bool) []ports.MirrorSyncResult); ok { r0 = returnFunc(ctx, p, force) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]ports.MirrorSyncResult) } } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, bool) error); ok { r1 = returnFunc(ctx, p, force) } else { r1 = ret.Error(1) } return r0, r1 } // MirrorService_SyncAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncAll' type MirrorService_SyncAll_Call struct { *mock.Call } // SyncAll is a helper method to define mock.On call // - ctx context.Context // - p domain.Principal // - force bool func (_e *MirrorService_Expecter) SyncAll(ctx any, p any, force any) *MirrorService_SyncAll_Call { return &MirrorService_SyncAll_Call{Call: _e.mock.On("SyncAll", ctx, p, force)} } func (_c *MirrorService_SyncAll_Call) Run(run func(ctx context.Context, p domain.Principal, force bool)) *MirrorService_SyncAll_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.Principal if args[1] != nil { arg1 = args[1].(domain.Principal) } var arg2 bool if args[2] != nil { arg2 = args[2].(bool) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MirrorService_SyncAll_Call) Return(mirrorSyncResults []ports.MirrorSyncResult, err error) *MirrorService_SyncAll_Call { _c.Call.Return(mirrorSyncResults, err) return _c } func (_c *MirrorService_SyncAll_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, force bool) ([]ports.MirrorSyncResult, error)) *MirrorService_SyncAll_Call { _c.Call.Return(run) return _c }