// 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" ) // NewWorkflowGuard creates a new instance of WorkflowGuard. 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 NewWorkflowGuard(t interface { mock.TestingT Cleanup(func()) }) *WorkflowGuard { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &WorkflowGuard{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // WorkflowGuard is an autogenerated mock type for the WorkflowGuard type type WorkflowGuard struct { mock.Mock } type WorkflowGuard_Expecter struct { mock *mock.Mock } func (_m *WorkflowGuard) EXPECT() *WorkflowGuard_Expecter { return &WorkflowGuard_Expecter{mock: &_m.Mock} } // ChangedWorkflow provides a mock function for the type WorkflowGuard func (_mock *WorkflowGuard) ChangedWorkflow(ctx context.Context, repo domain.RepoName, updates []domain.RefUpdate, objects ports.PushObjects) (string, error) { ret := _mock.Called(ctx, repo, updates, objects) if len(ret) == 0 { panic("no return value specified for ChangedWorkflow") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects) (string, error)); ok { return returnFunc(ctx, repo, updates, objects) } if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects) string); ok { r0 = returnFunc(ctx, repo, updates, objects) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects) error); ok { r1 = returnFunc(ctx, repo, updates, objects) } else { r1 = ret.Error(1) } return r0, r1 } // WorkflowGuard_ChangedWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChangedWorkflow' type WorkflowGuard_ChangedWorkflow_Call struct { *mock.Call } // ChangedWorkflow is a helper method to define mock.On call // - ctx context.Context // - repo domain.RepoName // - updates []domain.RefUpdate // - objects ports.PushObjects func (_e *WorkflowGuard_Expecter) ChangedWorkflow(ctx any, repo any, updates any, objects any) *WorkflowGuard_ChangedWorkflow_Call { return &WorkflowGuard_ChangedWorkflow_Call{Call: _e.mock.On("ChangedWorkflow", ctx, repo, updates, objects)} } func (_c *WorkflowGuard_ChangedWorkflow_Call) Run(run func(ctx context.Context, repo domain.RepoName, updates []domain.RefUpdate, objects ports.PushObjects)) *WorkflowGuard_ChangedWorkflow_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 domain.RepoName if args[1] != nil { arg1 = args[1].(domain.RepoName) } var arg2 []domain.RefUpdate if args[2] != nil { arg2 = args[2].([]domain.RefUpdate) } var arg3 ports.PushObjects if args[3] != nil { arg3 = args[3].(ports.PushObjects) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *WorkflowGuard_ChangedWorkflow_Call) Return(path string, err error) *WorkflowGuard_ChangedWorkflow_Call { _c.Call.Return(path, err) return _c } func (_c *WorkflowGuard_ChangedWorkflow_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, updates []domain.RefUpdate, objects ports.PushObjects) (string, error)) *WorkflowGuard_ChangedWorkflow_Call { _c.Call.Return(run) return _c }