From 2f3c4a28c19c93ccf37b5fe3e1423a5127215489 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 24 Sep 2025 13:12:55 +0200 Subject: [PATCH] Migrate to mockery v3 (#5547) --- .mockery.yaml | 22 +- Makefile | 5 +- cli/pipeline/list_test.go | 2 +- cli/pipeline/purge_test.go | 2 +- cli/repo/repo_show_test.go | 2 +- flake.nix | 2 +- pipeline/log/line_writer_test.go | 2 +- pipeline/rpc/mocks/mock_Peer.go | 680 ++ pipeline/rpc/mocks/peer.go | 251 - pipeline/rpc/peer.go | 2 - pipeline/rpc/proto/woodpecker.pb.go | 5 +- pipeline/rpc/proto/woodpecker_grpc.pb.go | 1 - server/api/agent_test.go | 34 +- server/api/hook_test.go | 24 +- server/api/login_test.go | 58 +- server/api/pipeline_test.go | 22 +- server/cron/cron_test.go | 12 +- server/forge/bitbucket/bitbucket_test.go | 4 +- server/forge/forge.go | 2 - server/forge/forgejo/forgejo_test.go | 4 +- server/forge/gitea/gitea_test.go | 4 +- server/forge/mocks/forge.go | 561 -- server/forge/mocks/mock_Forge.go | 1414 ++++ server/forge/mocks/mock_Refresher.go | 105 + server/grpc/rpc_test.go | 10 +- server/pipeline/pipeline_status_test.go | 2 +- server/pipeline/step_status_test.go | 2 +- server/pipeline/stepbuilder/metadata_test.go | 2 +- .../pipeline/stepbuilder/stepBuilder_test.go | 2 +- server/queue/mocks/mock_Queue.go | 694 ++ server/queue/mocks/queue.go | 223 - server/queue/queue.go | 2 - server/services/config/combined_test.go | 2 +- server/services/config/forge_test.go | 2 +- server/services/config/mocks/mock_Service.go | 139 + server/services/config/mocks/service.go | 63 - server/services/config/service.go | 2 - .../environment/mocks/mock_Service.go | 99 + server/services/environment/mocks/service.go | 57 - server/services/environment/service.go | 2 - server/services/log/mocks/mock_Service.go | 207 + server/services/manager.go | 2 - server/services/mocks/manager.go | 273 - server/services/mocks/mock_Manager.go | 573 ++ .../registry/mocks/mock_ReadOnlyService.go | 161 + .../services/registry/mocks/mock_Service.go | 996 +++ server/services/registry/mocks/service.go | 399 - server/services/registry/service.go | 2 - server/services/secret/db_test.go | 4 +- server/services/secret/mocks/mock_Service.go | 996 +++ server/services/secret/mocks/service.go | 399 - server/services/secret/service.go | 2 - server/store/mocks/mock_Store.go | 6566 +++++++++++++++++ server/store/mocks/store.go | 2811 ------- server/store/store.go | 2 - woodpecker-go/woodpecker/interface.go | 2 - woodpecker-go/woodpecker/mocks/client.go | 2160 ------ woodpecker-go/woodpecker/mocks/mock_Client.go | 4952 +++++++++++++ 58 files changed, 17705 insertions(+), 7325 deletions(-) create mode 100644 pipeline/rpc/mocks/mock_Peer.go delete mode 100644 pipeline/rpc/mocks/peer.go delete mode 100644 server/forge/mocks/forge.go create mode 100644 server/forge/mocks/mock_Forge.go create mode 100644 server/forge/mocks/mock_Refresher.go create mode 100644 server/queue/mocks/mock_Queue.go delete mode 100644 server/queue/mocks/queue.go create mode 100644 server/services/config/mocks/mock_Service.go delete mode 100644 server/services/config/mocks/service.go create mode 100644 server/services/environment/mocks/mock_Service.go delete mode 100644 server/services/environment/mocks/service.go create mode 100644 server/services/log/mocks/mock_Service.go delete mode 100644 server/services/mocks/manager.go create mode 100644 server/services/mocks/mock_Manager.go create mode 100644 server/services/registry/mocks/mock_ReadOnlyService.go create mode 100644 server/services/registry/mocks/mock_Service.go delete mode 100644 server/services/registry/mocks/service.go create mode 100644 server/services/secret/mocks/mock_Service.go delete mode 100644 server/services/secret/mocks/service.go create mode 100644 server/store/mocks/mock_Store.go delete mode 100644 server/store/mocks/store.go delete mode 100644 woodpecker-go/woodpecker/mocks/client.go create mode 100644 woodpecker-go/woodpecker/mocks/mock_Client.go diff --git a/.mockery.yaml b/.mockery.yaml index cc734bcae..0990c2916 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -1,2 +1,22 @@ --- -disable-version-string: true +all: true +dir: '{{.InterfaceDir}}/mocks' +filename: mock_{{.InterfaceName}}.go +pkgname: mocks +recursive: true +packages: + go.woodpecker-ci.org/woodpecker/v3/pipeline/rpc: + config: + recursive: false + go.woodpecker-ci.org/woodpecker/v3/server/forge: + go.woodpecker-ci.org/woodpecker/v3/server/queue: + go.woodpecker-ci.org/woodpecker/v3/server/services: + config: + exclude-subpkg-regex: + - types + go.woodpecker-ci.org/woodpecker/v3/server/services/config: + go.woodpecker-ci.org/woodpecker/v3/server/services/environment: + go.woodpecker-ci.org/woodpecker/v3/server/services/registry: + go.woodpecker-ci.org/woodpecker/v3/server/services/secret: + go.woodpecker-ci.org/woodpecker/v3/server/store: + go.woodpecker-ci.org/woodpecker/v3/woodpecker-go/woodpecker: diff --git a/Makefile b/Makefile index 159074b87..142617d9f 100644 --- a/Makefile +++ b/Makefile @@ -119,10 +119,11 @@ clean-all: clean ## Clean all artifacts .PHONY: generate generate: install-tools generate-openapi ## Run all code generations + mockery CGO_ENABLED=0 go generate ./... generate-openapi: install-tools ## Run openapi code generation and format it - go run github.com/swaggo/swag/cmd/swag fmt + go run github.com/swaggo/swag/cmd/swag fmt --exclude pipeline/rpc/proto CGO_ENABLED=0 go generate cmd/server/openapi.go generate-license-header: install-tools @@ -144,7 +145,7 @@ install-tools: ## Install development tools go install github.com/google/addlicense@latest; \ fi ; \ hash mockery > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - go install github.com/vektra/mockery/v2@latest; \ + go install github.com/vektra/mockery/v3@latest; \ fi ; \ hash protoc-gen-go > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest; \ diff --git a/cli/pipeline/list_test.go b/cli/pipeline/list_test.go index a93b31309..bca49637e 100644 --- a/cli/pipeline/list_test.go +++ b/cli/pipeline/list_test.go @@ -65,7 +65,7 @@ func TestPipelineList(t *testing.T) { for _, tt := range testtases { t.Run(tt.name, func(t *testing.T) { - mockClient := mocks.NewClient(t) + mockClient := mocks.NewMockClient(t) mockClient.On("PipelineList", mock.Anything, mock.Anything).Return(func(_ int64, opt woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error) { if tt.pipelineErr != nil { return nil, tt.pipelineErr diff --git a/cli/pipeline/purge_test.go b/cli/pipeline/purge_test.go index 8761d0276..c3bc73ae8 100644 --- a/cli/pipeline/purge_test.go +++ b/cli/pipeline/purge_test.go @@ -76,7 +76,7 @@ func TestPipelinePurge(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - mockClient := mocks.NewClient(t) + mockClient := mocks.NewMockClient(t) mockClient.On("RepoLookup", mock.Anything).Maybe().Return(&woodpecker.Repo{ID: tt.repoID}, nil) mockClient.On("PipelineList", mock.Anything, mock.Anything).Return(func(_ int64, opt woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error) { diff --git a/cli/repo/repo_show_test.go b/cli/repo/repo_show_test.go index 4d4ce42ec..ec7ad65d1 100644 --- a/cli/repo/repo_show_test.go +++ b/cli/repo/repo_show_test.go @@ -48,7 +48,7 @@ func TestRepoShow(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - mockClient := mocks.NewClient(t) + mockClient := mocks.NewMockClient(t) mockClient.On("Repo", tt.repoID).Return(tt.mockRepo, tt.mockError).Maybe() mockClient.On("RepoLookup", "owner/repo").Return(tt.mockRepo, nil).Maybe() diff --git a/flake.nix b/flake.nix index 3a0913984..e225048b7 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,7 @@ glibc.static gofumpt golangci-lint - go-mockery_2 + go-mockery protobuf sqlite go-swag # for generate-openapi diff --git a/pipeline/log/line_writer_test.go b/pipeline/log/line_writer_test.go index bcff046da..551899a45 100644 --- a/pipeline/log/line_writer_test.go +++ b/pipeline/log/line_writer_test.go @@ -26,7 +26,7 @@ import ( ) func TestLineWriter(t *testing.T) { - peer := mocks.NewPeer(t) + peer := mocks.NewMockPeer(t) peer.On("EnqueueLog", mock.Anything) secrets := []string{"world"} diff --git a/pipeline/rpc/mocks/mock_Peer.go b/pipeline/rpc/mocks/mock_Peer.go new file mode 100644 index 000000000..1205d9737 --- /dev/null +++ b/pipeline/rpc/mocks/mock_Peer.go @@ -0,0 +1,680 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "context" + + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/pipeline/rpc" +) + +// NewMockPeer creates a new instance of MockPeer. 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 NewMockPeer(t interface { + mock.TestingT + Cleanup(func()) +}) *MockPeer { + mock := &MockPeer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockPeer is an autogenerated mock type for the Peer type +type MockPeer struct { + mock.Mock +} + +type MockPeer_Expecter struct { + mock *mock.Mock +} + +func (_m *MockPeer) EXPECT() *MockPeer_Expecter { + return &MockPeer_Expecter{mock: &_m.Mock} +} + +// Done provides a mock function for the type MockPeer +func (_mock *MockPeer) Done(c context.Context, workflowID string, state rpc.WorkflowState) error { + ret := _mock.Called(c, workflowID, state) + + if len(ret) == 0 { + panic("no return value specified for Done") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, rpc.WorkflowState) error); ok { + r0 = returnFunc(c, workflowID, state) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockPeer_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done' +type MockPeer_Done_Call struct { + *mock.Call +} + +// Done is a helper method to define mock.On call +// - c context.Context +// - workflowID string +// - state rpc.WorkflowState +func (_e *MockPeer_Expecter) Done(c interface{}, workflowID interface{}, state interface{}) *MockPeer_Done_Call { + return &MockPeer_Done_Call{Call: _e.mock.On("Done", c, workflowID, state)} +} + +func (_c *MockPeer_Done_Call) Run(run func(c context.Context, workflowID string, state rpc.WorkflowState)) *MockPeer_Done_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 rpc.WorkflowState + if args[2] != nil { + arg2 = args[2].(rpc.WorkflowState) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockPeer_Done_Call) Return(err error) *MockPeer_Done_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPeer_Done_Call) RunAndReturn(run func(c context.Context, workflowID string, state rpc.WorkflowState) error) *MockPeer_Done_Call { + _c.Call.Return(run) + return _c +} + +// EnqueueLog provides a mock function for the type MockPeer +func (_mock *MockPeer) EnqueueLog(logEntry *rpc.LogEntry) { + _mock.Called(logEntry) + return +} + +// MockPeer_EnqueueLog_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnqueueLog' +type MockPeer_EnqueueLog_Call struct { + *mock.Call +} + +// EnqueueLog is a helper method to define mock.On call +// - logEntry *rpc.LogEntry +func (_e *MockPeer_Expecter) EnqueueLog(logEntry interface{}) *MockPeer_EnqueueLog_Call { + return &MockPeer_EnqueueLog_Call{Call: _e.mock.On("EnqueueLog", logEntry)} +} + +func (_c *MockPeer_EnqueueLog_Call) Run(run func(logEntry *rpc.LogEntry)) *MockPeer_EnqueueLog_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *rpc.LogEntry + if args[0] != nil { + arg0 = args[0].(*rpc.LogEntry) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockPeer_EnqueueLog_Call) Return() *MockPeer_EnqueueLog_Call { + _c.Call.Return() + return _c +} + +func (_c *MockPeer_EnqueueLog_Call) RunAndReturn(run func(logEntry *rpc.LogEntry)) *MockPeer_EnqueueLog_Call { + _c.Run(run) + return _c +} + +// Extend provides a mock function for the type MockPeer +func (_mock *MockPeer) Extend(c context.Context, workflowID string) error { + ret := _mock.Called(c, workflowID) + + if len(ret) == 0 { + panic("no return value specified for Extend") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(c, workflowID) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockPeer_Extend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Extend' +type MockPeer_Extend_Call struct { + *mock.Call +} + +// Extend is a helper method to define mock.On call +// - c context.Context +// - workflowID string +func (_e *MockPeer_Expecter) Extend(c interface{}, workflowID interface{}) *MockPeer_Extend_Call { + return &MockPeer_Extend_Call{Call: _e.mock.On("Extend", c, workflowID)} +} + +func (_c *MockPeer_Extend_Call) Run(run func(c context.Context, workflowID string)) *MockPeer_Extend_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 *MockPeer_Extend_Call) Return(err error) *MockPeer_Extend_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPeer_Extend_Call) RunAndReturn(run func(c context.Context, workflowID string) error) *MockPeer_Extend_Call { + _c.Call.Return(run) + return _c +} + +// Init provides a mock function for the type MockPeer +func (_mock *MockPeer) Init(c context.Context, workflowID string, state rpc.WorkflowState) error { + ret := _mock.Called(c, workflowID, state) + + if len(ret) == 0 { + panic("no return value specified for Init") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, rpc.WorkflowState) error); ok { + r0 = returnFunc(c, workflowID, state) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockPeer_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init' +type MockPeer_Init_Call struct { + *mock.Call +} + +// Init is a helper method to define mock.On call +// - c context.Context +// - workflowID string +// - state rpc.WorkflowState +func (_e *MockPeer_Expecter) Init(c interface{}, workflowID interface{}, state interface{}) *MockPeer_Init_Call { + return &MockPeer_Init_Call{Call: _e.mock.On("Init", c, workflowID, state)} +} + +func (_c *MockPeer_Init_Call) Run(run func(c context.Context, workflowID string, state rpc.WorkflowState)) *MockPeer_Init_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 rpc.WorkflowState + if args[2] != nil { + arg2 = args[2].(rpc.WorkflowState) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockPeer_Init_Call) Return(err error) *MockPeer_Init_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPeer_Init_Call) RunAndReturn(run func(c context.Context, workflowID string, state rpc.WorkflowState) error) *MockPeer_Init_Call { + _c.Call.Return(run) + return _c +} + +// Next provides a mock function for the type MockPeer +func (_mock *MockPeer) Next(c context.Context, f rpc.Filter) (*rpc.Workflow, error) { + ret := _mock.Called(c, f) + + if len(ret) == 0 { + panic("no return value specified for Next") + } + + var r0 *rpc.Workflow + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, rpc.Filter) (*rpc.Workflow, error)); ok { + return returnFunc(c, f) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, rpc.Filter) *rpc.Workflow); ok { + r0 = returnFunc(c, f) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*rpc.Workflow) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, rpc.Filter) error); ok { + r1 = returnFunc(c, f) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockPeer_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next' +type MockPeer_Next_Call struct { + *mock.Call +} + +// Next is a helper method to define mock.On call +// - c context.Context +// - f rpc.Filter +func (_e *MockPeer_Expecter) Next(c interface{}, f interface{}) *MockPeer_Next_Call { + return &MockPeer_Next_Call{Call: _e.mock.On("Next", c, f)} +} + +func (_c *MockPeer_Next_Call) Run(run func(c context.Context, f rpc.Filter)) *MockPeer_Next_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 rpc.Filter + if args[1] != nil { + arg1 = args[1].(rpc.Filter) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockPeer_Next_Call) Return(workflow *rpc.Workflow, err error) *MockPeer_Next_Call { + _c.Call.Return(workflow, err) + return _c +} + +func (_c *MockPeer_Next_Call) RunAndReturn(run func(c context.Context, f rpc.Filter) (*rpc.Workflow, error)) *MockPeer_Next_Call { + _c.Call.Return(run) + return _c +} + +// RegisterAgent provides a mock function for the type MockPeer +func (_mock *MockPeer) RegisterAgent(ctx context.Context, info rpc.AgentInfo) (int64, error) { + ret := _mock.Called(ctx, info) + + if len(ret) == 0 { + panic("no return value specified for RegisterAgent") + } + + var r0 int64 + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, rpc.AgentInfo) (int64, error)); ok { + return returnFunc(ctx, info) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, rpc.AgentInfo) int64); ok { + r0 = returnFunc(ctx, info) + } else { + r0 = ret.Get(0).(int64) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, rpc.AgentInfo) error); ok { + r1 = returnFunc(ctx, info) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockPeer_RegisterAgent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterAgent' +type MockPeer_RegisterAgent_Call struct { + *mock.Call +} + +// RegisterAgent is a helper method to define mock.On call +// - ctx context.Context +// - info rpc.AgentInfo +func (_e *MockPeer_Expecter) RegisterAgent(ctx interface{}, info interface{}) *MockPeer_RegisterAgent_Call { + return &MockPeer_RegisterAgent_Call{Call: _e.mock.On("RegisterAgent", ctx, info)} +} + +func (_c *MockPeer_RegisterAgent_Call) Run(run func(ctx context.Context, info rpc.AgentInfo)) *MockPeer_RegisterAgent_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 rpc.AgentInfo + if args[1] != nil { + arg1 = args[1].(rpc.AgentInfo) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockPeer_RegisterAgent_Call) Return(n int64, err error) *MockPeer_RegisterAgent_Call { + _c.Call.Return(n, err) + return _c +} + +func (_c *MockPeer_RegisterAgent_Call) RunAndReturn(run func(ctx context.Context, info rpc.AgentInfo) (int64, error)) *MockPeer_RegisterAgent_Call { + _c.Call.Return(run) + return _c +} + +// ReportHealth provides a mock function for the type MockPeer +func (_mock *MockPeer) ReportHealth(c context.Context) error { + ret := _mock.Called(c) + + if len(ret) == 0 { + panic("no return value specified for ReportHealth") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = returnFunc(c) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockPeer_ReportHealth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReportHealth' +type MockPeer_ReportHealth_Call struct { + *mock.Call +} + +// ReportHealth is a helper method to define mock.On call +// - c context.Context +func (_e *MockPeer_Expecter) ReportHealth(c interface{}) *MockPeer_ReportHealth_Call { + return &MockPeer_ReportHealth_Call{Call: _e.mock.On("ReportHealth", c)} +} + +func (_c *MockPeer_ReportHealth_Call) Run(run func(c context.Context)) *MockPeer_ReportHealth_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 *MockPeer_ReportHealth_Call) Return(err error) *MockPeer_ReportHealth_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPeer_ReportHealth_Call) RunAndReturn(run func(c context.Context) error) *MockPeer_ReportHealth_Call { + _c.Call.Return(run) + return _c +} + +// UnregisterAgent provides a mock function for the type MockPeer +func (_mock *MockPeer) UnregisterAgent(ctx context.Context) error { + ret := _mock.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for UnregisterAgent") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = returnFunc(ctx) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockPeer_UnregisterAgent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnregisterAgent' +type MockPeer_UnregisterAgent_Call struct { + *mock.Call +} + +// UnregisterAgent is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockPeer_Expecter) UnregisterAgent(ctx interface{}) *MockPeer_UnregisterAgent_Call { + return &MockPeer_UnregisterAgent_Call{Call: _e.mock.On("UnregisterAgent", ctx)} +} + +func (_c *MockPeer_UnregisterAgent_Call) Run(run func(ctx context.Context)) *MockPeer_UnregisterAgent_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 *MockPeer_UnregisterAgent_Call) Return(err error) *MockPeer_UnregisterAgent_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPeer_UnregisterAgent_Call) RunAndReturn(run func(ctx context.Context) error) *MockPeer_UnregisterAgent_Call { + _c.Call.Return(run) + return _c +} + +// Update provides a mock function for the type MockPeer +func (_mock *MockPeer) Update(c context.Context, workflowID string, state rpc.StepState) error { + ret := _mock.Called(c, workflowID, state) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, rpc.StepState) error); ok { + r0 = returnFunc(c, workflowID, state) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockPeer_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MockPeer_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - c context.Context +// - workflowID string +// - state rpc.StepState +func (_e *MockPeer_Expecter) Update(c interface{}, workflowID interface{}, state interface{}) *MockPeer_Update_Call { + return &MockPeer_Update_Call{Call: _e.mock.On("Update", c, workflowID, state)} +} + +func (_c *MockPeer_Update_Call) Run(run func(c context.Context, workflowID string, state rpc.StepState)) *MockPeer_Update_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 rpc.StepState + if args[2] != nil { + arg2 = args[2].(rpc.StepState) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockPeer_Update_Call) Return(err error) *MockPeer_Update_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPeer_Update_Call) RunAndReturn(run func(c context.Context, workflowID string, state rpc.StepState) error) *MockPeer_Update_Call { + _c.Call.Return(run) + return _c +} + +// Version provides a mock function for the type MockPeer +func (_mock *MockPeer) Version(c context.Context) (*rpc.Version, error) { + ret := _mock.Called(c) + + if len(ret) == 0 { + panic("no return value specified for Version") + } + + var r0 *rpc.Version + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context) (*rpc.Version, error)); ok { + return returnFunc(c) + } + if returnFunc, ok := ret.Get(0).(func(context.Context) *rpc.Version); ok { + r0 = returnFunc(c) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*rpc.Version) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(c) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockPeer_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type MockPeer_Version_Call struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +// - c context.Context +func (_e *MockPeer_Expecter) Version(c interface{}) *MockPeer_Version_Call { + return &MockPeer_Version_Call{Call: _e.mock.On("Version", c)} +} + +func (_c *MockPeer_Version_Call) Run(run func(c context.Context)) *MockPeer_Version_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 *MockPeer_Version_Call) Return(version *rpc.Version, err error) *MockPeer_Version_Call { + _c.Call.Return(version, err) + return _c +} + +func (_c *MockPeer_Version_Call) RunAndReturn(run func(c context.Context) (*rpc.Version, error)) *MockPeer_Version_Call { + _c.Call.Return(run) + return _c +} + +// Wait provides a mock function for the type MockPeer +func (_mock *MockPeer) Wait(c context.Context, workflowID string) error { + ret := _mock.Called(c, workflowID) + + if len(ret) == 0 { + panic("no return value specified for Wait") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(c, workflowID) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockPeer_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait' +type MockPeer_Wait_Call struct { + *mock.Call +} + +// Wait is a helper method to define mock.On call +// - c context.Context +// - workflowID string +func (_e *MockPeer_Expecter) Wait(c interface{}, workflowID interface{}) *MockPeer_Wait_Call { + return &MockPeer_Wait_Call{Call: _e.mock.On("Wait", c, workflowID)} +} + +func (_c *MockPeer_Wait_Call) Run(run func(c context.Context, workflowID string)) *MockPeer_Wait_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 *MockPeer_Wait_Call) Return(err error) *MockPeer_Wait_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockPeer_Wait_Call) RunAndReturn(run func(c context.Context, workflowID string) error) *MockPeer_Wait_Call { + _c.Call.Return(run) + return _c +} diff --git a/pipeline/rpc/mocks/peer.go b/pipeline/rpc/mocks/peer.go deleted file mode 100644 index e8383505b..000000000 --- a/pipeline/rpc/mocks/peer.go +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -//go:build test -// +build test - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - rpc "go.woodpecker-ci.org/woodpecker/v3/pipeline/rpc" -) - -// Peer is an autogenerated mock type for the Peer type -type Peer struct { - mock.Mock -} - -// Done provides a mock function with given fields: c, workflowID, state -func (_m *Peer) Done(c context.Context, workflowID string, state rpc.WorkflowState) error { - ret := _m.Called(c, workflowID, state) - - if len(ret) == 0 { - panic("no return value specified for Done") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, rpc.WorkflowState) error); ok { - r0 = rf(c, workflowID, state) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// EnqueueLog provides a mock function with given fields: logEntry -func (_m *Peer) EnqueueLog(logEntry *rpc.LogEntry) { - _m.Called(logEntry) -} - -// Extend provides a mock function with given fields: c, workflowID -func (_m *Peer) Extend(c context.Context, workflowID string) error { - ret := _m.Called(c, workflowID) - - if len(ret) == 0 { - panic("no return value specified for Extend") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(c, workflowID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Init provides a mock function with given fields: c, workflowID, state -func (_m *Peer) Init(c context.Context, workflowID string, state rpc.WorkflowState) error { - ret := _m.Called(c, workflowID, state) - - if len(ret) == 0 { - panic("no return value specified for Init") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, rpc.WorkflowState) error); ok { - r0 = rf(c, workflowID, state) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Next provides a mock function with given fields: c, f -func (_m *Peer) Next(c context.Context, f rpc.Filter) (*rpc.Workflow, error) { - ret := _m.Called(c, f) - - if len(ret) == 0 { - panic("no return value specified for Next") - } - - var r0 *rpc.Workflow - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, rpc.Filter) (*rpc.Workflow, error)); ok { - return rf(c, f) - } - if rf, ok := ret.Get(0).(func(context.Context, rpc.Filter) *rpc.Workflow); ok { - r0 = rf(c, f) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*rpc.Workflow) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, rpc.Filter) error); ok { - r1 = rf(c, f) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegisterAgent provides a mock function with given fields: ctx, info -func (_m *Peer) RegisterAgent(ctx context.Context, info rpc.AgentInfo) (int64, error) { - ret := _m.Called(ctx, info) - - if len(ret) == 0 { - panic("no return value specified for RegisterAgent") - } - - var r0 int64 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, rpc.AgentInfo) (int64, error)); ok { - return rf(ctx, info) - } - if rf, ok := ret.Get(0).(func(context.Context, rpc.AgentInfo) int64); ok { - r0 = rf(ctx, info) - } else { - r0 = ret.Get(0).(int64) - } - - if rf, ok := ret.Get(1).(func(context.Context, rpc.AgentInfo) error); ok { - r1 = rf(ctx, info) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReportHealth provides a mock function with given fields: c -func (_m *Peer) ReportHealth(c context.Context) error { - ret := _m.Called(c) - - if len(ret) == 0 { - panic("no return value specified for ReportHealth") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(c) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UnregisterAgent provides a mock function with given fields: ctx -func (_m *Peer) UnregisterAgent(ctx context.Context) error { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for UnregisterAgent") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Update provides a mock function with given fields: c, workflowID, state -func (_m *Peer) Update(c context.Context, workflowID string, state rpc.StepState) error { - ret := _m.Called(c, workflowID, state) - - if len(ret) == 0 { - panic("no return value specified for Update") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, rpc.StepState) error); ok { - r0 = rf(c, workflowID, state) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Version provides a mock function with given fields: c -func (_m *Peer) Version(c context.Context) (*rpc.Version, error) { - ret := _m.Called(c) - - if len(ret) == 0 { - panic("no return value specified for Version") - } - - var r0 *rpc.Version - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*rpc.Version, error)); ok { - return rf(c) - } - if rf, ok := ret.Get(0).(func(context.Context) *rpc.Version); ok { - r0 = rf(c) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*rpc.Version) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(c) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Wait provides a mock function with given fields: c, workflowID -func (_m *Peer) Wait(c context.Context, workflowID string) error { - ret := _m.Called(c, workflowID) - - if len(ret) == 0 { - panic("no return value specified for Wait") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(c, workflowID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewPeer creates a new instance of Peer. 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 NewPeer(t interface { - mock.TestingT - Cleanup(func()) -}) *Peer { - mock := &Peer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pipeline/rpc/peer.go b/pipeline/rpc/peer.go index 06790ffec..6dee992e1 100644 --- a/pipeline/rpc/peer.go +++ b/pipeline/rpc/peer.go @@ -66,8 +66,6 @@ type ( } ) -//go:generate mockery --name Peer --output mocks --case underscore --note "+build test" - // Peer defines a peer-to-peer connection. type Peer interface { // Version returns the server- & grpc-version diff --git a/pipeline/rpc/proto/woodpecker.pb.go b/pipeline/rpc/proto/woodpecker.pb.go index 6b0e32427..83e938256 100644 --- a/pipeline/rpc/proto/woodpecker.pb.go +++ b/pipeline/rpc/proto/woodpecker.pb.go @@ -22,12 +22,11 @@ package proto import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/pipeline/rpc/proto/woodpecker_grpc.pb.go b/pipeline/rpc/proto/woodpecker_grpc.pb.go index 9c21c298d..4ecfaf474 100644 --- a/pipeline/rpc/proto/woodpecker_grpc.pb.go +++ b/pipeline/rpc/proto/woodpecker_grpc.pb.go @@ -23,7 +23,6 @@ package proto import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/server/api/agent_test.go b/server/api/agent_test.go index 82d5e7c3f..7e7e408b3 100644 --- a/server/api/agent_test.go +++ b/server/api/agent_test.go @@ -29,7 +29,7 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server/model" "go.woodpecker-ci.org/woodpecker/v3/server/queue" queue_mocks "go.woodpecker-ci.org/woodpecker/v3/server/queue/mocks" - mocks_manager "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" + manager_mocks "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" "go.woodpecker-ci.org/woodpecker/v3/server/store/types" ) @@ -47,7 +47,7 @@ func TestGetAgents(t *testing.T) { t.Run("should get agents", func(t *testing.T) { agents := []*model.Agent{fakeAgent} - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("AgentList", mock.Anything).Return(agents, nil) w := httptest.NewRecorder() @@ -71,7 +71,7 @@ func TestGetAgent(t *testing.T) { gin.SetMode(gin.TestMode) t.Run("should get agent", func(t *testing.T) { - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("AgentFind", int64(1)).Return(fakeAgent, nil) w := httptest.NewRecorder() @@ -103,7 +103,7 @@ func TestGetAgent(t *testing.T) { }) t.Run("should return not found for non-existent agent", func(t *testing.T) { - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("AgentFind", int64(2)).Return((*model.Agent)(nil), types.RecordNotExist) w := httptest.NewRecorder() @@ -122,14 +122,11 @@ func TestPatchAgent(t *testing.T) { gin.SetMode(gin.TestMode) t.Run("should update agent", func(t *testing.T) { - updatedAgent := *fakeAgent - updatedAgent.Name = "updated-agent" - - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("AgentFind", int64(1)).Return(fakeAgent, nil) mockStore.On("AgentUpdate", mock.AnythingOfType("*model.Agent")).Return(nil) - mockManager := mocks_manager.NewManager(t) + mockManager := manager_mocks.NewMockManager(t) server.Config.Services.Manager = mockManager w := httptest.NewRecorder() @@ -158,11 +155,10 @@ func TestPostAgent(t *testing.T) { t.Run("should create agent", func(t *testing.T) { newAgent := &model.Agent{ - Name: "new-agent", - NoSchedule: false, + Name: "new-agent", } - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("AgentCreate", mock.AnythingOfType("*model.Agent")).Return(nil) w := httptest.NewRecorder() @@ -190,14 +186,14 @@ func TestDeleteAgent(t *testing.T) { gin.SetMode(gin.TestMode) t.Run("should delete agent", func(t *testing.T) { - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("AgentFind", int64(1)).Return(fakeAgent, nil) mockStore.On("AgentDelete", mock.AnythingOfType("*model.Agent")).Return(nil) - mockManager := mocks_manager.NewManager(t) + mockManager := manager_mocks.NewMockManager(t) server.Config.Services.Manager = mockManager - mockQueue := queue_mocks.NewQueue(t) + mockQueue := queue_mocks.NewMockQueue(t) mockQueue.On("Info", mock.Anything).Return(queue.InfoT{}) mockQueue.On("KickAgentWorkers", int64(1)).Return() server.Config.Services.Queue = mockQueue @@ -217,13 +213,13 @@ func TestDeleteAgent(t *testing.T) { }) t.Run("should not delete agent with running tasks", func(t *testing.T) { - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("AgentFind", int64(1)).Return(fakeAgent, nil) - mockManager := mocks_manager.NewManager(t) + mockManager := manager_mocks.NewMockManager(t) server.Config.Services.Manager = mockManager - mockQueue := queue_mocks.NewQueue(t) + mockQueue := queue_mocks.NewMockQueue(t) mockQueue.On("Info", mock.Anything).Return(queue.InfoT{ Running: []*model.Task{{AgentID: 1}}, }) @@ -247,7 +243,7 @@ func TestPostOrgAgent(t *testing.T) { gin.SetMode(gin.TestMode) t.Run("create org agent should succeed", func(t *testing.T) { - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("AgentCreate", mock.AnythingOfType("*model.Agent")).Return(nil) w := httptest.NewRecorder() diff --git a/server/api/hook_test.go b/server/api/hook_test.go index 6620440f3..f294e5042 100644 --- a/server/api/hook_test.go +++ b/server/api/hook_test.go @@ -13,26 +13,26 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server" "go.woodpecker-ci.org/woodpecker/v3/server/api" - mocks_forge "go.woodpecker-ci.org/woodpecker/v3/server/forge/mocks" + forge_mocks "go.woodpecker-ci.org/woodpecker/v3/server/forge/mocks" "go.woodpecker-ci.org/woodpecker/v3/server/model" - mocks_config_service "go.woodpecker-ci.org/woodpecker/v3/server/services/config/mocks" - mocks_services "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" + config_service_mocks "go.woodpecker-ci.org/woodpecker/v3/server/services/config/mocks" + services_mocks "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" "go.woodpecker-ci.org/woodpecker/v3/server/services/permissions" - mocks_registry_service "go.woodpecker-ci.org/woodpecker/v3/server/services/registry/mocks" - mocks_secret_service "go.woodpecker-ci.org/woodpecker/v3/server/services/secret/mocks" - mocks_store "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" + registry_service_mocks "go.woodpecker-ci.org/woodpecker/v3/server/services/registry/mocks" + secret_service_mocks "go.woodpecker-ci.org/woodpecker/v3/server/services/secret/mocks" + store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" "go.woodpecker-ci.org/woodpecker/v3/shared/token" ) func TestHook(t *testing.T) { gin.SetMode(gin.TestMode) - _manager := mocks_services.NewManager(t) - _forge := mocks_forge.NewForge(t) - _store := mocks_store.NewStore(t) - _configService := mocks_config_service.NewService(t) - _secretService := mocks_secret_service.NewService(t) - _registryService := mocks_registry_service.NewService(t) + _manager := services_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + _store := store_mocks.NewMockStore(t) + _configService := config_service_mocks.NewMockService(t) + _secretService := secret_service_mocks.NewMockService(t) + _registryService := registry_service_mocks.NewMockService(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = true server.Config.Permissions.Orgs = permissions.NewOrgs(nil) diff --git a/server/api/login_test.go b/server/api/login_test.go index 09a1821d0..30f04bc7b 100644 --- a/server/api/login_test.go +++ b/server/api/login_test.go @@ -15,12 +15,12 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server" "go.woodpecker-ci.org/woodpecker/v3/server/api" - mocks_forge "go.woodpecker-ci.org/woodpecker/v3/server/forge/mocks" + forge_mocks "go.woodpecker-ci.org/woodpecker/v3/server/forge/mocks" forge_types "go.woodpecker-ci.org/woodpecker/v3/server/forge/types" "go.woodpecker-ci.org/woodpecker/v3/server/model" - mocks_services "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" + services_mocks "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" "go.woodpecker-ci.org/woodpecker/v3/server/services/permissions" - mocks_store "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" + store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" "go.woodpecker-ci.org/woodpecker/v3/server/store/types" "go.woodpecker-ci.org/woodpecker/v3/shared/token" ) @@ -70,8 +70,8 @@ func TestHandleAuth(t *testing.T) { }) t.Run("should fail if the state is wrong", func(t *testing.T) { - _manager := mocks_services.NewManager(t) - _store := mocks_store.NewStore(t) + _manager := services_mocks.NewMockManager(t) + _store := store_mocks.NewMockStore(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = true server.Config.Permissions.Orgs = permissions.NewOrgs(nil) @@ -103,9 +103,9 @@ func TestHandleAuth(t *testing.T) { }) t.Run("should redirect to forge login page", func(t *testing.T) { - _manager := mocks_services.NewManager(t) - _forge := mocks_forge.NewForge(t) - _store := mocks_store.NewStore(t) + _manager := services_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + _store := store_mocks.NewMockStore(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = true server.Config.Permissions.Orgs = permissions.NewOrgs(nil) @@ -139,9 +139,9 @@ func TestHandleAuth(t *testing.T) { }) t.Run("should register a new user", func(t *testing.T) { - _manager := mocks_services.NewManager(t) - _forge := mocks_forge.NewForge(t) - _store := mocks_store.NewStore(t) + _manager := services_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + _store := store_mocks.NewMockStore(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = true server.Config.Permissions.Orgs = permissions.NewOrgs(nil) @@ -173,9 +173,9 @@ func TestHandleAuth(t *testing.T) { }) t.Run("should login an existing user", func(t *testing.T) { - _manager := mocks_services.NewManager(t) - _forge := mocks_forge.NewForge(t) - _store := mocks_store.NewStore(t) + _manager := services_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + _store := store_mocks.NewMockStore(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = true server.Config.Permissions.Orgs = permissions.NewOrgs(nil) @@ -205,9 +205,9 @@ func TestHandleAuth(t *testing.T) { }) t.Run("should deny a new user if registration is closed", func(t *testing.T) { - _manager := mocks_services.NewManager(t) - _forge := mocks_forge.NewForge(t) - _store := mocks_store.NewStore(t) + _manager := services_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + _store := store_mocks.NewMockStore(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = false server.Config.Permissions.Orgs = permissions.NewOrgs(nil) @@ -233,9 +233,9 @@ func TestHandleAuth(t *testing.T) { }) t.Run("should deny a user with missing org access", func(t *testing.T) { - _manager := mocks_services.NewManager(t) - _forge := mocks_forge.NewForge(t) - _store := mocks_store.NewStore(t) + _manager := services_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + _store := store_mocks.NewMockStore(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = true server.Config.Permissions.Orgs = permissions.NewOrgs([]string{"org1"}) @@ -265,9 +265,9 @@ func TestHandleAuth(t *testing.T) { }) t.Run("should create an user org if it does not exists", func(t *testing.T) { - _manager := mocks_services.NewManager(t) - _forge := mocks_forge.NewForge(t) - _store := mocks_store.NewStore(t) + _manager := services_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + _store := store_mocks.NewMockStore(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = true server.Config.Permissions.Orgs = permissions.NewOrgs(nil) @@ -299,9 +299,9 @@ func TestHandleAuth(t *testing.T) { }) t.Run("should link an user org if it has the same name as the user", func(t *testing.T) { - _manager := mocks_services.NewManager(t) - _forge := mocks_forge.NewForge(t) - _store := mocks_store.NewStore(t) + _manager := services_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + _store := store_mocks.NewMockStore(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = true server.Config.Permissions.Orgs = permissions.NewOrgs(nil) @@ -333,9 +333,9 @@ func TestHandleAuth(t *testing.T) { }) t.Run("should update an user org if the user name was changed", func(t *testing.T) { - _manager := mocks_services.NewManager(t) - _forge := mocks_forge.NewForge(t) - _store := mocks_store.NewStore(t) + _manager := services_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + _store := store_mocks.NewMockStore(t) server.Config.Services.Manager = _manager server.Config.Permissions.Open = true server.Config.Permissions.Orgs = permissions.NewOrgs(nil) diff --git a/server/api/pipeline_test.go b/server/api/pipeline_test.go index 04c1ba52c..65bb042bc 100644 --- a/server/api/pipeline_test.go +++ b/server/api/pipeline_test.go @@ -28,7 +28,7 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server" forge_mocks "go.woodpecker-ci.org/woodpecker/v3/server/forge/mocks" "go.woodpecker-ci.org/woodpecker/v3/server/model" - mocks_manager "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" + manager_mocks "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" "go.woodpecker-ci.org/woodpecker/v3/server/store/types" ) @@ -45,7 +45,7 @@ func TestGetPipelines(t *testing.T) { t.Run("should get pipelines", func(t *testing.T) { pipelines := []*model.Pipeline{fakePipeline} - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("GetPipelineList", mock.Anything, mock.Anything, mock.Anything).Return(pipelines, nil) w := httptest.NewRecorder() @@ -70,7 +70,7 @@ func TestGetPipelines(t *testing.T) { t.Run("should parse pipeline filter", func(t *testing.T) { pipelines := []*model.Pipeline{fakePipeline} - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("GetPipelineList", mock.Anything, mock.Anything, mock.Anything).Return(pipelines, nil) c, _ := gin.CreateTestContext(httptest.NewRecorder()) @@ -85,7 +85,7 @@ func TestGetPipelines(t *testing.T) { t.Run("should parse pipeline filter with tz offset", func(t *testing.T) { pipelines := []*model.Pipeline{fakePipeline} - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("GetPipelineList", mock.Anything, mock.Anything, mock.Anything).Return(pipelines, nil) c, _ := gin.CreateTestContext(httptest.NewRecorder()) @@ -99,7 +99,7 @@ func TestGetPipelines(t *testing.T) { t.Run("should filter pipelines by events", func(t *testing.T) { pipelines := []*model.Pipeline{fakePipeline} - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("GetPipelineList", mock.Anything, mock.Anything, mock.Anything).Return(pipelines, nil) w := httptest.NewRecorder() @@ -120,7 +120,7 @@ func TestDeletePipeline(t *testing.T) { gin.SetMode(gin.TestMode) t.Run("should delete pipeline", func(t *testing.T) { - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("GetPipelineNumber", mock.Anything, mock.Anything).Return(fakePipeline, nil) mockStore.On("DeletePipeline", mock.Anything).Return(nil) @@ -147,7 +147,7 @@ func TestDeletePipeline(t *testing.T) { fakePipeline := *fakePipeline fakePipeline.Status = model.StatusPending - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("GetPipelineNumber", mock.Anything, mock.Anything).Return(&fakePipeline, nil) c, _ := gin.CreateTestContext(httptest.NewRecorder()) @@ -173,15 +173,15 @@ func TestGetPipelineMetadata(t *testing.T) { fakeRepo := &model.Repo{ID: 1} - mockForge := forge_mocks.NewForge(t) + mockForge := forge_mocks.NewMockForge(t) mockForge.On("Name").Return("mock") mockForge.On("URL").Return("https://codeberg.org") - mockManager := mocks_manager.NewManager(t) + mockManager := manager_mocks.NewMockManager(t) mockManager.On("ForgeFromRepo", fakeRepo).Return(mockForge, nil) server.Config.Services.Manager = mockManager - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("GetPipelineNumber", mock.Anything, int64(2)).Return(fakePipeline, nil) mockStore.On("GetPipelineLastBefore", mock.Anything, mock.Anything, int64(2)).Return(prevPipeline, nil) @@ -218,7 +218,7 @@ func TestGetPipelineMetadata(t *testing.T) { }) t.Run("should return not found for non-existent pipeline", func(t *testing.T) { - mockStore := store_mocks.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("GetPipelineNumber", mock.Anything, int64(3)).Return((*model.Pipeline)(nil), types.RecordNotExist) w := httptest.NewRecorder() diff --git a/server/cron/cron_test.go b/server/cron/cron_test.go index 76876ead9..2d47a4f82 100644 --- a/server/cron/cron_test.go +++ b/server/cron/cron_test.go @@ -22,16 +22,16 @@ import ( "github.com/stretchr/testify/mock" "go.woodpecker-ci.org/woodpecker/v3/server" - mocks_forge "go.woodpecker-ci.org/woodpecker/v3/server/forge/mocks" + forge_mocks "go.woodpecker-ci.org/woodpecker/v3/server/forge/mocks" "go.woodpecker-ci.org/woodpecker/v3/server/model" - mocks_manager "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" - mocks_store "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" + manager_mocks "go.woodpecker-ci.org/woodpecker/v3/server/services/mocks" + store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" ) func TestCreatePipeline(t *testing.T) { - _manager := mocks_manager.NewManager(t) - _forge := mocks_forge.NewForge(t) - store := mocks_store.NewStore(t) + _manager := manager_mocks.NewMockManager(t) + _forge := forge_mocks.NewMockForge(t) + store := store_mocks.NewMockStore(t) ctx := t.Context() creator := &model.User{ diff --git a/server/forge/bitbucket/bitbucket_test.go b/server/forge/bitbucket/bitbucket_test.go index 6f822c9bd..248db68b2 100644 --- a/server/forge/bitbucket/bitbucket_test.go +++ b/server/forge/bitbucket/bitbucket_test.go @@ -30,7 +30,7 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server/forge/types" "go.woodpecker-ci.org/woodpecker/v3/server/model" "go.woodpecker-ci.org/woodpecker/v3/server/store" - mocks_store "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" + store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" ) func TestNew(t *testing.T) { @@ -206,7 +206,7 @@ func TestBitbucket(t *testing.T) { req.Header = http.Header{} req.Header.Set(hookEvent, hookPush) - mockStore := mocks_store.NewStore(t) + mockStore := store_mocks.NewMockStore(t) ctx = store.InjectToContext(ctx, mockStore) mockStore.On("GetUser", mock.Anything).Return(fakeUser, nil) mockStore.On("GetRepoForgeID", mock.Anything).Return(fakeRepoFromHook, nil) diff --git a/server/forge/forge.go b/server/forge/forge.go index f5102a73e..ad6b084e2 100644 --- a/server/forge/forge.go +++ b/server/forge/forge.go @@ -15,8 +15,6 @@ package forge -//go:generate mockery --name Forge --output mocks --case underscore --note "+build test" - import ( "context" "net/http" diff --git a/server/forge/forgejo/forgejo_test.go b/server/forge/forgejo/forgejo_test.go index 1b394604d..5ac92f45e 100644 --- a/server/forge/forgejo/forgejo_test.go +++ b/server/forge/forgejo/forgejo_test.go @@ -27,7 +27,7 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server/forge/forgejo/fixtures" "go.woodpecker-ci.org/woodpecker/v3/server/model" "go.woodpecker-ci.org/woodpecker/v3/server/store" - mocks_store "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" + store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" ) func TestNew(t *testing.T) { @@ -51,7 +51,7 @@ func Test_forgejo(t *testing.T) { SkipVerify: true, }) - mockStore := mocks_store.NewStore(t) + mockStore := store_mocks.NewMockStore(t) ctx := store.InjectToContext(t.Context(), mockStore) t.Run("netrc with user token", func(t *testing.T) { diff --git a/server/forge/gitea/gitea_test.go b/server/forge/gitea/gitea_test.go index 460fb7661..911a63232 100644 --- a/server/forge/gitea/gitea_test.go +++ b/server/forge/gitea/gitea_test.go @@ -28,7 +28,7 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server/forge/gitea/fixtures" "go.woodpecker-ci.org/woodpecker/v3/server/model" "go.woodpecker-ci.org/woodpecker/v3/server/store" - mocks_store "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" + store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" ) func TestNew(t *testing.T) { @@ -52,7 +52,7 @@ func Test_gitea(t *testing.T) { SkipVerify: true, }) - mockStore := mocks_store.NewStore(t) + mockStore := store_mocks.NewMockStore(t) ctx := store.InjectToContext(t.Context(), mockStore) t.Run("netrc with user token", func(t *testing.T) { diff --git a/server/forge/mocks/forge.go b/server/forge/mocks/forge.go deleted file mode 100644 index 0c6ec4421..000000000 --- a/server/forge/mocks/forge.go +++ /dev/null @@ -1,561 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -//go:build test -// +build test - -package mocks - -import ( - context "context" - - http "net/http" - - mock "github.com/stretchr/testify/mock" - - model "go.woodpecker-ci.org/woodpecker/v3/server/model" - - types "go.woodpecker-ci.org/woodpecker/v3/server/forge/types" -) - -// Forge is an autogenerated mock type for the Forge type -type Forge struct { - mock.Mock -} - -// Activate provides a mock function with given fields: ctx, u, r, link -func (_m *Forge) Activate(ctx context.Context, u *model.User, r *model.Repo, link string) error { - ret := _m.Called(ctx, u, r, link) - - if len(ret) == 0 { - panic("no return value specified for Activate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) error); ok { - r0 = rf(ctx, u, r, link) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Auth provides a mock function with given fields: ctx, token, secret -func (_m *Forge) Auth(ctx context.Context, token string, secret string) (string, error) { - ret := _m.Called(ctx, token, secret) - - if len(ret) == 0 { - panic("no return value specified for Auth") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { - return rf(ctx, token, secret) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) string); ok { - r0 = rf(ctx, token, secret) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, token, secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BranchHead provides a mock function with given fields: ctx, u, r, branch -func (_m *Forge) BranchHead(ctx context.Context, u *model.User, r *model.Repo, branch string) (*model.Commit, error) { - ret := _m.Called(ctx, u, r, branch) - - if len(ret) == 0 { - panic("no return value specified for BranchHead") - } - - var r0 *model.Commit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) (*model.Commit, error)); ok { - return rf(ctx, u, r, branch) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) *model.Commit); ok { - r0 = rf(ctx, u, r, branch) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Commit) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, string) error); ok { - r1 = rf(ctx, u, r, branch) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Branches provides a mock function with given fields: ctx, u, r, p -func (_m *Forge) Branches(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]string, error) { - ret := _m.Called(ctx, u, r, p) - - if len(ret) == 0 { - panic("no return value specified for Branches") - } - - var r0 []string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) ([]string, error)); ok { - return rf(ctx, u, r, p) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) []string); ok { - r0 = rf(ctx, u, r, p) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]string) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) error); ok { - r1 = rf(ctx, u, r, p) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Deactivate provides a mock function with given fields: ctx, u, r, link -func (_m *Forge) Deactivate(ctx context.Context, u *model.User, r *model.Repo, link string) error { - ret := _m.Called(ctx, u, r, link) - - if len(ret) == 0 { - panic("no return value specified for Deactivate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) error); ok { - r0 = rf(ctx, u, r, link) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Dir provides a mock function with given fields: ctx, u, r, b, f -func (_m *Forge) Dir(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string) ([]*types.FileMeta, error) { - ret := _m.Called(ctx, u, r, b, f) - - if len(ret) == 0 { - panic("no return value specified for Dir") - } - - var r0 []*types.FileMeta - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) ([]*types.FileMeta, error)); ok { - return rf(ctx, u, r, b, f) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) []*types.FileMeta); ok { - r0 = rf(ctx, u, r, b, f) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*types.FileMeta) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) error); ok { - r1 = rf(ctx, u, r, b, f) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// File provides a mock function with given fields: ctx, u, r, b, f -func (_m *Forge) File(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string) ([]byte, error) { - ret := _m.Called(ctx, u, r, b, f) - - if len(ret) == 0 { - panic("no return value specified for File") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) ([]byte, error)); ok { - return rf(ctx, u, r, b, f) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) []byte); ok { - r0 = rf(ctx, u, r, b, f) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) error); ok { - r1 = rf(ctx, u, r, b, f) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Hook provides a mock function with given fields: ctx, r -func (_m *Forge) Hook(ctx context.Context, r *http.Request) (*model.Repo, *model.Pipeline, error) { - ret := _m.Called(ctx, r) - - if len(ret) == 0 { - panic("no return value specified for Hook") - } - - var r0 *model.Repo - var r1 *model.Pipeline - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, *http.Request) (*model.Repo, *model.Pipeline, error)); ok { - return rf(ctx, r) - } - if rf, ok := ret.Get(0).(func(context.Context, *http.Request) *model.Repo); ok { - r0 = rf(ctx, r) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *http.Request) *model.Pipeline); ok { - r1 = rf(ctx, r) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.Pipeline) - } - } - - if rf, ok := ret.Get(2).(func(context.Context, *http.Request) error); ok { - r2 = rf(ctx, r) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// Login provides a mock function with given fields: ctx, r -func (_m *Forge) Login(ctx context.Context, r *types.OAuthRequest) (*model.User, string, error) { - ret := _m.Called(ctx, r) - - if len(ret) == 0 { - panic("no return value specified for Login") - } - - var r0 *model.User - var r1 string - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, *types.OAuthRequest) (*model.User, string, error)); ok { - return rf(ctx, r) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.OAuthRequest) *model.User); ok { - r0 = rf(ctx, r) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.User) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.OAuthRequest) string); ok { - r1 = rf(ctx, r) - } else { - r1 = ret.Get(1).(string) - } - - if rf, ok := ret.Get(2).(func(context.Context, *types.OAuthRequest) error); ok { - r2 = rf(ctx, r) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// Name provides a mock function with no fields -func (_m *Forge) Name() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Name") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// Netrc provides a mock function with given fields: u, r -func (_m *Forge) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error) { - ret := _m.Called(u, r) - - if len(ret) == 0 { - panic("no return value specified for Netrc") - } - - var r0 *model.Netrc - var r1 error - if rf, ok := ret.Get(0).(func(*model.User, *model.Repo) (*model.Netrc, error)); ok { - return rf(u, r) - } - if rf, ok := ret.Get(0).(func(*model.User, *model.Repo) *model.Netrc); ok { - r0 = rf(u, r) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Netrc) - } - } - - if rf, ok := ret.Get(1).(func(*model.User, *model.Repo) error); ok { - r1 = rf(u, r) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Org provides a mock function with given fields: ctx, u, org -func (_m *Forge) Org(ctx context.Context, u *model.User, org string) (*model.Org, error) { - ret := _m.Called(ctx, u, org) - - if len(ret) == 0 { - panic("no return value specified for Org") - } - - var r0 *model.Org - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, string) (*model.Org, error)); ok { - return rf(ctx, u, org) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User, string) *model.Org); ok { - r0 = rf(ctx, u, org) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Org) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User, string) error); ok { - r1 = rf(ctx, u, org) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgMembership provides a mock function with given fields: ctx, u, org -func (_m *Forge) OrgMembership(ctx context.Context, u *model.User, org string) (*model.OrgPerm, error) { - ret := _m.Called(ctx, u, org) - - if len(ret) == 0 { - panic("no return value specified for OrgMembership") - } - - var r0 *model.OrgPerm - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, string) (*model.OrgPerm, error)); ok { - return rf(ctx, u, org) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User, string) *model.OrgPerm); ok { - r0 = rf(ctx, u, org) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.OrgPerm) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User, string) error); ok { - r1 = rf(ctx, u, org) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PullRequests provides a mock function with given fields: ctx, u, r, p -func (_m *Forge) PullRequests(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]*model.PullRequest, error) { - ret := _m.Called(ctx, u, r, p) - - if len(ret) == 0 { - panic("no return value specified for PullRequests") - } - - var r0 []*model.PullRequest - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) ([]*model.PullRequest, error)); ok { - return rf(ctx, u, r, p) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) []*model.PullRequest); ok { - r0 = rf(ctx, u, r, p) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.PullRequest) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) error); ok { - r1 = rf(ctx, u, r, p) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Repo provides a mock function with given fields: ctx, u, remoteID, owner, name -func (_m *Forge) Repo(ctx context.Context, u *model.User, remoteID model.ForgeRemoteID, owner string, name string) (*model.Repo, error) { - ret := _m.Called(ctx, u, remoteID, owner, name) - - if len(ret) == 0 { - panic("no return value specified for Repo") - } - - var r0 *model.Repo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) (*model.Repo, error)); ok { - return rf(ctx, u, remoteID, owner, name) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) *model.Repo); ok { - r0 = rf(ctx, u, remoteID, owner, name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) error); ok { - r1 = rf(ctx, u, remoteID, owner, name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Repos provides a mock function with given fields: ctx, u -func (_m *Forge) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error) { - ret := _m.Called(ctx, u) - - if len(ret) == 0 { - panic("no return value specified for Repos") - } - - var r0 []*model.Repo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User) ([]*model.Repo, error)); ok { - return rf(ctx, u) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User) []*model.Repo); ok { - r0 = rf(ctx, u) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User) error); ok { - r1 = rf(ctx, u) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Status provides a mock function with given fields: ctx, u, r, b, p -func (_m *Forge) Status(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, p *model.Workflow) error { - ret := _m.Called(ctx, u, r, b, p) - - if len(ret) == 0 { - panic("no return value specified for Status") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, *model.Workflow) error); ok { - r0 = rf(ctx, u, r, b, p) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Teams provides a mock function with given fields: ctx, u -func (_m *Forge) Teams(ctx context.Context, u *model.User) ([]*model.Team, error) { - ret := _m.Called(ctx, u) - - if len(ret) == 0 { - panic("no return value specified for Teams") - } - - var r0 []*model.Team - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *model.User) ([]*model.Team, error)); ok { - return rf(ctx, u) - } - if rf, ok := ret.Get(0).(func(context.Context, *model.User) []*model.Team); ok { - r0 = rf(ctx, u) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Team) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *model.User) error); ok { - r1 = rf(ctx, u) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// URL provides a mock function with no fields -func (_m *Forge) URL() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for URL") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NewForge creates a new instance of Forge. 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 NewForge(t interface { - mock.TestingT - Cleanup(func()) -}) *Forge { - mock := &Forge{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/server/forge/mocks/mock_Forge.go b/server/forge/mocks/mock_Forge.go new file mode 100644 index 000000000..e012c2aac --- /dev/null +++ b/server/forge/mocks/mock_Forge.go @@ -0,0 +1,1414 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "context" + "net/http" + + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/forge/types" + "go.woodpecker-ci.org/woodpecker/v3/server/model" +) + +// NewMockForge creates a new instance of MockForge. 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 NewMockForge(t interface { + mock.TestingT + Cleanup(func()) +}) *MockForge { + mock := &MockForge{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockForge is an autogenerated mock type for the Forge type +type MockForge struct { + mock.Mock +} + +type MockForge_Expecter struct { + mock *mock.Mock +} + +func (_m *MockForge) EXPECT() *MockForge_Expecter { + return &MockForge_Expecter{mock: &_m.Mock} +} + +// Activate provides a mock function for the type MockForge +func (_mock *MockForge) Activate(ctx context.Context, u *model.User, r *model.Repo, link string) error { + ret := _mock.Called(ctx, u, r, link) + + if len(ret) == 0 { + panic("no return value specified for Activate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) error); ok { + r0 = returnFunc(ctx, u, r, link) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockForge_Activate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Activate' +type MockForge_Activate_Call struct { + *mock.Call +} + +// Activate is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - r *model.Repo +// - link string +func (_e *MockForge_Expecter) Activate(ctx interface{}, u interface{}, r interface{}, link interface{}) *MockForge_Activate_Call { + return &MockForge_Activate_Call{Call: _e.mock.On("Activate", ctx, u, r, link)} +} + +func (_c *MockForge_Activate_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, link string)) *MockForge_Activate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 *model.Repo + if args[2] != nil { + arg2 = args[2].(*model.Repo) + } + var arg3 string + if args[3] != nil { + arg3 = args[3].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockForge_Activate_Call) Return(err error) *MockForge_Activate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockForge_Activate_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, link string) error) *MockForge_Activate_Call { + _c.Call.Return(run) + return _c +} + +// Auth provides a mock function for the type MockForge +func (_mock *MockForge) Auth(ctx context.Context, token string, secret string) (string, error) { + ret := _mock.Called(ctx, token, secret) + + if len(ret) == 0 { + panic("no return value specified for Auth") + } + + var r0 string + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { + return returnFunc(ctx, token, secret) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) string); ok { + r0 = returnFunc(ctx, token, secret) + } else { + r0 = ret.Get(0).(string) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, token, secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_Auth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Auth' +type MockForge_Auth_Call struct { + *mock.Call +} + +// Auth is a helper method to define mock.On call +// - ctx context.Context +// - token string +// - secret string +func (_e *MockForge_Expecter) Auth(ctx interface{}, token interface{}, secret interface{}) *MockForge_Auth_Call { + return &MockForge_Auth_Call{Call: _e.mock.On("Auth", ctx, token, secret)} +} + +func (_c *MockForge_Auth_Call) Run(run func(ctx context.Context, token string, secret string)) *MockForge_Auth_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 *MockForge_Auth_Call) Return(s string, err error) *MockForge_Auth_Call { + _c.Call.Return(s, err) + return _c +} + +func (_c *MockForge_Auth_Call) RunAndReturn(run func(ctx context.Context, token string, secret string) (string, error)) *MockForge_Auth_Call { + _c.Call.Return(run) + return _c +} + +// BranchHead provides a mock function for the type MockForge +func (_mock *MockForge) BranchHead(ctx context.Context, u *model.User, r *model.Repo, branch string) (*model.Commit, error) { + ret := _mock.Called(ctx, u, r, branch) + + if len(ret) == 0 { + panic("no return value specified for BranchHead") + } + + var r0 *model.Commit + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) (*model.Commit, error)); ok { + return returnFunc(ctx, u, r, branch) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) *model.Commit); ok { + r0 = returnFunc(ctx, u, r, branch) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Commit) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, string) error); ok { + r1 = returnFunc(ctx, u, r, branch) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_BranchHead_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BranchHead' +type MockForge_BranchHead_Call struct { + *mock.Call +} + +// BranchHead is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - r *model.Repo +// - branch string +func (_e *MockForge_Expecter) BranchHead(ctx interface{}, u interface{}, r interface{}, branch interface{}) *MockForge_BranchHead_Call { + return &MockForge_BranchHead_Call{Call: _e.mock.On("BranchHead", ctx, u, r, branch)} +} + +func (_c *MockForge_BranchHead_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, branch string)) *MockForge_BranchHead_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 *model.Repo + if args[2] != nil { + arg2 = args[2].(*model.Repo) + } + var arg3 string + if args[3] != nil { + arg3 = args[3].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockForge_BranchHead_Call) Return(commit *model.Commit, err error) *MockForge_BranchHead_Call { + _c.Call.Return(commit, err) + return _c +} + +func (_c *MockForge_BranchHead_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, branch string) (*model.Commit, error)) *MockForge_BranchHead_Call { + _c.Call.Return(run) + return _c +} + +// Branches provides a mock function for the type MockForge +func (_mock *MockForge) Branches(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]string, error) { + ret := _mock.Called(ctx, u, r, p) + + if len(ret) == 0 { + panic("no return value specified for Branches") + } + + var r0 []string + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) ([]string, error)); ok { + return returnFunc(ctx, u, r, p) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) []string); ok { + r0 = returnFunc(ctx, u, r, p) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) error); ok { + r1 = returnFunc(ctx, u, r, p) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_Branches_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Branches' +type MockForge_Branches_Call struct { + *mock.Call +} + +// Branches is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - r *model.Repo +// - p *model.ListOptions +func (_e *MockForge_Expecter) Branches(ctx interface{}, u interface{}, r interface{}, p interface{}) *MockForge_Branches_Call { + return &MockForge_Branches_Call{Call: _e.mock.On("Branches", ctx, u, r, p)} +} + +func (_c *MockForge_Branches_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions)) *MockForge_Branches_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 *model.Repo + if args[2] != nil { + arg2 = args[2].(*model.Repo) + } + var arg3 *model.ListOptions + if args[3] != nil { + arg3 = args[3].(*model.ListOptions) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockForge_Branches_Call) Return(strings []string, err error) *MockForge_Branches_Call { + _c.Call.Return(strings, err) + return _c +} + +func (_c *MockForge_Branches_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]string, error)) *MockForge_Branches_Call { + _c.Call.Return(run) + return _c +} + +// Deactivate provides a mock function for the type MockForge +func (_mock *MockForge) Deactivate(ctx context.Context, u *model.User, r *model.Repo, link string) error { + ret := _mock.Called(ctx, u, r, link) + + if len(ret) == 0 { + panic("no return value specified for Deactivate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) error); ok { + r0 = returnFunc(ctx, u, r, link) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockForge_Deactivate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deactivate' +type MockForge_Deactivate_Call struct { + *mock.Call +} + +// Deactivate is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - r *model.Repo +// - link string +func (_e *MockForge_Expecter) Deactivate(ctx interface{}, u interface{}, r interface{}, link interface{}) *MockForge_Deactivate_Call { + return &MockForge_Deactivate_Call{Call: _e.mock.On("Deactivate", ctx, u, r, link)} +} + +func (_c *MockForge_Deactivate_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, link string)) *MockForge_Deactivate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 *model.Repo + if args[2] != nil { + arg2 = args[2].(*model.Repo) + } + var arg3 string + if args[3] != nil { + arg3 = args[3].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockForge_Deactivate_Call) Return(err error) *MockForge_Deactivate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockForge_Deactivate_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, link string) error) *MockForge_Deactivate_Call { + _c.Call.Return(run) + return _c +} + +// Dir provides a mock function for the type MockForge +func (_mock *MockForge) Dir(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string) ([]*types.FileMeta, error) { + ret := _mock.Called(ctx, u, r, b, f) + + if len(ret) == 0 { + panic("no return value specified for Dir") + } + + var r0 []*types.FileMeta + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) ([]*types.FileMeta, error)); ok { + return returnFunc(ctx, u, r, b, f) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) []*types.FileMeta); ok { + r0 = returnFunc(ctx, u, r, b, f) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*types.FileMeta) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) error); ok { + r1 = returnFunc(ctx, u, r, b, f) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_Dir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dir' +type MockForge_Dir_Call struct { + *mock.Call +} + +// Dir is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - r *model.Repo +// - b *model.Pipeline +// - f string +func (_e *MockForge_Expecter) Dir(ctx interface{}, u interface{}, r interface{}, b interface{}, f interface{}) *MockForge_Dir_Call { + return &MockForge_Dir_Call{Call: _e.mock.On("Dir", ctx, u, r, b, f)} +} + +func (_c *MockForge_Dir_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string)) *MockForge_Dir_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 *model.Repo + if args[2] != nil { + arg2 = args[2].(*model.Repo) + } + var arg3 *model.Pipeline + if args[3] != nil { + arg3 = args[3].(*model.Pipeline) + } + var arg4 string + if args[4] != nil { + arg4 = args[4].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) + }) + return _c +} + +func (_c *MockForge_Dir_Call) Return(fileMetas []*types.FileMeta, err error) *MockForge_Dir_Call { + _c.Call.Return(fileMetas, err) + return _c +} + +func (_c *MockForge_Dir_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string) ([]*types.FileMeta, error)) *MockForge_Dir_Call { + _c.Call.Return(run) + return _c +} + +// File provides a mock function for the type MockForge +func (_mock *MockForge) File(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string) ([]byte, error) { + ret := _mock.Called(ctx, u, r, b, f) + + if len(ret) == 0 { + panic("no return value specified for File") + } + + var r0 []byte + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) ([]byte, error)); ok { + return returnFunc(ctx, u, r, b, f) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) []byte); ok { + r0 = returnFunc(ctx, u, r, b, f) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) error); ok { + r1 = returnFunc(ctx, u, r, b, f) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_File_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'File' +type MockForge_File_Call struct { + *mock.Call +} + +// File is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - r *model.Repo +// - b *model.Pipeline +// - f string +func (_e *MockForge_Expecter) File(ctx interface{}, u interface{}, r interface{}, b interface{}, f interface{}) *MockForge_File_Call { + return &MockForge_File_Call{Call: _e.mock.On("File", ctx, u, r, b, f)} +} + +func (_c *MockForge_File_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string)) *MockForge_File_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 *model.Repo + if args[2] != nil { + arg2 = args[2].(*model.Repo) + } + var arg3 *model.Pipeline + if args[3] != nil { + arg3 = args[3].(*model.Pipeline) + } + var arg4 string + if args[4] != nil { + arg4 = args[4].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) + }) + return _c +} + +func (_c *MockForge_File_Call) Return(bytes []byte, err error) *MockForge_File_Call { + _c.Call.Return(bytes, err) + return _c +} + +func (_c *MockForge_File_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string) ([]byte, error)) *MockForge_File_Call { + _c.Call.Return(run) + return _c +} + +// Hook provides a mock function for the type MockForge +func (_mock *MockForge) Hook(ctx context.Context, r *http.Request) (*model.Repo, *model.Pipeline, error) { + ret := _mock.Called(ctx, r) + + if len(ret) == 0 { + panic("no return value specified for Hook") + } + + var r0 *model.Repo + var r1 *model.Pipeline + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *http.Request) (*model.Repo, *model.Pipeline, error)); ok { + return returnFunc(ctx, r) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *http.Request) *model.Repo); ok { + r0 = returnFunc(ctx, r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *http.Request) *model.Pipeline); ok { + r1 = returnFunc(ctx, r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.Pipeline) + } + } + if returnFunc, ok := ret.Get(2).(func(context.Context, *http.Request) error); ok { + r2 = returnFunc(ctx, r) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockForge_Hook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Hook' +type MockForge_Hook_Call struct { + *mock.Call +} + +// Hook is a helper method to define mock.On call +// - ctx context.Context +// - r *http.Request +func (_e *MockForge_Expecter) Hook(ctx interface{}, r interface{}) *MockForge_Hook_Call { + return &MockForge_Hook_Call{Call: _e.mock.On("Hook", ctx, r)} +} + +func (_c *MockForge_Hook_Call) Run(run func(ctx context.Context, r *http.Request)) *MockForge_Hook_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *http.Request + if args[1] != nil { + arg1 = args[1].(*http.Request) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockForge_Hook_Call) Return(repo *model.Repo, pipeline *model.Pipeline, err error) *MockForge_Hook_Call { + _c.Call.Return(repo, pipeline, err) + return _c +} + +func (_c *MockForge_Hook_Call) RunAndReturn(run func(ctx context.Context, r *http.Request) (*model.Repo, *model.Pipeline, error)) *MockForge_Hook_Call { + _c.Call.Return(run) + return _c +} + +// Login provides a mock function for the type MockForge +func (_mock *MockForge) Login(ctx context.Context, r *types.OAuthRequest) (*model.User, string, error) { + ret := _mock.Called(ctx, r) + + if len(ret) == 0 { + panic("no return value specified for Login") + } + + var r0 *model.User + var r1 string + var r2 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.OAuthRequest) (*model.User, string, error)); ok { + return returnFunc(ctx, r) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.OAuthRequest) *model.User); ok { + r0 = returnFunc(ctx, r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.User) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.OAuthRequest) string); ok { + r1 = returnFunc(ctx, r) + } else { + r1 = ret.Get(1).(string) + } + if returnFunc, ok := ret.Get(2).(func(context.Context, *types.OAuthRequest) error); ok { + r2 = returnFunc(ctx, r) + } else { + r2 = ret.Error(2) + } + return r0, r1, r2 +} + +// MockForge_Login_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Login' +type MockForge_Login_Call struct { + *mock.Call +} + +// Login is a helper method to define mock.On call +// - ctx context.Context +// - r *types.OAuthRequest +func (_e *MockForge_Expecter) Login(ctx interface{}, r interface{}) *MockForge_Login_Call { + return &MockForge_Login_Call{Call: _e.mock.On("Login", ctx, r)} +} + +func (_c *MockForge_Login_Call) Run(run func(ctx context.Context, r *types.OAuthRequest)) *MockForge_Login_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *types.OAuthRequest + if args[1] != nil { + arg1 = args[1].(*types.OAuthRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockForge_Login_Call) Return(user *model.User, s string, err error) *MockForge_Login_Call { + _c.Call.Return(user, s, err) + return _c +} + +func (_c *MockForge_Login_Call) RunAndReturn(run func(ctx context.Context, r *types.OAuthRequest) (*model.User, string, error)) *MockForge_Login_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function for the type MockForge +func (_mock *MockForge) Name() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Name") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// MockForge_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type MockForge_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *MockForge_Expecter) Name() *MockForge_Name_Call { + return &MockForge_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *MockForge_Name_Call) Run(run func()) *MockForge_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockForge_Name_Call) Return(s string) *MockForge_Name_Call { + _c.Call.Return(s) + return _c +} + +func (_c *MockForge_Name_Call) RunAndReturn(run func() string) *MockForge_Name_Call { + _c.Call.Return(run) + return _c +} + +// Netrc provides a mock function for the type MockForge +func (_mock *MockForge) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error) { + ret := _mock.Called(u, r) + + if len(ret) == 0 { + panic("no return value specified for Netrc") + } + + var r0 *model.Netrc + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.User, *model.Repo) (*model.Netrc, error)); ok { + return returnFunc(u, r) + } + if returnFunc, ok := ret.Get(0).(func(*model.User, *model.Repo) *model.Netrc); ok { + r0 = returnFunc(u, r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Netrc) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.User, *model.Repo) error); ok { + r1 = returnFunc(u, r) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_Netrc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Netrc' +type MockForge_Netrc_Call struct { + *mock.Call +} + +// Netrc is a helper method to define mock.On call +// - u *model.User +// - r *model.Repo +func (_e *MockForge_Expecter) Netrc(u interface{}, r interface{}) *MockForge_Netrc_Call { + return &MockForge_Netrc_Call{Call: _e.mock.On("Netrc", u, r)} +} + +func (_c *MockForge_Netrc_Call) Run(run func(u *model.User, r *model.Repo)) *MockForge_Netrc_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.User + if args[0] != nil { + arg0 = args[0].(*model.User) + } + var arg1 *model.Repo + if args[1] != nil { + arg1 = args[1].(*model.Repo) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockForge_Netrc_Call) Return(netrc *model.Netrc, err error) *MockForge_Netrc_Call { + _c.Call.Return(netrc, err) + return _c +} + +func (_c *MockForge_Netrc_Call) RunAndReturn(run func(u *model.User, r *model.Repo) (*model.Netrc, error)) *MockForge_Netrc_Call { + _c.Call.Return(run) + return _c +} + +// Org provides a mock function for the type MockForge +func (_mock *MockForge) Org(ctx context.Context, u *model.User, org string) (*model.Org, error) { + ret := _mock.Called(ctx, u, org) + + if len(ret) == 0 { + panic("no return value specified for Org") + } + + var r0 *model.Org + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, string) (*model.Org, error)); ok { + return returnFunc(ctx, u, org) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, string) *model.Org); ok { + r0 = returnFunc(ctx, u, org) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Org) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, string) error); ok { + r1 = returnFunc(ctx, u, org) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_Org_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Org' +type MockForge_Org_Call struct { + *mock.Call +} + +// Org is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - org string +func (_e *MockForge_Expecter) Org(ctx interface{}, u interface{}, org interface{}) *MockForge_Org_Call { + return &MockForge_Org_Call{Call: _e.mock.On("Org", ctx, u, org)} +} + +func (_c *MockForge_Org_Call) Run(run func(ctx context.Context, u *model.User, org string)) *MockForge_Org_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockForge_Org_Call) Return(org1 *model.Org, err error) *MockForge_Org_Call { + _c.Call.Return(org1, err) + return _c +} + +func (_c *MockForge_Org_Call) RunAndReturn(run func(ctx context.Context, u *model.User, org string) (*model.Org, error)) *MockForge_Org_Call { + _c.Call.Return(run) + return _c +} + +// OrgMembership provides a mock function for the type MockForge +func (_mock *MockForge) OrgMembership(ctx context.Context, u *model.User, org string) (*model.OrgPerm, error) { + ret := _mock.Called(ctx, u, org) + + if len(ret) == 0 { + panic("no return value specified for OrgMembership") + } + + var r0 *model.OrgPerm + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, string) (*model.OrgPerm, error)); ok { + return returnFunc(ctx, u, org) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, string) *model.OrgPerm); ok { + r0 = returnFunc(ctx, u, org) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.OrgPerm) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, string) error); ok { + r1 = returnFunc(ctx, u, org) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_OrgMembership_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgMembership' +type MockForge_OrgMembership_Call struct { + *mock.Call +} + +// OrgMembership is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - org string +func (_e *MockForge_Expecter) OrgMembership(ctx interface{}, u interface{}, org interface{}) *MockForge_OrgMembership_Call { + return &MockForge_OrgMembership_Call{Call: _e.mock.On("OrgMembership", ctx, u, org)} +} + +func (_c *MockForge_OrgMembership_Call) Run(run func(ctx context.Context, u *model.User, org string)) *MockForge_OrgMembership_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockForge_OrgMembership_Call) Return(orgPerm *model.OrgPerm, err error) *MockForge_OrgMembership_Call { + _c.Call.Return(orgPerm, err) + return _c +} + +func (_c *MockForge_OrgMembership_Call) RunAndReturn(run func(ctx context.Context, u *model.User, org string) (*model.OrgPerm, error)) *MockForge_OrgMembership_Call { + _c.Call.Return(run) + return _c +} + +// PullRequests provides a mock function for the type MockForge +func (_mock *MockForge) PullRequests(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]*model.PullRequest, error) { + ret := _mock.Called(ctx, u, r, p) + + if len(ret) == 0 { + panic("no return value specified for PullRequests") + } + + var r0 []*model.PullRequest + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) ([]*model.PullRequest, error)); ok { + return returnFunc(ctx, u, r, p) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) []*model.PullRequest); ok { + r0 = returnFunc(ctx, u, r, p) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.PullRequest) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) error); ok { + r1 = returnFunc(ctx, u, r, p) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_PullRequests_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PullRequests' +type MockForge_PullRequests_Call struct { + *mock.Call +} + +// PullRequests is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - r *model.Repo +// - p *model.ListOptions +func (_e *MockForge_Expecter) PullRequests(ctx interface{}, u interface{}, r interface{}, p interface{}) *MockForge_PullRequests_Call { + return &MockForge_PullRequests_Call{Call: _e.mock.On("PullRequests", ctx, u, r, p)} +} + +func (_c *MockForge_PullRequests_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions)) *MockForge_PullRequests_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 *model.Repo + if args[2] != nil { + arg2 = args[2].(*model.Repo) + } + var arg3 *model.ListOptions + if args[3] != nil { + arg3 = args[3].(*model.ListOptions) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockForge_PullRequests_Call) Return(pullRequests []*model.PullRequest, err error) *MockForge_PullRequests_Call { + _c.Call.Return(pullRequests, err) + return _c +} + +func (_c *MockForge_PullRequests_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]*model.PullRequest, error)) *MockForge_PullRequests_Call { + _c.Call.Return(run) + return _c +} + +// Repo provides a mock function for the type MockForge +func (_mock *MockForge) Repo(ctx context.Context, u *model.User, remoteID model.ForgeRemoteID, owner string, name string) (*model.Repo, error) { + ret := _mock.Called(ctx, u, remoteID, owner, name) + + if len(ret) == 0 { + panic("no return value specified for Repo") + } + + var r0 *model.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) (*model.Repo, error)); ok { + return returnFunc(ctx, u, remoteID, owner, name) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) *model.Repo); ok { + r0 = returnFunc(ctx, u, remoteID, owner, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) error); ok { + r1 = returnFunc(ctx, u, remoteID, owner, name) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_Repo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Repo' +type MockForge_Repo_Call struct { + *mock.Call +} + +// Repo is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - remoteID model.ForgeRemoteID +// - owner string +// - name string +func (_e *MockForge_Expecter) Repo(ctx interface{}, u interface{}, remoteID interface{}, owner interface{}, name interface{}) *MockForge_Repo_Call { + return &MockForge_Repo_Call{Call: _e.mock.On("Repo", ctx, u, remoteID, owner, name)} +} + +func (_c *MockForge_Repo_Call) Run(run func(ctx context.Context, u *model.User, remoteID model.ForgeRemoteID, owner string, name string)) *MockForge_Repo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 model.ForgeRemoteID + if args[2] != nil { + arg2 = args[2].(model.ForgeRemoteID) + } + var arg3 string + if args[3] != nil { + arg3 = args[3].(string) + } + var arg4 string + if args[4] != nil { + arg4 = args[4].(string) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) + }) + return _c +} + +func (_c *MockForge_Repo_Call) Return(repo *model.Repo, err error) *MockForge_Repo_Call { + _c.Call.Return(repo, err) + return _c +} + +func (_c *MockForge_Repo_Call) RunAndReturn(run func(ctx context.Context, u *model.User, remoteID model.ForgeRemoteID, owner string, name string) (*model.Repo, error)) *MockForge_Repo_Call { + _c.Call.Return(run) + return _c +} + +// Repos provides a mock function for the type MockForge +func (_mock *MockForge) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error) { + ret := _mock.Called(ctx, u) + + if len(ret) == 0 { + panic("no return value specified for Repos") + } + + var r0 []*model.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User) ([]*model.Repo, error)); ok { + return returnFunc(ctx, u) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User) []*model.Repo); ok { + r0 = returnFunc(ctx, u) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User) error); ok { + r1 = returnFunc(ctx, u) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_Repos_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Repos' +type MockForge_Repos_Call struct { + *mock.Call +} + +// Repos is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +func (_e *MockForge_Expecter) Repos(ctx interface{}, u interface{}) *MockForge_Repos_Call { + return &MockForge_Repos_Call{Call: _e.mock.On("Repos", ctx, u)} +} + +func (_c *MockForge_Repos_Call) Run(run func(ctx context.Context, u *model.User)) *MockForge_Repos_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockForge_Repos_Call) Return(repos []*model.Repo, err error) *MockForge_Repos_Call { + _c.Call.Return(repos, err) + return _c +} + +func (_c *MockForge_Repos_Call) RunAndReturn(run func(ctx context.Context, u *model.User) ([]*model.Repo, error)) *MockForge_Repos_Call { + _c.Call.Return(run) + return _c +} + +// Status provides a mock function for the type MockForge +func (_mock *MockForge) Status(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, p *model.Workflow) error { + ret := _mock.Called(ctx, u, r, b, p) + + if len(ret) == 0 { + panic("no return value specified for Status") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, *model.Workflow) error); ok { + r0 = returnFunc(ctx, u, r, b, p) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockForge_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type MockForge_Status_Call struct { + *mock.Call +} + +// Status is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +// - r *model.Repo +// - b *model.Pipeline +// - p *model.Workflow +func (_e *MockForge_Expecter) Status(ctx interface{}, u interface{}, r interface{}, b interface{}, p interface{}) *MockForge_Status_Call { + return &MockForge_Status_Call{Call: _e.mock.On("Status", ctx, u, r, b, p)} +} + +func (_c *MockForge_Status_Call) Run(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, p *model.Workflow)) *MockForge_Status_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + var arg2 *model.Repo + if args[2] != nil { + arg2 = args[2].(*model.Repo) + } + var arg3 *model.Pipeline + if args[3] != nil { + arg3 = args[3].(*model.Pipeline) + } + var arg4 *model.Workflow + if args[4] != nil { + arg4 = args[4].(*model.Workflow) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + ) + }) + return _c +} + +func (_c *MockForge_Status_Call) Return(err error) *MockForge_Status_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockForge_Status_Call) RunAndReturn(run func(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, p *model.Workflow) error) *MockForge_Status_Call { + _c.Call.Return(run) + return _c +} + +// Teams provides a mock function for the type MockForge +func (_mock *MockForge) Teams(ctx context.Context, u *model.User) ([]*model.Team, error) { + ret := _mock.Called(ctx, u) + + if len(ret) == 0 { + panic("no return value specified for Teams") + } + + var r0 []*model.Team + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User) ([]*model.Team, error)); ok { + return returnFunc(ctx, u) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User) []*model.Team); ok { + r0 = returnFunc(ctx, u) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Team) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User) error); ok { + r1 = returnFunc(ctx, u) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockForge_Teams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Teams' +type MockForge_Teams_Call struct { + *mock.Call +} + +// Teams is a helper method to define mock.On call +// - ctx context.Context +// - u *model.User +func (_e *MockForge_Expecter) Teams(ctx interface{}, u interface{}) *MockForge_Teams_Call { + return &MockForge_Teams_Call{Call: _e.mock.On("Teams", ctx, u)} +} + +func (_c *MockForge_Teams_Call) Run(run func(ctx context.Context, u *model.User)) *MockForge_Teams_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockForge_Teams_Call) Return(teams []*model.Team, err error) *MockForge_Teams_Call { + _c.Call.Return(teams, err) + return _c +} + +func (_c *MockForge_Teams_Call) RunAndReturn(run func(ctx context.Context, u *model.User) ([]*model.Team, error)) *MockForge_Teams_Call { + _c.Call.Return(run) + return _c +} + +// URL provides a mock function for the type MockForge +func (_mock *MockForge) URL() string { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for URL") + } + + var r0 string + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(string) + } + return r0 +} + +// MockForge_URL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'URL' +type MockForge_URL_Call struct { + *mock.Call +} + +// URL is a helper method to define mock.On call +func (_e *MockForge_Expecter) URL() *MockForge_URL_Call { + return &MockForge_URL_Call{Call: _e.mock.On("URL")} +} + +func (_c *MockForge_URL_Call) Run(run func()) *MockForge_URL_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockForge_URL_Call) Return(s string) *MockForge_URL_Call { + _c.Call.Return(s) + return _c +} + +func (_c *MockForge_URL_Call) RunAndReturn(run func() string) *MockForge_URL_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/forge/mocks/mock_Refresher.go b/server/forge/mocks/mock_Refresher.go new file mode 100644 index 000000000..faa7d19e0 --- /dev/null +++ b/server/forge/mocks/mock_Refresher.go @@ -0,0 +1,105 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "context" + + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/model" +) + +// NewMockRefresher creates a new instance of MockRefresher. 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 NewMockRefresher(t interface { + mock.TestingT + Cleanup(func()) +}) *MockRefresher { + mock := &MockRefresher{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockRefresher is an autogenerated mock type for the Refresher type +type MockRefresher struct { + mock.Mock +} + +type MockRefresher_Expecter struct { + mock *mock.Mock +} + +func (_m *MockRefresher) EXPECT() *MockRefresher_Expecter { + return &MockRefresher_Expecter{mock: &_m.Mock} +} + +// Refresh provides a mock function for the type MockRefresher +func (_mock *MockRefresher) Refresh(context1 context.Context, user *model.User) (bool, error) { + ret := _mock.Called(context1, user) + + if len(ret) == 0 { + panic("no return value specified for Refresh") + } + + var r0 bool + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User) (bool, error)); ok { + return returnFunc(context1, user) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *model.User) bool); ok { + r0 = returnFunc(context1, user) + } else { + r0 = ret.Get(0).(bool) + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *model.User) error); ok { + r1 = returnFunc(context1, user) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockRefresher_Refresh_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Refresh' +type MockRefresher_Refresh_Call struct { + *mock.Call +} + +// Refresh is a helper method to define mock.On call +// - context1 context.Context +// - user *model.User +func (_e *MockRefresher_Expecter) Refresh(context1 interface{}, user interface{}) *MockRefresher_Refresh_Call { + return &MockRefresher_Refresh_Call{Call: _e.mock.On("Refresh", context1, user)} +} + +func (_c *MockRefresher_Refresh_Call) Run(run func(context1 context.Context, user *model.User)) *MockRefresher_Refresh_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *model.User + if args[1] != nil { + arg1 = args[1].(*model.User) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockRefresher_Refresh_Call) Return(b bool, err error) *MockRefresher_Refresh_Call { + _c.Call.Return(b, err) + return _c +} + +func (_c *MockRefresher_Refresh_Call) RunAndReturn(run func(context1 context.Context, user *model.User) (bool, error)) *MockRefresher_Refresh_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/grpc/rpc_test.go b/server/grpc/rpc_test.go index af287fa61..1a20abdc5 100644 --- a/server/grpc/rpc_test.go +++ b/server/grpc/rpc_test.go @@ -24,12 +24,12 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/pipeline/rpc" "go.woodpecker-ci.org/woodpecker/v3/server/model" - mocks_store "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" + store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" ) func TestRegisterAgent(t *testing.T) { t.Run("When existing agent Name is empty it should update Name with hostname from metadata", func(t *testing.T) { - store := mocks_store.NewStore(t) + store := store_mocks.NewMockStore(t) storeAgent := new(model.Agent) storeAgent.ID = 1337 updatedAgent := model.Agent{ @@ -70,7 +70,7 @@ func TestRegisterAgent(t *testing.T) { }) t.Run("When existing agent hostname is present it should not update the hostname", func(t *testing.T) { - store := mocks_store.NewStore(t) + store := store_mocks.NewMockStore(t) storeAgent := new(model.Agent) storeAgent.ID = 1337 storeAgent.Name = "originalHostname" @@ -117,7 +117,7 @@ func TestUpdateAgentLastWork(t *testing.T) { agent := model.Agent{ LastWork: 0, } - store := mocks_store.NewStore(t) + store := store_mocks.NewMockStore(t) rpc := RPC{ store: store, } @@ -134,7 +134,7 @@ func TestUpdateAgentLastWork(t *testing.T) { agent := model.Agent{ LastWork: lastWork, } - store := mocks_store.NewStore(t) + store := store_mocks.NewMockStore(t) rpc := RPC{ store: store, } diff --git a/server/pipeline/pipeline_status_test.go b/server/pipeline/pipeline_status_test.go index 1f9b87580..aa4bfcee4 100644 --- a/server/pipeline/pipeline_status_test.go +++ b/server/pipeline/pipeline_status_test.go @@ -29,7 +29,7 @@ import ( ) func mockStorePipeline(t *testing.T) store.Store { - s := mocks.NewStore(t) + s := mocks.NewMockStore(t) s.On("UpdatePipeline", mock.Anything).Return(nil) return s } diff --git a/server/pipeline/step_status_test.go b/server/pipeline/step_status_test.go index 1d6212880..f049f5adf 100644 --- a/server/pipeline/step_status_test.go +++ b/server/pipeline/step_status_test.go @@ -30,7 +30,7 @@ import ( ) func mockStoreStep(t *testing.T) store.Store { - s := mocks.NewStore(t) + s := mocks.NewMockStore(t) s.On("StepUpdate", mock.Anything).Return(nil) return s } diff --git a/server/pipeline/stepbuilder/metadata_test.go b/server/pipeline/stepbuilder/metadata_test.go index c63680d94..7d6b598fe 100644 --- a/server/pipeline/stepbuilder/metadata_test.go +++ b/server/pipeline/stepbuilder/metadata_test.go @@ -25,7 +25,7 @@ import ( ) func TestMetadataFromStruct(t *testing.T) { - forge := mocks.NewForge(t) + forge := mocks.NewMockForge(t) forge.On("Name").Return("gitea") forge.On("URL").Return("https://gitea.com") diff --git a/server/pipeline/stepbuilder/stepBuilder_test.go b/server/pipeline/stepbuilder/stepBuilder_test.go index bca38e798..e56c372de 100644 --- a/server/pipeline/stepbuilder/stepBuilder_test.go +++ b/server/pipeline/stepbuilder/stepBuilder_test.go @@ -625,7 +625,7 @@ func TestSanitizePath(t *testing.T) { } func getMockForge(t *testing.T) forge.Forge { - forge := mocks.NewForge(t) + forge := mocks.NewMockForge(t) forge.On("Name").Return("mock") forge.On("URL").Return("https://codeberg.org") return forge diff --git a/server/queue/mocks/mock_Queue.go b/server/queue/mocks/mock_Queue.go new file mode 100644 index 000000000..97a215ed9 --- /dev/null +++ b/server/queue/mocks/mock_Queue.go @@ -0,0 +1,694 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "context" + + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/model" + "go.woodpecker-ci.org/woodpecker/v3/server/queue" +) + +// NewMockQueue creates a new instance of MockQueue. 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 NewMockQueue(t interface { + mock.TestingT + Cleanup(func()) +}) *MockQueue { + mock := &MockQueue{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockQueue is an autogenerated mock type for the Queue type +type MockQueue struct { + mock.Mock +} + +type MockQueue_Expecter struct { + mock *mock.Mock +} + +func (_m *MockQueue) EXPECT() *MockQueue_Expecter { + return &MockQueue_Expecter{mock: &_m.Mock} +} + +// Done provides a mock function for the type MockQueue +func (_mock *MockQueue) Done(c context.Context, id string, exitStatus model.StatusValue) error { + ret := _mock.Called(c, id, exitStatus) + + if len(ret) == 0 { + panic("no return value specified for Done") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, model.StatusValue) error); ok { + r0 = returnFunc(c, id, exitStatus) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockQueue_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done' +type MockQueue_Done_Call struct { + *mock.Call +} + +// Done is a helper method to define mock.On call +// - c context.Context +// - id string +// - exitStatus model.StatusValue +func (_e *MockQueue_Expecter) Done(c interface{}, id interface{}, exitStatus interface{}) *MockQueue_Done_Call { + return &MockQueue_Done_Call{Call: _e.mock.On("Done", c, id, exitStatus)} +} + +func (_c *MockQueue_Done_Call) Run(run func(c context.Context, id string, exitStatus model.StatusValue)) *MockQueue_Done_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 model.StatusValue + if args[2] != nil { + arg2 = args[2].(model.StatusValue) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockQueue_Done_Call) Return(err error) *MockQueue_Done_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockQueue_Done_Call) RunAndReturn(run func(c context.Context, id string, exitStatus model.StatusValue) error) *MockQueue_Done_Call { + _c.Call.Return(run) + return _c +} + +// Error provides a mock function for the type MockQueue +func (_mock *MockQueue) Error(c context.Context, id string, err error) error { + ret := _mock.Called(c, id, err) + + if len(ret) == 0 { + panic("no return value specified for Error") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, error) error); ok { + r0 = returnFunc(c, id, err) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockQueue_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type MockQueue_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +// - c context.Context +// - id string +// - err error +func (_e *MockQueue_Expecter) Error(c interface{}, id interface{}, err interface{}) *MockQueue_Error_Call { + return &MockQueue_Error_Call{Call: _e.mock.On("Error", c, id, err)} +} + +func (_c *MockQueue_Error_Call) Run(run func(c context.Context, id string, err error)) *MockQueue_Error_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 error + if args[2] != nil { + arg2 = args[2].(error) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockQueue_Error_Call) Return(err1 error) *MockQueue_Error_Call { + _c.Call.Return(err1) + return _c +} + +func (_c *MockQueue_Error_Call) RunAndReturn(run func(c context.Context, id string, err error) error) *MockQueue_Error_Call { + _c.Call.Return(run) + return _c +} + +// ErrorAtOnce provides a mock function for the type MockQueue +func (_mock *MockQueue) ErrorAtOnce(c context.Context, ids []string, err error) error { + ret := _mock.Called(c, ids, err) + + if len(ret) == 0 { + panic("no return value specified for ErrorAtOnce") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, []string, error) error); ok { + r0 = returnFunc(c, ids, err) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockQueue_ErrorAtOnce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ErrorAtOnce' +type MockQueue_ErrorAtOnce_Call struct { + *mock.Call +} + +// ErrorAtOnce is a helper method to define mock.On call +// - c context.Context +// - ids []string +// - err error +func (_e *MockQueue_Expecter) ErrorAtOnce(c interface{}, ids interface{}, err interface{}) *MockQueue_ErrorAtOnce_Call { + return &MockQueue_ErrorAtOnce_Call{Call: _e.mock.On("ErrorAtOnce", c, ids, err)} +} + +func (_c *MockQueue_ErrorAtOnce_Call) Run(run func(c context.Context, ids []string, err error)) *MockQueue_ErrorAtOnce_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 error + if args[2] != nil { + arg2 = args[2].(error) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockQueue_ErrorAtOnce_Call) Return(err1 error) *MockQueue_ErrorAtOnce_Call { + _c.Call.Return(err1) + return _c +} + +func (_c *MockQueue_ErrorAtOnce_Call) RunAndReturn(run func(c context.Context, ids []string, err error) error) *MockQueue_ErrorAtOnce_Call { + _c.Call.Return(run) + return _c +} + +// EvictAtOnce provides a mock function for the type MockQueue +func (_mock *MockQueue) EvictAtOnce(c context.Context, ids []string) error { + ret := _mock.Called(c, ids) + + if len(ret) == 0 { + panic("no return value specified for EvictAtOnce") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, []string) error); ok { + r0 = returnFunc(c, ids) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockQueue_EvictAtOnce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EvictAtOnce' +type MockQueue_EvictAtOnce_Call struct { + *mock.Call +} + +// EvictAtOnce is a helper method to define mock.On call +// - c context.Context +// - ids []string +func (_e *MockQueue_Expecter) EvictAtOnce(c interface{}, ids interface{}) *MockQueue_EvictAtOnce_Call { + return &MockQueue_EvictAtOnce_Call{Call: _e.mock.On("EvictAtOnce", c, ids)} +} + +func (_c *MockQueue_EvictAtOnce_Call) Run(run func(c context.Context, ids []string)) *MockQueue_EvictAtOnce_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 *MockQueue_EvictAtOnce_Call) Return(err error) *MockQueue_EvictAtOnce_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockQueue_EvictAtOnce_Call) RunAndReturn(run func(c context.Context, ids []string) error) *MockQueue_EvictAtOnce_Call { + _c.Call.Return(run) + return _c +} + +// Extend provides a mock function for the type MockQueue +func (_mock *MockQueue) Extend(c context.Context, agentID int64, workflowID string) error { + ret := _mock.Called(c, agentID, workflowID) + + if len(ret) == 0 { + panic("no return value specified for Extend") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, string) error); ok { + r0 = returnFunc(c, agentID, workflowID) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockQueue_Extend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Extend' +type MockQueue_Extend_Call struct { + *mock.Call +} + +// Extend is a helper method to define mock.On call +// - c context.Context +// - agentID int64 +// - workflowID string +func (_e *MockQueue_Expecter) Extend(c interface{}, agentID interface{}, workflowID interface{}) *MockQueue_Extend_Call { + return &MockQueue_Extend_Call{Call: _e.mock.On("Extend", c, agentID, workflowID)} +} + +func (_c *MockQueue_Extend_Call) Run(run func(c context.Context, agentID int64, workflowID string)) *MockQueue_Extend_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockQueue_Extend_Call) Return(err error) *MockQueue_Extend_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockQueue_Extend_Call) RunAndReturn(run func(c context.Context, agentID int64, workflowID string) error) *MockQueue_Extend_Call { + _c.Call.Return(run) + return _c +} + +// Info provides a mock function for the type MockQueue +func (_mock *MockQueue) Info(c context.Context) queue.InfoT { + ret := _mock.Called(c) + + if len(ret) == 0 { + panic("no return value specified for Info") + } + + var r0 queue.InfoT + if returnFunc, ok := ret.Get(0).(func(context.Context) queue.InfoT); ok { + r0 = returnFunc(c) + } else { + r0 = ret.Get(0).(queue.InfoT) + } + return r0 +} + +// MockQueue_Info_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Info' +type MockQueue_Info_Call struct { + *mock.Call +} + +// Info is a helper method to define mock.On call +// - c context.Context +func (_e *MockQueue_Expecter) Info(c interface{}) *MockQueue_Info_Call { + return &MockQueue_Info_Call{Call: _e.mock.On("Info", c)} +} + +func (_c *MockQueue_Info_Call) Run(run func(c context.Context)) *MockQueue_Info_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 *MockQueue_Info_Call) Return(infoT queue.InfoT) *MockQueue_Info_Call { + _c.Call.Return(infoT) + return _c +} + +func (_c *MockQueue_Info_Call) RunAndReturn(run func(c context.Context) queue.InfoT) *MockQueue_Info_Call { + _c.Call.Return(run) + return _c +} + +// KickAgentWorkers provides a mock function for the type MockQueue +func (_mock *MockQueue) KickAgentWorkers(agentID int64) { + _mock.Called(agentID) + return +} + +// MockQueue_KickAgentWorkers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KickAgentWorkers' +type MockQueue_KickAgentWorkers_Call struct { + *mock.Call +} + +// KickAgentWorkers is a helper method to define mock.On call +// - agentID int64 +func (_e *MockQueue_Expecter) KickAgentWorkers(agentID interface{}) *MockQueue_KickAgentWorkers_Call { + return &MockQueue_KickAgentWorkers_Call{Call: _e.mock.On("KickAgentWorkers", agentID)} +} + +func (_c *MockQueue_KickAgentWorkers_Call) Run(run func(agentID int64)) *MockQueue_KickAgentWorkers_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockQueue_KickAgentWorkers_Call) Return() *MockQueue_KickAgentWorkers_Call { + _c.Call.Return() + return _c +} + +func (_c *MockQueue_KickAgentWorkers_Call) RunAndReturn(run func(agentID int64)) *MockQueue_KickAgentWorkers_Call { + _c.Run(run) + return _c +} + +// Pause provides a mock function for the type MockQueue +func (_mock *MockQueue) Pause() { + _mock.Called() + return +} + +// MockQueue_Pause_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pause' +type MockQueue_Pause_Call struct { + *mock.Call +} + +// Pause is a helper method to define mock.On call +func (_e *MockQueue_Expecter) Pause() *MockQueue_Pause_Call { + return &MockQueue_Pause_Call{Call: _e.mock.On("Pause")} +} + +func (_c *MockQueue_Pause_Call) Run(run func()) *MockQueue_Pause_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockQueue_Pause_Call) Return() *MockQueue_Pause_Call { + _c.Call.Return() + return _c +} + +func (_c *MockQueue_Pause_Call) RunAndReturn(run func()) *MockQueue_Pause_Call { + _c.Run(run) + return _c +} + +// Poll provides a mock function for the type MockQueue +func (_mock *MockQueue) Poll(c context.Context, agentID int64, f queue.FilterFn) (*model.Task, error) { + ret := _mock.Called(c, agentID, f) + + if len(ret) == 0 { + panic("no return value specified for Poll") + } + + var r0 *model.Task + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, queue.FilterFn) (*model.Task, error)); ok { + return returnFunc(c, agentID, f) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, queue.FilterFn) *model.Task); ok { + r0 = returnFunc(c, agentID, f) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Task) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, int64, queue.FilterFn) error); ok { + r1 = returnFunc(c, agentID, f) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockQueue_Poll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Poll' +type MockQueue_Poll_Call struct { + *mock.Call +} + +// Poll is a helper method to define mock.On call +// - c context.Context +// - agentID int64 +// - f queue.FilterFn +func (_e *MockQueue_Expecter) Poll(c interface{}, agentID interface{}, f interface{}) *MockQueue_Poll_Call { + return &MockQueue_Poll_Call{Call: _e.mock.On("Poll", c, agentID, f)} +} + +func (_c *MockQueue_Poll_Call) Run(run func(c context.Context, agentID int64, f queue.FilterFn)) *MockQueue_Poll_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + var arg2 queue.FilterFn + if args[2] != nil { + arg2 = args[2].(queue.FilterFn) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockQueue_Poll_Call) Return(task *model.Task, err error) *MockQueue_Poll_Call { + _c.Call.Return(task, err) + return _c +} + +func (_c *MockQueue_Poll_Call) RunAndReturn(run func(c context.Context, agentID int64, f queue.FilterFn) (*model.Task, error)) *MockQueue_Poll_Call { + _c.Call.Return(run) + return _c +} + +// PushAtOnce provides a mock function for the type MockQueue +func (_mock *MockQueue) PushAtOnce(c context.Context, tasks []*model.Task) error { + ret := _mock.Called(c, tasks) + + if len(ret) == 0 { + panic("no return value specified for PushAtOnce") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, []*model.Task) error); ok { + r0 = returnFunc(c, tasks) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockQueue_PushAtOnce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushAtOnce' +type MockQueue_PushAtOnce_Call struct { + *mock.Call +} + +// PushAtOnce is a helper method to define mock.On call +// - c context.Context +// - tasks []*model.Task +func (_e *MockQueue_Expecter) PushAtOnce(c interface{}, tasks interface{}) *MockQueue_PushAtOnce_Call { + return &MockQueue_PushAtOnce_Call{Call: _e.mock.On("PushAtOnce", c, tasks)} +} + +func (_c *MockQueue_PushAtOnce_Call) Run(run func(c context.Context, tasks []*model.Task)) *MockQueue_PushAtOnce_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 []*model.Task + if args[1] != nil { + arg1 = args[1].([]*model.Task) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockQueue_PushAtOnce_Call) Return(err error) *MockQueue_PushAtOnce_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockQueue_PushAtOnce_Call) RunAndReturn(run func(c context.Context, tasks []*model.Task) error) *MockQueue_PushAtOnce_Call { + _c.Call.Return(run) + return _c +} + +// Resume provides a mock function for the type MockQueue +func (_mock *MockQueue) Resume() { + _mock.Called() + return +} + +// MockQueue_Resume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Resume' +type MockQueue_Resume_Call struct { + *mock.Call +} + +// Resume is a helper method to define mock.On call +func (_e *MockQueue_Expecter) Resume() *MockQueue_Resume_Call { + return &MockQueue_Resume_Call{Call: _e.mock.On("Resume")} +} + +func (_c *MockQueue_Resume_Call) Run(run func()) *MockQueue_Resume_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockQueue_Resume_Call) Return() *MockQueue_Resume_Call { + _c.Call.Return() + return _c +} + +func (_c *MockQueue_Resume_Call) RunAndReturn(run func()) *MockQueue_Resume_Call { + _c.Run(run) + return _c +} + +// Wait provides a mock function for the type MockQueue +func (_mock *MockQueue) Wait(c context.Context, id string) error { + ret := _mock.Called(c, id) + + if len(ret) == 0 { + panic("no return value specified for Wait") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(c, id) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockQueue_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait' +type MockQueue_Wait_Call struct { + *mock.Call +} + +// Wait is a helper method to define mock.On call +// - c context.Context +// - id string +func (_e *MockQueue_Expecter) Wait(c interface{}, id interface{}) *MockQueue_Wait_Call { + return &MockQueue_Wait_Call{Call: _e.mock.On("Wait", c, id)} +} + +func (_c *MockQueue_Wait_Call) Run(run func(c context.Context, id string)) *MockQueue_Wait_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 *MockQueue_Wait_Call) Return(err error) *MockQueue_Wait_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockQueue_Wait_Call) RunAndReturn(run func(c context.Context, id string) error) *MockQueue_Wait_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/queue/mocks/queue.go b/server/queue/mocks/queue.go deleted file mode 100644 index 1fdbc1d3a..000000000 --- a/server/queue/mocks/queue.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -//go:build test -// +build test - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - model "go.woodpecker-ci.org/woodpecker/v3/server/model" - - queue "go.woodpecker-ci.org/woodpecker/v3/server/queue" -) - -// Queue is an autogenerated mock type for the Queue type -type Queue struct { - mock.Mock -} - -// Done provides a mock function with given fields: c, id, exitStatus -func (_m *Queue) Done(c context.Context, id string, exitStatus model.StatusValue) error { - ret := _m.Called(c, id, exitStatus) - - if len(ret) == 0 { - panic("no return value specified for Done") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, model.StatusValue) error); ok { - r0 = rf(c, id, exitStatus) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Error provides a mock function with given fields: c, id, err -func (_m *Queue) Error(c context.Context, id string, err error) error { - ret := _m.Called(c, id, err) - - if len(ret) == 0 { - panic("no return value specified for Error") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, error) error); ok { - r0 = rf(c, id, err) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ErrorAtOnce provides a mock function with given fields: c, ids, err -func (_m *Queue) ErrorAtOnce(c context.Context, ids []string, err error) error { - ret := _m.Called(c, ids, err) - - if len(ret) == 0 { - panic("no return value specified for ErrorAtOnce") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []string, error) error); ok { - r0 = rf(c, ids, err) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// EvictAtOnce provides a mock function with given fields: c, ids -func (_m *Queue) EvictAtOnce(c context.Context, ids []string) error { - ret := _m.Called(c, ids) - - if len(ret) == 0 { - panic("no return value specified for EvictAtOnce") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []string) error); ok { - r0 = rf(c, ids) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Extend provides a mock function with given fields: c, agentID, workflowID -func (_m *Queue) Extend(c context.Context, agentID int64, workflowID string) error { - ret := _m.Called(c, agentID, workflowID) - - if len(ret) == 0 { - panic("no return value specified for Extend") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, int64, string) error); ok { - r0 = rf(c, agentID, workflowID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Info provides a mock function with given fields: c -func (_m *Queue) Info(c context.Context) queue.InfoT { - ret := _m.Called(c) - - if len(ret) == 0 { - panic("no return value specified for Info") - } - - var r0 queue.InfoT - if rf, ok := ret.Get(0).(func(context.Context) queue.InfoT); ok { - r0 = rf(c) - } else { - r0 = ret.Get(0).(queue.InfoT) - } - - return r0 -} - -// KickAgentWorkers provides a mock function with given fields: agentID -func (_m *Queue) KickAgentWorkers(agentID int64) { - _m.Called(agentID) -} - -// Pause provides a mock function with no fields -func (_m *Queue) Pause() { - _m.Called() -} - -// Poll provides a mock function with given fields: c, agentID, f -func (_m *Queue) Poll(c context.Context, agentID int64, f queue.FilterFn) (*model.Task, error) { - ret := _m.Called(c, agentID, f) - - if len(ret) == 0 { - panic("no return value specified for Poll") - } - - var r0 *model.Task - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, queue.FilterFn) (*model.Task, error)); ok { - return rf(c, agentID, f) - } - if rf, ok := ret.Get(0).(func(context.Context, int64, queue.FilterFn) *model.Task); ok { - r0 = rf(c, agentID, f) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Task) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, int64, queue.FilterFn) error); ok { - r1 = rf(c, agentID, f) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PushAtOnce provides a mock function with given fields: c, tasks -func (_m *Queue) PushAtOnce(c context.Context, tasks []*model.Task) error { - ret := _m.Called(c, tasks) - - if len(ret) == 0 { - panic("no return value specified for PushAtOnce") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []*model.Task) error); ok { - r0 = rf(c, tasks) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Resume provides a mock function with no fields -func (_m *Queue) Resume() { - _m.Called() -} - -// Wait provides a mock function with given fields: c, id -func (_m *Queue) Wait(c context.Context, id string) error { - ret := _m.Called(c, id) - - if len(ret) == 0 { - panic("no return value specified for Wait") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(c, id) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewQueue creates a new instance of Queue. 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 NewQueue(t interface { - mock.TestingT - Cleanup(func()) -}) *Queue { - mock := &Queue{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/server/queue/queue.go b/server/queue/queue.go index 645ff2d9c..cc2447286 100644 --- a/server/queue/queue.go +++ b/server/queue/queue.go @@ -72,8 +72,6 @@ func (t *InfoT) String() string { // The int return value represents the matching score (higher is better). type FilterFn func(*model.Task) (bool, int) -//go:generate mockery --name Queue --output mocks --case underscore --note "+build test" - // Queue defines a task queue for scheduling tasks among // a pool of workers. type Queue interface { diff --git a/server/services/config/combined_test.go b/server/services/config/combined_test.go index 46d9b868d..0269a8a44 100644 --- a/server/services/config/combined_test.go +++ b/server/services/config/combined_test.go @@ -191,7 +191,7 @@ func TestFetchFromConfigService(t *testing.T) { t.Run(tt.name, func(t *testing.T) { repo := &model.Repo{Owner: "laszlocph", Name: tt.name, Config: tt.repoConfig} // Using test name as repo name to provide different responses in mock server - f := new(mocks.Forge) + f := new(mocks.MockForge) dirs := map[string][]*forge_types.FileMeta{} for _, file := range tt.files { f.On("File", mock.Anything, mock.Anything, mock.Anything, mock.Anything, file.name).Return(file.data, nil) diff --git a/server/services/config/forge_test.go b/server/services/config/forge_test.go index dfcb75f6d..6902942fc 100644 --- a/server/services/config/forge_test.go +++ b/server/services/config/forge_test.go @@ -283,7 +283,7 @@ func TestFetch(t *testing.T) { t.Run(tt.name, func(t *testing.T) { repo := &model.Repo{Owner: "laszlocph", Name: "multipipeline", Config: tt.repoConfig} - f := new(mocks.Forge) + f := new(mocks.MockForge) dirs := map[string][]*forge_types.FileMeta{} for _, file := range tt.files { f.On("File", mock.Anything, mock.Anything, mock.Anything, mock.Anything, file.name).Once().Return(file.data, nil) diff --git a/server/services/config/mocks/mock_Service.go b/server/services/config/mocks/mock_Service.go new file mode 100644 index 000000000..758ab4e8b --- /dev/null +++ b/server/services/config/mocks/mock_Service.go @@ -0,0 +1,139 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "context" + + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/forge" + "go.woodpecker-ci.org/woodpecker/v3/server/forge/types" + "go.woodpecker-ci.org/woodpecker/v3/server/model" +) + +// NewMockService creates a new instance of MockService. 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 NewMockService(t interface { + mock.TestingT + Cleanup(func()) +}) *MockService { + mock := &MockService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockService is an autogenerated mock type for the Service type +type MockService struct { + mock.Mock +} + +type MockService_Expecter struct { + mock *mock.Mock +} + +func (_m *MockService) EXPECT() *MockService_Expecter { + return &MockService_Expecter{mock: &_m.Mock} +} + +// Fetch provides a mock function for the type MockService +func (_mock *MockService) Fetch(ctx context.Context, forge1 forge.Forge, user *model.User, repo *model.Repo, pipeline *model.Pipeline, oldConfigData []*types.FileMeta, restart bool) ([]*types.FileMeta, error) { + ret := _mock.Called(ctx, forge1, user, repo, pipeline, oldConfigData, restart) + + if len(ret) == 0 { + panic("no return value specified for Fetch") + } + + var r0 []*types.FileMeta + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) ([]*types.FileMeta, error)); ok { + return returnFunc(ctx, forge1, user, repo, pipeline, oldConfigData, restart) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) []*types.FileMeta); ok { + r0 = returnFunc(ctx, forge1, user, repo, pipeline, oldConfigData, restart) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*types.FileMeta) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) error); ok { + r1 = returnFunc(ctx, forge1, user, repo, pipeline, oldConfigData, restart) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_Fetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fetch' +type MockService_Fetch_Call struct { + *mock.Call +} + +// Fetch is a helper method to define mock.On call +// - ctx context.Context +// - forge1 forge.Forge +// - user *model.User +// - repo *model.Repo +// - pipeline *model.Pipeline +// - oldConfigData []*types.FileMeta +// - restart bool +func (_e *MockService_Expecter) Fetch(ctx interface{}, forge1 interface{}, user interface{}, repo interface{}, pipeline interface{}, oldConfigData interface{}, restart interface{}) *MockService_Fetch_Call { + return &MockService_Fetch_Call{Call: _e.mock.On("Fetch", ctx, forge1, user, repo, pipeline, oldConfigData, restart)} +} + +func (_c *MockService_Fetch_Call) Run(run func(ctx context.Context, forge1 forge.Forge, user *model.User, repo *model.Repo, pipeline *model.Pipeline, oldConfigData []*types.FileMeta, restart bool)) *MockService_Fetch_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 forge.Forge + if args[1] != nil { + arg1 = args[1].(forge.Forge) + } + var arg2 *model.User + if args[2] != nil { + arg2 = args[2].(*model.User) + } + var arg3 *model.Repo + if args[3] != nil { + arg3 = args[3].(*model.Repo) + } + var arg4 *model.Pipeline + if args[4] != nil { + arg4 = args[4].(*model.Pipeline) + } + var arg5 []*types.FileMeta + if args[5] != nil { + arg5 = args[5].([]*types.FileMeta) + } + var arg6 bool + if args[6] != nil { + arg6 = args[6].(bool) + } + run( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + ) + }) + return _c +} + +func (_c *MockService_Fetch_Call) Return(configData []*types.FileMeta, err error) *MockService_Fetch_Call { + _c.Call.Return(configData, err) + return _c +} + +func (_c *MockService_Fetch_Call) RunAndReturn(run func(ctx context.Context, forge1 forge.Forge, user *model.User, repo *model.Repo, pipeline *model.Pipeline, oldConfigData []*types.FileMeta, restart bool) ([]*types.FileMeta, error)) *MockService_Fetch_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/services/config/mocks/service.go b/server/services/config/mocks/service.go deleted file mode 100644 index ca6989af1..000000000 --- a/server/services/config/mocks/service.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - forge "go.woodpecker-ci.org/woodpecker/v3/server/forge" - - model "go.woodpecker-ci.org/woodpecker/v3/server/model" - - types "go.woodpecker-ci.org/woodpecker/v3/server/forge/types" -) - -// Service is an autogenerated mock type for the Service type -type Service struct { - mock.Mock -} - -// Fetch provides a mock function with given fields: ctx, _a1, user, repo, pipeline, oldConfigData, restart -func (_m *Service) Fetch(ctx context.Context, _a1 forge.Forge, user *model.User, repo *model.Repo, pipeline *model.Pipeline, oldConfigData []*types.FileMeta, restart bool) ([]*types.FileMeta, error) { - ret := _m.Called(ctx, _a1, user, repo, pipeline, oldConfigData, restart) - - if len(ret) == 0 { - panic("no return value specified for Fetch") - } - - var r0 []*types.FileMeta - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) ([]*types.FileMeta, error)); ok { - return rf(ctx, _a1, user, repo, pipeline, oldConfigData, restart) - } - if rf, ok := ret.Get(0).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) []*types.FileMeta); ok { - r0 = rf(ctx, _a1, user, repo, pipeline, oldConfigData, restart) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*types.FileMeta) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, forge.Forge, *model.User, *model.Repo, *model.Pipeline, []*types.FileMeta, bool) error); ok { - r1 = rf(ctx, _a1, user, repo, pipeline, oldConfigData, restart) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewService creates a new instance of Service. 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 NewService(t interface { - mock.TestingT - Cleanup(func()) -}) *Service { - mock := &Service{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/server/services/config/service.go b/server/services/config/service.go index b1d100d7a..9d509e972 100644 --- a/server/services/config/service.go +++ b/server/services/config/service.go @@ -22,8 +22,6 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server/model" ) -//go:generate mockery --name Service --output mocks --case underscore - type Service interface { Fetch(ctx context.Context, forge forge.Forge, user *model.User, repo *model.Repo, pipeline *model.Pipeline, oldConfigData []*types.FileMeta, restart bool) (configData []*types.FileMeta, err error) } diff --git a/server/services/environment/mocks/mock_Service.go b/server/services/environment/mocks/mock_Service.go new file mode 100644 index 000000000..ddc35061f --- /dev/null +++ b/server/services/environment/mocks/mock_Service.go @@ -0,0 +1,99 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/model" +) + +// NewMockService creates a new instance of MockService. 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 NewMockService(t interface { + mock.TestingT + Cleanup(func()) +}) *MockService { + mock := &MockService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockService is an autogenerated mock type for the Service type +type MockService struct { + mock.Mock +} + +type MockService_Expecter struct { + mock *mock.Mock +} + +func (_m *MockService) EXPECT() *MockService_Expecter { + return &MockService_Expecter{mock: &_m.Mock} +} + +// EnvironList provides a mock function for the type MockService +func (_mock *MockService) EnvironList(repo *model.Repo) ([]*model.Environ, error) { + ret := _mock.Called(repo) + + if len(ret) == 0 { + panic("no return value specified for EnvironList") + } + + var r0 []*model.Environ + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo) ([]*model.Environ, error)); ok { + return returnFunc(repo) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo) []*model.Environ); ok { + r0 = returnFunc(repo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Environ) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo) error); ok { + r1 = returnFunc(repo) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_EnvironList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnvironList' +type MockService_EnvironList_Call struct { + *mock.Call +} + +// EnvironList is a helper method to define mock.On call +// - repo *model.Repo +func (_e *MockService_Expecter) EnvironList(repo interface{}) *MockService_EnvironList_Call { + return &MockService_EnvironList_Call{Call: _e.mock.On("EnvironList", repo)} +} + +func (_c *MockService_EnvironList_Call) Run(run func(repo *model.Repo)) *MockService_EnvironList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_EnvironList_Call) Return(environs []*model.Environ, err error) *MockService_EnvironList_Call { + _c.Call.Return(environs, err) + return _c +} + +func (_c *MockService_EnvironList_Call) RunAndReturn(run func(repo *model.Repo) ([]*model.Environ, error)) *MockService_EnvironList_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/services/environment/mocks/service.go b/server/services/environment/mocks/service.go deleted file mode 100644 index 9d85dff54..000000000 --- a/server/services/environment/mocks/service.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - model "go.woodpecker-ci.org/woodpecker/v3/server/model" -) - -// Service is an autogenerated mock type for the Service type -type Service struct { - mock.Mock -} - -// EnvironList provides a mock function with given fields: _a0 -func (_m *Service) EnvironList(_a0 *model.Repo) ([]*model.Environ, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for EnvironList") - } - - var r0 []*model.Environ - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo) ([]*model.Environ, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.Repo) []*model.Environ); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Environ) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewService creates a new instance of Service. 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 NewService(t interface { - mock.TestingT - Cleanup(func()) -}) *Service { - mock := &Service{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/server/services/environment/service.go b/server/services/environment/service.go index ac8bfff98..e325d96fd 100644 --- a/server/services/environment/service.go +++ b/server/services/environment/service.go @@ -16,8 +16,6 @@ package environment import "go.woodpecker-ci.org/woodpecker/v3/server/model" -//go:generate mockery --name Service --output mocks --case underscore - // Service defines a service for managing environment variables. type Service interface { EnvironList(*model.Repo) ([]*model.Environ, error) diff --git a/server/services/log/mocks/mock_Service.go b/server/services/log/mocks/mock_Service.go new file mode 100644 index 000000000..d5bb6c874 --- /dev/null +++ b/server/services/log/mocks/mock_Service.go @@ -0,0 +1,207 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/model" +) + +// NewMockService creates a new instance of MockService. 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 NewMockService(t interface { + mock.TestingT + Cleanup(func()) +}) *MockService { + mock := &MockService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockService is an autogenerated mock type for the Service type +type MockService struct { + mock.Mock +} + +type MockService_Expecter struct { + mock *mock.Mock +} + +func (_m *MockService) EXPECT() *MockService_Expecter { + return &MockService_Expecter{mock: &_m.Mock} +} + +// LogAppend provides a mock function for the type MockService +func (_mock *MockService) LogAppend(step *model.Step, logEntries []*model.LogEntry) error { + ret := _mock.Called(step, logEntries) + + if len(ret) == 0 { + panic("no return value specified for LogAppend") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Step, []*model.LogEntry) error); ok { + r0 = returnFunc(step, logEntries) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_LogAppend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogAppend' +type MockService_LogAppend_Call struct { + *mock.Call +} + +// LogAppend is a helper method to define mock.On call +// - step *model.Step +// - logEntries []*model.LogEntry +func (_e *MockService_Expecter) LogAppend(step interface{}, logEntries interface{}) *MockService_LogAppend_Call { + return &MockService_LogAppend_Call{Call: _e.mock.On("LogAppend", step, logEntries)} +} + +func (_c *MockService_LogAppend_Call) Run(run func(step *model.Step, logEntries []*model.LogEntry)) *MockService_LogAppend_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Step + if args[0] != nil { + arg0 = args[0].(*model.Step) + } + var arg1 []*model.LogEntry + if args[1] != nil { + arg1 = args[1].([]*model.LogEntry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_LogAppend_Call) Return(err error) *MockService_LogAppend_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_LogAppend_Call) RunAndReturn(run func(step *model.Step, logEntries []*model.LogEntry) error) *MockService_LogAppend_Call { + _c.Call.Return(run) + return _c +} + +// LogDelete provides a mock function for the type MockService +func (_mock *MockService) LogDelete(step *model.Step) error { + ret := _mock.Called(step) + + if len(ret) == 0 { + panic("no return value specified for LogDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Step) error); ok { + r0 = returnFunc(step) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_LogDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogDelete' +type MockService_LogDelete_Call struct { + *mock.Call +} + +// LogDelete is a helper method to define mock.On call +// - step *model.Step +func (_e *MockService_Expecter) LogDelete(step interface{}) *MockService_LogDelete_Call { + return &MockService_LogDelete_Call{Call: _e.mock.On("LogDelete", step)} +} + +func (_c *MockService_LogDelete_Call) Run(run func(step *model.Step)) *MockService_LogDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Step + if args[0] != nil { + arg0 = args[0].(*model.Step) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_LogDelete_Call) Return(err error) *MockService_LogDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_LogDelete_Call) RunAndReturn(run func(step *model.Step) error) *MockService_LogDelete_Call { + _c.Call.Return(run) + return _c +} + +// LogFind provides a mock function for the type MockService +func (_mock *MockService) LogFind(step *model.Step) ([]*model.LogEntry, error) { + ret := _mock.Called(step) + + if len(ret) == 0 { + panic("no return value specified for LogFind") + } + + var r0 []*model.LogEntry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Step) ([]*model.LogEntry, error)); ok { + return returnFunc(step) + } + if returnFunc, ok := ret.Get(0).(func(*model.Step) []*model.LogEntry); ok { + r0 = returnFunc(step) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.LogEntry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Step) error); ok { + r1 = returnFunc(step) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_LogFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogFind' +type MockService_LogFind_Call struct { + *mock.Call +} + +// LogFind is a helper method to define mock.On call +// - step *model.Step +func (_e *MockService_Expecter) LogFind(step interface{}) *MockService_LogFind_Call { + return &MockService_LogFind_Call{Call: _e.mock.On("LogFind", step)} +} + +func (_c *MockService_LogFind_Call) Run(run func(step *model.Step)) *MockService_LogFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Step + if args[0] != nil { + arg0 = args[0].(*model.Step) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_LogFind_Call) Return(logEntrys []*model.LogEntry, err error) *MockService_LogFind_Call { + _c.Call.Return(logEntrys, err) + return _c +} + +func (_c *MockService_LogFind_Call) RunAndReturn(run func(step *model.Step) ([]*model.LogEntry, error)) *MockService_LogFind_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/services/manager.go b/server/services/manager.go index ca101f2bf..1e7f8b179 100644 --- a/server/services/manager.go +++ b/server/services/manager.go @@ -30,8 +30,6 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server/store" ) -//go:generate mockery --name Manager --output mocks --case underscore --note "+build test" - const forgeCacheTTL = 10 * time.Minute type SetupForge func(forge *model.Forge) (forge.Forge, error) diff --git a/server/services/mocks/manager.go b/server/services/mocks/manager.go deleted file mode 100644 index c2e071296..000000000 --- a/server/services/mocks/manager.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -//go:build test -// +build test - -package mocks - -import ( - crypto "crypto" - - config "go.woodpecker-ci.org/woodpecker/v3/server/services/config" - - environment "go.woodpecker-ci.org/woodpecker/v3/server/services/environment" - - forge "go.woodpecker-ci.org/woodpecker/v3/server/forge" - - mock "github.com/stretchr/testify/mock" - - model "go.woodpecker-ci.org/woodpecker/v3/server/model" - - registry "go.woodpecker-ci.org/woodpecker/v3/server/services/registry" - - secret "go.woodpecker-ci.org/woodpecker/v3/server/services/secret" -) - -// Manager is an autogenerated mock type for the Manager type -type Manager struct { - mock.Mock -} - -// ConfigServiceFromRepo provides a mock function with given fields: repo -func (_m *Manager) ConfigServiceFromRepo(repo *model.Repo) config.Service { - ret := _m.Called(repo) - - if len(ret) == 0 { - panic("no return value specified for ConfigServiceFromRepo") - } - - var r0 config.Service - if rf, ok := ret.Get(0).(func(*model.Repo) config.Service); ok { - r0 = rf(repo) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(config.Service) - } - } - - return r0 -} - -// EnvironmentService provides a mock function with no fields -func (_m *Manager) EnvironmentService() environment.Service { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for EnvironmentService") - } - - var r0 environment.Service - if rf, ok := ret.Get(0).(func() environment.Service); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(environment.Service) - } - } - - return r0 -} - -// ForgeByID provides a mock function with given fields: forgeID -func (_m *Manager) ForgeByID(forgeID int64) (forge.Forge, error) { - ret := _m.Called(forgeID) - - if len(ret) == 0 { - panic("no return value specified for ForgeByID") - } - - var r0 forge.Forge - var r1 error - if rf, ok := ret.Get(0).(func(int64) (forge.Forge, error)); ok { - return rf(forgeID) - } - if rf, ok := ret.Get(0).(func(int64) forge.Forge); ok { - r0 = rf(forgeID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(forge.Forge) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(forgeID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ForgeFromRepo provides a mock function with given fields: repo -func (_m *Manager) ForgeFromRepo(repo *model.Repo) (forge.Forge, error) { - ret := _m.Called(repo) - - if len(ret) == 0 { - panic("no return value specified for ForgeFromRepo") - } - - var r0 forge.Forge - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo) (forge.Forge, error)); ok { - return rf(repo) - } - if rf, ok := ret.Get(0).(func(*model.Repo) forge.Forge); ok { - r0 = rf(repo) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(forge.Forge) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo) error); ok { - r1 = rf(repo) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ForgeFromUser provides a mock function with given fields: user -func (_m *Manager) ForgeFromUser(user *model.User) (forge.Forge, error) { - ret := _m.Called(user) - - if len(ret) == 0 { - panic("no return value specified for ForgeFromUser") - } - - var r0 forge.Forge - var r1 error - if rf, ok := ret.Get(0).(func(*model.User) (forge.Forge, error)); ok { - return rf(user) - } - if rf, ok := ret.Get(0).(func(*model.User) forge.Forge); ok { - r0 = rf(user) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(forge.Forge) - } - } - - if rf, ok := ret.Get(1).(func(*model.User) error); ok { - r1 = rf(user) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryService provides a mock function with no fields -func (_m *Manager) RegistryService() registry.Service { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for RegistryService") - } - - var r0 registry.Service - if rf, ok := ret.Get(0).(func() registry.Service); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(registry.Service) - } - } - - return r0 -} - -// RegistryServiceFromRepo provides a mock function with given fields: repo -func (_m *Manager) RegistryServiceFromRepo(repo *model.Repo) registry.Service { - ret := _m.Called(repo) - - if len(ret) == 0 { - panic("no return value specified for RegistryServiceFromRepo") - } - - var r0 registry.Service - if rf, ok := ret.Get(0).(func(*model.Repo) registry.Service); ok { - r0 = rf(repo) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(registry.Service) - } - } - - return r0 -} - -// SecretService provides a mock function with no fields -func (_m *Manager) SecretService() secret.Service { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for SecretService") - } - - var r0 secret.Service - if rf, ok := ret.Get(0).(func() secret.Service); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(secret.Service) - } - } - - return r0 -} - -// SecretServiceFromRepo provides a mock function with given fields: repo -func (_m *Manager) SecretServiceFromRepo(repo *model.Repo) secret.Service { - ret := _m.Called(repo) - - if len(ret) == 0 { - panic("no return value specified for SecretServiceFromRepo") - } - - var r0 secret.Service - if rf, ok := ret.Get(0).(func(*model.Repo) secret.Service); ok { - r0 = rf(repo) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(secret.Service) - } - } - - return r0 -} - -// SignaturePublicKey provides a mock function with no fields -func (_m *Manager) SignaturePublicKey() crypto.PublicKey { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for SignaturePublicKey") - } - - var r0 crypto.PublicKey - if rf, ok := ret.Get(0).(func() crypto.PublicKey); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(crypto.PublicKey) - } - } - - return r0 -} - -// NewManager creates a new instance of Manager. 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 NewManager(t interface { - mock.TestingT - Cleanup(func()) -}) *Manager { - mock := &Manager{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/server/services/mocks/mock_Manager.go b/server/services/mocks/mock_Manager.go new file mode 100644 index 000000000..280263d13 --- /dev/null +++ b/server/services/mocks/mock_Manager.go @@ -0,0 +1,573 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "crypto" + + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/forge" + "go.woodpecker-ci.org/woodpecker/v3/server/model" + "go.woodpecker-ci.org/woodpecker/v3/server/services/config" + "go.woodpecker-ci.org/woodpecker/v3/server/services/environment" + "go.woodpecker-ci.org/woodpecker/v3/server/services/registry" + "go.woodpecker-ci.org/woodpecker/v3/server/services/secret" +) + +// NewMockManager creates a new instance of MockManager. 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 NewMockManager(t interface { + mock.TestingT + Cleanup(func()) +}) *MockManager { + mock := &MockManager{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockManager is an autogenerated mock type for the Manager type +type MockManager struct { + mock.Mock +} + +type MockManager_Expecter struct { + mock *mock.Mock +} + +func (_m *MockManager) EXPECT() *MockManager_Expecter { + return &MockManager_Expecter{mock: &_m.Mock} +} + +// ConfigServiceFromRepo provides a mock function for the type MockManager +func (_mock *MockManager) ConfigServiceFromRepo(repo *model.Repo) config.Service { + ret := _mock.Called(repo) + + if len(ret) == 0 { + panic("no return value specified for ConfigServiceFromRepo") + } + + var r0 config.Service + if returnFunc, ok := ret.Get(0).(func(*model.Repo) config.Service); ok { + r0 = returnFunc(repo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(config.Service) + } + } + return r0 +} + +// MockManager_ConfigServiceFromRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigServiceFromRepo' +type MockManager_ConfigServiceFromRepo_Call struct { + *mock.Call +} + +// ConfigServiceFromRepo is a helper method to define mock.On call +// - repo *model.Repo +func (_e *MockManager_Expecter) ConfigServiceFromRepo(repo interface{}) *MockManager_ConfigServiceFromRepo_Call { + return &MockManager_ConfigServiceFromRepo_Call{Call: _e.mock.On("ConfigServiceFromRepo", repo)} +} + +func (_c *MockManager_ConfigServiceFromRepo_Call) Run(run func(repo *model.Repo)) *MockManager_ConfigServiceFromRepo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockManager_ConfigServiceFromRepo_Call) Return(service config.Service) *MockManager_ConfigServiceFromRepo_Call { + _c.Call.Return(service) + return _c +} + +func (_c *MockManager_ConfigServiceFromRepo_Call) RunAndReturn(run func(repo *model.Repo) config.Service) *MockManager_ConfigServiceFromRepo_Call { + _c.Call.Return(run) + return _c +} + +// EnvironmentService provides a mock function for the type MockManager +func (_mock *MockManager) EnvironmentService() environment.Service { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for EnvironmentService") + } + + var r0 environment.Service + if returnFunc, ok := ret.Get(0).(func() environment.Service); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(environment.Service) + } + } + return r0 +} + +// MockManager_EnvironmentService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnvironmentService' +type MockManager_EnvironmentService_Call struct { + *mock.Call +} + +// EnvironmentService is a helper method to define mock.On call +func (_e *MockManager_Expecter) EnvironmentService() *MockManager_EnvironmentService_Call { + return &MockManager_EnvironmentService_Call{Call: _e.mock.On("EnvironmentService")} +} + +func (_c *MockManager_EnvironmentService_Call) Run(run func()) *MockManager_EnvironmentService_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockManager_EnvironmentService_Call) Return(service environment.Service) *MockManager_EnvironmentService_Call { + _c.Call.Return(service) + return _c +} + +func (_c *MockManager_EnvironmentService_Call) RunAndReturn(run func() environment.Service) *MockManager_EnvironmentService_Call { + _c.Call.Return(run) + return _c +} + +// ForgeByID provides a mock function for the type MockManager +func (_mock *MockManager) ForgeByID(forgeID int64) (forge.Forge, error) { + ret := _mock.Called(forgeID) + + if len(ret) == 0 { + panic("no return value specified for ForgeByID") + } + + var r0 forge.Forge + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (forge.Forge, error)); ok { + return returnFunc(forgeID) + } + if returnFunc, ok := ret.Get(0).(func(int64) forge.Forge); ok { + r0 = returnFunc(forgeID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(forge.Forge) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(forgeID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockManager_ForgeByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForgeByID' +type MockManager_ForgeByID_Call struct { + *mock.Call +} + +// ForgeByID is a helper method to define mock.On call +// - forgeID int64 +func (_e *MockManager_Expecter) ForgeByID(forgeID interface{}) *MockManager_ForgeByID_Call { + return &MockManager_ForgeByID_Call{Call: _e.mock.On("ForgeByID", forgeID)} +} + +func (_c *MockManager_ForgeByID_Call) Run(run func(forgeID int64)) *MockManager_ForgeByID_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockManager_ForgeByID_Call) Return(forge1 forge.Forge, err error) *MockManager_ForgeByID_Call { + _c.Call.Return(forge1, err) + return _c +} + +func (_c *MockManager_ForgeByID_Call) RunAndReturn(run func(forgeID int64) (forge.Forge, error)) *MockManager_ForgeByID_Call { + _c.Call.Return(run) + return _c +} + +// ForgeFromRepo provides a mock function for the type MockManager +func (_mock *MockManager) ForgeFromRepo(repo *model.Repo) (forge.Forge, error) { + ret := _mock.Called(repo) + + if len(ret) == 0 { + panic("no return value specified for ForgeFromRepo") + } + + var r0 forge.Forge + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo) (forge.Forge, error)); ok { + return returnFunc(repo) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo) forge.Forge); ok { + r0 = returnFunc(repo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(forge.Forge) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo) error); ok { + r1 = returnFunc(repo) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockManager_ForgeFromRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForgeFromRepo' +type MockManager_ForgeFromRepo_Call struct { + *mock.Call +} + +// ForgeFromRepo is a helper method to define mock.On call +// - repo *model.Repo +func (_e *MockManager_Expecter) ForgeFromRepo(repo interface{}) *MockManager_ForgeFromRepo_Call { + return &MockManager_ForgeFromRepo_Call{Call: _e.mock.On("ForgeFromRepo", repo)} +} + +func (_c *MockManager_ForgeFromRepo_Call) Run(run func(repo *model.Repo)) *MockManager_ForgeFromRepo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockManager_ForgeFromRepo_Call) Return(forge1 forge.Forge, err error) *MockManager_ForgeFromRepo_Call { + _c.Call.Return(forge1, err) + return _c +} + +func (_c *MockManager_ForgeFromRepo_Call) RunAndReturn(run func(repo *model.Repo) (forge.Forge, error)) *MockManager_ForgeFromRepo_Call { + _c.Call.Return(run) + return _c +} + +// ForgeFromUser provides a mock function for the type MockManager +func (_mock *MockManager) ForgeFromUser(user *model.User) (forge.Forge, error) { + ret := _mock.Called(user) + + if len(ret) == 0 { + panic("no return value specified for ForgeFromUser") + } + + var r0 forge.Forge + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.User) (forge.Forge, error)); ok { + return returnFunc(user) + } + if returnFunc, ok := ret.Get(0).(func(*model.User) forge.Forge); ok { + r0 = returnFunc(user) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(forge.Forge) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.User) error); ok { + r1 = returnFunc(user) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockManager_ForgeFromUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForgeFromUser' +type MockManager_ForgeFromUser_Call struct { + *mock.Call +} + +// ForgeFromUser is a helper method to define mock.On call +// - user *model.User +func (_e *MockManager_Expecter) ForgeFromUser(user interface{}) *MockManager_ForgeFromUser_Call { + return &MockManager_ForgeFromUser_Call{Call: _e.mock.On("ForgeFromUser", user)} +} + +func (_c *MockManager_ForgeFromUser_Call) Run(run func(user *model.User)) *MockManager_ForgeFromUser_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.User + if args[0] != nil { + arg0 = args[0].(*model.User) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockManager_ForgeFromUser_Call) Return(forge1 forge.Forge, err error) *MockManager_ForgeFromUser_Call { + _c.Call.Return(forge1, err) + return _c +} + +func (_c *MockManager_ForgeFromUser_Call) RunAndReturn(run func(user *model.User) (forge.Forge, error)) *MockManager_ForgeFromUser_Call { + _c.Call.Return(run) + return _c +} + +// RegistryService provides a mock function for the type MockManager +func (_mock *MockManager) RegistryService() registry.Service { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for RegistryService") + } + + var r0 registry.Service + if returnFunc, ok := ret.Get(0).(func() registry.Service); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(registry.Service) + } + } + return r0 +} + +// MockManager_RegistryService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryService' +type MockManager_RegistryService_Call struct { + *mock.Call +} + +// RegistryService is a helper method to define mock.On call +func (_e *MockManager_Expecter) RegistryService() *MockManager_RegistryService_Call { + return &MockManager_RegistryService_Call{Call: _e.mock.On("RegistryService")} +} + +func (_c *MockManager_RegistryService_Call) Run(run func()) *MockManager_RegistryService_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockManager_RegistryService_Call) Return(service registry.Service) *MockManager_RegistryService_Call { + _c.Call.Return(service) + return _c +} + +func (_c *MockManager_RegistryService_Call) RunAndReturn(run func() registry.Service) *MockManager_RegistryService_Call { + _c.Call.Return(run) + return _c +} + +// RegistryServiceFromRepo provides a mock function for the type MockManager +func (_mock *MockManager) RegistryServiceFromRepo(repo *model.Repo) registry.Service { + ret := _mock.Called(repo) + + if len(ret) == 0 { + panic("no return value specified for RegistryServiceFromRepo") + } + + var r0 registry.Service + if returnFunc, ok := ret.Get(0).(func(*model.Repo) registry.Service); ok { + r0 = returnFunc(repo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(registry.Service) + } + } + return r0 +} + +// MockManager_RegistryServiceFromRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryServiceFromRepo' +type MockManager_RegistryServiceFromRepo_Call struct { + *mock.Call +} + +// RegistryServiceFromRepo is a helper method to define mock.On call +// - repo *model.Repo +func (_e *MockManager_Expecter) RegistryServiceFromRepo(repo interface{}) *MockManager_RegistryServiceFromRepo_Call { + return &MockManager_RegistryServiceFromRepo_Call{Call: _e.mock.On("RegistryServiceFromRepo", repo)} +} + +func (_c *MockManager_RegistryServiceFromRepo_Call) Run(run func(repo *model.Repo)) *MockManager_RegistryServiceFromRepo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockManager_RegistryServiceFromRepo_Call) Return(service registry.Service) *MockManager_RegistryServiceFromRepo_Call { + _c.Call.Return(service) + return _c +} + +func (_c *MockManager_RegistryServiceFromRepo_Call) RunAndReturn(run func(repo *model.Repo) registry.Service) *MockManager_RegistryServiceFromRepo_Call { + _c.Call.Return(run) + return _c +} + +// SecretService provides a mock function for the type MockManager +func (_mock *MockManager) SecretService() secret.Service { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for SecretService") + } + + var r0 secret.Service + if returnFunc, ok := ret.Get(0).(func() secret.Service); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(secret.Service) + } + } + return r0 +} + +// MockManager_SecretService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretService' +type MockManager_SecretService_Call struct { + *mock.Call +} + +// SecretService is a helper method to define mock.On call +func (_e *MockManager_Expecter) SecretService() *MockManager_SecretService_Call { + return &MockManager_SecretService_Call{Call: _e.mock.On("SecretService")} +} + +func (_c *MockManager_SecretService_Call) Run(run func()) *MockManager_SecretService_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockManager_SecretService_Call) Return(service secret.Service) *MockManager_SecretService_Call { + _c.Call.Return(service) + return _c +} + +func (_c *MockManager_SecretService_Call) RunAndReturn(run func() secret.Service) *MockManager_SecretService_Call { + _c.Call.Return(run) + return _c +} + +// SecretServiceFromRepo provides a mock function for the type MockManager +func (_mock *MockManager) SecretServiceFromRepo(repo *model.Repo) secret.Service { + ret := _mock.Called(repo) + + if len(ret) == 0 { + panic("no return value specified for SecretServiceFromRepo") + } + + var r0 secret.Service + if returnFunc, ok := ret.Get(0).(func(*model.Repo) secret.Service); ok { + r0 = returnFunc(repo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(secret.Service) + } + } + return r0 +} + +// MockManager_SecretServiceFromRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretServiceFromRepo' +type MockManager_SecretServiceFromRepo_Call struct { + *mock.Call +} + +// SecretServiceFromRepo is a helper method to define mock.On call +// - repo *model.Repo +func (_e *MockManager_Expecter) SecretServiceFromRepo(repo interface{}) *MockManager_SecretServiceFromRepo_Call { + return &MockManager_SecretServiceFromRepo_Call{Call: _e.mock.On("SecretServiceFromRepo", repo)} +} + +func (_c *MockManager_SecretServiceFromRepo_Call) Run(run func(repo *model.Repo)) *MockManager_SecretServiceFromRepo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockManager_SecretServiceFromRepo_Call) Return(service secret.Service) *MockManager_SecretServiceFromRepo_Call { + _c.Call.Return(service) + return _c +} + +func (_c *MockManager_SecretServiceFromRepo_Call) RunAndReturn(run func(repo *model.Repo) secret.Service) *MockManager_SecretServiceFromRepo_Call { + _c.Call.Return(run) + return _c +} + +// SignaturePublicKey provides a mock function for the type MockManager +func (_mock *MockManager) SignaturePublicKey() crypto.PublicKey { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for SignaturePublicKey") + } + + var r0 crypto.PublicKey + if returnFunc, ok := ret.Get(0).(func() crypto.PublicKey); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.PublicKey) + } + } + return r0 +} + +// MockManager_SignaturePublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignaturePublicKey' +type MockManager_SignaturePublicKey_Call struct { + *mock.Call +} + +// SignaturePublicKey is a helper method to define mock.On call +func (_e *MockManager_Expecter) SignaturePublicKey() *MockManager_SignaturePublicKey_Call { + return &MockManager_SignaturePublicKey_Call{Call: _e.mock.On("SignaturePublicKey")} +} + +func (_c *MockManager_SignaturePublicKey_Call) Run(run func()) *MockManager_SignaturePublicKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockManager_SignaturePublicKey_Call) Return(publicKey crypto.PublicKey) *MockManager_SignaturePublicKey_Call { + _c.Call.Return(publicKey) + return _c +} + +func (_c *MockManager_SignaturePublicKey_Call) RunAndReturn(run func() crypto.PublicKey) *MockManager_SignaturePublicKey_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/services/registry/mocks/mock_ReadOnlyService.go b/server/services/registry/mocks/mock_ReadOnlyService.go new file mode 100644 index 000000000..2b1506303 --- /dev/null +++ b/server/services/registry/mocks/mock_ReadOnlyService.go @@ -0,0 +1,161 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/model" +) + +// NewMockReadOnlyService creates a new instance of MockReadOnlyService. 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 NewMockReadOnlyService(t interface { + mock.TestingT + Cleanup(func()) +}) *MockReadOnlyService { + mock := &MockReadOnlyService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockReadOnlyService is an autogenerated mock type for the ReadOnlyService type +type MockReadOnlyService struct { + mock.Mock +} + +type MockReadOnlyService_Expecter struct { + mock *mock.Mock +} + +func (_m *MockReadOnlyService) EXPECT() *MockReadOnlyService_Expecter { + return &MockReadOnlyService_Expecter{mock: &_m.Mock} +} + +// GlobalRegistryFind provides a mock function for the type MockReadOnlyService +func (_mock *MockReadOnlyService) GlobalRegistryFind(s string) (*model.Registry, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryFind") + } + + var r0 *model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*model.Registry, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *model.Registry); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockReadOnlyService_GlobalRegistryFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryFind' +type MockReadOnlyService_GlobalRegistryFind_Call struct { + *mock.Call +} + +// GlobalRegistryFind is a helper method to define mock.On call +// - s string +func (_e *MockReadOnlyService_Expecter) GlobalRegistryFind(s interface{}) *MockReadOnlyService_GlobalRegistryFind_Call { + return &MockReadOnlyService_GlobalRegistryFind_Call{Call: _e.mock.On("GlobalRegistryFind", s)} +} + +func (_c *MockReadOnlyService_GlobalRegistryFind_Call) Run(run func(s string)) *MockReadOnlyService_GlobalRegistryFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockReadOnlyService_GlobalRegistryFind_Call) Return(registry *model.Registry, err error) *MockReadOnlyService_GlobalRegistryFind_Call { + _c.Call.Return(registry, err) + return _c +} + +func (_c *MockReadOnlyService_GlobalRegistryFind_Call) RunAndReturn(run func(s string) (*model.Registry, error)) *MockReadOnlyService_GlobalRegistryFind_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryList provides a mock function for the type MockReadOnlyService +func (_mock *MockReadOnlyService) GlobalRegistryList(listOptions *model.ListOptions) ([]*model.Registry, error) { + ret := _mock.Called(listOptions) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryList") + } + + var r0 []*model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Registry, error)); ok { + return returnFunc(listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) []*model.Registry); ok { + r0 = returnFunc(listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.ListOptions) error); ok { + r1 = returnFunc(listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockReadOnlyService_GlobalRegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryList' +type MockReadOnlyService_GlobalRegistryList_Call struct { + *mock.Call +} + +// GlobalRegistryList is a helper method to define mock.On call +// - listOptions *model.ListOptions +func (_e *MockReadOnlyService_Expecter) GlobalRegistryList(listOptions interface{}) *MockReadOnlyService_GlobalRegistryList_Call { + return &MockReadOnlyService_GlobalRegistryList_Call{Call: _e.mock.On("GlobalRegistryList", listOptions)} +} + +func (_c *MockReadOnlyService_GlobalRegistryList_Call) Run(run func(listOptions *model.ListOptions)) *MockReadOnlyService_GlobalRegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.ListOptions + if args[0] != nil { + arg0 = args[0].(*model.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockReadOnlyService_GlobalRegistryList_Call) Return(registrys []*model.Registry, err error) *MockReadOnlyService_GlobalRegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockReadOnlyService_GlobalRegistryList_Call) RunAndReturn(run func(listOptions *model.ListOptions) ([]*model.Registry, error)) *MockReadOnlyService_GlobalRegistryList_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/services/registry/mocks/mock_Service.go b/server/services/registry/mocks/mock_Service.go new file mode 100644 index 000000000..3fdbe7d11 --- /dev/null +++ b/server/services/registry/mocks/mock_Service.go @@ -0,0 +1,996 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/model" +) + +// NewMockService creates a new instance of MockService. 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 NewMockService(t interface { + mock.TestingT + Cleanup(func()) +}) *MockService { + mock := &MockService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockService is an autogenerated mock type for the Service type +type MockService struct { + mock.Mock +} + +type MockService_Expecter struct { + mock *mock.Mock +} + +func (_m *MockService) EXPECT() *MockService_Expecter { + return &MockService_Expecter{mock: &_m.Mock} +} + +// GlobalRegistryCreate provides a mock function for the type MockService +func (_mock *MockService) GlobalRegistryCreate(registry *model.Registry) error { + ret := _mock.Called(registry) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Registry) error); ok { + r0 = returnFunc(registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_GlobalRegistryCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryCreate' +type MockService_GlobalRegistryCreate_Call struct { + *mock.Call +} + +// GlobalRegistryCreate is a helper method to define mock.On call +// - registry *model.Registry +func (_e *MockService_Expecter) GlobalRegistryCreate(registry interface{}) *MockService_GlobalRegistryCreate_Call { + return &MockService_GlobalRegistryCreate_Call{Call: _e.mock.On("GlobalRegistryCreate", registry)} +} + +func (_c *MockService_GlobalRegistryCreate_Call) Run(run func(registry *model.Registry)) *MockService_GlobalRegistryCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Registry + if args[0] != nil { + arg0 = args[0].(*model.Registry) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalRegistryCreate_Call) Return(err error) *MockService_GlobalRegistryCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_GlobalRegistryCreate_Call) RunAndReturn(run func(registry *model.Registry) error) *MockService_GlobalRegistryCreate_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryDelete provides a mock function for the type MockService +func (_mock *MockService) GlobalRegistryDelete(s string) error { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(s) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_GlobalRegistryDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryDelete' +type MockService_GlobalRegistryDelete_Call struct { + *mock.Call +} + +// GlobalRegistryDelete is a helper method to define mock.On call +// - s string +func (_e *MockService_Expecter) GlobalRegistryDelete(s interface{}) *MockService_GlobalRegistryDelete_Call { + return &MockService_GlobalRegistryDelete_Call{Call: _e.mock.On("GlobalRegistryDelete", s)} +} + +func (_c *MockService_GlobalRegistryDelete_Call) Run(run func(s string)) *MockService_GlobalRegistryDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalRegistryDelete_Call) Return(err error) *MockService_GlobalRegistryDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_GlobalRegistryDelete_Call) RunAndReturn(run func(s string) error) *MockService_GlobalRegistryDelete_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryFind provides a mock function for the type MockService +func (_mock *MockService) GlobalRegistryFind(s string) (*model.Registry, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryFind") + } + + var r0 *model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*model.Registry, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *model.Registry); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_GlobalRegistryFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryFind' +type MockService_GlobalRegistryFind_Call struct { + *mock.Call +} + +// GlobalRegistryFind is a helper method to define mock.On call +// - s string +func (_e *MockService_Expecter) GlobalRegistryFind(s interface{}) *MockService_GlobalRegistryFind_Call { + return &MockService_GlobalRegistryFind_Call{Call: _e.mock.On("GlobalRegistryFind", s)} +} + +func (_c *MockService_GlobalRegistryFind_Call) Run(run func(s string)) *MockService_GlobalRegistryFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalRegistryFind_Call) Return(registry *model.Registry, err error) *MockService_GlobalRegistryFind_Call { + _c.Call.Return(registry, err) + return _c +} + +func (_c *MockService_GlobalRegistryFind_Call) RunAndReturn(run func(s string) (*model.Registry, error)) *MockService_GlobalRegistryFind_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryList provides a mock function for the type MockService +func (_mock *MockService) GlobalRegistryList(listOptions *model.ListOptions) ([]*model.Registry, error) { + ret := _mock.Called(listOptions) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryList") + } + + var r0 []*model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Registry, error)); ok { + return returnFunc(listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) []*model.Registry); ok { + r0 = returnFunc(listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.ListOptions) error); ok { + r1 = returnFunc(listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_GlobalRegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryList' +type MockService_GlobalRegistryList_Call struct { + *mock.Call +} + +// GlobalRegistryList is a helper method to define mock.On call +// - listOptions *model.ListOptions +func (_e *MockService_Expecter) GlobalRegistryList(listOptions interface{}) *MockService_GlobalRegistryList_Call { + return &MockService_GlobalRegistryList_Call{Call: _e.mock.On("GlobalRegistryList", listOptions)} +} + +func (_c *MockService_GlobalRegistryList_Call) Run(run func(listOptions *model.ListOptions)) *MockService_GlobalRegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.ListOptions + if args[0] != nil { + arg0 = args[0].(*model.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalRegistryList_Call) Return(registrys []*model.Registry, err error) *MockService_GlobalRegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockService_GlobalRegistryList_Call) RunAndReturn(run func(listOptions *model.ListOptions) ([]*model.Registry, error)) *MockService_GlobalRegistryList_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryUpdate provides a mock function for the type MockService +func (_mock *MockService) GlobalRegistryUpdate(registry *model.Registry) error { + ret := _mock.Called(registry) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Registry) error); ok { + r0 = returnFunc(registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_GlobalRegistryUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryUpdate' +type MockService_GlobalRegistryUpdate_Call struct { + *mock.Call +} + +// GlobalRegistryUpdate is a helper method to define mock.On call +// - registry *model.Registry +func (_e *MockService_Expecter) GlobalRegistryUpdate(registry interface{}) *MockService_GlobalRegistryUpdate_Call { + return &MockService_GlobalRegistryUpdate_Call{Call: _e.mock.On("GlobalRegistryUpdate", registry)} +} + +func (_c *MockService_GlobalRegistryUpdate_Call) Run(run func(registry *model.Registry)) *MockService_GlobalRegistryUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Registry + if args[0] != nil { + arg0 = args[0].(*model.Registry) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalRegistryUpdate_Call) Return(err error) *MockService_GlobalRegistryUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_GlobalRegistryUpdate_Call) RunAndReturn(run func(registry *model.Registry) error) *MockService_GlobalRegistryUpdate_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryCreate provides a mock function for the type MockService +func (_mock *MockService) OrgRegistryCreate(n int64, registry *model.Registry) error { + ret := _mock.Called(n, registry) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, *model.Registry) error); ok { + r0 = returnFunc(n, registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_OrgRegistryCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryCreate' +type MockService_OrgRegistryCreate_Call struct { + *mock.Call +} + +// OrgRegistryCreate is a helper method to define mock.On call +// - n int64 +// - registry *model.Registry +func (_e *MockService_Expecter) OrgRegistryCreate(n interface{}, registry interface{}) *MockService_OrgRegistryCreate_Call { + return &MockService_OrgRegistryCreate_Call{Call: _e.mock.On("OrgRegistryCreate", n, registry)} +} + +func (_c *MockService_OrgRegistryCreate_Call) Run(run func(n int64, registry *model.Registry)) *MockService_OrgRegistryCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *model.Registry + if args[1] != nil { + arg1 = args[1].(*model.Registry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgRegistryCreate_Call) Return(err error) *MockService_OrgRegistryCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_OrgRegistryCreate_Call) RunAndReturn(run func(n int64, registry *model.Registry) error) *MockService_OrgRegistryCreate_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryDelete provides a mock function for the type MockService +func (_mock *MockService) OrgRegistryDelete(n int64, s string) error { + ret := _mock.Called(n, s) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, string) error); ok { + r0 = returnFunc(n, s) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_OrgRegistryDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryDelete' +type MockService_OrgRegistryDelete_Call struct { + *mock.Call +} + +// OrgRegistryDelete is a helper method to define mock.On call +// - n int64 +// - s string +func (_e *MockService_Expecter) OrgRegistryDelete(n interface{}, s interface{}) *MockService_OrgRegistryDelete_Call { + return &MockService_OrgRegistryDelete_Call{Call: _e.mock.On("OrgRegistryDelete", n, s)} +} + +func (_c *MockService_OrgRegistryDelete_Call) Run(run func(n int64, s string)) *MockService_OrgRegistryDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgRegistryDelete_Call) Return(err error) *MockService_OrgRegistryDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_OrgRegistryDelete_Call) RunAndReturn(run func(n int64, s string) error) *MockService_OrgRegistryDelete_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryFind provides a mock function for the type MockService +func (_mock *MockService) OrgRegistryFind(n int64, s string) (*model.Registry, error) { + ret := _mock.Called(n, s) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryFind") + } + + var r0 *model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, string) (*model.Registry, error)); ok { + return returnFunc(n, s) + } + if returnFunc, ok := ret.Get(0).(func(int64, string) *model.Registry); ok { + r0 = returnFunc(n, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, string) error); ok { + r1 = returnFunc(n, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_OrgRegistryFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryFind' +type MockService_OrgRegistryFind_Call struct { + *mock.Call +} + +// OrgRegistryFind is a helper method to define mock.On call +// - n int64 +// - s string +func (_e *MockService_Expecter) OrgRegistryFind(n interface{}, s interface{}) *MockService_OrgRegistryFind_Call { + return &MockService_OrgRegistryFind_Call{Call: _e.mock.On("OrgRegistryFind", n, s)} +} + +func (_c *MockService_OrgRegistryFind_Call) Run(run func(n int64, s string)) *MockService_OrgRegistryFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgRegistryFind_Call) Return(registry *model.Registry, err error) *MockService_OrgRegistryFind_Call { + _c.Call.Return(registry, err) + return _c +} + +func (_c *MockService_OrgRegistryFind_Call) RunAndReturn(run func(n int64, s string) (*model.Registry, error)) *MockService_OrgRegistryFind_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryList provides a mock function for the type MockService +func (_mock *MockService) OrgRegistryList(n int64, listOptions *model.ListOptions) ([]*model.Registry, error) { + ret := _mock.Called(n, listOptions) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryList") + } + + var r0 []*model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Registry, error)); ok { + return returnFunc(n, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Registry); ok { + r0 = returnFunc(n, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { + r1 = returnFunc(n, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_OrgRegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryList' +type MockService_OrgRegistryList_Call struct { + *mock.Call +} + +// OrgRegistryList is a helper method to define mock.On call +// - n int64 +// - listOptions *model.ListOptions +func (_e *MockService_Expecter) OrgRegistryList(n interface{}, listOptions interface{}) *MockService_OrgRegistryList_Call { + return &MockService_OrgRegistryList_Call{Call: _e.mock.On("OrgRegistryList", n, listOptions)} +} + +func (_c *MockService_OrgRegistryList_Call) Run(run func(n int64, listOptions *model.ListOptions)) *MockService_OrgRegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgRegistryList_Call) Return(registrys []*model.Registry, err error) *MockService_OrgRegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockService_OrgRegistryList_Call) RunAndReturn(run func(n int64, listOptions *model.ListOptions) ([]*model.Registry, error)) *MockService_OrgRegistryList_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryUpdate provides a mock function for the type MockService +func (_mock *MockService) OrgRegistryUpdate(n int64, registry *model.Registry) error { + ret := _mock.Called(n, registry) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, *model.Registry) error); ok { + r0 = returnFunc(n, registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_OrgRegistryUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryUpdate' +type MockService_OrgRegistryUpdate_Call struct { + *mock.Call +} + +// OrgRegistryUpdate is a helper method to define mock.On call +// - n int64 +// - registry *model.Registry +func (_e *MockService_Expecter) OrgRegistryUpdate(n interface{}, registry interface{}) *MockService_OrgRegistryUpdate_Call { + return &MockService_OrgRegistryUpdate_Call{Call: _e.mock.On("OrgRegistryUpdate", n, registry)} +} + +func (_c *MockService_OrgRegistryUpdate_Call) Run(run func(n int64, registry *model.Registry)) *MockService_OrgRegistryUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *model.Registry + if args[1] != nil { + arg1 = args[1].(*model.Registry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgRegistryUpdate_Call) Return(err error) *MockService_OrgRegistryUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_OrgRegistryUpdate_Call) RunAndReturn(run func(n int64, registry *model.Registry) error) *MockService_OrgRegistryUpdate_Call { + _c.Call.Return(run) + return _c +} + +// RegistryCreate provides a mock function for the type MockService +func (_mock *MockService) RegistryCreate(repo *model.Repo, registry *model.Registry) error { + ret := _mock.Called(repo, registry) + + if len(ret) == 0 { + panic("no return value specified for RegistryCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.Registry) error); ok { + r0 = returnFunc(repo, registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_RegistryCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryCreate' +type MockService_RegistryCreate_Call struct { + *mock.Call +} + +// RegistryCreate is a helper method to define mock.On call +// - repo *model.Repo +// - registry *model.Registry +func (_e *MockService_Expecter) RegistryCreate(repo interface{}, registry interface{}) *MockService_RegistryCreate_Call { + return &MockService_RegistryCreate_Call{Call: _e.mock.On("RegistryCreate", repo, registry)} +} + +func (_c *MockService_RegistryCreate_Call) Run(run func(repo *model.Repo, registry *model.Registry)) *MockService_RegistryCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.Registry + if args[1] != nil { + arg1 = args[1].(*model.Registry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_RegistryCreate_Call) Return(err error) *MockService_RegistryCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_RegistryCreate_Call) RunAndReturn(run func(repo *model.Repo, registry *model.Registry) error) *MockService_RegistryCreate_Call { + _c.Call.Return(run) + return _c +} + +// RegistryDelete provides a mock function for the type MockService +func (_mock *MockService) RegistryDelete(repo *model.Repo, s string) error { + ret := _mock.Called(repo, s) + + if len(ret) == 0 { + panic("no return value specified for RegistryDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) error); ok { + r0 = returnFunc(repo, s) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_RegistryDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryDelete' +type MockService_RegistryDelete_Call struct { + *mock.Call +} + +// RegistryDelete is a helper method to define mock.On call +// - repo *model.Repo +// - s string +func (_e *MockService_Expecter) RegistryDelete(repo interface{}, s interface{}) *MockService_RegistryDelete_Call { + return &MockService_RegistryDelete_Call{Call: _e.mock.On("RegistryDelete", repo, s)} +} + +func (_c *MockService_RegistryDelete_Call) Run(run func(repo *model.Repo, s string)) *MockService_RegistryDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_RegistryDelete_Call) Return(err error) *MockService_RegistryDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_RegistryDelete_Call) RunAndReturn(run func(repo *model.Repo, s string) error) *MockService_RegistryDelete_Call { + _c.Call.Return(run) + return _c +} + +// RegistryFind provides a mock function for the type MockService +func (_mock *MockService) RegistryFind(repo *model.Repo, s string) (*model.Registry, error) { + ret := _mock.Called(repo, s) + + if len(ret) == 0 { + panic("no return value specified for RegistryFind") + } + + var r0 *model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) (*model.Registry, error)); ok { + return returnFunc(repo, s) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) *model.Registry); ok { + r0 = returnFunc(repo, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, string) error); ok { + r1 = returnFunc(repo, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_RegistryFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryFind' +type MockService_RegistryFind_Call struct { + *mock.Call +} + +// RegistryFind is a helper method to define mock.On call +// - repo *model.Repo +// - s string +func (_e *MockService_Expecter) RegistryFind(repo interface{}, s interface{}) *MockService_RegistryFind_Call { + return &MockService_RegistryFind_Call{Call: _e.mock.On("RegistryFind", repo, s)} +} + +func (_c *MockService_RegistryFind_Call) Run(run func(repo *model.Repo, s string)) *MockService_RegistryFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_RegistryFind_Call) Return(registry *model.Registry, err error) *MockService_RegistryFind_Call { + _c.Call.Return(registry, err) + return _c +} + +func (_c *MockService_RegistryFind_Call) RunAndReturn(run func(repo *model.Repo, s string) (*model.Registry, error)) *MockService_RegistryFind_Call { + _c.Call.Return(run) + return _c +} + +// RegistryList provides a mock function for the type MockService +func (_mock *MockService) RegistryList(repo *model.Repo, listOptions *model.ListOptions) ([]*model.Registry, error) { + ret := _mock.Called(repo, listOptions) + + if len(ret) == 0 { + panic("no return value specified for RegistryList") + } + + var r0 []*model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) ([]*model.Registry, error)); ok { + return returnFunc(repo, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) []*model.Registry); ok { + r0 = returnFunc(repo, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, *model.ListOptions) error); ok { + r1 = returnFunc(repo, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_RegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryList' +type MockService_RegistryList_Call struct { + *mock.Call +} + +// RegistryList is a helper method to define mock.On call +// - repo *model.Repo +// - listOptions *model.ListOptions +func (_e *MockService_Expecter) RegistryList(repo interface{}, listOptions interface{}) *MockService_RegistryList_Call { + return &MockService_RegistryList_Call{Call: _e.mock.On("RegistryList", repo, listOptions)} +} + +func (_c *MockService_RegistryList_Call) Run(run func(repo *model.Repo, listOptions *model.ListOptions)) *MockService_RegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_RegistryList_Call) Return(registrys []*model.Registry, err error) *MockService_RegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockService_RegistryList_Call) RunAndReturn(run func(repo *model.Repo, listOptions *model.ListOptions) ([]*model.Registry, error)) *MockService_RegistryList_Call { + _c.Call.Return(run) + return _c +} + +// RegistryListPipeline provides a mock function for the type MockService +func (_mock *MockService) RegistryListPipeline(repo *model.Repo, pipeline *model.Pipeline) ([]*model.Registry, error) { + ret := _mock.Called(repo, pipeline) + + if len(ret) == 0 { + panic("no return value specified for RegistryListPipeline") + } + + var r0 []*model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.Pipeline) ([]*model.Registry, error)); ok { + return returnFunc(repo, pipeline) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.Pipeline) []*model.Registry); ok { + r0 = returnFunc(repo, pipeline) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, *model.Pipeline) error); ok { + r1 = returnFunc(repo, pipeline) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_RegistryListPipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryListPipeline' +type MockService_RegistryListPipeline_Call struct { + *mock.Call +} + +// RegistryListPipeline is a helper method to define mock.On call +// - repo *model.Repo +// - pipeline *model.Pipeline +func (_e *MockService_Expecter) RegistryListPipeline(repo interface{}, pipeline interface{}) *MockService_RegistryListPipeline_Call { + return &MockService_RegistryListPipeline_Call{Call: _e.mock.On("RegistryListPipeline", repo, pipeline)} +} + +func (_c *MockService_RegistryListPipeline_Call) Run(run func(repo *model.Repo, pipeline *model.Pipeline)) *MockService_RegistryListPipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.Pipeline + if args[1] != nil { + arg1 = args[1].(*model.Pipeline) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_RegistryListPipeline_Call) Return(registrys []*model.Registry, err error) *MockService_RegistryListPipeline_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockService_RegistryListPipeline_Call) RunAndReturn(run func(repo *model.Repo, pipeline *model.Pipeline) ([]*model.Registry, error)) *MockService_RegistryListPipeline_Call { + _c.Call.Return(run) + return _c +} + +// RegistryUpdate provides a mock function for the type MockService +func (_mock *MockService) RegistryUpdate(repo *model.Repo, registry *model.Registry) error { + ret := _mock.Called(repo, registry) + + if len(ret) == 0 { + panic("no return value specified for RegistryUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.Registry) error); ok { + r0 = returnFunc(repo, registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_RegistryUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryUpdate' +type MockService_RegistryUpdate_Call struct { + *mock.Call +} + +// RegistryUpdate is a helper method to define mock.On call +// - repo *model.Repo +// - registry *model.Registry +func (_e *MockService_Expecter) RegistryUpdate(repo interface{}, registry interface{}) *MockService_RegistryUpdate_Call { + return &MockService_RegistryUpdate_Call{Call: _e.mock.On("RegistryUpdate", repo, registry)} +} + +func (_c *MockService_RegistryUpdate_Call) Run(run func(repo *model.Repo, registry *model.Registry)) *MockService_RegistryUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.Registry + if args[1] != nil { + arg1 = args[1].(*model.Registry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_RegistryUpdate_Call) Return(err error) *MockService_RegistryUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_RegistryUpdate_Call) RunAndReturn(run func(repo *model.Repo, registry *model.Registry) error) *MockService_RegistryUpdate_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/services/registry/mocks/service.go b/server/services/registry/mocks/service.go deleted file mode 100644 index 49cf1e8e2..000000000 --- a/server/services/registry/mocks/service.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - model "go.woodpecker-ci.org/woodpecker/v3/server/model" -) - -// Service is an autogenerated mock type for the Service type -type Service struct { - mock.Mock -} - -// GlobalRegistryCreate provides a mock function with given fields: _a0 -func (_m *Service) GlobalRegistryCreate(_a0 *model.Registry) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Registry) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GlobalRegistryDelete provides a mock function with given fields: _a0 -func (_m *Service) GlobalRegistryDelete(_a0 string) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GlobalRegistryFind provides a mock function with given fields: _a0 -func (_m *Service) GlobalRegistryFind(_a0 string) (*model.Registry, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryFind") - } - - var r0 *model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(string) (*model.Registry, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) *model.Registry); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalRegistryList provides a mock function with given fields: _a0 -func (_m *Service) GlobalRegistryList(_a0 *model.ListOptions) ([]*model.Registry, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryList") - } - - var r0 []*model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Registry, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.ListOptions) []*model.Registry); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(*model.ListOptions) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalRegistryUpdate provides a mock function with given fields: _a0 -func (_m *Service) GlobalRegistryUpdate(_a0 *model.Registry) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Registry) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgRegistryCreate provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgRegistryCreate(_a0 int64, _a1 *model.Registry) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, *model.Registry) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgRegistryDelete provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgRegistryDelete(_a0 int64, _a1 string) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, string) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgRegistryFind provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgRegistryFind(_a0 int64, _a1 string) (*model.Registry, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryFind") - } - - var r0 *model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, string) (*model.Registry, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, string) *model.Registry); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgRegistryList provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgRegistryList(_a0 int64, _a1 *model.ListOptions) ([]*model.Registry, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryList") - } - - var r0 []*model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Registry, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Registry); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgRegistryUpdate provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgRegistryUpdate(_a0 int64, _a1 *model.Registry) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, *model.Registry) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RegistryCreate provides a mock function with given fields: _a0, _a1 -func (_m *Service) RegistryCreate(_a0 *model.Repo, _a1 *model.Registry) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for RegistryCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.Registry) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RegistryDelete provides a mock function with given fields: _a0, _a1 -func (_m *Service) RegistryDelete(_a0 *model.Repo, _a1 string) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for RegistryDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo, string) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RegistryFind provides a mock function with given fields: _a0, _a1 -func (_m *Service) RegistryFind(_a0 *model.Repo, _a1 string) (*model.Registry, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for RegistryFind") - } - - var r0 *model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Registry, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, string) *model.Registry); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryList provides a mock function with given fields: _a0, _a1 -func (_m *Service) RegistryList(_a0 *model.Repo, _a1 *model.ListOptions) ([]*model.Registry, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for RegistryList") - } - - var r0 []*model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) ([]*model.Registry, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) []*model.Registry); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryListPipeline provides a mock function with given fields: _a0, _a1 -func (_m *Service) RegistryListPipeline(_a0 *model.Repo, _a1 *model.Pipeline) ([]*model.Registry, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for RegistryListPipeline") - } - - var r0 []*model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.Pipeline) ([]*model.Registry, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, *model.Pipeline) []*model.Registry); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, *model.Pipeline) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryUpdate provides a mock function with given fields: _a0, _a1 -func (_m *Service) RegistryUpdate(_a0 *model.Repo, _a1 *model.Registry) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for RegistryUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.Registry) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewService creates a new instance of Service. 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 NewService(t interface { - mock.TestingT - Cleanup(func()) -}) *Service { - mock := &Service{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/server/services/registry/service.go b/server/services/registry/service.go index a2fc03979..f42bbe488 100644 --- a/server/services/registry/service.go +++ b/server/services/registry/service.go @@ -16,8 +16,6 @@ package registry import "go.woodpecker-ci.org/woodpecker/v3/server/model" -//go:generate mockery --name Service --output mocks --case underscore - // Service defines a service for managing registries. type Service interface { RegistryListPipeline(*model.Repo, *model.Pipeline) ([]*model.Registry, error) diff --git a/server/services/secret/db_test.go b/server/services/secret/db_test.go index c966a7f9b..433b3e886 100644 --- a/server/services/secret/db_test.go +++ b/server/services/secret/db_test.go @@ -22,7 +22,7 @@ import ( "go.woodpecker-ci.org/woodpecker/v3/server/model" "go.woodpecker-ci.org/woodpecker/v3/server/services/secret" - mocks_store "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" + store_mocks "go.woodpecker-ci.org/woodpecker/v3/server/store/mocks" ) var ( @@ -52,7 +52,7 @@ var ( ) func TestSecretListPipeline(t *testing.T) { - mockStore := mocks_store.NewStore(t) + mockStore := store_mocks.NewMockStore(t) mockStore.On("SecretList", mock.Anything, mock.Anything, mock.Anything).Once().Return([]*model.Secret{ globalSecret, diff --git a/server/services/secret/mocks/mock_Service.go b/server/services/secret/mocks/mock_Service.go new file mode 100644 index 000000000..38d15e16d --- /dev/null +++ b/server/services/secret/mocks/mock_Service.go @@ -0,0 +1,996 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/model" +) + +// NewMockService creates a new instance of MockService. 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 NewMockService(t interface { + mock.TestingT + Cleanup(func()) +}) *MockService { + mock := &MockService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockService is an autogenerated mock type for the Service type +type MockService struct { + mock.Mock +} + +type MockService_Expecter struct { + mock *mock.Mock +} + +func (_m *MockService) EXPECT() *MockService_Expecter { + return &MockService_Expecter{mock: &_m.Mock} +} + +// GlobalSecretCreate provides a mock function for the type MockService +func (_mock *MockService) GlobalSecretCreate(secret *model.Secret) error { + ret := _mock.Called(secret) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Secret) error); ok { + r0 = returnFunc(secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_GlobalSecretCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretCreate' +type MockService_GlobalSecretCreate_Call struct { + *mock.Call +} + +// GlobalSecretCreate is a helper method to define mock.On call +// - secret *model.Secret +func (_e *MockService_Expecter) GlobalSecretCreate(secret interface{}) *MockService_GlobalSecretCreate_Call { + return &MockService_GlobalSecretCreate_Call{Call: _e.mock.On("GlobalSecretCreate", secret)} +} + +func (_c *MockService_GlobalSecretCreate_Call) Run(run func(secret *model.Secret)) *MockService_GlobalSecretCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Secret + if args[0] != nil { + arg0 = args[0].(*model.Secret) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalSecretCreate_Call) Return(err error) *MockService_GlobalSecretCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_GlobalSecretCreate_Call) RunAndReturn(run func(secret *model.Secret) error) *MockService_GlobalSecretCreate_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretDelete provides a mock function for the type MockService +func (_mock *MockService) GlobalSecretDelete(s string) error { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(s) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_GlobalSecretDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretDelete' +type MockService_GlobalSecretDelete_Call struct { + *mock.Call +} + +// GlobalSecretDelete is a helper method to define mock.On call +// - s string +func (_e *MockService_Expecter) GlobalSecretDelete(s interface{}) *MockService_GlobalSecretDelete_Call { + return &MockService_GlobalSecretDelete_Call{Call: _e.mock.On("GlobalSecretDelete", s)} +} + +func (_c *MockService_GlobalSecretDelete_Call) Run(run func(s string)) *MockService_GlobalSecretDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalSecretDelete_Call) Return(err error) *MockService_GlobalSecretDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_GlobalSecretDelete_Call) RunAndReturn(run func(s string) error) *MockService_GlobalSecretDelete_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretFind provides a mock function for the type MockService +func (_mock *MockService) GlobalSecretFind(s string) (*model.Secret, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretFind") + } + + var r0 *model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*model.Secret, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *model.Secret); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_GlobalSecretFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretFind' +type MockService_GlobalSecretFind_Call struct { + *mock.Call +} + +// GlobalSecretFind is a helper method to define mock.On call +// - s string +func (_e *MockService_Expecter) GlobalSecretFind(s interface{}) *MockService_GlobalSecretFind_Call { + return &MockService_GlobalSecretFind_Call{Call: _e.mock.On("GlobalSecretFind", s)} +} + +func (_c *MockService_GlobalSecretFind_Call) Run(run func(s string)) *MockService_GlobalSecretFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalSecretFind_Call) Return(secret *model.Secret, err error) *MockService_GlobalSecretFind_Call { + _c.Call.Return(secret, err) + return _c +} + +func (_c *MockService_GlobalSecretFind_Call) RunAndReturn(run func(s string) (*model.Secret, error)) *MockService_GlobalSecretFind_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretList provides a mock function for the type MockService +func (_mock *MockService) GlobalSecretList(listOptions *model.ListOptions) ([]*model.Secret, error) { + ret := _mock.Called(listOptions) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretList") + } + + var r0 []*model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Secret, error)); ok { + return returnFunc(listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) []*model.Secret); ok { + r0 = returnFunc(listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.ListOptions) error); ok { + r1 = returnFunc(listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_GlobalSecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretList' +type MockService_GlobalSecretList_Call struct { + *mock.Call +} + +// GlobalSecretList is a helper method to define mock.On call +// - listOptions *model.ListOptions +func (_e *MockService_Expecter) GlobalSecretList(listOptions interface{}) *MockService_GlobalSecretList_Call { + return &MockService_GlobalSecretList_Call{Call: _e.mock.On("GlobalSecretList", listOptions)} +} + +func (_c *MockService_GlobalSecretList_Call) Run(run func(listOptions *model.ListOptions)) *MockService_GlobalSecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.ListOptions + if args[0] != nil { + arg0 = args[0].(*model.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalSecretList_Call) Return(secrets []*model.Secret, err error) *MockService_GlobalSecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockService_GlobalSecretList_Call) RunAndReturn(run func(listOptions *model.ListOptions) ([]*model.Secret, error)) *MockService_GlobalSecretList_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretUpdate provides a mock function for the type MockService +func (_mock *MockService) GlobalSecretUpdate(secret *model.Secret) error { + ret := _mock.Called(secret) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Secret) error); ok { + r0 = returnFunc(secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_GlobalSecretUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretUpdate' +type MockService_GlobalSecretUpdate_Call struct { + *mock.Call +} + +// GlobalSecretUpdate is a helper method to define mock.On call +// - secret *model.Secret +func (_e *MockService_Expecter) GlobalSecretUpdate(secret interface{}) *MockService_GlobalSecretUpdate_Call { + return &MockService_GlobalSecretUpdate_Call{Call: _e.mock.On("GlobalSecretUpdate", secret)} +} + +func (_c *MockService_GlobalSecretUpdate_Call) Run(run func(secret *model.Secret)) *MockService_GlobalSecretUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Secret + if args[0] != nil { + arg0 = args[0].(*model.Secret) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockService_GlobalSecretUpdate_Call) Return(err error) *MockService_GlobalSecretUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_GlobalSecretUpdate_Call) RunAndReturn(run func(secret *model.Secret) error) *MockService_GlobalSecretUpdate_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretCreate provides a mock function for the type MockService +func (_mock *MockService) OrgSecretCreate(n int64, secret *model.Secret) error { + ret := _mock.Called(n, secret) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, *model.Secret) error); ok { + r0 = returnFunc(n, secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_OrgSecretCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretCreate' +type MockService_OrgSecretCreate_Call struct { + *mock.Call +} + +// OrgSecretCreate is a helper method to define mock.On call +// - n int64 +// - secret *model.Secret +func (_e *MockService_Expecter) OrgSecretCreate(n interface{}, secret interface{}) *MockService_OrgSecretCreate_Call { + return &MockService_OrgSecretCreate_Call{Call: _e.mock.On("OrgSecretCreate", n, secret)} +} + +func (_c *MockService_OrgSecretCreate_Call) Run(run func(n int64, secret *model.Secret)) *MockService_OrgSecretCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *model.Secret + if args[1] != nil { + arg1 = args[1].(*model.Secret) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgSecretCreate_Call) Return(err error) *MockService_OrgSecretCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_OrgSecretCreate_Call) RunAndReturn(run func(n int64, secret *model.Secret) error) *MockService_OrgSecretCreate_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretDelete provides a mock function for the type MockService +func (_mock *MockService) OrgSecretDelete(n int64, s string) error { + ret := _mock.Called(n, s) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, string) error); ok { + r0 = returnFunc(n, s) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_OrgSecretDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretDelete' +type MockService_OrgSecretDelete_Call struct { + *mock.Call +} + +// OrgSecretDelete is a helper method to define mock.On call +// - n int64 +// - s string +func (_e *MockService_Expecter) OrgSecretDelete(n interface{}, s interface{}) *MockService_OrgSecretDelete_Call { + return &MockService_OrgSecretDelete_Call{Call: _e.mock.On("OrgSecretDelete", n, s)} +} + +func (_c *MockService_OrgSecretDelete_Call) Run(run func(n int64, s string)) *MockService_OrgSecretDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgSecretDelete_Call) Return(err error) *MockService_OrgSecretDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_OrgSecretDelete_Call) RunAndReturn(run func(n int64, s string) error) *MockService_OrgSecretDelete_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretFind provides a mock function for the type MockService +func (_mock *MockService) OrgSecretFind(n int64, s string) (*model.Secret, error) { + ret := _mock.Called(n, s) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretFind") + } + + var r0 *model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, string) (*model.Secret, error)); ok { + return returnFunc(n, s) + } + if returnFunc, ok := ret.Get(0).(func(int64, string) *model.Secret); ok { + r0 = returnFunc(n, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, string) error); ok { + r1 = returnFunc(n, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_OrgSecretFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretFind' +type MockService_OrgSecretFind_Call struct { + *mock.Call +} + +// OrgSecretFind is a helper method to define mock.On call +// - n int64 +// - s string +func (_e *MockService_Expecter) OrgSecretFind(n interface{}, s interface{}) *MockService_OrgSecretFind_Call { + return &MockService_OrgSecretFind_Call{Call: _e.mock.On("OrgSecretFind", n, s)} +} + +func (_c *MockService_OrgSecretFind_Call) Run(run func(n int64, s string)) *MockService_OrgSecretFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgSecretFind_Call) Return(secret *model.Secret, err error) *MockService_OrgSecretFind_Call { + _c.Call.Return(secret, err) + return _c +} + +func (_c *MockService_OrgSecretFind_Call) RunAndReturn(run func(n int64, s string) (*model.Secret, error)) *MockService_OrgSecretFind_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretList provides a mock function for the type MockService +func (_mock *MockService) OrgSecretList(n int64, listOptions *model.ListOptions) ([]*model.Secret, error) { + ret := _mock.Called(n, listOptions) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretList") + } + + var r0 []*model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Secret, error)); ok { + return returnFunc(n, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Secret); ok { + r0 = returnFunc(n, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { + r1 = returnFunc(n, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_OrgSecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretList' +type MockService_OrgSecretList_Call struct { + *mock.Call +} + +// OrgSecretList is a helper method to define mock.On call +// - n int64 +// - listOptions *model.ListOptions +func (_e *MockService_Expecter) OrgSecretList(n interface{}, listOptions interface{}) *MockService_OrgSecretList_Call { + return &MockService_OrgSecretList_Call{Call: _e.mock.On("OrgSecretList", n, listOptions)} +} + +func (_c *MockService_OrgSecretList_Call) Run(run func(n int64, listOptions *model.ListOptions)) *MockService_OrgSecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgSecretList_Call) Return(secrets []*model.Secret, err error) *MockService_OrgSecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockService_OrgSecretList_Call) RunAndReturn(run func(n int64, listOptions *model.ListOptions) ([]*model.Secret, error)) *MockService_OrgSecretList_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretUpdate provides a mock function for the type MockService +func (_mock *MockService) OrgSecretUpdate(n int64, secret *model.Secret) error { + ret := _mock.Called(n, secret) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, *model.Secret) error); ok { + r0 = returnFunc(n, secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_OrgSecretUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretUpdate' +type MockService_OrgSecretUpdate_Call struct { + *mock.Call +} + +// OrgSecretUpdate is a helper method to define mock.On call +// - n int64 +// - secret *model.Secret +func (_e *MockService_Expecter) OrgSecretUpdate(n interface{}, secret interface{}) *MockService_OrgSecretUpdate_Call { + return &MockService_OrgSecretUpdate_Call{Call: _e.mock.On("OrgSecretUpdate", n, secret)} +} + +func (_c *MockService_OrgSecretUpdate_Call) Run(run func(n int64, secret *model.Secret)) *MockService_OrgSecretUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *model.Secret + if args[1] != nil { + arg1 = args[1].(*model.Secret) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_OrgSecretUpdate_Call) Return(err error) *MockService_OrgSecretUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_OrgSecretUpdate_Call) RunAndReturn(run func(n int64, secret *model.Secret) error) *MockService_OrgSecretUpdate_Call { + _c.Call.Return(run) + return _c +} + +// SecretCreate provides a mock function for the type MockService +func (_mock *MockService) SecretCreate(repo *model.Repo, secret *model.Secret) error { + ret := _mock.Called(repo, secret) + + if len(ret) == 0 { + panic("no return value specified for SecretCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.Secret) error); ok { + r0 = returnFunc(repo, secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_SecretCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretCreate' +type MockService_SecretCreate_Call struct { + *mock.Call +} + +// SecretCreate is a helper method to define mock.On call +// - repo *model.Repo +// - secret *model.Secret +func (_e *MockService_Expecter) SecretCreate(repo interface{}, secret interface{}) *MockService_SecretCreate_Call { + return &MockService_SecretCreate_Call{Call: _e.mock.On("SecretCreate", repo, secret)} +} + +func (_c *MockService_SecretCreate_Call) Run(run func(repo *model.Repo, secret *model.Secret)) *MockService_SecretCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.Secret + if args[1] != nil { + arg1 = args[1].(*model.Secret) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_SecretCreate_Call) Return(err error) *MockService_SecretCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_SecretCreate_Call) RunAndReturn(run func(repo *model.Repo, secret *model.Secret) error) *MockService_SecretCreate_Call { + _c.Call.Return(run) + return _c +} + +// SecretDelete provides a mock function for the type MockService +func (_mock *MockService) SecretDelete(repo *model.Repo, s string) error { + ret := _mock.Called(repo, s) + + if len(ret) == 0 { + panic("no return value specified for SecretDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) error); ok { + r0 = returnFunc(repo, s) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_SecretDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretDelete' +type MockService_SecretDelete_Call struct { + *mock.Call +} + +// SecretDelete is a helper method to define mock.On call +// - repo *model.Repo +// - s string +func (_e *MockService_Expecter) SecretDelete(repo interface{}, s interface{}) *MockService_SecretDelete_Call { + return &MockService_SecretDelete_Call{Call: _e.mock.On("SecretDelete", repo, s)} +} + +func (_c *MockService_SecretDelete_Call) Run(run func(repo *model.Repo, s string)) *MockService_SecretDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_SecretDelete_Call) Return(err error) *MockService_SecretDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_SecretDelete_Call) RunAndReturn(run func(repo *model.Repo, s string) error) *MockService_SecretDelete_Call { + _c.Call.Return(run) + return _c +} + +// SecretFind provides a mock function for the type MockService +func (_mock *MockService) SecretFind(repo *model.Repo, s string) (*model.Secret, error) { + ret := _mock.Called(repo, s) + + if len(ret) == 0 { + panic("no return value specified for SecretFind") + } + + var r0 *model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) (*model.Secret, error)); ok { + return returnFunc(repo, s) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) *model.Secret); ok { + r0 = returnFunc(repo, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, string) error); ok { + r1 = returnFunc(repo, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_SecretFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretFind' +type MockService_SecretFind_Call struct { + *mock.Call +} + +// SecretFind is a helper method to define mock.On call +// - repo *model.Repo +// - s string +func (_e *MockService_Expecter) SecretFind(repo interface{}, s interface{}) *MockService_SecretFind_Call { + return &MockService_SecretFind_Call{Call: _e.mock.On("SecretFind", repo, s)} +} + +func (_c *MockService_SecretFind_Call) Run(run func(repo *model.Repo, s string)) *MockService_SecretFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_SecretFind_Call) Return(secret *model.Secret, err error) *MockService_SecretFind_Call { + _c.Call.Return(secret, err) + return _c +} + +func (_c *MockService_SecretFind_Call) RunAndReturn(run func(repo *model.Repo, s string) (*model.Secret, error)) *MockService_SecretFind_Call { + _c.Call.Return(run) + return _c +} + +// SecretList provides a mock function for the type MockService +func (_mock *MockService) SecretList(repo *model.Repo, listOptions *model.ListOptions) ([]*model.Secret, error) { + ret := _mock.Called(repo, listOptions) + + if len(ret) == 0 { + panic("no return value specified for SecretList") + } + + var r0 []*model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) ([]*model.Secret, error)); ok { + return returnFunc(repo, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) []*model.Secret); ok { + r0 = returnFunc(repo, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, *model.ListOptions) error); ok { + r1 = returnFunc(repo, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_SecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretList' +type MockService_SecretList_Call struct { + *mock.Call +} + +// SecretList is a helper method to define mock.On call +// - repo *model.Repo +// - listOptions *model.ListOptions +func (_e *MockService_Expecter) SecretList(repo interface{}, listOptions interface{}) *MockService_SecretList_Call { + return &MockService_SecretList_Call{Call: _e.mock.On("SecretList", repo, listOptions)} +} + +func (_c *MockService_SecretList_Call) Run(run func(repo *model.Repo, listOptions *model.ListOptions)) *MockService_SecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_SecretList_Call) Return(secrets []*model.Secret, err error) *MockService_SecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockService_SecretList_Call) RunAndReturn(run func(repo *model.Repo, listOptions *model.ListOptions) ([]*model.Secret, error)) *MockService_SecretList_Call { + _c.Call.Return(run) + return _c +} + +// SecretListPipeline provides a mock function for the type MockService +func (_mock *MockService) SecretListPipeline(repo *model.Repo, pipeline *model.Pipeline) ([]*model.Secret, error) { + ret := _mock.Called(repo, pipeline) + + if len(ret) == 0 { + panic("no return value specified for SecretListPipeline") + } + + var r0 []*model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.Pipeline) ([]*model.Secret, error)); ok { + return returnFunc(repo, pipeline) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.Pipeline) []*model.Secret); ok { + r0 = returnFunc(repo, pipeline) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, *model.Pipeline) error); ok { + r1 = returnFunc(repo, pipeline) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockService_SecretListPipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretListPipeline' +type MockService_SecretListPipeline_Call struct { + *mock.Call +} + +// SecretListPipeline is a helper method to define mock.On call +// - repo *model.Repo +// - pipeline *model.Pipeline +func (_e *MockService_Expecter) SecretListPipeline(repo interface{}, pipeline interface{}) *MockService_SecretListPipeline_Call { + return &MockService_SecretListPipeline_Call{Call: _e.mock.On("SecretListPipeline", repo, pipeline)} +} + +func (_c *MockService_SecretListPipeline_Call) Run(run func(repo *model.Repo, pipeline *model.Pipeline)) *MockService_SecretListPipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.Pipeline + if args[1] != nil { + arg1 = args[1].(*model.Pipeline) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_SecretListPipeline_Call) Return(secrets []*model.Secret, err error) *MockService_SecretListPipeline_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockService_SecretListPipeline_Call) RunAndReturn(run func(repo *model.Repo, pipeline *model.Pipeline) ([]*model.Secret, error)) *MockService_SecretListPipeline_Call { + _c.Call.Return(run) + return _c +} + +// SecretUpdate provides a mock function for the type MockService +func (_mock *MockService) SecretUpdate(repo *model.Repo, secret *model.Secret) error { + ret := _mock.Called(repo, secret) + + if len(ret) == 0 { + panic("no return value specified for SecretUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.Secret) error); ok { + r0 = returnFunc(repo, secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockService_SecretUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretUpdate' +type MockService_SecretUpdate_Call struct { + *mock.Call +} + +// SecretUpdate is a helper method to define mock.On call +// - repo *model.Repo +// - secret *model.Secret +func (_e *MockService_Expecter) SecretUpdate(repo interface{}, secret interface{}) *MockService_SecretUpdate_Call { + return &MockService_SecretUpdate_Call{Call: _e.mock.On("SecretUpdate", repo, secret)} +} + +func (_c *MockService_SecretUpdate_Call) Run(run func(repo *model.Repo, secret *model.Secret)) *MockService_SecretUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.Secret + if args[1] != nil { + arg1 = args[1].(*model.Secret) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockService_SecretUpdate_Call) Return(err error) *MockService_SecretUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockService_SecretUpdate_Call) RunAndReturn(run func(repo *model.Repo, secret *model.Secret) error) *MockService_SecretUpdate_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/services/secret/mocks/service.go b/server/services/secret/mocks/service.go deleted file mode 100644 index d918d625b..000000000 --- a/server/services/secret/mocks/service.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - model "go.woodpecker-ci.org/woodpecker/v3/server/model" -) - -// Service is an autogenerated mock type for the Service type -type Service struct { - mock.Mock -} - -// GlobalSecretCreate provides a mock function with given fields: _a0 -func (_m *Service) GlobalSecretCreate(_a0 *model.Secret) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Secret) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GlobalSecretDelete provides a mock function with given fields: _a0 -func (_m *Service) GlobalSecretDelete(_a0 string) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GlobalSecretFind provides a mock function with given fields: _a0 -func (_m *Service) GlobalSecretFind(_a0 string) (*model.Secret, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretFind") - } - - var r0 *model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(string) (*model.Secret, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) *model.Secret); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalSecretList provides a mock function with given fields: _a0 -func (_m *Service) GlobalSecretList(_a0 *model.ListOptions) ([]*model.Secret, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretList") - } - - var r0 []*model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Secret, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.ListOptions) []*model.Secret); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(*model.ListOptions) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalSecretUpdate provides a mock function with given fields: _a0 -func (_m *Service) GlobalSecretUpdate(_a0 *model.Secret) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Secret) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgSecretCreate provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgSecretCreate(_a0 int64, _a1 *model.Secret) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, *model.Secret) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgSecretDelete provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgSecretDelete(_a0 int64, _a1 string) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, string) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgSecretFind provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgSecretFind(_a0 int64, _a1 string) (*model.Secret, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretFind") - } - - var r0 *model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, string) (*model.Secret, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, string) *model.Secret); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgSecretList provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgSecretList(_a0 int64, _a1 *model.ListOptions) ([]*model.Secret, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretList") - } - - var r0 []*model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Secret, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Secret); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgSecretUpdate provides a mock function with given fields: _a0, _a1 -func (_m *Service) OrgSecretUpdate(_a0 int64, _a1 *model.Secret) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, *model.Secret) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SecretCreate provides a mock function with given fields: _a0, _a1 -func (_m *Service) SecretCreate(_a0 *model.Repo, _a1 *model.Secret) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for SecretCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.Secret) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SecretDelete provides a mock function with given fields: _a0, _a1 -func (_m *Service) SecretDelete(_a0 *model.Repo, _a1 string) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for SecretDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo, string) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SecretFind provides a mock function with given fields: _a0, _a1 -func (_m *Service) SecretFind(_a0 *model.Repo, _a1 string) (*model.Secret, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for SecretFind") - } - - var r0 *model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Secret, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, string) *model.Secret); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretList provides a mock function with given fields: _a0, _a1 -func (_m *Service) SecretList(_a0 *model.Repo, _a1 *model.ListOptions) ([]*model.Secret, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for SecretList") - } - - var r0 []*model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) ([]*model.Secret, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) []*model.Secret); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretListPipeline provides a mock function with given fields: _a0, _a1 -func (_m *Service) SecretListPipeline(_a0 *model.Repo, _a1 *model.Pipeline) ([]*model.Secret, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for SecretListPipeline") - } - - var r0 []*model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.Pipeline) ([]*model.Secret, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, *model.Pipeline) []*model.Secret); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, *model.Pipeline) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretUpdate provides a mock function with given fields: _a0, _a1 -func (_m *Service) SecretUpdate(_a0 *model.Repo, _a1 *model.Secret) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for SecretUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.Secret) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewService creates a new instance of Service. 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 NewService(t interface { - mock.TestingT - Cleanup(func()) -}) *Service { - mock := &Service{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/server/services/secret/service.go b/server/services/secret/service.go index 8bc691d2e..c2f5c9758 100644 --- a/server/services/secret/service.go +++ b/server/services/secret/service.go @@ -16,8 +16,6 @@ package secret import "go.woodpecker-ci.org/woodpecker/v3/server/model" -//go:generate mockery --name Service --output mocks --case underscore - // Service defines a service for managing secrets. type Service interface { SecretListPipeline(*model.Repo, *model.Pipeline) ([]*model.Secret, error) diff --git a/server/store/mocks/mock_Store.go b/server/store/mocks/mock_Store.go new file mode 100644 index 000000000..8f0c65163 --- /dev/null +++ b/server/store/mocks/mock_Store.go @@ -0,0 +1,6566 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "context" + + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/server/model" +) + +// NewMockStore creates a new instance of MockStore. 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 NewMockStore(t interface { + mock.TestingT + Cleanup(func()) +}) *MockStore { + mock := &MockStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockStore is an autogenerated mock type for the Store type +type MockStore struct { + mock.Mock +} + +type MockStore_Expecter struct { + mock *mock.Mock +} + +func (_m *MockStore) EXPECT() *MockStore_Expecter { + return &MockStore_Expecter{mock: &_m.Mock} +} + +// AgentCreate provides a mock function for the type MockStore +func (_mock *MockStore) AgentCreate(agent *model.Agent) error { + ret := _mock.Called(agent) + + if len(ret) == 0 { + panic("no return value specified for AgentCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Agent) error); ok { + r0 = returnFunc(agent) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_AgentCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentCreate' +type MockStore_AgentCreate_Call struct { + *mock.Call +} + +// AgentCreate is a helper method to define mock.On call +// - agent *model.Agent +func (_e *MockStore_Expecter) AgentCreate(agent interface{}) *MockStore_AgentCreate_Call { + return &MockStore_AgentCreate_Call{Call: _e.mock.On("AgentCreate", agent)} +} + +func (_c *MockStore_AgentCreate_Call) Run(run func(agent *model.Agent)) *MockStore_AgentCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Agent + if args[0] != nil { + arg0 = args[0].(*model.Agent) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_AgentCreate_Call) Return(err error) *MockStore_AgentCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_AgentCreate_Call) RunAndReturn(run func(agent *model.Agent) error) *MockStore_AgentCreate_Call { + _c.Call.Return(run) + return _c +} + +// AgentDelete provides a mock function for the type MockStore +func (_mock *MockStore) AgentDelete(agent *model.Agent) error { + ret := _mock.Called(agent) + + if len(ret) == 0 { + panic("no return value specified for AgentDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Agent) error); ok { + r0 = returnFunc(agent) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_AgentDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentDelete' +type MockStore_AgentDelete_Call struct { + *mock.Call +} + +// AgentDelete is a helper method to define mock.On call +// - agent *model.Agent +func (_e *MockStore_Expecter) AgentDelete(agent interface{}) *MockStore_AgentDelete_Call { + return &MockStore_AgentDelete_Call{Call: _e.mock.On("AgentDelete", agent)} +} + +func (_c *MockStore_AgentDelete_Call) Run(run func(agent *model.Agent)) *MockStore_AgentDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Agent + if args[0] != nil { + arg0 = args[0].(*model.Agent) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_AgentDelete_Call) Return(err error) *MockStore_AgentDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_AgentDelete_Call) RunAndReturn(run func(agent *model.Agent) error) *MockStore_AgentDelete_Call { + _c.Call.Return(run) + return _c +} + +// AgentFind provides a mock function for the type MockStore +func (_mock *MockStore) AgentFind(n int64) (*model.Agent, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for AgentFind") + } + + var r0 *model.Agent + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*model.Agent, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) *model.Agent); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Agent) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_AgentFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentFind' +type MockStore_AgentFind_Call struct { + *mock.Call +} + +// AgentFind is a helper method to define mock.On call +// - n int64 +func (_e *MockStore_Expecter) AgentFind(n interface{}) *MockStore_AgentFind_Call { + return &MockStore_AgentFind_Call{Call: _e.mock.On("AgentFind", n)} +} + +func (_c *MockStore_AgentFind_Call) Run(run func(n int64)) *MockStore_AgentFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_AgentFind_Call) Return(agent *model.Agent, err error) *MockStore_AgentFind_Call { + _c.Call.Return(agent, err) + return _c +} + +func (_c *MockStore_AgentFind_Call) RunAndReturn(run func(n int64) (*model.Agent, error)) *MockStore_AgentFind_Call { + _c.Call.Return(run) + return _c +} + +// AgentFindByToken provides a mock function for the type MockStore +func (_mock *MockStore) AgentFindByToken(s string) (*model.Agent, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for AgentFindByToken") + } + + var r0 *model.Agent + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*model.Agent, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *model.Agent); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Agent) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_AgentFindByToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentFindByToken' +type MockStore_AgentFindByToken_Call struct { + *mock.Call +} + +// AgentFindByToken is a helper method to define mock.On call +// - s string +func (_e *MockStore_Expecter) AgentFindByToken(s interface{}) *MockStore_AgentFindByToken_Call { + return &MockStore_AgentFindByToken_Call{Call: _e.mock.On("AgentFindByToken", s)} +} + +func (_c *MockStore_AgentFindByToken_Call) Run(run func(s string)) *MockStore_AgentFindByToken_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_AgentFindByToken_Call) Return(agent *model.Agent, err error) *MockStore_AgentFindByToken_Call { + _c.Call.Return(agent, err) + return _c +} + +func (_c *MockStore_AgentFindByToken_Call) RunAndReturn(run func(s string) (*model.Agent, error)) *MockStore_AgentFindByToken_Call { + _c.Call.Return(run) + return _c +} + +// AgentList provides a mock function for the type MockStore +func (_mock *MockStore) AgentList(p *model.ListOptions) ([]*model.Agent, error) { + ret := _mock.Called(p) + + if len(ret) == 0 { + panic("no return value specified for AgentList") + } + + var r0 []*model.Agent + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Agent, error)); ok { + return returnFunc(p) + } + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) []*model.Agent); ok { + r0 = returnFunc(p) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Agent) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.ListOptions) error); ok { + r1 = returnFunc(p) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_AgentList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentList' +type MockStore_AgentList_Call struct { + *mock.Call +} + +// AgentList is a helper method to define mock.On call +// - p *model.ListOptions +func (_e *MockStore_Expecter) AgentList(p interface{}) *MockStore_AgentList_Call { + return &MockStore_AgentList_Call{Call: _e.mock.On("AgentList", p)} +} + +func (_c *MockStore_AgentList_Call) Run(run func(p *model.ListOptions)) *MockStore_AgentList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.ListOptions + if args[0] != nil { + arg0 = args[0].(*model.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_AgentList_Call) Return(agents []*model.Agent, err error) *MockStore_AgentList_Call { + _c.Call.Return(agents, err) + return _c +} + +func (_c *MockStore_AgentList_Call) RunAndReturn(run func(p *model.ListOptions) ([]*model.Agent, error)) *MockStore_AgentList_Call { + _c.Call.Return(run) + return _c +} + +// AgentListForOrg provides a mock function for the type MockStore +func (_mock *MockStore) AgentListForOrg(orgID int64, opt *model.ListOptions) ([]*model.Agent, error) { + ret := _mock.Called(orgID, opt) + + if len(ret) == 0 { + panic("no return value specified for AgentListForOrg") + } + + var r0 []*model.Agent + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Agent, error)); ok { + return returnFunc(orgID, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Agent); ok { + r0 = returnFunc(orgID, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Agent) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { + r1 = returnFunc(orgID, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_AgentListForOrg_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentListForOrg' +type MockStore_AgentListForOrg_Call struct { + *mock.Call +} + +// AgentListForOrg is a helper method to define mock.On call +// - orgID int64 +// - opt *model.ListOptions +func (_e *MockStore_Expecter) AgentListForOrg(orgID interface{}, opt interface{}) *MockStore_AgentListForOrg_Call { + return &MockStore_AgentListForOrg_Call{Call: _e.mock.On("AgentListForOrg", orgID, opt)} +} + +func (_c *MockStore_AgentListForOrg_Call) Run(run func(orgID int64, opt *model.ListOptions)) *MockStore_AgentListForOrg_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_AgentListForOrg_Call) Return(agents []*model.Agent, err error) *MockStore_AgentListForOrg_Call { + _c.Call.Return(agents, err) + return _c +} + +func (_c *MockStore_AgentListForOrg_Call) RunAndReturn(run func(orgID int64, opt *model.ListOptions) ([]*model.Agent, error)) *MockStore_AgentListForOrg_Call { + _c.Call.Return(run) + return _c +} + +// AgentUpdate provides a mock function for the type MockStore +func (_mock *MockStore) AgentUpdate(agent *model.Agent) error { + ret := _mock.Called(agent) + + if len(ret) == 0 { + panic("no return value specified for AgentUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Agent) error); ok { + r0 = returnFunc(agent) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_AgentUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentUpdate' +type MockStore_AgentUpdate_Call struct { + *mock.Call +} + +// AgentUpdate is a helper method to define mock.On call +// - agent *model.Agent +func (_e *MockStore_Expecter) AgentUpdate(agent interface{}) *MockStore_AgentUpdate_Call { + return &MockStore_AgentUpdate_Call{Call: _e.mock.On("AgentUpdate", agent)} +} + +func (_c *MockStore_AgentUpdate_Call) Run(run func(agent *model.Agent)) *MockStore_AgentUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Agent + if args[0] != nil { + arg0 = args[0].(*model.Agent) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_AgentUpdate_Call) Return(err error) *MockStore_AgentUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_AgentUpdate_Call) RunAndReturn(run func(agent *model.Agent) error) *MockStore_AgentUpdate_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function for the type MockStore +func (_mock *MockStore) 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 +} + +// MockStore_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockStore_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockStore_Expecter) Close() *MockStore_Close_Call { + return &MockStore_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockStore_Close_Call) Run(run func()) *MockStore_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStore_Close_Call) Return(err error) *MockStore_Close_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_Close_Call) RunAndReturn(run func() error) *MockStore_Close_Call { + _c.Call.Return(run) + return _c +} + +// ConfigPersist provides a mock function for the type MockStore +func (_mock *MockStore) ConfigPersist(config *model.Config) (*model.Config, error) { + ret := _mock.Called(config) + + if len(ret) == 0 { + panic("no return value specified for ConfigPersist") + } + + var r0 *model.Config + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Config) (*model.Config, error)); ok { + return returnFunc(config) + } + if returnFunc, ok := ret.Get(0).(func(*model.Config) *model.Config); ok { + r0 = returnFunc(config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Config) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Config) error); ok { + r1 = returnFunc(config) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_ConfigPersist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigPersist' +type MockStore_ConfigPersist_Call struct { + *mock.Call +} + +// ConfigPersist is a helper method to define mock.On call +// - config *model.Config +func (_e *MockStore_Expecter) ConfigPersist(config interface{}) *MockStore_ConfigPersist_Call { + return &MockStore_ConfigPersist_Call{Call: _e.mock.On("ConfigPersist", config)} +} + +func (_c *MockStore_ConfigPersist_Call) Run(run func(config *model.Config)) *MockStore_ConfigPersist_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Config + if args[0] != nil { + arg0 = args[0].(*model.Config) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_ConfigPersist_Call) Return(config1 *model.Config, err error) *MockStore_ConfigPersist_Call { + _c.Call.Return(config1, err) + return _c +} + +func (_c *MockStore_ConfigPersist_Call) RunAndReturn(run func(config *model.Config) (*model.Config, error)) *MockStore_ConfigPersist_Call { + _c.Call.Return(run) + return _c +} + +// ConfigsForPipeline provides a mock function for the type MockStore +func (_mock *MockStore) ConfigsForPipeline(pipelineID int64) ([]*model.Config, error) { + ret := _mock.Called(pipelineID) + + if len(ret) == 0 { + panic("no return value specified for ConfigsForPipeline") + } + + var r0 []*model.Config + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) ([]*model.Config, error)); ok { + return returnFunc(pipelineID) + } + if returnFunc, ok := ret.Get(0).(func(int64) []*model.Config); ok { + r0 = returnFunc(pipelineID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Config) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(pipelineID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_ConfigsForPipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfigsForPipeline' +type MockStore_ConfigsForPipeline_Call struct { + *mock.Call +} + +// ConfigsForPipeline is a helper method to define mock.On call +// - pipelineID int64 +func (_e *MockStore_Expecter) ConfigsForPipeline(pipelineID interface{}) *MockStore_ConfigsForPipeline_Call { + return &MockStore_ConfigsForPipeline_Call{Call: _e.mock.On("ConfigsForPipeline", pipelineID)} +} + +func (_c *MockStore_ConfigsForPipeline_Call) Run(run func(pipelineID int64)) *MockStore_ConfigsForPipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_ConfigsForPipeline_Call) Return(configs []*model.Config, err error) *MockStore_ConfigsForPipeline_Call { + _c.Call.Return(configs, err) + return _c +} + +func (_c *MockStore_ConfigsForPipeline_Call) RunAndReturn(run func(pipelineID int64) ([]*model.Config, error)) *MockStore_ConfigsForPipeline_Call { + _c.Call.Return(run) + return _c +} + +// CreatePipeline provides a mock function for the type MockStore +func (_mock *MockStore) CreatePipeline(pipeline *model.Pipeline, steps ...*model.Step) error { + var tmpRet mock.Arguments + if len(steps) > 0 { + tmpRet = _mock.Called(pipeline, steps) + } else { + tmpRet = _mock.Called(pipeline) + } + ret := tmpRet + + if len(ret) == 0 { + panic("no return value specified for CreatePipeline") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline, ...*model.Step) error); ok { + r0 = returnFunc(pipeline, steps...) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_CreatePipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatePipeline' +type MockStore_CreatePipeline_Call struct { + *mock.Call +} + +// CreatePipeline is a helper method to define mock.On call +// - pipeline *model.Pipeline +// - steps ...*model.Step +func (_e *MockStore_Expecter) CreatePipeline(pipeline interface{}, steps ...interface{}) *MockStore_CreatePipeline_Call { + return &MockStore_CreatePipeline_Call{Call: _e.mock.On("CreatePipeline", + append([]interface{}{pipeline}, steps...)...)} +} + +func (_c *MockStore_CreatePipeline_Call) Run(run func(pipeline *model.Pipeline, steps ...*model.Step)) *MockStore_CreatePipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Pipeline + if args[0] != nil { + arg0 = args[0].(*model.Pipeline) + } + var arg1 []*model.Step + var variadicArgs []*model.Step + if len(args) > 1 { + variadicArgs = args[1].([]*model.Step) + } + arg1 = variadicArgs + run( + arg0, + arg1..., + ) + }) + return _c +} + +func (_c *MockStore_CreatePipeline_Call) Return(err error) *MockStore_CreatePipeline_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_CreatePipeline_Call) RunAndReturn(run func(pipeline *model.Pipeline, steps ...*model.Step) error) *MockStore_CreatePipeline_Call { + _c.Call.Return(run) + return _c +} + +// CreateRedirection provides a mock function for the type MockStore +func (_mock *MockStore) CreateRedirection(redirection *model.Redirection) error { + ret := _mock.Called(redirection) + + if len(ret) == 0 { + panic("no return value specified for CreateRedirection") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Redirection) error); ok { + r0 = returnFunc(redirection) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_CreateRedirection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRedirection' +type MockStore_CreateRedirection_Call struct { + *mock.Call +} + +// CreateRedirection is a helper method to define mock.On call +// - redirection *model.Redirection +func (_e *MockStore_Expecter) CreateRedirection(redirection interface{}) *MockStore_CreateRedirection_Call { + return &MockStore_CreateRedirection_Call{Call: _e.mock.On("CreateRedirection", redirection)} +} + +func (_c *MockStore_CreateRedirection_Call) Run(run func(redirection *model.Redirection)) *MockStore_CreateRedirection_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Redirection + if args[0] != nil { + arg0 = args[0].(*model.Redirection) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_CreateRedirection_Call) Return(err error) *MockStore_CreateRedirection_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_CreateRedirection_Call) RunAndReturn(run func(redirection *model.Redirection) error) *MockStore_CreateRedirection_Call { + _c.Call.Return(run) + return _c +} + +// CreateRepo provides a mock function for the type MockStore +func (_mock *MockStore) CreateRepo(repo *model.Repo) error { + ret := _mock.Called(repo) + + if len(ret) == 0 { + panic("no return value specified for CreateRepo") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo) error); ok { + r0 = returnFunc(repo) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_CreateRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRepo' +type MockStore_CreateRepo_Call struct { + *mock.Call +} + +// CreateRepo is a helper method to define mock.On call +// - repo *model.Repo +func (_e *MockStore_Expecter) CreateRepo(repo interface{}) *MockStore_CreateRepo_Call { + return &MockStore_CreateRepo_Call{Call: _e.mock.On("CreateRepo", repo)} +} + +func (_c *MockStore_CreateRepo_Call) Run(run func(repo *model.Repo)) *MockStore_CreateRepo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_CreateRepo_Call) Return(err error) *MockStore_CreateRepo_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_CreateRepo_Call) RunAndReturn(run func(repo *model.Repo) error) *MockStore_CreateRepo_Call { + _c.Call.Return(run) + return _c +} + +// CreateUser provides a mock function for the type MockStore +func (_mock *MockStore) CreateUser(user *model.User) error { + ret := _mock.Called(user) + + if len(ret) == 0 { + panic("no return value specified for CreateUser") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.User) error); ok { + r0 = returnFunc(user) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_CreateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUser' +type MockStore_CreateUser_Call struct { + *mock.Call +} + +// CreateUser is a helper method to define mock.On call +// - user *model.User +func (_e *MockStore_Expecter) CreateUser(user interface{}) *MockStore_CreateUser_Call { + return &MockStore_CreateUser_Call{Call: _e.mock.On("CreateUser", user)} +} + +func (_c *MockStore_CreateUser_Call) Run(run func(user *model.User)) *MockStore_CreateUser_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.User + if args[0] != nil { + arg0 = args[0].(*model.User) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_CreateUser_Call) Return(err error) *MockStore_CreateUser_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_CreateUser_Call) RunAndReturn(run func(user *model.User) error) *MockStore_CreateUser_Call { + _c.Call.Return(run) + return _c +} + +// CronCreate provides a mock function for the type MockStore +func (_mock *MockStore) CronCreate(cron *model.Cron) error { + ret := _mock.Called(cron) + + if len(ret) == 0 { + panic("no return value specified for CronCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Cron) error); ok { + r0 = returnFunc(cron) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_CronCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronCreate' +type MockStore_CronCreate_Call struct { + *mock.Call +} + +// CronCreate is a helper method to define mock.On call +// - cron *model.Cron +func (_e *MockStore_Expecter) CronCreate(cron interface{}) *MockStore_CronCreate_Call { + return &MockStore_CronCreate_Call{Call: _e.mock.On("CronCreate", cron)} +} + +func (_c *MockStore_CronCreate_Call) Run(run func(cron *model.Cron)) *MockStore_CronCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Cron + if args[0] != nil { + arg0 = args[0].(*model.Cron) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_CronCreate_Call) Return(err error) *MockStore_CronCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_CronCreate_Call) RunAndReturn(run func(cron *model.Cron) error) *MockStore_CronCreate_Call { + _c.Call.Return(run) + return _c +} + +// CronDelete provides a mock function for the type MockStore +func (_mock *MockStore) CronDelete(repo *model.Repo, n int64) error { + ret := _mock.Called(repo, n) + + if len(ret) == 0 { + panic("no return value specified for CronDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, int64) error); ok { + r0 = returnFunc(repo, n) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_CronDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronDelete' +type MockStore_CronDelete_Call struct { + *mock.Call +} + +// CronDelete is a helper method to define mock.On call +// - repo *model.Repo +// - n int64 +func (_e *MockStore_Expecter) CronDelete(repo interface{}, n interface{}) *MockStore_CronDelete_Call { + return &MockStore_CronDelete_Call{Call: _e.mock.On("CronDelete", repo, n)} +} + +func (_c *MockStore_CronDelete_Call) Run(run func(repo *model.Repo, n int64)) *MockStore_CronDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_CronDelete_Call) Return(err error) *MockStore_CronDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_CronDelete_Call) RunAndReturn(run func(repo *model.Repo, n int64) error) *MockStore_CronDelete_Call { + _c.Call.Return(run) + return _c +} + +// CronFind provides a mock function for the type MockStore +func (_mock *MockStore) CronFind(repo *model.Repo, n int64) (*model.Cron, error) { + ret := _mock.Called(repo, n) + + if len(ret) == 0 { + panic("no return value specified for CronFind") + } + + var r0 *model.Cron + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, int64) (*model.Cron, error)); ok { + return returnFunc(repo, n) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, int64) *model.Cron); ok { + r0 = returnFunc(repo, n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Cron) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, int64) error); ok { + r1 = returnFunc(repo, n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_CronFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronFind' +type MockStore_CronFind_Call struct { + *mock.Call +} + +// CronFind is a helper method to define mock.On call +// - repo *model.Repo +// - n int64 +func (_e *MockStore_Expecter) CronFind(repo interface{}, n interface{}) *MockStore_CronFind_Call { + return &MockStore_CronFind_Call{Call: _e.mock.On("CronFind", repo, n)} +} + +func (_c *MockStore_CronFind_Call) Run(run func(repo *model.Repo, n int64)) *MockStore_CronFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_CronFind_Call) Return(cron *model.Cron, err error) *MockStore_CronFind_Call { + _c.Call.Return(cron, err) + return _c +} + +func (_c *MockStore_CronFind_Call) RunAndReturn(run func(repo *model.Repo, n int64) (*model.Cron, error)) *MockStore_CronFind_Call { + _c.Call.Return(run) + return _c +} + +// CronGetLock provides a mock function for the type MockStore +func (_mock *MockStore) CronGetLock(cron *model.Cron, n int64) (bool, error) { + ret := _mock.Called(cron, n) + + if len(ret) == 0 { + panic("no return value specified for CronGetLock") + } + + var r0 bool + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Cron, int64) (bool, error)); ok { + return returnFunc(cron, n) + } + if returnFunc, ok := ret.Get(0).(func(*model.Cron, int64) bool); ok { + r0 = returnFunc(cron, n) + } else { + r0 = ret.Get(0).(bool) + } + if returnFunc, ok := ret.Get(1).(func(*model.Cron, int64) error); ok { + r1 = returnFunc(cron, n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_CronGetLock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronGetLock' +type MockStore_CronGetLock_Call struct { + *mock.Call +} + +// CronGetLock is a helper method to define mock.On call +// - cron *model.Cron +// - n int64 +func (_e *MockStore_Expecter) CronGetLock(cron interface{}, n interface{}) *MockStore_CronGetLock_Call { + return &MockStore_CronGetLock_Call{Call: _e.mock.On("CronGetLock", cron, n)} +} + +func (_c *MockStore_CronGetLock_Call) Run(run func(cron *model.Cron, n int64)) *MockStore_CronGetLock_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Cron + if args[0] != nil { + arg0 = args[0].(*model.Cron) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_CronGetLock_Call) Return(b bool, err error) *MockStore_CronGetLock_Call { + _c.Call.Return(b, err) + return _c +} + +func (_c *MockStore_CronGetLock_Call) RunAndReturn(run func(cron *model.Cron, n int64) (bool, error)) *MockStore_CronGetLock_Call { + _c.Call.Return(run) + return _c +} + +// CronList provides a mock function for the type MockStore +func (_mock *MockStore) CronList(repo *model.Repo, listOptions *model.ListOptions) ([]*model.Cron, error) { + ret := _mock.Called(repo, listOptions) + + if len(ret) == 0 { + panic("no return value specified for CronList") + } + + var r0 []*model.Cron + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) ([]*model.Cron, error)); ok { + return returnFunc(repo, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) []*model.Cron); ok { + r0 = returnFunc(repo, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Cron) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, *model.ListOptions) error); ok { + r1 = returnFunc(repo, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_CronList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronList' +type MockStore_CronList_Call struct { + *mock.Call +} + +// CronList is a helper method to define mock.On call +// - repo *model.Repo +// - listOptions *model.ListOptions +func (_e *MockStore_Expecter) CronList(repo interface{}, listOptions interface{}) *MockStore_CronList_Call { + return &MockStore_CronList_Call{Call: _e.mock.On("CronList", repo, listOptions)} +} + +func (_c *MockStore_CronList_Call) Run(run func(repo *model.Repo, listOptions *model.ListOptions)) *MockStore_CronList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_CronList_Call) Return(crons []*model.Cron, err error) *MockStore_CronList_Call { + _c.Call.Return(crons, err) + return _c +} + +func (_c *MockStore_CronList_Call) RunAndReturn(run func(repo *model.Repo, listOptions *model.ListOptions) ([]*model.Cron, error)) *MockStore_CronList_Call { + _c.Call.Return(run) + return _c +} + +// CronListNextExecute provides a mock function for the type MockStore +func (_mock *MockStore) CronListNextExecute(n int64, n1 int64) ([]*model.Cron, error) { + ret := _mock.Called(n, n1) + + if len(ret) == 0 { + panic("no return value specified for CronListNextExecute") + } + + var r0 []*model.Cron + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, int64) ([]*model.Cron, error)); ok { + return returnFunc(n, n1) + } + if returnFunc, ok := ret.Get(0).(func(int64, int64) []*model.Cron); ok { + r0 = returnFunc(n, n1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Cron) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, int64) error); ok { + r1 = returnFunc(n, n1) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_CronListNextExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronListNextExecute' +type MockStore_CronListNextExecute_Call struct { + *mock.Call +} + +// CronListNextExecute is a helper method to define mock.On call +// - n int64 +// - n1 int64 +func (_e *MockStore_Expecter) CronListNextExecute(n interface{}, n1 interface{}) *MockStore_CronListNextExecute_Call { + return &MockStore_CronListNextExecute_Call{Call: _e.mock.On("CronListNextExecute", n, n1)} +} + +func (_c *MockStore_CronListNextExecute_Call) Run(run func(n int64, n1 int64)) *MockStore_CronListNextExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_CronListNextExecute_Call) Return(crons []*model.Cron, err error) *MockStore_CronListNextExecute_Call { + _c.Call.Return(crons, err) + return _c +} + +func (_c *MockStore_CronListNextExecute_Call) RunAndReturn(run func(n int64, n1 int64) ([]*model.Cron, error)) *MockStore_CronListNextExecute_Call { + _c.Call.Return(run) + return _c +} + +// CronUpdate provides a mock function for the type MockStore +func (_mock *MockStore) CronUpdate(repo *model.Repo, cron *model.Cron) error { + ret := _mock.Called(repo, cron) + + if len(ret) == 0 { + panic("no return value specified for CronUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.Cron) error); ok { + r0 = returnFunc(repo, cron) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_CronUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronUpdate' +type MockStore_CronUpdate_Call struct { + *mock.Call +} + +// CronUpdate is a helper method to define mock.On call +// - repo *model.Repo +// - cron *model.Cron +func (_e *MockStore_Expecter) CronUpdate(repo interface{}, cron interface{}) *MockStore_CronUpdate_Call { + return &MockStore_CronUpdate_Call{Call: _e.mock.On("CronUpdate", repo, cron)} +} + +func (_c *MockStore_CronUpdate_Call) Run(run func(repo *model.Repo, cron *model.Cron)) *MockStore_CronUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.Cron + if args[1] != nil { + arg1 = args[1].(*model.Cron) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_CronUpdate_Call) Return(err error) *MockStore_CronUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_CronUpdate_Call) RunAndReturn(run func(repo *model.Repo, cron *model.Cron) error) *MockStore_CronUpdate_Call { + _c.Call.Return(run) + return _c +} + +// DeletePipeline provides a mock function for the type MockStore +func (_mock *MockStore) DeletePipeline(pipeline *model.Pipeline) error { + ret := _mock.Called(pipeline) + + if len(ret) == 0 { + panic("no return value specified for DeletePipeline") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline) error); ok { + r0 = returnFunc(pipeline) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_DeletePipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePipeline' +type MockStore_DeletePipeline_Call struct { + *mock.Call +} + +// DeletePipeline is a helper method to define mock.On call +// - pipeline *model.Pipeline +func (_e *MockStore_Expecter) DeletePipeline(pipeline interface{}) *MockStore_DeletePipeline_Call { + return &MockStore_DeletePipeline_Call{Call: _e.mock.On("DeletePipeline", pipeline)} +} + +func (_c *MockStore_DeletePipeline_Call) Run(run func(pipeline *model.Pipeline)) *MockStore_DeletePipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Pipeline + if args[0] != nil { + arg0 = args[0].(*model.Pipeline) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_DeletePipeline_Call) Return(err error) *MockStore_DeletePipeline_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_DeletePipeline_Call) RunAndReturn(run func(pipeline *model.Pipeline) error) *MockStore_DeletePipeline_Call { + _c.Call.Return(run) + return _c +} + +// DeleteRepo provides a mock function for the type MockStore +func (_mock *MockStore) DeleteRepo(repo *model.Repo) error { + ret := _mock.Called(repo) + + if len(ret) == 0 { + panic("no return value specified for DeleteRepo") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo) error); ok { + r0 = returnFunc(repo) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_DeleteRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRepo' +type MockStore_DeleteRepo_Call struct { + *mock.Call +} + +// DeleteRepo is a helper method to define mock.On call +// - repo *model.Repo +func (_e *MockStore_Expecter) DeleteRepo(repo interface{}) *MockStore_DeleteRepo_Call { + return &MockStore_DeleteRepo_Call{Call: _e.mock.On("DeleteRepo", repo)} +} + +func (_c *MockStore_DeleteRepo_Call) Run(run func(repo *model.Repo)) *MockStore_DeleteRepo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_DeleteRepo_Call) Return(err error) *MockStore_DeleteRepo_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_DeleteRepo_Call) RunAndReturn(run func(repo *model.Repo) error) *MockStore_DeleteRepo_Call { + _c.Call.Return(run) + return _c +} + +// DeleteUser provides a mock function for the type MockStore +func (_mock *MockStore) DeleteUser(user *model.User) error { + ret := _mock.Called(user) + + if len(ret) == 0 { + panic("no return value specified for DeleteUser") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.User) error); ok { + r0 = returnFunc(user) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_DeleteUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteUser' +type MockStore_DeleteUser_Call struct { + *mock.Call +} + +// DeleteUser is a helper method to define mock.On call +// - user *model.User +func (_e *MockStore_Expecter) DeleteUser(user interface{}) *MockStore_DeleteUser_Call { + return &MockStore_DeleteUser_Call{Call: _e.mock.On("DeleteUser", user)} +} + +func (_c *MockStore_DeleteUser_Call) Run(run func(user *model.User)) *MockStore_DeleteUser_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.User + if args[0] != nil { + arg0 = args[0].(*model.User) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_DeleteUser_Call) Return(err error) *MockStore_DeleteUser_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_DeleteUser_Call) RunAndReturn(run func(user *model.User) error) *MockStore_DeleteUser_Call { + _c.Call.Return(run) + return _c +} + +// ForgeCreate provides a mock function for the type MockStore +func (_mock *MockStore) ForgeCreate(forge *model.Forge) error { + ret := _mock.Called(forge) + + if len(ret) == 0 { + panic("no return value specified for ForgeCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Forge) error); ok { + r0 = returnFunc(forge) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_ForgeCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForgeCreate' +type MockStore_ForgeCreate_Call struct { + *mock.Call +} + +// ForgeCreate is a helper method to define mock.On call +// - forge *model.Forge +func (_e *MockStore_Expecter) ForgeCreate(forge interface{}) *MockStore_ForgeCreate_Call { + return &MockStore_ForgeCreate_Call{Call: _e.mock.On("ForgeCreate", forge)} +} + +func (_c *MockStore_ForgeCreate_Call) Run(run func(forge *model.Forge)) *MockStore_ForgeCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Forge + if args[0] != nil { + arg0 = args[0].(*model.Forge) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_ForgeCreate_Call) Return(err error) *MockStore_ForgeCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_ForgeCreate_Call) RunAndReturn(run func(forge *model.Forge) error) *MockStore_ForgeCreate_Call { + _c.Call.Return(run) + return _c +} + +// ForgeDelete provides a mock function for the type MockStore +func (_mock *MockStore) ForgeDelete(forge *model.Forge) error { + ret := _mock.Called(forge) + + if len(ret) == 0 { + panic("no return value specified for ForgeDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Forge) error); ok { + r0 = returnFunc(forge) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_ForgeDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForgeDelete' +type MockStore_ForgeDelete_Call struct { + *mock.Call +} + +// ForgeDelete is a helper method to define mock.On call +// - forge *model.Forge +func (_e *MockStore_Expecter) ForgeDelete(forge interface{}) *MockStore_ForgeDelete_Call { + return &MockStore_ForgeDelete_Call{Call: _e.mock.On("ForgeDelete", forge)} +} + +func (_c *MockStore_ForgeDelete_Call) Run(run func(forge *model.Forge)) *MockStore_ForgeDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Forge + if args[0] != nil { + arg0 = args[0].(*model.Forge) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_ForgeDelete_Call) Return(err error) *MockStore_ForgeDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_ForgeDelete_Call) RunAndReturn(run func(forge *model.Forge) error) *MockStore_ForgeDelete_Call { + _c.Call.Return(run) + return _c +} + +// ForgeGet provides a mock function for the type MockStore +func (_mock *MockStore) ForgeGet(n int64) (*model.Forge, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for ForgeGet") + } + + var r0 *model.Forge + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*model.Forge, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) *model.Forge); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Forge) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_ForgeGet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForgeGet' +type MockStore_ForgeGet_Call struct { + *mock.Call +} + +// ForgeGet is a helper method to define mock.On call +// - n int64 +func (_e *MockStore_Expecter) ForgeGet(n interface{}) *MockStore_ForgeGet_Call { + return &MockStore_ForgeGet_Call{Call: _e.mock.On("ForgeGet", n)} +} + +func (_c *MockStore_ForgeGet_Call) Run(run func(n int64)) *MockStore_ForgeGet_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_ForgeGet_Call) Return(forge *model.Forge, err error) *MockStore_ForgeGet_Call { + _c.Call.Return(forge, err) + return _c +} + +func (_c *MockStore_ForgeGet_Call) RunAndReturn(run func(n int64) (*model.Forge, error)) *MockStore_ForgeGet_Call { + _c.Call.Return(run) + return _c +} + +// ForgeList provides a mock function for the type MockStore +func (_mock *MockStore) ForgeList(p *model.ListOptions) ([]*model.Forge, error) { + ret := _mock.Called(p) + + if len(ret) == 0 { + panic("no return value specified for ForgeList") + } + + var r0 []*model.Forge + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Forge, error)); ok { + return returnFunc(p) + } + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) []*model.Forge); ok { + r0 = returnFunc(p) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Forge) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.ListOptions) error); ok { + r1 = returnFunc(p) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_ForgeList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForgeList' +type MockStore_ForgeList_Call struct { + *mock.Call +} + +// ForgeList is a helper method to define mock.On call +// - p *model.ListOptions +func (_e *MockStore_Expecter) ForgeList(p interface{}) *MockStore_ForgeList_Call { + return &MockStore_ForgeList_Call{Call: _e.mock.On("ForgeList", p)} +} + +func (_c *MockStore_ForgeList_Call) Run(run func(p *model.ListOptions)) *MockStore_ForgeList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.ListOptions + if args[0] != nil { + arg0 = args[0].(*model.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_ForgeList_Call) Return(forges []*model.Forge, err error) *MockStore_ForgeList_Call { + _c.Call.Return(forges, err) + return _c +} + +func (_c *MockStore_ForgeList_Call) RunAndReturn(run func(p *model.ListOptions) ([]*model.Forge, error)) *MockStore_ForgeList_Call { + _c.Call.Return(run) + return _c +} + +// ForgeUpdate provides a mock function for the type MockStore +func (_mock *MockStore) ForgeUpdate(forge *model.Forge) error { + ret := _mock.Called(forge) + + if len(ret) == 0 { + panic("no return value specified for ForgeUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Forge) error); ok { + r0 = returnFunc(forge) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_ForgeUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForgeUpdate' +type MockStore_ForgeUpdate_Call struct { + *mock.Call +} + +// ForgeUpdate is a helper method to define mock.On call +// - forge *model.Forge +func (_e *MockStore_Expecter) ForgeUpdate(forge interface{}) *MockStore_ForgeUpdate_Call { + return &MockStore_ForgeUpdate_Call{Call: _e.mock.On("ForgeUpdate", forge)} +} + +func (_c *MockStore_ForgeUpdate_Call) Run(run func(forge *model.Forge)) *MockStore_ForgeUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Forge + if args[0] != nil { + arg0 = args[0].(*model.Forge) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_ForgeUpdate_Call) Return(err error) *MockStore_ForgeUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_ForgeUpdate_Call) RunAndReturn(run func(forge *model.Forge) error) *MockStore_ForgeUpdate_Call { + _c.Call.Return(run) + return _c +} + +// GetActivePipelineList provides a mock function for the type MockStore +func (_mock *MockStore) GetActivePipelineList(repo *model.Repo) ([]*model.Pipeline, error) { + ret := _mock.Called(repo) + + if len(ret) == 0 { + panic("no return value specified for GetActivePipelineList") + } + + var r0 []*model.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo) ([]*model.Pipeline, error)); ok { + return returnFunc(repo) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo) []*model.Pipeline); ok { + r0 = returnFunc(repo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo) error); ok { + r1 = returnFunc(repo) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetActivePipelineList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActivePipelineList' +type MockStore_GetActivePipelineList_Call struct { + *mock.Call +} + +// GetActivePipelineList is a helper method to define mock.On call +// - repo *model.Repo +func (_e *MockStore_Expecter) GetActivePipelineList(repo interface{}) *MockStore_GetActivePipelineList_Call { + return &MockStore_GetActivePipelineList_Call{Call: _e.mock.On("GetActivePipelineList", repo)} +} + +func (_c *MockStore_GetActivePipelineList_Call) Run(run func(repo *model.Repo)) *MockStore_GetActivePipelineList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GetActivePipelineList_Call) Return(pipelines []*model.Pipeline, err error) *MockStore_GetActivePipelineList_Call { + _c.Call.Return(pipelines, err) + return _c +} + +func (_c *MockStore_GetActivePipelineList_Call) RunAndReturn(run func(repo *model.Repo) ([]*model.Pipeline, error)) *MockStore_GetActivePipelineList_Call { + _c.Call.Return(run) + return _c +} + +// GetPipeline provides a mock function for the type MockStore +func (_mock *MockStore) GetPipeline(n int64) (*model.Pipeline, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for GetPipeline") + } + + var r0 *model.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*model.Pipeline, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) *model.Pipeline); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetPipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPipeline' +type MockStore_GetPipeline_Call struct { + *mock.Call +} + +// GetPipeline is a helper method to define mock.On call +// - n int64 +func (_e *MockStore_Expecter) GetPipeline(n interface{}) *MockStore_GetPipeline_Call { + return &MockStore_GetPipeline_Call{Call: _e.mock.On("GetPipeline", n)} +} + +func (_c *MockStore_GetPipeline_Call) Run(run func(n int64)) *MockStore_GetPipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GetPipeline_Call) Return(pipeline *model.Pipeline, err error) *MockStore_GetPipeline_Call { + _c.Call.Return(pipeline, err) + return _c +} + +func (_c *MockStore_GetPipeline_Call) RunAndReturn(run func(n int64) (*model.Pipeline, error)) *MockStore_GetPipeline_Call { + _c.Call.Return(run) + return _c +} + +// GetPipelineBadge provides a mock function for the type MockStore +func (_mock *MockStore) GetPipelineBadge(repo *model.Repo, s string) (*model.Pipeline, error) { + ret := _mock.Called(repo, s) + + if len(ret) == 0 { + panic("no return value specified for GetPipelineBadge") + } + + var r0 *model.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) (*model.Pipeline, error)); ok { + return returnFunc(repo, s) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) *model.Pipeline); ok { + r0 = returnFunc(repo, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, string) error); ok { + r1 = returnFunc(repo, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetPipelineBadge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPipelineBadge' +type MockStore_GetPipelineBadge_Call struct { + *mock.Call +} + +// GetPipelineBadge is a helper method to define mock.On call +// - repo *model.Repo +// - s string +func (_e *MockStore_Expecter) GetPipelineBadge(repo interface{}, s interface{}) *MockStore_GetPipelineBadge_Call { + return &MockStore_GetPipelineBadge_Call{Call: _e.mock.On("GetPipelineBadge", repo, s)} +} + +func (_c *MockStore_GetPipelineBadge_Call) Run(run func(repo *model.Repo, s string)) *MockStore_GetPipelineBadge_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_GetPipelineBadge_Call) Return(pipeline *model.Pipeline, err error) *MockStore_GetPipelineBadge_Call { + _c.Call.Return(pipeline, err) + return _c +} + +func (_c *MockStore_GetPipelineBadge_Call) RunAndReturn(run func(repo *model.Repo, s string) (*model.Pipeline, error)) *MockStore_GetPipelineBadge_Call { + _c.Call.Return(run) + return _c +} + +// GetPipelineCount provides a mock function for the type MockStore +func (_mock *MockStore) GetPipelineCount() (int64, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPipelineCount") + } + + var r0 int64 + var r1 error + if returnFunc, ok := ret.Get(0).(func() (int64, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int64) + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetPipelineCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPipelineCount' +type MockStore_GetPipelineCount_Call struct { + *mock.Call +} + +// GetPipelineCount is a helper method to define mock.On call +func (_e *MockStore_Expecter) GetPipelineCount() *MockStore_GetPipelineCount_Call { + return &MockStore_GetPipelineCount_Call{Call: _e.mock.On("GetPipelineCount")} +} + +func (_c *MockStore_GetPipelineCount_Call) Run(run func()) *MockStore_GetPipelineCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStore_GetPipelineCount_Call) Return(n int64, err error) *MockStore_GetPipelineCount_Call { + _c.Call.Return(n, err) + return _c +} + +func (_c *MockStore_GetPipelineCount_Call) RunAndReturn(run func() (int64, error)) *MockStore_GetPipelineCount_Call { + _c.Call.Return(run) + return _c +} + +// GetPipelineLast provides a mock function for the type MockStore +func (_mock *MockStore) GetPipelineLast(repo *model.Repo, s string) (*model.Pipeline, error) { + ret := _mock.Called(repo, s) + + if len(ret) == 0 { + panic("no return value specified for GetPipelineLast") + } + + var r0 *model.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) (*model.Pipeline, error)); ok { + return returnFunc(repo, s) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) *model.Pipeline); ok { + r0 = returnFunc(repo, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, string) error); ok { + r1 = returnFunc(repo, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetPipelineLast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPipelineLast' +type MockStore_GetPipelineLast_Call struct { + *mock.Call +} + +// GetPipelineLast is a helper method to define mock.On call +// - repo *model.Repo +// - s string +func (_e *MockStore_Expecter) GetPipelineLast(repo interface{}, s interface{}) *MockStore_GetPipelineLast_Call { + return &MockStore_GetPipelineLast_Call{Call: _e.mock.On("GetPipelineLast", repo, s)} +} + +func (_c *MockStore_GetPipelineLast_Call) Run(run func(repo *model.Repo, s string)) *MockStore_GetPipelineLast_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_GetPipelineLast_Call) Return(pipeline *model.Pipeline, err error) *MockStore_GetPipelineLast_Call { + _c.Call.Return(pipeline, err) + return _c +} + +func (_c *MockStore_GetPipelineLast_Call) RunAndReturn(run func(repo *model.Repo, s string) (*model.Pipeline, error)) *MockStore_GetPipelineLast_Call { + _c.Call.Return(run) + return _c +} + +// GetPipelineLastBefore provides a mock function for the type MockStore +func (_mock *MockStore) GetPipelineLastBefore(repo *model.Repo, s string, n int64) (*model.Pipeline, error) { + ret := _mock.Called(repo, s, n) + + if len(ret) == 0 { + panic("no return value specified for GetPipelineLastBefore") + } + + var r0 *model.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string, int64) (*model.Pipeline, error)); ok { + return returnFunc(repo, s, n) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string, int64) *model.Pipeline); ok { + r0 = returnFunc(repo, s, n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, string, int64) error); ok { + r1 = returnFunc(repo, s, n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetPipelineLastBefore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPipelineLastBefore' +type MockStore_GetPipelineLastBefore_Call struct { + *mock.Call +} + +// GetPipelineLastBefore is a helper method to define mock.On call +// - repo *model.Repo +// - s string +// - n int64 +func (_e *MockStore_Expecter) GetPipelineLastBefore(repo interface{}, s interface{}, n interface{}) *MockStore_GetPipelineLastBefore_Call { + return &MockStore_GetPipelineLastBefore_Call{Call: _e.mock.On("GetPipelineLastBefore", repo, s, n)} +} + +func (_c *MockStore_GetPipelineLastBefore_Call) Run(run func(repo *model.Repo, s string, n int64)) *MockStore_GetPipelineLastBefore_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 int64 + if args[2] != nil { + arg2 = args[2].(int64) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockStore_GetPipelineLastBefore_Call) Return(pipeline *model.Pipeline, err error) *MockStore_GetPipelineLastBefore_Call { + _c.Call.Return(pipeline, err) + return _c +} + +func (_c *MockStore_GetPipelineLastBefore_Call) RunAndReturn(run func(repo *model.Repo, s string, n int64) (*model.Pipeline, error)) *MockStore_GetPipelineLastBefore_Call { + _c.Call.Return(run) + return _c +} + +// GetPipelineList provides a mock function for the type MockStore +func (_mock *MockStore) GetPipelineList(repo *model.Repo, listOptions *model.ListOptions, pipelineFilter *model.PipelineFilter) ([]*model.Pipeline, error) { + ret := _mock.Called(repo, listOptions, pipelineFilter) + + if len(ret) == 0 { + panic("no return value specified for GetPipelineList") + } + + var r0 []*model.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions, *model.PipelineFilter) ([]*model.Pipeline, error)); ok { + return returnFunc(repo, listOptions, pipelineFilter) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions, *model.PipelineFilter) []*model.Pipeline); ok { + r0 = returnFunc(repo, listOptions, pipelineFilter) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, *model.ListOptions, *model.PipelineFilter) error); ok { + r1 = returnFunc(repo, listOptions, pipelineFilter) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetPipelineList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPipelineList' +type MockStore_GetPipelineList_Call struct { + *mock.Call +} + +// GetPipelineList is a helper method to define mock.On call +// - repo *model.Repo +// - listOptions *model.ListOptions +// - pipelineFilter *model.PipelineFilter +func (_e *MockStore_Expecter) GetPipelineList(repo interface{}, listOptions interface{}, pipelineFilter interface{}) *MockStore_GetPipelineList_Call { + return &MockStore_GetPipelineList_Call{Call: _e.mock.On("GetPipelineList", repo, listOptions, pipelineFilter)} +} + +func (_c *MockStore_GetPipelineList_Call) Run(run func(repo *model.Repo, listOptions *model.ListOptions, pipelineFilter *model.PipelineFilter)) *MockStore_GetPipelineList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + var arg2 *model.PipelineFilter + if args[2] != nil { + arg2 = args[2].(*model.PipelineFilter) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockStore_GetPipelineList_Call) Return(pipelines []*model.Pipeline, err error) *MockStore_GetPipelineList_Call { + _c.Call.Return(pipelines, err) + return _c +} + +func (_c *MockStore_GetPipelineList_Call) RunAndReturn(run func(repo *model.Repo, listOptions *model.ListOptions, pipelineFilter *model.PipelineFilter) ([]*model.Pipeline, error)) *MockStore_GetPipelineList_Call { + _c.Call.Return(run) + return _c +} + +// GetPipelineNumber provides a mock function for the type MockStore +func (_mock *MockStore) GetPipelineNumber(repo *model.Repo, n int64) (*model.Pipeline, error) { + ret := _mock.Called(repo, n) + + if len(ret) == 0 { + panic("no return value specified for GetPipelineNumber") + } + + var r0 *model.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, int64) (*model.Pipeline, error)); ok { + return returnFunc(repo, n) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, int64) *model.Pipeline); ok { + r0 = returnFunc(repo, n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, int64) error); ok { + r1 = returnFunc(repo, n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetPipelineNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPipelineNumber' +type MockStore_GetPipelineNumber_Call struct { + *mock.Call +} + +// GetPipelineNumber is a helper method to define mock.On call +// - repo *model.Repo +// - n int64 +func (_e *MockStore_Expecter) GetPipelineNumber(repo interface{}, n interface{}) *MockStore_GetPipelineNumber_Call { + return &MockStore_GetPipelineNumber_Call{Call: _e.mock.On("GetPipelineNumber", repo, n)} +} + +func (_c *MockStore_GetPipelineNumber_Call) Run(run func(repo *model.Repo, n int64)) *MockStore_GetPipelineNumber_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_GetPipelineNumber_Call) Return(pipeline *model.Pipeline, err error) *MockStore_GetPipelineNumber_Call { + _c.Call.Return(pipeline, err) + return _c +} + +func (_c *MockStore_GetPipelineNumber_Call) RunAndReturn(run func(repo *model.Repo, n int64) (*model.Pipeline, error)) *MockStore_GetPipelineNumber_Call { + _c.Call.Return(run) + return _c +} + +// GetPipelineQueue provides a mock function for the type MockStore +func (_mock *MockStore) GetPipelineQueue() ([]*model.Feed, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPipelineQueue") + } + + var r0 []*model.Feed + var r1 error + if returnFunc, ok := ret.Get(0).(func() ([]*model.Feed, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []*model.Feed); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Feed) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetPipelineQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPipelineQueue' +type MockStore_GetPipelineQueue_Call struct { + *mock.Call +} + +// GetPipelineQueue is a helper method to define mock.On call +func (_e *MockStore_Expecter) GetPipelineQueue() *MockStore_GetPipelineQueue_Call { + return &MockStore_GetPipelineQueue_Call{Call: _e.mock.On("GetPipelineQueue")} +} + +func (_c *MockStore_GetPipelineQueue_Call) Run(run func()) *MockStore_GetPipelineQueue_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStore_GetPipelineQueue_Call) Return(feeds []*model.Feed, err error) *MockStore_GetPipelineQueue_Call { + _c.Call.Return(feeds, err) + return _c +} + +func (_c *MockStore_GetPipelineQueue_Call) RunAndReturn(run func() ([]*model.Feed, error)) *MockStore_GetPipelineQueue_Call { + _c.Call.Return(run) + return _c +} + +// GetRepo provides a mock function for the type MockStore +func (_mock *MockStore) GetRepo(n int64) (*model.Repo, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for GetRepo") + } + + var r0 *model.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*model.Repo, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) *model.Repo); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepo' +type MockStore_GetRepo_Call struct { + *mock.Call +} + +// GetRepo is a helper method to define mock.On call +// - n int64 +func (_e *MockStore_Expecter) GetRepo(n interface{}) *MockStore_GetRepo_Call { + return &MockStore_GetRepo_Call{Call: _e.mock.On("GetRepo", n)} +} + +func (_c *MockStore_GetRepo_Call) Run(run func(n int64)) *MockStore_GetRepo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GetRepo_Call) Return(repo *model.Repo, err error) *MockStore_GetRepo_Call { + _c.Call.Return(repo, err) + return _c +} + +func (_c *MockStore_GetRepo_Call) RunAndReturn(run func(n int64) (*model.Repo, error)) *MockStore_GetRepo_Call { + _c.Call.Return(run) + return _c +} + +// GetRepoCount provides a mock function for the type MockStore +func (_mock *MockStore) GetRepoCount() (int64, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRepoCount") + } + + var r0 int64 + var r1 error + if returnFunc, ok := ret.Get(0).(func() (int64, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int64) + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetRepoCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepoCount' +type MockStore_GetRepoCount_Call struct { + *mock.Call +} + +// GetRepoCount is a helper method to define mock.On call +func (_e *MockStore_Expecter) GetRepoCount() *MockStore_GetRepoCount_Call { + return &MockStore_GetRepoCount_Call{Call: _e.mock.On("GetRepoCount")} +} + +func (_c *MockStore_GetRepoCount_Call) Run(run func()) *MockStore_GetRepoCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStore_GetRepoCount_Call) Return(n int64, err error) *MockStore_GetRepoCount_Call { + _c.Call.Return(n, err) + return _c +} + +func (_c *MockStore_GetRepoCount_Call) RunAndReturn(run func() (int64, error)) *MockStore_GetRepoCount_Call { + _c.Call.Return(run) + return _c +} + +// GetRepoForgeID provides a mock function for the type MockStore +func (_mock *MockStore) GetRepoForgeID(forgeRemoteID model.ForgeRemoteID) (*model.Repo, error) { + ret := _mock.Called(forgeRemoteID) + + if len(ret) == 0 { + panic("no return value specified for GetRepoForgeID") + } + + var r0 *model.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(model.ForgeRemoteID) (*model.Repo, error)); ok { + return returnFunc(forgeRemoteID) + } + if returnFunc, ok := ret.Get(0).(func(model.ForgeRemoteID) *model.Repo); ok { + r0 = returnFunc(forgeRemoteID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(model.ForgeRemoteID) error); ok { + r1 = returnFunc(forgeRemoteID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetRepoForgeID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepoForgeID' +type MockStore_GetRepoForgeID_Call struct { + *mock.Call +} + +// GetRepoForgeID is a helper method to define mock.On call +// - forgeRemoteID model.ForgeRemoteID +func (_e *MockStore_Expecter) GetRepoForgeID(forgeRemoteID interface{}) *MockStore_GetRepoForgeID_Call { + return &MockStore_GetRepoForgeID_Call{Call: _e.mock.On("GetRepoForgeID", forgeRemoteID)} +} + +func (_c *MockStore_GetRepoForgeID_Call) Run(run func(forgeRemoteID model.ForgeRemoteID)) *MockStore_GetRepoForgeID_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 model.ForgeRemoteID + if args[0] != nil { + arg0 = args[0].(model.ForgeRemoteID) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GetRepoForgeID_Call) Return(repo *model.Repo, err error) *MockStore_GetRepoForgeID_Call { + _c.Call.Return(repo, err) + return _c +} + +func (_c *MockStore_GetRepoForgeID_Call) RunAndReturn(run func(forgeRemoteID model.ForgeRemoteID) (*model.Repo, error)) *MockStore_GetRepoForgeID_Call { + _c.Call.Return(run) + return _c +} + +// GetRepoLatestPipelines provides a mock function for the type MockStore +func (_mock *MockStore) GetRepoLatestPipelines(int64s []int64) ([]*model.Pipeline, error) { + ret := _mock.Called(int64s) + + if len(ret) == 0 { + panic("no return value specified for GetRepoLatestPipelines") + } + + var r0 []*model.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func([]int64) ([]*model.Pipeline, error)); ok { + return returnFunc(int64s) + } + if returnFunc, ok := ret.Get(0).(func([]int64) []*model.Pipeline); ok { + r0 = returnFunc(int64s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func([]int64) error); ok { + r1 = returnFunc(int64s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetRepoLatestPipelines_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepoLatestPipelines' +type MockStore_GetRepoLatestPipelines_Call struct { + *mock.Call +} + +// GetRepoLatestPipelines is a helper method to define mock.On call +// - int64s []int64 +func (_e *MockStore_Expecter) GetRepoLatestPipelines(int64s interface{}) *MockStore_GetRepoLatestPipelines_Call { + return &MockStore_GetRepoLatestPipelines_Call{Call: _e.mock.On("GetRepoLatestPipelines", int64s)} +} + +func (_c *MockStore_GetRepoLatestPipelines_Call) Run(run func(int64s []int64)) *MockStore_GetRepoLatestPipelines_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []int64 + if args[0] != nil { + arg0 = args[0].([]int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GetRepoLatestPipelines_Call) Return(pipelines []*model.Pipeline, err error) *MockStore_GetRepoLatestPipelines_Call { + _c.Call.Return(pipelines, err) + return _c +} + +func (_c *MockStore_GetRepoLatestPipelines_Call) RunAndReturn(run func(int64s []int64) ([]*model.Pipeline, error)) *MockStore_GetRepoLatestPipelines_Call { + _c.Call.Return(run) + return _c +} + +// GetRepoName provides a mock function for the type MockStore +func (_mock *MockStore) GetRepoName(s string) (*model.Repo, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for GetRepoName") + } + + var r0 *model.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*model.Repo, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *model.Repo); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetRepoName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepoName' +type MockStore_GetRepoName_Call struct { + *mock.Call +} + +// GetRepoName is a helper method to define mock.On call +// - s string +func (_e *MockStore_Expecter) GetRepoName(s interface{}) *MockStore_GetRepoName_Call { + return &MockStore_GetRepoName_Call{Call: _e.mock.On("GetRepoName", s)} +} + +func (_c *MockStore_GetRepoName_Call) Run(run func(s string)) *MockStore_GetRepoName_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GetRepoName_Call) Return(repo *model.Repo, err error) *MockStore_GetRepoName_Call { + _c.Call.Return(repo, err) + return _c +} + +func (_c *MockStore_GetRepoName_Call) RunAndReturn(run func(s string) (*model.Repo, error)) *MockStore_GetRepoName_Call { + _c.Call.Return(run) + return _c +} + +// GetRepoNameFallback provides a mock function for the type MockStore +func (_mock *MockStore) GetRepoNameFallback(remoteID model.ForgeRemoteID, fullName string) (*model.Repo, error) { + ret := _mock.Called(remoteID, fullName) + + if len(ret) == 0 { + panic("no return value specified for GetRepoNameFallback") + } + + var r0 *model.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(model.ForgeRemoteID, string) (*model.Repo, error)); ok { + return returnFunc(remoteID, fullName) + } + if returnFunc, ok := ret.Get(0).(func(model.ForgeRemoteID, string) *model.Repo); ok { + r0 = returnFunc(remoteID, fullName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(model.ForgeRemoteID, string) error); ok { + r1 = returnFunc(remoteID, fullName) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetRepoNameFallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepoNameFallback' +type MockStore_GetRepoNameFallback_Call struct { + *mock.Call +} + +// GetRepoNameFallback is a helper method to define mock.On call +// - remoteID model.ForgeRemoteID +// - fullName string +func (_e *MockStore_Expecter) GetRepoNameFallback(remoteID interface{}, fullName interface{}) *MockStore_GetRepoNameFallback_Call { + return &MockStore_GetRepoNameFallback_Call{Call: _e.mock.On("GetRepoNameFallback", remoteID, fullName)} +} + +func (_c *MockStore_GetRepoNameFallback_Call) Run(run func(remoteID model.ForgeRemoteID, fullName string)) *MockStore_GetRepoNameFallback_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 model.ForgeRemoteID + if args[0] != nil { + arg0 = args[0].(model.ForgeRemoteID) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_GetRepoNameFallback_Call) Return(repo *model.Repo, err error) *MockStore_GetRepoNameFallback_Call { + _c.Call.Return(repo, err) + return _c +} + +func (_c *MockStore_GetRepoNameFallback_Call) RunAndReturn(run func(remoteID model.ForgeRemoteID, fullName string) (*model.Repo, error)) *MockStore_GetRepoNameFallback_Call { + _c.Call.Return(run) + return _c +} + +// GetUser provides a mock function for the type MockStore +func (_mock *MockStore) GetUser(n int64) (*model.User, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for GetUser") + } + + var r0 *model.User + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*model.User, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) *model.User); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.User) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUser' +type MockStore_GetUser_Call struct { + *mock.Call +} + +// GetUser is a helper method to define mock.On call +// - n int64 +func (_e *MockStore_Expecter) GetUser(n interface{}) *MockStore_GetUser_Call { + return &MockStore_GetUser_Call{Call: _e.mock.On("GetUser", n)} +} + +func (_c *MockStore_GetUser_Call) Run(run func(n int64)) *MockStore_GetUser_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GetUser_Call) Return(user *model.User, err error) *MockStore_GetUser_Call { + _c.Call.Return(user, err) + return _c +} + +func (_c *MockStore_GetUser_Call) RunAndReturn(run func(n int64) (*model.User, error)) *MockStore_GetUser_Call { + _c.Call.Return(run) + return _c +} + +// GetUserCount provides a mock function for the type MockStore +func (_mock *MockStore) GetUserCount() (int64, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUserCount") + } + + var r0 int64 + var r1 error + if returnFunc, ok := ret.Get(0).(func() (int64, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() + } else { + r0 = ret.Get(0).(int64) + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetUserCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserCount' +type MockStore_GetUserCount_Call struct { + *mock.Call +} + +// GetUserCount is a helper method to define mock.On call +func (_e *MockStore_Expecter) GetUserCount() *MockStore_GetUserCount_Call { + return &MockStore_GetUserCount_Call{Call: _e.mock.On("GetUserCount")} +} + +func (_c *MockStore_GetUserCount_Call) Run(run func()) *MockStore_GetUserCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStore_GetUserCount_Call) Return(n int64, err error) *MockStore_GetUserCount_Call { + _c.Call.Return(n, err) + return _c +} + +func (_c *MockStore_GetUserCount_Call) RunAndReturn(run func() (int64, error)) *MockStore_GetUserCount_Call { + _c.Call.Return(run) + return _c +} + +// GetUserList provides a mock function for the type MockStore +func (_mock *MockStore) GetUserList(p *model.ListOptions) ([]*model.User, error) { + ret := _mock.Called(p) + + if len(ret) == 0 { + panic("no return value specified for GetUserList") + } + + var r0 []*model.User + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.User, error)); ok { + return returnFunc(p) + } + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) []*model.User); ok { + r0 = returnFunc(p) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.User) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.ListOptions) error); ok { + r1 = returnFunc(p) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetUserList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserList' +type MockStore_GetUserList_Call struct { + *mock.Call +} + +// GetUserList is a helper method to define mock.On call +// - p *model.ListOptions +func (_e *MockStore_Expecter) GetUserList(p interface{}) *MockStore_GetUserList_Call { + return &MockStore_GetUserList_Call{Call: _e.mock.On("GetUserList", p)} +} + +func (_c *MockStore_GetUserList_Call) Run(run func(p *model.ListOptions)) *MockStore_GetUserList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.ListOptions + if args[0] != nil { + arg0 = args[0].(*model.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GetUserList_Call) Return(users []*model.User, err error) *MockStore_GetUserList_Call { + _c.Call.Return(users, err) + return _c +} + +func (_c *MockStore_GetUserList_Call) RunAndReturn(run func(p *model.ListOptions) ([]*model.User, error)) *MockStore_GetUserList_Call { + _c.Call.Return(run) + return _c +} + +// GetUserLogin provides a mock function for the type MockStore +func (_mock *MockStore) GetUserLogin(s string) (*model.User, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for GetUserLogin") + } + + var r0 *model.User + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*model.User, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *model.User); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.User) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetUserLogin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserLogin' +type MockStore_GetUserLogin_Call struct { + *mock.Call +} + +// GetUserLogin is a helper method to define mock.On call +// - s string +func (_e *MockStore_Expecter) GetUserLogin(s interface{}) *MockStore_GetUserLogin_Call { + return &MockStore_GetUserLogin_Call{Call: _e.mock.On("GetUserLogin", s)} +} + +func (_c *MockStore_GetUserLogin_Call) Run(run func(s string)) *MockStore_GetUserLogin_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GetUserLogin_Call) Return(user *model.User, err error) *MockStore_GetUserLogin_Call { + _c.Call.Return(user, err) + return _c +} + +func (_c *MockStore_GetUserLogin_Call) RunAndReturn(run func(s string) (*model.User, error)) *MockStore_GetUserLogin_Call { + _c.Call.Return(run) + return _c +} + +// GetUserRemoteID provides a mock function for the type MockStore +func (_mock *MockStore) GetUserRemoteID(forgeRemoteID model.ForgeRemoteID, s string) (*model.User, error) { + ret := _mock.Called(forgeRemoteID, s) + + if len(ret) == 0 { + panic("no return value specified for GetUserRemoteID") + } + + var r0 *model.User + var r1 error + if returnFunc, ok := ret.Get(0).(func(model.ForgeRemoteID, string) (*model.User, error)); ok { + return returnFunc(forgeRemoteID, s) + } + if returnFunc, ok := ret.Get(0).(func(model.ForgeRemoteID, string) *model.User); ok { + r0 = returnFunc(forgeRemoteID, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.User) + } + } + if returnFunc, ok := ret.Get(1).(func(model.ForgeRemoteID, string) error); ok { + r1 = returnFunc(forgeRemoteID, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GetUserRemoteID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserRemoteID' +type MockStore_GetUserRemoteID_Call struct { + *mock.Call +} + +// GetUserRemoteID is a helper method to define mock.On call +// - forgeRemoteID model.ForgeRemoteID +// - s string +func (_e *MockStore_Expecter) GetUserRemoteID(forgeRemoteID interface{}, s interface{}) *MockStore_GetUserRemoteID_Call { + return &MockStore_GetUserRemoteID_Call{Call: _e.mock.On("GetUserRemoteID", forgeRemoteID, s)} +} + +func (_c *MockStore_GetUserRemoteID_Call) Run(run func(forgeRemoteID model.ForgeRemoteID, s string)) *MockStore_GetUserRemoteID_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 model.ForgeRemoteID + if args[0] != nil { + arg0 = args[0].(model.ForgeRemoteID) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_GetUserRemoteID_Call) Return(user *model.User, err error) *MockStore_GetUserRemoteID_Call { + _c.Call.Return(user, err) + return _c +} + +func (_c *MockStore_GetUserRemoteID_Call) RunAndReturn(run func(forgeRemoteID model.ForgeRemoteID, s string) (*model.User, error)) *MockStore_GetUserRemoteID_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryFind provides a mock function for the type MockStore +func (_mock *MockStore) GlobalRegistryFind(s string) (*model.Registry, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryFind") + } + + var r0 *model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*model.Registry, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *model.Registry); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GlobalRegistryFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryFind' +type MockStore_GlobalRegistryFind_Call struct { + *mock.Call +} + +// GlobalRegistryFind is a helper method to define mock.On call +// - s string +func (_e *MockStore_Expecter) GlobalRegistryFind(s interface{}) *MockStore_GlobalRegistryFind_Call { + return &MockStore_GlobalRegistryFind_Call{Call: _e.mock.On("GlobalRegistryFind", s)} +} + +func (_c *MockStore_GlobalRegistryFind_Call) Run(run func(s string)) *MockStore_GlobalRegistryFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GlobalRegistryFind_Call) Return(registry *model.Registry, err error) *MockStore_GlobalRegistryFind_Call { + _c.Call.Return(registry, err) + return _c +} + +func (_c *MockStore_GlobalRegistryFind_Call) RunAndReturn(run func(s string) (*model.Registry, error)) *MockStore_GlobalRegistryFind_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryList provides a mock function for the type MockStore +func (_mock *MockStore) GlobalRegistryList(listOptions *model.ListOptions) ([]*model.Registry, error) { + ret := _mock.Called(listOptions) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryList") + } + + var r0 []*model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Registry, error)); ok { + return returnFunc(listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) []*model.Registry); ok { + r0 = returnFunc(listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.ListOptions) error); ok { + r1 = returnFunc(listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GlobalRegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryList' +type MockStore_GlobalRegistryList_Call struct { + *mock.Call +} + +// GlobalRegistryList is a helper method to define mock.On call +// - listOptions *model.ListOptions +func (_e *MockStore_Expecter) GlobalRegistryList(listOptions interface{}) *MockStore_GlobalRegistryList_Call { + return &MockStore_GlobalRegistryList_Call{Call: _e.mock.On("GlobalRegistryList", listOptions)} +} + +func (_c *MockStore_GlobalRegistryList_Call) Run(run func(listOptions *model.ListOptions)) *MockStore_GlobalRegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.ListOptions + if args[0] != nil { + arg0 = args[0].(*model.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GlobalRegistryList_Call) Return(registrys []*model.Registry, err error) *MockStore_GlobalRegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockStore_GlobalRegistryList_Call) RunAndReturn(run func(listOptions *model.ListOptions) ([]*model.Registry, error)) *MockStore_GlobalRegistryList_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretFind provides a mock function for the type MockStore +func (_mock *MockStore) GlobalSecretFind(s string) (*model.Secret, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretFind") + } + + var r0 *model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*model.Secret, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *model.Secret); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GlobalSecretFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretFind' +type MockStore_GlobalSecretFind_Call struct { + *mock.Call +} + +// GlobalSecretFind is a helper method to define mock.On call +// - s string +func (_e *MockStore_Expecter) GlobalSecretFind(s interface{}) *MockStore_GlobalSecretFind_Call { + return &MockStore_GlobalSecretFind_Call{Call: _e.mock.On("GlobalSecretFind", s)} +} + +func (_c *MockStore_GlobalSecretFind_Call) Run(run func(s string)) *MockStore_GlobalSecretFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GlobalSecretFind_Call) Return(secret *model.Secret, err error) *MockStore_GlobalSecretFind_Call { + _c.Call.Return(secret, err) + return _c +} + +func (_c *MockStore_GlobalSecretFind_Call) RunAndReturn(run func(s string) (*model.Secret, error)) *MockStore_GlobalSecretFind_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretList provides a mock function for the type MockStore +func (_mock *MockStore) GlobalSecretList(listOptions *model.ListOptions) ([]*model.Secret, error) { + ret := _mock.Called(listOptions) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretList") + } + + var r0 []*model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Secret, error)); ok { + return returnFunc(listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) []*model.Secret); ok { + r0 = returnFunc(listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.ListOptions) error); ok { + r1 = returnFunc(listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_GlobalSecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretList' +type MockStore_GlobalSecretList_Call struct { + *mock.Call +} + +// GlobalSecretList is a helper method to define mock.On call +// - listOptions *model.ListOptions +func (_e *MockStore_Expecter) GlobalSecretList(listOptions interface{}) *MockStore_GlobalSecretList_Call { + return &MockStore_GlobalSecretList_Call{Call: _e.mock.On("GlobalSecretList", listOptions)} +} + +func (_c *MockStore_GlobalSecretList_Call) Run(run func(listOptions *model.ListOptions)) *MockStore_GlobalSecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.ListOptions + if args[0] != nil { + arg0 = args[0].(*model.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_GlobalSecretList_Call) Return(secrets []*model.Secret, err error) *MockStore_GlobalSecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockStore_GlobalSecretList_Call) RunAndReturn(run func(listOptions *model.ListOptions) ([]*model.Secret, error)) *MockStore_GlobalSecretList_Call { + _c.Call.Return(run) + return _c +} + +// HasRedirectionForRepo provides a mock function for the type MockStore +func (_mock *MockStore) HasRedirectionForRepo(n int64, s string) (bool, error) { + ret := _mock.Called(n, s) + + if len(ret) == 0 { + panic("no return value specified for HasRedirectionForRepo") + } + + var r0 bool + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, string) (bool, error)); ok { + return returnFunc(n, s) + } + if returnFunc, ok := ret.Get(0).(func(int64, string) bool); ok { + r0 = returnFunc(n, s) + } else { + r0 = ret.Get(0).(bool) + } + if returnFunc, ok := ret.Get(1).(func(int64, string) error); ok { + r1 = returnFunc(n, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_HasRedirectionForRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasRedirectionForRepo' +type MockStore_HasRedirectionForRepo_Call struct { + *mock.Call +} + +// HasRedirectionForRepo is a helper method to define mock.On call +// - n int64 +// - s string +func (_e *MockStore_Expecter) HasRedirectionForRepo(n interface{}, s interface{}) *MockStore_HasRedirectionForRepo_Call { + return &MockStore_HasRedirectionForRepo_Call{Call: _e.mock.On("HasRedirectionForRepo", n, s)} +} + +func (_c *MockStore_HasRedirectionForRepo_Call) Run(run func(n int64, s string)) *MockStore_HasRedirectionForRepo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_HasRedirectionForRepo_Call) Return(b bool, err error) *MockStore_HasRedirectionForRepo_Call { + _c.Call.Return(b, err) + return _c +} + +func (_c *MockStore_HasRedirectionForRepo_Call) RunAndReturn(run func(n int64, s string) (bool, error)) *MockStore_HasRedirectionForRepo_Call { + _c.Call.Return(run) + return _c +} + +// LogAppend provides a mock function for the type MockStore +func (_mock *MockStore) LogAppend(step *model.Step, logEntrys []*model.LogEntry) error { + ret := _mock.Called(step, logEntrys) + + if len(ret) == 0 { + panic("no return value specified for LogAppend") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Step, []*model.LogEntry) error); ok { + r0 = returnFunc(step, logEntrys) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_LogAppend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogAppend' +type MockStore_LogAppend_Call struct { + *mock.Call +} + +// LogAppend is a helper method to define mock.On call +// - step *model.Step +// - logEntrys []*model.LogEntry +func (_e *MockStore_Expecter) LogAppend(step interface{}, logEntrys interface{}) *MockStore_LogAppend_Call { + return &MockStore_LogAppend_Call{Call: _e.mock.On("LogAppend", step, logEntrys)} +} + +func (_c *MockStore_LogAppend_Call) Run(run func(step *model.Step, logEntrys []*model.LogEntry)) *MockStore_LogAppend_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Step + if args[0] != nil { + arg0 = args[0].(*model.Step) + } + var arg1 []*model.LogEntry + if args[1] != nil { + arg1 = args[1].([]*model.LogEntry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_LogAppend_Call) Return(err error) *MockStore_LogAppend_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_LogAppend_Call) RunAndReturn(run func(step *model.Step, logEntrys []*model.LogEntry) error) *MockStore_LogAppend_Call { + _c.Call.Return(run) + return _c +} + +// LogDelete provides a mock function for the type MockStore +func (_mock *MockStore) LogDelete(step *model.Step) error { + ret := _mock.Called(step) + + if len(ret) == 0 { + panic("no return value specified for LogDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Step) error); ok { + r0 = returnFunc(step) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_LogDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogDelete' +type MockStore_LogDelete_Call struct { + *mock.Call +} + +// LogDelete is a helper method to define mock.On call +// - step *model.Step +func (_e *MockStore_Expecter) LogDelete(step interface{}) *MockStore_LogDelete_Call { + return &MockStore_LogDelete_Call{Call: _e.mock.On("LogDelete", step)} +} + +func (_c *MockStore_LogDelete_Call) Run(run func(step *model.Step)) *MockStore_LogDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Step + if args[0] != nil { + arg0 = args[0].(*model.Step) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_LogDelete_Call) Return(err error) *MockStore_LogDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_LogDelete_Call) RunAndReturn(run func(step *model.Step) error) *MockStore_LogDelete_Call { + _c.Call.Return(run) + return _c +} + +// LogFind provides a mock function for the type MockStore +func (_mock *MockStore) LogFind(step *model.Step) ([]*model.LogEntry, error) { + ret := _mock.Called(step) + + if len(ret) == 0 { + panic("no return value specified for LogFind") + } + + var r0 []*model.LogEntry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Step) ([]*model.LogEntry, error)); ok { + return returnFunc(step) + } + if returnFunc, ok := ret.Get(0).(func(*model.Step) []*model.LogEntry); ok { + r0 = returnFunc(step) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.LogEntry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Step) error); ok { + r1 = returnFunc(step) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_LogFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogFind' +type MockStore_LogFind_Call struct { + *mock.Call +} + +// LogFind is a helper method to define mock.On call +// - step *model.Step +func (_e *MockStore_Expecter) LogFind(step interface{}) *MockStore_LogFind_Call { + return &MockStore_LogFind_Call{Call: _e.mock.On("LogFind", step)} +} + +func (_c *MockStore_LogFind_Call) Run(run func(step *model.Step)) *MockStore_LogFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Step + if args[0] != nil { + arg0 = args[0].(*model.Step) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_LogFind_Call) Return(logEntrys []*model.LogEntry, err error) *MockStore_LogFind_Call { + _c.Call.Return(logEntrys, err) + return _c +} + +func (_c *MockStore_LogFind_Call) RunAndReturn(run func(step *model.Step) ([]*model.LogEntry, error)) *MockStore_LogFind_Call { + _c.Call.Return(run) + return _c +} + +// Migrate provides a mock function for the type MockStore +func (_mock *MockStore) Migrate(context1 context.Context, b bool) error { + ret := _mock.Called(context1, b) + + if len(ret) == 0 { + panic("no return value specified for Migrate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(context.Context, bool) error); ok { + r0 = returnFunc(context1, b) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_Migrate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Migrate' +type MockStore_Migrate_Call struct { + *mock.Call +} + +// Migrate is a helper method to define mock.On call +// - context1 context.Context +// - b bool +func (_e *MockStore_Expecter) Migrate(context1 interface{}, b interface{}) *MockStore_Migrate_Call { + return &MockStore_Migrate_Call{Call: _e.mock.On("Migrate", context1, b)} +} + +func (_c *MockStore_Migrate_Call) Run(run func(context1 context.Context, b bool)) *MockStore_Migrate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 bool + if args[1] != nil { + arg1 = args[1].(bool) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_Migrate_Call) Return(err error) *MockStore_Migrate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_Migrate_Call) RunAndReturn(run func(context1 context.Context, b bool) error) *MockStore_Migrate_Call { + _c.Call.Return(run) + return _c +} + +// OrgCreate provides a mock function for the type MockStore +func (_mock *MockStore) OrgCreate(org *model.Org) error { + ret := _mock.Called(org) + + if len(ret) == 0 { + panic("no return value specified for OrgCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Org) error); ok { + r0 = returnFunc(org) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_OrgCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgCreate' +type MockStore_OrgCreate_Call struct { + *mock.Call +} + +// OrgCreate is a helper method to define mock.On call +// - org *model.Org +func (_e *MockStore_Expecter) OrgCreate(org interface{}) *MockStore_OrgCreate_Call { + return &MockStore_OrgCreate_Call{Call: _e.mock.On("OrgCreate", org)} +} + +func (_c *MockStore_OrgCreate_Call) Run(run func(org *model.Org)) *MockStore_OrgCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Org + if args[0] != nil { + arg0 = args[0].(*model.Org) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_OrgCreate_Call) Return(err error) *MockStore_OrgCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_OrgCreate_Call) RunAndReturn(run func(org *model.Org) error) *MockStore_OrgCreate_Call { + _c.Call.Return(run) + return _c +} + +// OrgDelete provides a mock function for the type MockStore +func (_mock *MockStore) OrgDelete(n int64) error { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for OrgDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64) error); ok { + r0 = returnFunc(n) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_OrgDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgDelete' +type MockStore_OrgDelete_Call struct { + *mock.Call +} + +// OrgDelete is a helper method to define mock.On call +// - n int64 +func (_e *MockStore_Expecter) OrgDelete(n interface{}) *MockStore_OrgDelete_Call { + return &MockStore_OrgDelete_Call{Call: _e.mock.On("OrgDelete", n)} +} + +func (_c *MockStore_OrgDelete_Call) Run(run func(n int64)) *MockStore_OrgDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_OrgDelete_Call) Return(err error) *MockStore_OrgDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_OrgDelete_Call) RunAndReturn(run func(n int64) error) *MockStore_OrgDelete_Call { + _c.Call.Return(run) + return _c +} + +// OrgFindByName provides a mock function for the type MockStore +func (_mock *MockStore) OrgFindByName(s string, n int64) (*model.Org, error) { + ret := _mock.Called(s, n) + + if len(ret) == 0 { + panic("no return value specified for OrgFindByName") + } + + var r0 *model.Org + var r1 error + if returnFunc, ok := ret.Get(0).(func(string, int64) (*model.Org, error)); ok { + return returnFunc(s, n) + } + if returnFunc, ok := ret.Get(0).(func(string, int64) *model.Org); ok { + r0 = returnFunc(s, n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Org) + } + } + if returnFunc, ok := ret.Get(1).(func(string, int64) error); ok { + r1 = returnFunc(s, n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_OrgFindByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgFindByName' +type MockStore_OrgFindByName_Call struct { + *mock.Call +} + +// OrgFindByName is a helper method to define mock.On call +// - s string +// - n int64 +func (_e *MockStore_Expecter) OrgFindByName(s interface{}, n interface{}) *MockStore_OrgFindByName_Call { + return &MockStore_OrgFindByName_Call{Call: _e.mock.On("OrgFindByName", s, n)} +} + +func (_c *MockStore_OrgFindByName_Call) Run(run func(s string, n int64)) *MockStore_OrgFindByName_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_OrgFindByName_Call) Return(org *model.Org, err error) *MockStore_OrgFindByName_Call { + _c.Call.Return(org, err) + return _c +} + +func (_c *MockStore_OrgFindByName_Call) RunAndReturn(run func(s string, n int64) (*model.Org, error)) *MockStore_OrgFindByName_Call { + _c.Call.Return(run) + return _c +} + +// OrgGet provides a mock function for the type MockStore +func (_mock *MockStore) OrgGet(n int64) (*model.Org, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for OrgGet") + } + + var r0 *model.Org + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*model.Org, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) *model.Org); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Org) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_OrgGet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgGet' +type MockStore_OrgGet_Call struct { + *mock.Call +} + +// OrgGet is a helper method to define mock.On call +// - n int64 +func (_e *MockStore_Expecter) OrgGet(n interface{}) *MockStore_OrgGet_Call { + return &MockStore_OrgGet_Call{Call: _e.mock.On("OrgGet", n)} +} + +func (_c *MockStore_OrgGet_Call) Run(run func(n int64)) *MockStore_OrgGet_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_OrgGet_Call) Return(org *model.Org, err error) *MockStore_OrgGet_Call { + _c.Call.Return(org, err) + return _c +} + +func (_c *MockStore_OrgGet_Call) RunAndReturn(run func(n int64) (*model.Org, error)) *MockStore_OrgGet_Call { + _c.Call.Return(run) + return _c +} + +// OrgList provides a mock function for the type MockStore +func (_mock *MockStore) OrgList(listOptions *model.ListOptions) ([]*model.Org, error) { + ret := _mock.Called(listOptions) + + if len(ret) == 0 { + panic("no return value specified for OrgList") + } + + var r0 []*model.Org + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Org, error)); ok { + return returnFunc(listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.ListOptions) []*model.Org); ok { + r0 = returnFunc(listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Org) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.ListOptions) error); ok { + r1 = returnFunc(listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_OrgList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgList' +type MockStore_OrgList_Call struct { + *mock.Call +} + +// OrgList is a helper method to define mock.On call +// - listOptions *model.ListOptions +func (_e *MockStore_Expecter) OrgList(listOptions interface{}) *MockStore_OrgList_Call { + return &MockStore_OrgList_Call{Call: _e.mock.On("OrgList", listOptions)} +} + +func (_c *MockStore_OrgList_Call) Run(run func(listOptions *model.ListOptions)) *MockStore_OrgList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.ListOptions + if args[0] != nil { + arg0 = args[0].(*model.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_OrgList_Call) Return(orgs []*model.Org, err error) *MockStore_OrgList_Call { + _c.Call.Return(orgs, err) + return _c +} + +func (_c *MockStore_OrgList_Call) RunAndReturn(run func(listOptions *model.ListOptions) ([]*model.Org, error)) *MockStore_OrgList_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryFind provides a mock function for the type MockStore +func (_mock *MockStore) OrgRegistryFind(n int64, s string) (*model.Registry, error) { + ret := _mock.Called(n, s) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryFind") + } + + var r0 *model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, string) (*model.Registry, error)); ok { + return returnFunc(n, s) + } + if returnFunc, ok := ret.Get(0).(func(int64, string) *model.Registry); ok { + r0 = returnFunc(n, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, string) error); ok { + r1 = returnFunc(n, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_OrgRegistryFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryFind' +type MockStore_OrgRegistryFind_Call struct { + *mock.Call +} + +// OrgRegistryFind is a helper method to define mock.On call +// - n int64 +// - s string +func (_e *MockStore_Expecter) OrgRegistryFind(n interface{}, s interface{}) *MockStore_OrgRegistryFind_Call { + return &MockStore_OrgRegistryFind_Call{Call: _e.mock.On("OrgRegistryFind", n, s)} +} + +func (_c *MockStore_OrgRegistryFind_Call) Run(run func(n int64, s string)) *MockStore_OrgRegistryFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_OrgRegistryFind_Call) Return(registry *model.Registry, err error) *MockStore_OrgRegistryFind_Call { + _c.Call.Return(registry, err) + return _c +} + +func (_c *MockStore_OrgRegistryFind_Call) RunAndReturn(run func(n int64, s string) (*model.Registry, error)) *MockStore_OrgRegistryFind_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryList provides a mock function for the type MockStore +func (_mock *MockStore) OrgRegistryList(n int64, listOptions *model.ListOptions) ([]*model.Registry, error) { + ret := _mock.Called(n, listOptions) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryList") + } + + var r0 []*model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Registry, error)); ok { + return returnFunc(n, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Registry); ok { + r0 = returnFunc(n, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { + r1 = returnFunc(n, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_OrgRegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryList' +type MockStore_OrgRegistryList_Call struct { + *mock.Call +} + +// OrgRegistryList is a helper method to define mock.On call +// - n int64 +// - listOptions *model.ListOptions +func (_e *MockStore_Expecter) OrgRegistryList(n interface{}, listOptions interface{}) *MockStore_OrgRegistryList_Call { + return &MockStore_OrgRegistryList_Call{Call: _e.mock.On("OrgRegistryList", n, listOptions)} +} + +func (_c *MockStore_OrgRegistryList_Call) Run(run func(n int64, listOptions *model.ListOptions)) *MockStore_OrgRegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_OrgRegistryList_Call) Return(registrys []*model.Registry, err error) *MockStore_OrgRegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockStore_OrgRegistryList_Call) RunAndReturn(run func(n int64, listOptions *model.ListOptions) ([]*model.Registry, error)) *MockStore_OrgRegistryList_Call { + _c.Call.Return(run) + return _c +} + +// OrgRepoList provides a mock function for the type MockStore +func (_mock *MockStore) OrgRepoList(org *model.Org, listOptions *model.ListOptions) ([]*model.Repo, error) { + ret := _mock.Called(org, listOptions) + + if len(ret) == 0 { + panic("no return value specified for OrgRepoList") + } + + var r0 []*model.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Org, *model.ListOptions) ([]*model.Repo, error)); ok { + return returnFunc(org, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.Org, *model.ListOptions) []*model.Repo); ok { + r0 = returnFunc(org, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Org, *model.ListOptions) error); ok { + r1 = returnFunc(org, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_OrgRepoList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRepoList' +type MockStore_OrgRepoList_Call struct { + *mock.Call +} + +// OrgRepoList is a helper method to define mock.On call +// - org *model.Org +// - listOptions *model.ListOptions +func (_e *MockStore_Expecter) OrgRepoList(org interface{}, listOptions interface{}) *MockStore_OrgRepoList_Call { + return &MockStore_OrgRepoList_Call{Call: _e.mock.On("OrgRepoList", org, listOptions)} +} + +func (_c *MockStore_OrgRepoList_Call) Run(run func(org *model.Org, listOptions *model.ListOptions)) *MockStore_OrgRepoList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Org + if args[0] != nil { + arg0 = args[0].(*model.Org) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_OrgRepoList_Call) Return(repos []*model.Repo, err error) *MockStore_OrgRepoList_Call { + _c.Call.Return(repos, err) + return _c +} + +func (_c *MockStore_OrgRepoList_Call) RunAndReturn(run func(org *model.Org, listOptions *model.ListOptions) ([]*model.Repo, error)) *MockStore_OrgRepoList_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretFind provides a mock function for the type MockStore +func (_mock *MockStore) OrgSecretFind(n int64, s string) (*model.Secret, error) { + ret := _mock.Called(n, s) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretFind") + } + + var r0 *model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, string) (*model.Secret, error)); ok { + return returnFunc(n, s) + } + if returnFunc, ok := ret.Get(0).(func(int64, string) *model.Secret); ok { + r0 = returnFunc(n, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, string) error); ok { + r1 = returnFunc(n, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_OrgSecretFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretFind' +type MockStore_OrgSecretFind_Call struct { + *mock.Call +} + +// OrgSecretFind is a helper method to define mock.On call +// - n int64 +// - s string +func (_e *MockStore_Expecter) OrgSecretFind(n interface{}, s interface{}) *MockStore_OrgSecretFind_Call { + return &MockStore_OrgSecretFind_Call{Call: _e.mock.On("OrgSecretFind", n, s)} +} + +func (_c *MockStore_OrgSecretFind_Call) Run(run func(n int64, s string)) *MockStore_OrgSecretFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_OrgSecretFind_Call) Return(secret *model.Secret, err error) *MockStore_OrgSecretFind_Call { + _c.Call.Return(secret, err) + return _c +} + +func (_c *MockStore_OrgSecretFind_Call) RunAndReturn(run func(n int64, s string) (*model.Secret, error)) *MockStore_OrgSecretFind_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretList provides a mock function for the type MockStore +func (_mock *MockStore) OrgSecretList(n int64, listOptions *model.ListOptions) ([]*model.Secret, error) { + ret := _mock.Called(n, listOptions) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretList") + } + + var r0 []*model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Secret, error)); ok { + return returnFunc(n, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Secret); ok { + r0 = returnFunc(n, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { + r1 = returnFunc(n, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_OrgSecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretList' +type MockStore_OrgSecretList_Call struct { + *mock.Call +} + +// OrgSecretList is a helper method to define mock.On call +// - n int64 +// - listOptions *model.ListOptions +func (_e *MockStore_Expecter) OrgSecretList(n interface{}, listOptions interface{}) *MockStore_OrgSecretList_Call { + return &MockStore_OrgSecretList_Call{Call: _e.mock.On("OrgSecretList", n, listOptions)} +} + +func (_c *MockStore_OrgSecretList_Call) Run(run func(n int64, listOptions *model.ListOptions)) *MockStore_OrgSecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_OrgSecretList_Call) Return(secrets []*model.Secret, err error) *MockStore_OrgSecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockStore_OrgSecretList_Call) RunAndReturn(run func(n int64, listOptions *model.ListOptions) ([]*model.Secret, error)) *MockStore_OrgSecretList_Call { + _c.Call.Return(run) + return _c +} + +// OrgUpdate provides a mock function for the type MockStore +func (_mock *MockStore) OrgUpdate(org *model.Org) error { + ret := _mock.Called(org) + + if len(ret) == 0 { + panic("no return value specified for OrgUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Org) error); ok { + r0 = returnFunc(org) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_OrgUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgUpdate' +type MockStore_OrgUpdate_Call struct { + *mock.Call +} + +// OrgUpdate is a helper method to define mock.On call +// - org *model.Org +func (_e *MockStore_Expecter) OrgUpdate(org interface{}) *MockStore_OrgUpdate_Call { + return &MockStore_OrgUpdate_Call{Call: _e.mock.On("OrgUpdate", org)} +} + +func (_c *MockStore_OrgUpdate_Call) Run(run func(org *model.Org)) *MockStore_OrgUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Org + if args[0] != nil { + arg0 = args[0].(*model.Org) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_OrgUpdate_Call) Return(err error) *MockStore_OrgUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_OrgUpdate_Call) RunAndReturn(run func(org *model.Org) error) *MockStore_OrgUpdate_Call { + _c.Call.Return(run) + return _c +} + +// PermFind provides a mock function for the type MockStore +func (_mock *MockStore) PermFind(user *model.User, repo *model.Repo) (*model.Perm, error) { + ret := _mock.Called(user, repo) + + if len(ret) == 0 { + panic("no return value specified for PermFind") + } + + var r0 *model.Perm + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.User, *model.Repo) (*model.Perm, error)); ok { + return returnFunc(user, repo) + } + if returnFunc, ok := ret.Get(0).(func(*model.User, *model.Repo) *model.Perm); ok { + r0 = returnFunc(user, repo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Perm) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.User, *model.Repo) error); ok { + r1 = returnFunc(user, repo) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_PermFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PermFind' +type MockStore_PermFind_Call struct { + *mock.Call +} + +// PermFind is a helper method to define mock.On call +// - user *model.User +// - repo *model.Repo +func (_e *MockStore_Expecter) PermFind(user interface{}, repo interface{}) *MockStore_PermFind_Call { + return &MockStore_PermFind_Call{Call: _e.mock.On("PermFind", user, repo)} +} + +func (_c *MockStore_PermFind_Call) Run(run func(user *model.User, repo *model.Repo)) *MockStore_PermFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.User + if args[0] != nil { + arg0 = args[0].(*model.User) + } + var arg1 *model.Repo + if args[1] != nil { + arg1 = args[1].(*model.Repo) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_PermFind_Call) Return(perm *model.Perm, err error) *MockStore_PermFind_Call { + _c.Call.Return(perm, err) + return _c +} + +func (_c *MockStore_PermFind_Call) RunAndReturn(run func(user *model.User, repo *model.Repo) (*model.Perm, error)) *MockStore_PermFind_Call { + _c.Call.Return(run) + return _c +} + +// PermUpsert provides a mock function for the type MockStore +func (_mock *MockStore) PermUpsert(perm *model.Perm) error { + ret := _mock.Called(perm) + + if len(ret) == 0 { + panic("no return value specified for PermUpsert") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Perm) error); ok { + r0 = returnFunc(perm) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_PermUpsert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PermUpsert' +type MockStore_PermUpsert_Call struct { + *mock.Call +} + +// PermUpsert is a helper method to define mock.On call +// - perm *model.Perm +func (_e *MockStore_Expecter) PermUpsert(perm interface{}) *MockStore_PermUpsert_Call { + return &MockStore_PermUpsert_Call{Call: _e.mock.On("PermUpsert", perm)} +} + +func (_c *MockStore_PermUpsert_Call) Run(run func(perm *model.Perm)) *MockStore_PermUpsert_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Perm + if args[0] != nil { + arg0 = args[0].(*model.Perm) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_PermUpsert_Call) Return(err error) *MockStore_PermUpsert_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_PermUpsert_Call) RunAndReturn(run func(perm *model.Perm) error) *MockStore_PermUpsert_Call { + _c.Call.Return(run) + return _c +} + +// Ping provides a mock function for the type MockStore +func (_mock *MockStore) Ping() error { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Ping") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_Ping_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ping' +type MockStore_Ping_Call struct { + *mock.Call +} + +// Ping is a helper method to define mock.On call +func (_e *MockStore_Expecter) Ping() *MockStore_Ping_Call { + return &MockStore_Ping_Call{Call: _e.mock.On("Ping")} +} + +func (_c *MockStore_Ping_Call) Run(run func()) *MockStore_Ping_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStore_Ping_Call) Return(err error) *MockStore_Ping_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_Ping_Call) RunAndReturn(run func() error) *MockStore_Ping_Call { + _c.Call.Return(run) + return _c +} + +// PipelineConfigCreate provides a mock function for the type MockStore +func (_mock *MockStore) PipelineConfigCreate(pipelineConfig *model.PipelineConfig) error { + ret := _mock.Called(pipelineConfig) + + if len(ret) == 0 { + panic("no return value specified for PipelineConfigCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.PipelineConfig) error); ok { + r0 = returnFunc(pipelineConfig) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_PipelineConfigCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineConfigCreate' +type MockStore_PipelineConfigCreate_Call struct { + *mock.Call +} + +// PipelineConfigCreate is a helper method to define mock.On call +// - pipelineConfig *model.PipelineConfig +func (_e *MockStore_Expecter) PipelineConfigCreate(pipelineConfig interface{}) *MockStore_PipelineConfigCreate_Call { + return &MockStore_PipelineConfigCreate_Call{Call: _e.mock.On("PipelineConfigCreate", pipelineConfig)} +} + +func (_c *MockStore_PipelineConfigCreate_Call) Run(run func(pipelineConfig *model.PipelineConfig)) *MockStore_PipelineConfigCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.PipelineConfig + if args[0] != nil { + arg0 = args[0].(*model.PipelineConfig) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_PipelineConfigCreate_Call) Return(err error) *MockStore_PipelineConfigCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_PipelineConfigCreate_Call) RunAndReturn(run func(pipelineConfig *model.PipelineConfig) error) *MockStore_PipelineConfigCreate_Call { + _c.Call.Return(run) + return _c +} + +// RegistryCreate provides a mock function for the type MockStore +func (_mock *MockStore) RegistryCreate(registry *model.Registry) error { + ret := _mock.Called(registry) + + if len(ret) == 0 { + panic("no return value specified for RegistryCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Registry) error); ok { + r0 = returnFunc(registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_RegistryCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryCreate' +type MockStore_RegistryCreate_Call struct { + *mock.Call +} + +// RegistryCreate is a helper method to define mock.On call +// - registry *model.Registry +func (_e *MockStore_Expecter) RegistryCreate(registry interface{}) *MockStore_RegistryCreate_Call { + return &MockStore_RegistryCreate_Call{Call: _e.mock.On("RegistryCreate", registry)} +} + +func (_c *MockStore_RegistryCreate_Call) Run(run func(registry *model.Registry)) *MockStore_RegistryCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Registry + if args[0] != nil { + arg0 = args[0].(*model.Registry) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_RegistryCreate_Call) Return(err error) *MockStore_RegistryCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_RegistryCreate_Call) RunAndReturn(run func(registry *model.Registry) error) *MockStore_RegistryCreate_Call { + _c.Call.Return(run) + return _c +} + +// RegistryDelete provides a mock function for the type MockStore +func (_mock *MockStore) RegistryDelete(registry *model.Registry) error { + ret := _mock.Called(registry) + + if len(ret) == 0 { + panic("no return value specified for RegistryDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Registry) error); ok { + r0 = returnFunc(registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_RegistryDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryDelete' +type MockStore_RegistryDelete_Call struct { + *mock.Call +} + +// RegistryDelete is a helper method to define mock.On call +// - registry *model.Registry +func (_e *MockStore_Expecter) RegistryDelete(registry interface{}) *MockStore_RegistryDelete_Call { + return &MockStore_RegistryDelete_Call{Call: _e.mock.On("RegistryDelete", registry)} +} + +func (_c *MockStore_RegistryDelete_Call) Run(run func(registry *model.Registry)) *MockStore_RegistryDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Registry + if args[0] != nil { + arg0 = args[0].(*model.Registry) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_RegistryDelete_Call) Return(err error) *MockStore_RegistryDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_RegistryDelete_Call) RunAndReturn(run func(registry *model.Registry) error) *MockStore_RegistryDelete_Call { + _c.Call.Return(run) + return _c +} + +// RegistryFind provides a mock function for the type MockStore +func (_mock *MockStore) RegistryFind(repo *model.Repo, s string) (*model.Registry, error) { + ret := _mock.Called(repo, s) + + if len(ret) == 0 { + panic("no return value specified for RegistryFind") + } + + var r0 *model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) (*model.Registry, error)); ok { + return returnFunc(repo, s) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) *model.Registry); ok { + r0 = returnFunc(repo, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, string) error); ok { + r1 = returnFunc(repo, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_RegistryFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryFind' +type MockStore_RegistryFind_Call struct { + *mock.Call +} + +// RegistryFind is a helper method to define mock.On call +// - repo *model.Repo +// - s string +func (_e *MockStore_Expecter) RegistryFind(repo interface{}, s interface{}) *MockStore_RegistryFind_Call { + return &MockStore_RegistryFind_Call{Call: _e.mock.On("RegistryFind", repo, s)} +} + +func (_c *MockStore_RegistryFind_Call) Run(run func(repo *model.Repo, s string)) *MockStore_RegistryFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_RegistryFind_Call) Return(registry *model.Registry, err error) *MockStore_RegistryFind_Call { + _c.Call.Return(registry, err) + return _c +} + +func (_c *MockStore_RegistryFind_Call) RunAndReturn(run func(repo *model.Repo, s string) (*model.Registry, error)) *MockStore_RegistryFind_Call { + _c.Call.Return(run) + return _c +} + +// RegistryList provides a mock function for the type MockStore +func (_mock *MockStore) RegistryList(repo *model.Repo, b bool, listOptions *model.ListOptions) ([]*model.Registry, error) { + ret := _mock.Called(repo, b, listOptions) + + if len(ret) == 0 { + panic("no return value specified for RegistryList") + } + + var r0 []*model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, bool, *model.ListOptions) ([]*model.Registry, error)); ok { + return returnFunc(repo, b, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, bool, *model.ListOptions) []*model.Registry); ok { + r0 = returnFunc(repo, b, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, bool, *model.ListOptions) error); ok { + r1 = returnFunc(repo, b, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_RegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryList' +type MockStore_RegistryList_Call struct { + *mock.Call +} + +// RegistryList is a helper method to define mock.On call +// - repo *model.Repo +// - b bool +// - listOptions *model.ListOptions +func (_e *MockStore_Expecter) RegistryList(repo interface{}, b interface{}, listOptions interface{}) *MockStore_RegistryList_Call { + return &MockStore_RegistryList_Call{Call: _e.mock.On("RegistryList", repo, b, listOptions)} +} + +func (_c *MockStore_RegistryList_Call) Run(run func(repo *model.Repo, b bool, listOptions *model.ListOptions)) *MockStore_RegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 bool + if args[1] != nil { + arg1 = args[1].(bool) + } + var arg2 *model.ListOptions + if args[2] != nil { + arg2 = args[2].(*model.ListOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockStore_RegistryList_Call) Return(registrys []*model.Registry, err error) *MockStore_RegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockStore_RegistryList_Call) RunAndReturn(run func(repo *model.Repo, b bool, listOptions *model.ListOptions) ([]*model.Registry, error)) *MockStore_RegistryList_Call { + _c.Call.Return(run) + return _c +} + +// RegistryListAll provides a mock function for the type MockStore +func (_mock *MockStore) RegistryListAll() ([]*model.Registry, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for RegistryListAll") + } + + var r0 []*model.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func() ([]*model.Registry, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []*model.Registry); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_RegistryListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryListAll' +type MockStore_RegistryListAll_Call struct { + *mock.Call +} + +// RegistryListAll is a helper method to define mock.On call +func (_e *MockStore_Expecter) RegistryListAll() *MockStore_RegistryListAll_Call { + return &MockStore_RegistryListAll_Call{Call: _e.mock.On("RegistryListAll")} +} + +func (_c *MockStore_RegistryListAll_Call) Run(run func()) *MockStore_RegistryListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStore_RegistryListAll_Call) Return(registrys []*model.Registry, err error) *MockStore_RegistryListAll_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockStore_RegistryListAll_Call) RunAndReturn(run func() ([]*model.Registry, error)) *MockStore_RegistryListAll_Call { + _c.Call.Return(run) + return _c +} + +// RegistryUpdate provides a mock function for the type MockStore +func (_mock *MockStore) RegistryUpdate(registry *model.Registry) error { + ret := _mock.Called(registry) + + if len(ret) == 0 { + panic("no return value specified for RegistryUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Registry) error); ok { + r0 = returnFunc(registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_RegistryUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryUpdate' +type MockStore_RegistryUpdate_Call struct { + *mock.Call +} + +// RegistryUpdate is a helper method to define mock.On call +// - registry *model.Registry +func (_e *MockStore_Expecter) RegistryUpdate(registry interface{}) *MockStore_RegistryUpdate_Call { + return &MockStore_RegistryUpdate_Call{Call: _e.mock.On("RegistryUpdate", registry)} +} + +func (_c *MockStore_RegistryUpdate_Call) Run(run func(registry *model.Registry)) *MockStore_RegistryUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Registry + if args[0] != nil { + arg0 = args[0].(*model.Registry) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_RegistryUpdate_Call) Return(err error) *MockStore_RegistryUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_RegistryUpdate_Call) RunAndReturn(run func(registry *model.Registry) error) *MockStore_RegistryUpdate_Call { + _c.Call.Return(run) + return _c +} + +// RepoList provides a mock function for the type MockStore +func (_mock *MockStore) RepoList(user *model.User, owned bool, active bool) ([]*model.Repo, error) { + ret := _mock.Called(user, owned, active) + + if len(ret) == 0 { + panic("no return value specified for RepoList") + } + + var r0 []*model.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.User, bool, bool) ([]*model.Repo, error)); ok { + return returnFunc(user, owned, active) + } + if returnFunc, ok := ret.Get(0).(func(*model.User, bool, bool) []*model.Repo); ok { + r0 = returnFunc(user, owned, active) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.User, bool, bool) error); ok { + r1 = returnFunc(user, owned, active) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_RepoList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoList' +type MockStore_RepoList_Call struct { + *mock.Call +} + +// RepoList is a helper method to define mock.On call +// - user *model.User +// - owned bool +// - active bool +func (_e *MockStore_Expecter) RepoList(user interface{}, owned interface{}, active interface{}) *MockStore_RepoList_Call { + return &MockStore_RepoList_Call{Call: _e.mock.On("RepoList", user, owned, active)} +} + +func (_c *MockStore_RepoList_Call) Run(run func(user *model.User, owned bool, active bool)) *MockStore_RepoList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.User + if args[0] != nil { + arg0 = args[0].(*model.User) + } + var arg1 bool + if args[1] != nil { + arg1 = args[1].(bool) + } + var arg2 bool + if args[2] != nil { + arg2 = args[2].(bool) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockStore_RepoList_Call) Return(repos []*model.Repo, err error) *MockStore_RepoList_Call { + _c.Call.Return(repos, err) + return _c +} + +func (_c *MockStore_RepoList_Call) RunAndReturn(run func(user *model.User, owned bool, active bool) ([]*model.Repo, error)) *MockStore_RepoList_Call { + _c.Call.Return(run) + return _c +} + +// RepoListAll provides a mock function for the type MockStore +func (_mock *MockStore) RepoListAll(active bool, p *model.ListOptions) ([]*model.Repo, error) { + ret := _mock.Called(active, p) + + if len(ret) == 0 { + panic("no return value specified for RepoListAll") + } + + var r0 []*model.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(bool, *model.ListOptions) ([]*model.Repo, error)); ok { + return returnFunc(active, p) + } + if returnFunc, ok := ret.Get(0).(func(bool, *model.ListOptions) []*model.Repo); ok { + r0 = returnFunc(active, p) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(bool, *model.ListOptions) error); ok { + r1 = returnFunc(active, p) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_RepoListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoListAll' +type MockStore_RepoListAll_Call struct { + *mock.Call +} + +// RepoListAll is a helper method to define mock.On call +// - active bool +// - p *model.ListOptions +func (_e *MockStore_Expecter) RepoListAll(active interface{}, p interface{}) *MockStore_RepoListAll_Call { + return &MockStore_RepoListAll_Call{Call: _e.mock.On("RepoListAll", active, p)} +} + +func (_c *MockStore_RepoListAll_Call) Run(run func(active bool, p *model.ListOptions)) *MockStore_RepoListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 bool + if args[0] != nil { + arg0 = args[0].(bool) + } + var arg1 *model.ListOptions + if args[1] != nil { + arg1 = args[1].(*model.ListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_RepoListAll_Call) Return(repos []*model.Repo, err error) *MockStore_RepoListAll_Call { + _c.Call.Return(repos, err) + return _c +} + +func (_c *MockStore_RepoListAll_Call) RunAndReturn(run func(active bool, p *model.ListOptions) ([]*model.Repo, error)) *MockStore_RepoListAll_Call { + _c.Call.Return(run) + return _c +} + +// RepoListLatest provides a mock function for the type MockStore +func (_mock *MockStore) RepoListLatest(user *model.User) ([]*model.Feed, error) { + ret := _mock.Called(user) + + if len(ret) == 0 { + panic("no return value specified for RepoListLatest") + } + + var r0 []*model.Feed + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.User) ([]*model.Feed, error)); ok { + return returnFunc(user) + } + if returnFunc, ok := ret.Get(0).(func(*model.User) []*model.Feed); ok { + r0 = returnFunc(user) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Feed) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.User) error); ok { + r1 = returnFunc(user) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_RepoListLatest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoListLatest' +type MockStore_RepoListLatest_Call struct { + *mock.Call +} + +// RepoListLatest is a helper method to define mock.On call +// - user *model.User +func (_e *MockStore_Expecter) RepoListLatest(user interface{}) *MockStore_RepoListLatest_Call { + return &MockStore_RepoListLatest_Call{Call: _e.mock.On("RepoListLatest", user)} +} + +func (_c *MockStore_RepoListLatest_Call) Run(run func(user *model.User)) *MockStore_RepoListLatest_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.User + if args[0] != nil { + arg0 = args[0].(*model.User) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_RepoListLatest_Call) Return(feeds []*model.Feed, err error) *MockStore_RepoListLatest_Call { + _c.Call.Return(feeds, err) + return _c +} + +func (_c *MockStore_RepoListLatest_Call) RunAndReturn(run func(user *model.User) ([]*model.Feed, error)) *MockStore_RepoListLatest_Call { + _c.Call.Return(run) + return _c +} + +// SecretCreate provides a mock function for the type MockStore +func (_mock *MockStore) SecretCreate(secret *model.Secret) error { + ret := _mock.Called(secret) + + if len(ret) == 0 { + panic("no return value specified for SecretCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Secret) error); ok { + r0 = returnFunc(secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_SecretCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretCreate' +type MockStore_SecretCreate_Call struct { + *mock.Call +} + +// SecretCreate is a helper method to define mock.On call +// - secret *model.Secret +func (_e *MockStore_Expecter) SecretCreate(secret interface{}) *MockStore_SecretCreate_Call { + return &MockStore_SecretCreate_Call{Call: _e.mock.On("SecretCreate", secret)} +} + +func (_c *MockStore_SecretCreate_Call) Run(run func(secret *model.Secret)) *MockStore_SecretCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Secret + if args[0] != nil { + arg0 = args[0].(*model.Secret) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_SecretCreate_Call) Return(err error) *MockStore_SecretCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_SecretCreate_Call) RunAndReturn(run func(secret *model.Secret) error) *MockStore_SecretCreate_Call { + _c.Call.Return(run) + return _c +} + +// SecretDelete provides a mock function for the type MockStore +func (_mock *MockStore) SecretDelete(secret *model.Secret) error { + ret := _mock.Called(secret) + + if len(ret) == 0 { + panic("no return value specified for SecretDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Secret) error); ok { + r0 = returnFunc(secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_SecretDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretDelete' +type MockStore_SecretDelete_Call struct { + *mock.Call +} + +// SecretDelete is a helper method to define mock.On call +// - secret *model.Secret +func (_e *MockStore_Expecter) SecretDelete(secret interface{}) *MockStore_SecretDelete_Call { + return &MockStore_SecretDelete_Call{Call: _e.mock.On("SecretDelete", secret)} +} + +func (_c *MockStore_SecretDelete_Call) Run(run func(secret *model.Secret)) *MockStore_SecretDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Secret + if args[0] != nil { + arg0 = args[0].(*model.Secret) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_SecretDelete_Call) Return(err error) *MockStore_SecretDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_SecretDelete_Call) RunAndReturn(run func(secret *model.Secret) error) *MockStore_SecretDelete_Call { + _c.Call.Return(run) + return _c +} + +// SecretFind provides a mock function for the type MockStore +func (_mock *MockStore) SecretFind(repo *model.Repo, s string) (*model.Secret, error) { + ret := _mock.Called(repo, s) + + if len(ret) == 0 { + panic("no return value specified for SecretFind") + } + + var r0 *model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) (*model.Secret, error)); ok { + return returnFunc(repo, s) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, string) *model.Secret); ok { + r0 = returnFunc(repo, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, string) error); ok { + r1 = returnFunc(repo, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_SecretFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretFind' +type MockStore_SecretFind_Call struct { + *mock.Call +} + +// SecretFind is a helper method to define mock.On call +// - repo *model.Repo +// - s string +func (_e *MockStore_Expecter) SecretFind(repo interface{}, s interface{}) *MockStore_SecretFind_Call { + return &MockStore_SecretFind_Call{Call: _e.mock.On("SecretFind", repo, s)} +} + +func (_c *MockStore_SecretFind_Call) Run(run func(repo *model.Repo, s string)) *MockStore_SecretFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_SecretFind_Call) Return(secret *model.Secret, err error) *MockStore_SecretFind_Call { + _c.Call.Return(secret, err) + return _c +} + +func (_c *MockStore_SecretFind_Call) RunAndReturn(run func(repo *model.Repo, s string) (*model.Secret, error)) *MockStore_SecretFind_Call { + _c.Call.Return(run) + return _c +} + +// SecretList provides a mock function for the type MockStore +func (_mock *MockStore) SecretList(repo *model.Repo, b bool, listOptions *model.ListOptions) ([]*model.Secret, error) { + ret := _mock.Called(repo, b, listOptions) + + if len(ret) == 0 { + panic("no return value specified for SecretList") + } + + var r0 []*model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo, bool, *model.ListOptions) ([]*model.Secret, error)); ok { + return returnFunc(repo, b, listOptions) + } + if returnFunc, ok := ret.Get(0).(func(*model.Repo, bool, *model.ListOptions) []*model.Secret); ok { + r0 = returnFunc(repo, b, listOptions) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Repo, bool, *model.ListOptions) error); ok { + r1 = returnFunc(repo, b, listOptions) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_SecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretList' +type MockStore_SecretList_Call struct { + *mock.Call +} + +// SecretList is a helper method to define mock.On call +// - repo *model.Repo +// - b bool +// - listOptions *model.ListOptions +func (_e *MockStore_Expecter) SecretList(repo interface{}, b interface{}, listOptions interface{}) *MockStore_SecretList_Call { + return &MockStore_SecretList_Call{Call: _e.mock.On("SecretList", repo, b, listOptions)} +} + +func (_c *MockStore_SecretList_Call) Run(run func(repo *model.Repo, b bool, listOptions *model.ListOptions)) *MockStore_SecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + var arg1 bool + if args[1] != nil { + arg1 = args[1].(bool) + } + var arg2 *model.ListOptions + if args[2] != nil { + arg2 = args[2].(*model.ListOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockStore_SecretList_Call) Return(secrets []*model.Secret, err error) *MockStore_SecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockStore_SecretList_Call) RunAndReturn(run func(repo *model.Repo, b bool, listOptions *model.ListOptions) ([]*model.Secret, error)) *MockStore_SecretList_Call { + _c.Call.Return(run) + return _c +} + +// SecretListAll provides a mock function for the type MockStore +func (_mock *MockStore) SecretListAll() ([]*model.Secret, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for SecretListAll") + } + + var r0 []*model.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func() ([]*model.Secret, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []*model.Secret); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_SecretListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretListAll' +type MockStore_SecretListAll_Call struct { + *mock.Call +} + +// SecretListAll is a helper method to define mock.On call +func (_e *MockStore_Expecter) SecretListAll() *MockStore_SecretListAll_Call { + return &MockStore_SecretListAll_Call{Call: _e.mock.On("SecretListAll")} +} + +func (_c *MockStore_SecretListAll_Call) Run(run func()) *MockStore_SecretListAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStore_SecretListAll_Call) Return(secrets []*model.Secret, err error) *MockStore_SecretListAll_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockStore_SecretListAll_Call) RunAndReturn(run func() ([]*model.Secret, error)) *MockStore_SecretListAll_Call { + _c.Call.Return(run) + return _c +} + +// SecretUpdate provides a mock function for the type MockStore +func (_mock *MockStore) SecretUpdate(secret *model.Secret) error { + ret := _mock.Called(secret) + + if len(ret) == 0 { + panic("no return value specified for SecretUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Secret) error); ok { + r0 = returnFunc(secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_SecretUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretUpdate' +type MockStore_SecretUpdate_Call struct { + *mock.Call +} + +// SecretUpdate is a helper method to define mock.On call +// - secret *model.Secret +func (_e *MockStore_Expecter) SecretUpdate(secret interface{}) *MockStore_SecretUpdate_Call { + return &MockStore_SecretUpdate_Call{Call: _e.mock.On("SecretUpdate", secret)} +} + +func (_c *MockStore_SecretUpdate_Call) Run(run func(secret *model.Secret)) *MockStore_SecretUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Secret + if args[0] != nil { + arg0 = args[0].(*model.Secret) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_SecretUpdate_Call) Return(err error) *MockStore_SecretUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_SecretUpdate_Call) RunAndReturn(run func(secret *model.Secret) error) *MockStore_SecretUpdate_Call { + _c.Call.Return(run) + return _c +} + +// ServerConfigDelete provides a mock function for the type MockStore +func (_mock *MockStore) ServerConfigDelete(s string) error { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for ServerConfigDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(s) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_ServerConfigDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServerConfigDelete' +type MockStore_ServerConfigDelete_Call struct { + *mock.Call +} + +// ServerConfigDelete is a helper method to define mock.On call +// - s string +func (_e *MockStore_Expecter) ServerConfigDelete(s interface{}) *MockStore_ServerConfigDelete_Call { + return &MockStore_ServerConfigDelete_Call{Call: _e.mock.On("ServerConfigDelete", s)} +} + +func (_c *MockStore_ServerConfigDelete_Call) Run(run func(s string)) *MockStore_ServerConfigDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_ServerConfigDelete_Call) Return(err error) *MockStore_ServerConfigDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_ServerConfigDelete_Call) RunAndReturn(run func(s string) error) *MockStore_ServerConfigDelete_Call { + _c.Call.Return(run) + return _c +} + +// ServerConfigGet provides a mock function for the type MockStore +func (_mock *MockStore) ServerConfigGet(s string) (string, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for ServerConfigGet") + } + + var r0 string + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (string, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) string); ok { + r0 = returnFunc(s) + } else { + r0 = ret.Get(0).(string) + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_ServerConfigGet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServerConfigGet' +type MockStore_ServerConfigGet_Call struct { + *mock.Call +} + +// ServerConfigGet is a helper method to define mock.On call +// - s string +func (_e *MockStore_Expecter) ServerConfigGet(s interface{}) *MockStore_ServerConfigGet_Call { + return &MockStore_ServerConfigGet_Call{Call: _e.mock.On("ServerConfigGet", s)} +} + +func (_c *MockStore_ServerConfigGet_Call) Run(run func(s string)) *MockStore_ServerConfigGet_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_ServerConfigGet_Call) Return(s1 string, err error) *MockStore_ServerConfigGet_Call { + _c.Call.Return(s1, err) + return _c +} + +func (_c *MockStore_ServerConfigGet_Call) RunAndReturn(run func(s string) (string, error)) *MockStore_ServerConfigGet_Call { + _c.Call.Return(run) + return _c +} + +// ServerConfigSet provides a mock function for the type MockStore +func (_mock *MockStore) ServerConfigSet(s string, s1 string) error { + ret := _mock.Called(s, s1) + + if len(ret) == 0 { + panic("no return value specified for ServerConfigSet") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string, string) error); ok { + r0 = returnFunc(s, s1) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_ServerConfigSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServerConfigSet' +type MockStore_ServerConfigSet_Call struct { + *mock.Call +} + +// ServerConfigSet is a helper method to define mock.On call +// - s string +// - s1 string +func (_e *MockStore_Expecter) ServerConfigSet(s interface{}, s1 interface{}) *MockStore_ServerConfigSet_Call { + return &MockStore_ServerConfigSet_Call{Call: _e.mock.On("ServerConfigSet", s, s1)} +} + +func (_c *MockStore_ServerConfigSet_Call) Run(run func(s string, s1 string)) *MockStore_ServerConfigSet_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_ServerConfigSet_Call) Return(err error) *MockStore_ServerConfigSet_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_ServerConfigSet_Call) RunAndReturn(run func(s string, s1 string) error) *MockStore_ServerConfigSet_Call { + _c.Call.Return(run) + return _c +} + +// StepByUUID provides a mock function for the type MockStore +func (_mock *MockStore) StepByUUID(s string) (*model.Step, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for StepByUUID") + } + + var r0 *model.Step + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*model.Step, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *model.Step); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Step) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_StepByUUID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StepByUUID' +type MockStore_StepByUUID_Call struct { + *mock.Call +} + +// StepByUUID is a helper method to define mock.On call +// - s string +func (_e *MockStore_Expecter) StepByUUID(s interface{}) *MockStore_StepByUUID_Call { + return &MockStore_StepByUUID_Call{Call: _e.mock.On("StepByUUID", s)} +} + +func (_c *MockStore_StepByUUID_Call) Run(run func(s string)) *MockStore_StepByUUID_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_StepByUUID_Call) Return(step *model.Step, err error) *MockStore_StepByUUID_Call { + _c.Call.Return(step, err) + return _c +} + +func (_c *MockStore_StepByUUID_Call) RunAndReturn(run func(s string) (*model.Step, error)) *MockStore_StepByUUID_Call { + _c.Call.Return(run) + return _c +} + +// StepChild provides a mock function for the type MockStore +func (_mock *MockStore) StepChild(pipeline *model.Pipeline, n int, s string) (*model.Step, error) { + ret := _mock.Called(pipeline, n, s) + + if len(ret) == 0 { + panic("no return value specified for StepChild") + } + + var r0 *model.Step + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline, int, string) (*model.Step, error)); ok { + return returnFunc(pipeline, n, s) + } + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline, int, string) *model.Step); ok { + r0 = returnFunc(pipeline, n, s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Step) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Pipeline, int, string) error); ok { + r1 = returnFunc(pipeline, n, s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_StepChild_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StepChild' +type MockStore_StepChild_Call struct { + *mock.Call +} + +// StepChild is a helper method to define mock.On call +// - pipeline *model.Pipeline +// - n int +// - s string +func (_e *MockStore_Expecter) StepChild(pipeline interface{}, n interface{}, s interface{}) *MockStore_StepChild_Call { + return &MockStore_StepChild_Call{Call: _e.mock.On("StepChild", pipeline, n, s)} +} + +func (_c *MockStore_StepChild_Call) Run(run func(pipeline *model.Pipeline, n int, s string)) *MockStore_StepChild_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Pipeline + if args[0] != nil { + arg0 = args[0].(*model.Pipeline) + } + var arg1 int + if args[1] != nil { + arg1 = args[1].(int) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockStore_StepChild_Call) Return(step *model.Step, err error) *MockStore_StepChild_Call { + _c.Call.Return(step, err) + return _c +} + +func (_c *MockStore_StepChild_Call) RunAndReturn(run func(pipeline *model.Pipeline, n int, s string) (*model.Step, error)) *MockStore_StepChild_Call { + _c.Call.Return(run) + return _c +} + +// StepFind provides a mock function for the type MockStore +func (_mock *MockStore) StepFind(pipeline *model.Pipeline, n int) (*model.Step, error) { + ret := _mock.Called(pipeline, n) + + if len(ret) == 0 { + panic("no return value specified for StepFind") + } + + var r0 *model.Step + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline, int) (*model.Step, error)); ok { + return returnFunc(pipeline, n) + } + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline, int) *model.Step); ok { + r0 = returnFunc(pipeline, n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Step) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Pipeline, int) error); ok { + r1 = returnFunc(pipeline, n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_StepFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StepFind' +type MockStore_StepFind_Call struct { + *mock.Call +} + +// StepFind is a helper method to define mock.On call +// - pipeline *model.Pipeline +// - n int +func (_e *MockStore_Expecter) StepFind(pipeline interface{}, n interface{}) *MockStore_StepFind_Call { + return &MockStore_StepFind_Call{Call: _e.mock.On("StepFind", pipeline, n)} +} + +func (_c *MockStore_StepFind_Call) Run(run func(pipeline *model.Pipeline, n int)) *MockStore_StepFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Pipeline + if args[0] != nil { + arg0 = args[0].(*model.Pipeline) + } + var arg1 int + if args[1] != nil { + arg1 = args[1].(int) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_StepFind_Call) Return(step *model.Step, err error) *MockStore_StepFind_Call { + _c.Call.Return(step, err) + return _c +} + +func (_c *MockStore_StepFind_Call) RunAndReturn(run func(pipeline *model.Pipeline, n int) (*model.Step, error)) *MockStore_StepFind_Call { + _c.Call.Return(run) + return _c +} + +// StepList provides a mock function for the type MockStore +func (_mock *MockStore) StepList(pipeline *model.Pipeline) ([]*model.Step, error) { + ret := _mock.Called(pipeline) + + if len(ret) == 0 { + panic("no return value specified for StepList") + } + + var r0 []*model.Step + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline) ([]*model.Step, error)); ok { + return returnFunc(pipeline) + } + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline) []*model.Step); ok { + r0 = returnFunc(pipeline) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Step) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Pipeline) error); ok { + r1 = returnFunc(pipeline) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_StepList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StepList' +type MockStore_StepList_Call struct { + *mock.Call +} + +// StepList is a helper method to define mock.On call +// - pipeline *model.Pipeline +func (_e *MockStore_Expecter) StepList(pipeline interface{}) *MockStore_StepList_Call { + return &MockStore_StepList_Call{Call: _e.mock.On("StepList", pipeline)} +} + +func (_c *MockStore_StepList_Call) Run(run func(pipeline *model.Pipeline)) *MockStore_StepList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Pipeline + if args[0] != nil { + arg0 = args[0].(*model.Pipeline) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_StepList_Call) Return(steps []*model.Step, err error) *MockStore_StepList_Call { + _c.Call.Return(steps, err) + return _c +} + +func (_c *MockStore_StepList_Call) RunAndReturn(run func(pipeline *model.Pipeline) ([]*model.Step, error)) *MockStore_StepList_Call { + _c.Call.Return(run) + return _c +} + +// StepListFromWorkflowFind provides a mock function for the type MockStore +func (_mock *MockStore) StepListFromWorkflowFind(workflow *model.Workflow) ([]*model.Step, error) { + ret := _mock.Called(workflow) + + if len(ret) == 0 { + panic("no return value specified for StepListFromWorkflowFind") + } + + var r0 []*model.Step + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Workflow) ([]*model.Step, error)); ok { + return returnFunc(workflow) + } + if returnFunc, ok := ret.Get(0).(func(*model.Workflow) []*model.Step); ok { + r0 = returnFunc(workflow) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Step) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Workflow) error); ok { + r1 = returnFunc(workflow) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_StepListFromWorkflowFind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StepListFromWorkflowFind' +type MockStore_StepListFromWorkflowFind_Call struct { + *mock.Call +} + +// StepListFromWorkflowFind is a helper method to define mock.On call +// - workflow *model.Workflow +func (_e *MockStore_Expecter) StepListFromWorkflowFind(workflow interface{}) *MockStore_StepListFromWorkflowFind_Call { + return &MockStore_StepListFromWorkflowFind_Call{Call: _e.mock.On("StepListFromWorkflowFind", workflow)} +} + +func (_c *MockStore_StepListFromWorkflowFind_Call) Run(run func(workflow *model.Workflow)) *MockStore_StepListFromWorkflowFind_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Workflow + if args[0] != nil { + arg0 = args[0].(*model.Workflow) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_StepListFromWorkflowFind_Call) Return(steps []*model.Step, err error) *MockStore_StepListFromWorkflowFind_Call { + _c.Call.Return(steps, err) + return _c +} + +func (_c *MockStore_StepListFromWorkflowFind_Call) RunAndReturn(run func(workflow *model.Workflow) ([]*model.Step, error)) *MockStore_StepListFromWorkflowFind_Call { + _c.Call.Return(run) + return _c +} + +// StepLoad provides a mock function for the type MockStore +func (_mock *MockStore) StepLoad(n int64) (*model.Step, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for StepLoad") + } + + var r0 *model.Step + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*model.Step, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) *model.Step); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Step) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_StepLoad_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StepLoad' +type MockStore_StepLoad_Call struct { + *mock.Call +} + +// StepLoad is a helper method to define mock.On call +// - n int64 +func (_e *MockStore_Expecter) StepLoad(n interface{}) *MockStore_StepLoad_Call { + return &MockStore_StepLoad_Call{Call: _e.mock.On("StepLoad", n)} +} + +func (_c *MockStore_StepLoad_Call) Run(run func(n int64)) *MockStore_StepLoad_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_StepLoad_Call) Return(step *model.Step, err error) *MockStore_StepLoad_Call { + _c.Call.Return(step, err) + return _c +} + +func (_c *MockStore_StepLoad_Call) RunAndReturn(run func(n int64) (*model.Step, error)) *MockStore_StepLoad_Call { + _c.Call.Return(run) + return _c +} + +// StepUpdate provides a mock function for the type MockStore +func (_mock *MockStore) StepUpdate(step *model.Step) error { + ret := _mock.Called(step) + + if len(ret) == 0 { + panic("no return value specified for StepUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Step) error); ok { + r0 = returnFunc(step) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_StepUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StepUpdate' +type MockStore_StepUpdate_Call struct { + *mock.Call +} + +// StepUpdate is a helper method to define mock.On call +// - step *model.Step +func (_e *MockStore_Expecter) StepUpdate(step interface{}) *MockStore_StepUpdate_Call { + return &MockStore_StepUpdate_Call{Call: _e.mock.On("StepUpdate", step)} +} + +func (_c *MockStore_StepUpdate_Call) Run(run func(step *model.Step)) *MockStore_StepUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Step + if args[0] != nil { + arg0 = args[0].(*model.Step) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_StepUpdate_Call) Return(err error) *MockStore_StepUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_StepUpdate_Call) RunAndReturn(run func(step *model.Step) error) *MockStore_StepUpdate_Call { + _c.Call.Return(run) + return _c +} + +// TaskDelete provides a mock function for the type MockStore +func (_mock *MockStore) TaskDelete(s string) error { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for TaskDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(s) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_TaskDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TaskDelete' +type MockStore_TaskDelete_Call struct { + *mock.Call +} + +// TaskDelete is a helper method to define mock.On call +// - s string +func (_e *MockStore_Expecter) TaskDelete(s interface{}) *MockStore_TaskDelete_Call { + return &MockStore_TaskDelete_Call{Call: _e.mock.On("TaskDelete", s)} +} + +func (_c *MockStore_TaskDelete_Call) Run(run func(s string)) *MockStore_TaskDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_TaskDelete_Call) Return(err error) *MockStore_TaskDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_TaskDelete_Call) RunAndReturn(run func(s string) error) *MockStore_TaskDelete_Call { + _c.Call.Return(run) + return _c +} + +// TaskInsert provides a mock function for the type MockStore +func (_mock *MockStore) TaskInsert(task *model.Task) error { + ret := _mock.Called(task) + + if len(ret) == 0 { + panic("no return value specified for TaskInsert") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Task) error); ok { + r0 = returnFunc(task) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_TaskInsert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TaskInsert' +type MockStore_TaskInsert_Call struct { + *mock.Call +} + +// TaskInsert is a helper method to define mock.On call +// - task *model.Task +func (_e *MockStore_Expecter) TaskInsert(task interface{}) *MockStore_TaskInsert_Call { + return &MockStore_TaskInsert_Call{Call: _e.mock.On("TaskInsert", task)} +} + +func (_c *MockStore_TaskInsert_Call) Run(run func(task *model.Task)) *MockStore_TaskInsert_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Task + if args[0] != nil { + arg0 = args[0].(*model.Task) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_TaskInsert_Call) Return(err error) *MockStore_TaskInsert_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_TaskInsert_Call) RunAndReturn(run func(task *model.Task) error) *MockStore_TaskInsert_Call { + _c.Call.Return(run) + return _c +} + +// TaskList provides a mock function for the type MockStore +func (_mock *MockStore) TaskList() ([]*model.Task, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for TaskList") + } + + var r0 []*model.Task + var r1 error + if returnFunc, ok := ret.Get(0).(func() ([]*model.Task, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []*model.Task); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Task) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_TaskList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TaskList' +type MockStore_TaskList_Call struct { + *mock.Call +} + +// TaskList is a helper method to define mock.On call +func (_e *MockStore_Expecter) TaskList() *MockStore_TaskList_Call { + return &MockStore_TaskList_Call{Call: _e.mock.On("TaskList")} +} + +func (_c *MockStore_TaskList_Call) Run(run func()) *MockStore_TaskList_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockStore_TaskList_Call) Return(tasks []*model.Task, err error) *MockStore_TaskList_Call { + _c.Call.Return(tasks, err) + return _c +} + +func (_c *MockStore_TaskList_Call) RunAndReturn(run func() ([]*model.Task, error)) *MockStore_TaskList_Call { + _c.Call.Return(run) + return _c +} + +// UpdatePipeline provides a mock function for the type MockStore +func (_mock *MockStore) UpdatePipeline(pipeline *model.Pipeline) error { + ret := _mock.Called(pipeline) + + if len(ret) == 0 { + panic("no return value specified for UpdatePipeline") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline) error); ok { + r0 = returnFunc(pipeline) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_UpdatePipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePipeline' +type MockStore_UpdatePipeline_Call struct { + *mock.Call +} + +// UpdatePipeline is a helper method to define mock.On call +// - pipeline *model.Pipeline +func (_e *MockStore_Expecter) UpdatePipeline(pipeline interface{}) *MockStore_UpdatePipeline_Call { + return &MockStore_UpdatePipeline_Call{Call: _e.mock.On("UpdatePipeline", pipeline)} +} + +func (_c *MockStore_UpdatePipeline_Call) Run(run func(pipeline *model.Pipeline)) *MockStore_UpdatePipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Pipeline + if args[0] != nil { + arg0 = args[0].(*model.Pipeline) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_UpdatePipeline_Call) Return(err error) *MockStore_UpdatePipeline_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_UpdatePipeline_Call) RunAndReturn(run func(pipeline *model.Pipeline) error) *MockStore_UpdatePipeline_Call { + _c.Call.Return(run) + return _c +} + +// UpdateRepo provides a mock function for the type MockStore +func (_mock *MockStore) UpdateRepo(repo *model.Repo) error { + ret := _mock.Called(repo) + + if len(ret) == 0 { + panic("no return value specified for UpdateRepo") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Repo) error); ok { + r0 = returnFunc(repo) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_UpdateRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRepo' +type MockStore_UpdateRepo_Call struct { + *mock.Call +} + +// UpdateRepo is a helper method to define mock.On call +// - repo *model.Repo +func (_e *MockStore_Expecter) UpdateRepo(repo interface{}) *MockStore_UpdateRepo_Call { + return &MockStore_UpdateRepo_Call{Call: _e.mock.On("UpdateRepo", repo)} +} + +func (_c *MockStore_UpdateRepo_Call) Run(run func(repo *model.Repo)) *MockStore_UpdateRepo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Repo + if args[0] != nil { + arg0 = args[0].(*model.Repo) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_UpdateRepo_Call) Return(err error) *MockStore_UpdateRepo_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_UpdateRepo_Call) RunAndReturn(run func(repo *model.Repo) error) *MockStore_UpdateRepo_Call { + _c.Call.Return(run) + return _c +} + +// UpdateUser provides a mock function for the type MockStore +func (_mock *MockStore) UpdateUser(user *model.User) error { + ret := _mock.Called(user) + + if len(ret) == 0 { + panic("no return value specified for UpdateUser") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.User) error); ok { + r0 = returnFunc(user) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_UpdateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUser' +type MockStore_UpdateUser_Call struct { + *mock.Call +} + +// UpdateUser is a helper method to define mock.On call +// - user *model.User +func (_e *MockStore_Expecter) UpdateUser(user interface{}) *MockStore_UpdateUser_Call { + return &MockStore_UpdateUser_Call{Call: _e.mock.On("UpdateUser", user)} +} + +func (_c *MockStore_UpdateUser_Call) Run(run func(user *model.User)) *MockStore_UpdateUser_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.User + if args[0] != nil { + arg0 = args[0].(*model.User) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_UpdateUser_Call) Return(err error) *MockStore_UpdateUser_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_UpdateUser_Call) RunAndReturn(run func(user *model.User) error) *MockStore_UpdateUser_Call { + _c.Call.Return(run) + return _c +} + +// UserFeed provides a mock function for the type MockStore +func (_mock *MockStore) UserFeed(user *model.User) ([]*model.Feed, error) { + ret := _mock.Called(user) + + if len(ret) == 0 { + panic("no return value specified for UserFeed") + } + + var r0 []*model.Feed + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.User) ([]*model.Feed, error)); ok { + return returnFunc(user) + } + if returnFunc, ok := ret.Get(0).(func(*model.User) []*model.Feed); ok { + r0 = returnFunc(user) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Feed) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.User) error); ok { + r1 = returnFunc(user) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_UserFeed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserFeed' +type MockStore_UserFeed_Call struct { + *mock.Call +} + +// UserFeed is a helper method to define mock.On call +// - user *model.User +func (_e *MockStore_Expecter) UserFeed(user interface{}) *MockStore_UserFeed_Call { + return &MockStore_UserFeed_Call{Call: _e.mock.On("UserFeed", user)} +} + +func (_c *MockStore_UserFeed_Call) Run(run func(user *model.User)) *MockStore_UserFeed_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.User + if args[0] != nil { + arg0 = args[0].(*model.User) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_UserFeed_Call) Return(feeds []*model.Feed, err error) *MockStore_UserFeed_Call { + _c.Call.Return(feeds, err) + return _c +} + +func (_c *MockStore_UserFeed_Call) RunAndReturn(run func(user *model.User) ([]*model.Feed, error)) *MockStore_UserFeed_Call { + _c.Call.Return(run) + return _c +} + +// WorkflowGetTree provides a mock function for the type MockStore +func (_mock *MockStore) WorkflowGetTree(pipeline *model.Pipeline) ([]*model.Workflow, error) { + ret := _mock.Called(pipeline) + + if len(ret) == 0 { + panic("no return value specified for WorkflowGetTree") + } + + var r0 []*model.Workflow + var r1 error + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline) ([]*model.Workflow, error)); ok { + return returnFunc(pipeline) + } + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline) []*model.Workflow); ok { + r0 = returnFunc(pipeline) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*model.Workflow) + } + } + if returnFunc, ok := ret.Get(1).(func(*model.Pipeline) error); ok { + r1 = returnFunc(pipeline) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_WorkflowGetTree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WorkflowGetTree' +type MockStore_WorkflowGetTree_Call struct { + *mock.Call +} + +// WorkflowGetTree is a helper method to define mock.On call +// - pipeline *model.Pipeline +func (_e *MockStore_Expecter) WorkflowGetTree(pipeline interface{}) *MockStore_WorkflowGetTree_Call { + return &MockStore_WorkflowGetTree_Call{Call: _e.mock.On("WorkflowGetTree", pipeline)} +} + +func (_c *MockStore_WorkflowGetTree_Call) Run(run func(pipeline *model.Pipeline)) *MockStore_WorkflowGetTree_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Pipeline + if args[0] != nil { + arg0 = args[0].(*model.Pipeline) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_WorkflowGetTree_Call) Return(workflows []*model.Workflow, err error) *MockStore_WorkflowGetTree_Call { + _c.Call.Return(workflows, err) + return _c +} + +func (_c *MockStore_WorkflowGetTree_Call) RunAndReturn(run func(pipeline *model.Pipeline) ([]*model.Workflow, error)) *MockStore_WorkflowGetTree_Call { + _c.Call.Return(run) + return _c +} + +// WorkflowLoad provides a mock function for the type MockStore +func (_mock *MockStore) WorkflowLoad(n int64) (*model.Workflow, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for WorkflowLoad") + } + + var r0 *model.Workflow + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*model.Workflow, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) *model.Workflow); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.Workflow) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockStore_WorkflowLoad_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WorkflowLoad' +type MockStore_WorkflowLoad_Call struct { + *mock.Call +} + +// WorkflowLoad is a helper method to define mock.On call +// - n int64 +func (_e *MockStore_Expecter) WorkflowLoad(n interface{}) *MockStore_WorkflowLoad_Call { + return &MockStore_WorkflowLoad_Call{Call: _e.mock.On("WorkflowLoad", n)} +} + +func (_c *MockStore_WorkflowLoad_Call) Run(run func(n int64)) *MockStore_WorkflowLoad_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_WorkflowLoad_Call) Return(workflow *model.Workflow, err error) *MockStore_WorkflowLoad_Call { + _c.Call.Return(workflow, err) + return _c +} + +func (_c *MockStore_WorkflowLoad_Call) RunAndReturn(run func(n int64) (*model.Workflow, error)) *MockStore_WorkflowLoad_Call { + _c.Call.Return(run) + return _c +} + +// WorkflowUpdate provides a mock function for the type MockStore +func (_mock *MockStore) WorkflowUpdate(workflow *model.Workflow) error { + ret := _mock.Called(workflow) + + if len(ret) == 0 { + panic("no return value specified for WorkflowUpdate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Workflow) error); ok { + r0 = returnFunc(workflow) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_WorkflowUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WorkflowUpdate' +type MockStore_WorkflowUpdate_Call struct { + *mock.Call +} + +// WorkflowUpdate is a helper method to define mock.On call +// - workflow *model.Workflow +func (_e *MockStore_Expecter) WorkflowUpdate(workflow interface{}) *MockStore_WorkflowUpdate_Call { + return &MockStore_WorkflowUpdate_Call{Call: _e.mock.On("WorkflowUpdate", workflow)} +} + +func (_c *MockStore_WorkflowUpdate_Call) Run(run func(workflow *model.Workflow)) *MockStore_WorkflowUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Workflow + if args[0] != nil { + arg0 = args[0].(*model.Workflow) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_WorkflowUpdate_Call) Return(err error) *MockStore_WorkflowUpdate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_WorkflowUpdate_Call) RunAndReturn(run func(workflow *model.Workflow) error) *MockStore_WorkflowUpdate_Call { + _c.Call.Return(run) + return _c +} + +// WorkflowsCreate provides a mock function for the type MockStore +func (_mock *MockStore) WorkflowsCreate(workflows []*model.Workflow) error { + ret := _mock.Called(workflows) + + if len(ret) == 0 { + panic("no return value specified for WorkflowsCreate") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func([]*model.Workflow) error); ok { + r0 = returnFunc(workflows) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_WorkflowsCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WorkflowsCreate' +type MockStore_WorkflowsCreate_Call struct { + *mock.Call +} + +// WorkflowsCreate is a helper method to define mock.On call +// - workflows []*model.Workflow +func (_e *MockStore_Expecter) WorkflowsCreate(workflows interface{}) *MockStore_WorkflowsCreate_Call { + return &MockStore_WorkflowsCreate_Call{Call: _e.mock.On("WorkflowsCreate", workflows)} +} + +func (_c *MockStore_WorkflowsCreate_Call) Run(run func(workflows []*model.Workflow)) *MockStore_WorkflowsCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 []*model.Workflow + if args[0] != nil { + arg0 = args[0].([]*model.Workflow) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockStore_WorkflowsCreate_Call) Return(err error) *MockStore_WorkflowsCreate_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_WorkflowsCreate_Call) RunAndReturn(run func(workflows []*model.Workflow) error) *MockStore_WorkflowsCreate_Call { + _c.Call.Return(run) + return _c +} + +// WorkflowsReplace provides a mock function for the type MockStore +func (_mock *MockStore) WorkflowsReplace(pipeline *model.Pipeline, workflows []*model.Workflow) error { + ret := _mock.Called(pipeline, workflows) + + if len(ret) == 0 { + panic("no return value specified for WorkflowsReplace") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(*model.Pipeline, []*model.Workflow) error); ok { + r0 = returnFunc(pipeline, workflows) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockStore_WorkflowsReplace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WorkflowsReplace' +type MockStore_WorkflowsReplace_Call struct { + *mock.Call +} + +// WorkflowsReplace is a helper method to define mock.On call +// - pipeline *model.Pipeline +// - workflows []*model.Workflow +func (_e *MockStore_Expecter) WorkflowsReplace(pipeline interface{}, workflows interface{}) *MockStore_WorkflowsReplace_Call { + return &MockStore_WorkflowsReplace_Call{Call: _e.mock.On("WorkflowsReplace", pipeline, workflows)} +} + +func (_c *MockStore_WorkflowsReplace_Call) Run(run func(pipeline *model.Pipeline, workflows []*model.Workflow)) *MockStore_WorkflowsReplace_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *model.Pipeline + if args[0] != nil { + arg0 = args[0].(*model.Pipeline) + } + var arg1 []*model.Workflow + if args[1] != nil { + arg1 = args[1].([]*model.Workflow) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockStore_WorkflowsReplace_Call) Return(err error) *MockStore_WorkflowsReplace_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockStore_WorkflowsReplace_Call) RunAndReturn(run func(pipeline *model.Pipeline, workflows []*model.Workflow) error) *MockStore_WorkflowsReplace_Call { + _c.Call.Return(run) + return _c +} diff --git a/server/store/mocks/store.go b/server/store/mocks/store.go deleted file mode 100644 index 260fc9838..000000000 --- a/server/store/mocks/store.go +++ /dev/null @@ -1,2811 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -//go:build test -// +build test - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - model "go.woodpecker-ci.org/woodpecker/v3/server/model" -) - -// Store is an autogenerated mock type for the Store type -type Store struct { - mock.Mock -} - -// AgentCreate provides a mock function with given fields: _a0 -func (_m *Store) AgentCreate(_a0 *model.Agent) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AgentCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Agent) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// AgentDelete provides a mock function with given fields: _a0 -func (_m *Store) AgentDelete(_a0 *model.Agent) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AgentDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Agent) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// AgentFind provides a mock function with given fields: _a0 -func (_m *Store) AgentFind(_a0 int64) (*model.Agent, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AgentFind") - } - - var r0 *model.Agent - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*model.Agent, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) *model.Agent); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Agent) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentFindByToken provides a mock function with given fields: _a0 -func (_m *Store) AgentFindByToken(_a0 string) (*model.Agent, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AgentFindByToken") - } - - var r0 *model.Agent - var r1 error - if rf, ok := ret.Get(0).(func(string) (*model.Agent, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) *model.Agent); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Agent) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentList provides a mock function with given fields: p -func (_m *Store) AgentList(p *model.ListOptions) ([]*model.Agent, error) { - ret := _m.Called(p) - - if len(ret) == 0 { - panic("no return value specified for AgentList") - } - - var r0 []*model.Agent - var r1 error - if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Agent, error)); ok { - return rf(p) - } - if rf, ok := ret.Get(0).(func(*model.ListOptions) []*model.Agent); ok { - r0 = rf(p) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Agent) - } - } - - if rf, ok := ret.Get(1).(func(*model.ListOptions) error); ok { - r1 = rf(p) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentListForOrg provides a mock function with given fields: orgID, opt -func (_m *Store) AgentListForOrg(orgID int64, opt *model.ListOptions) ([]*model.Agent, error) { - ret := _m.Called(orgID, opt) - - if len(ret) == 0 { - panic("no return value specified for AgentListForOrg") - } - - var r0 []*model.Agent - var r1 error - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Agent, error)); ok { - return rf(orgID, opt) - } - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Agent); ok { - r0 = rf(orgID, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Agent) - } - } - - if rf, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { - r1 = rf(orgID, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentUpdate provides a mock function with given fields: _a0 -func (_m *Store) AgentUpdate(_a0 *model.Agent) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AgentUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Agent) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Close provides a mock function with no fields -func (_m *Store) Close() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Close") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ConfigPersist provides a mock function with given fields: _a0 -func (_m *Store) ConfigPersist(_a0 *model.Config) (*model.Config, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ConfigPersist") - } - - var r0 *model.Config - var r1 error - if rf, ok := ret.Get(0).(func(*model.Config) (*model.Config, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.Config) *model.Config); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Config) - } - } - - if rf, ok := ret.Get(1).(func(*model.Config) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ConfigsForPipeline provides a mock function with given fields: pipelineID -func (_m *Store) ConfigsForPipeline(pipelineID int64) ([]*model.Config, error) { - ret := _m.Called(pipelineID) - - if len(ret) == 0 { - panic("no return value specified for ConfigsForPipeline") - } - - var r0 []*model.Config - var r1 error - if rf, ok := ret.Get(0).(func(int64) ([]*model.Config, error)); ok { - return rf(pipelineID) - } - if rf, ok := ret.Get(0).(func(int64) []*model.Config); ok { - r0 = rf(pipelineID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Config) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(pipelineID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CreatePipeline provides a mock function with given fields: _a0, _a1 -func (_m *Store) CreatePipeline(_a0 *model.Pipeline, _a1 ...*model.Step) error { - _va := make([]interface{}, len(_a1)) - for _i := range _a1 { - _va[_i] = _a1[_i] - } - var _ca []interface{} - _ca = append(_ca, _a0) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for CreatePipeline") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Pipeline, ...*model.Step) error); ok { - r0 = rf(_a0, _a1...) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CreateRedirection provides a mock function with given fields: redirection -func (_m *Store) CreateRedirection(redirection *model.Redirection) error { - ret := _m.Called(redirection) - - if len(ret) == 0 { - panic("no return value specified for CreateRedirection") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Redirection) error); ok { - r0 = rf(redirection) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CreateRepo provides a mock function with given fields: _a0 -func (_m *Store) CreateRepo(_a0 *model.Repo) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for CreateRepo") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CreateUser provides a mock function with given fields: _a0 -func (_m *Store) CreateUser(_a0 *model.User) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for CreateUser") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.User) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CronCreate provides a mock function with given fields: _a0 -func (_m *Store) CronCreate(_a0 *model.Cron) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for CronCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Cron) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CronDelete provides a mock function with given fields: _a0, _a1 -func (_m *Store) CronDelete(_a0 *model.Repo, _a1 int64) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for CronDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo, int64) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CronFind provides a mock function with given fields: _a0, _a1 -func (_m *Store) CronFind(_a0 *model.Repo, _a1 int64) (*model.Cron, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for CronFind") - } - - var r0 *model.Cron - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, int64) (*model.Cron, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, int64) *model.Cron); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Cron) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, int64) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CronGetLock provides a mock function with given fields: _a0, _a1 -func (_m *Store) CronGetLock(_a0 *model.Cron, _a1 int64) (bool, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for CronGetLock") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(*model.Cron, int64) (bool, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Cron, int64) bool); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(*model.Cron, int64) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CronList provides a mock function with given fields: _a0, _a1 -func (_m *Store) CronList(_a0 *model.Repo, _a1 *model.ListOptions) ([]*model.Cron, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for CronList") - } - - var r0 []*model.Cron - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) ([]*model.Cron, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) []*model.Cron); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Cron) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CronListNextExecute provides a mock function with given fields: _a0, _a1 -func (_m *Store) CronListNextExecute(_a0 int64, _a1 int64) ([]*model.Cron, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for CronListNextExecute") - } - - var r0 []*model.Cron - var r1 error - if rf, ok := ret.Get(0).(func(int64, int64) ([]*model.Cron, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, int64) []*model.Cron); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Cron) - } - } - - if rf, ok := ret.Get(1).(func(int64, int64) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CronUpdate provides a mock function with given fields: _a0, _a1 -func (_m *Store) CronUpdate(_a0 *model.Repo, _a1 *model.Cron) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for CronUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.Cron) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DeletePipeline provides a mock function with given fields: _a0 -func (_m *Store) DeletePipeline(_a0 *model.Pipeline) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for DeletePipeline") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Pipeline) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DeleteRepo provides a mock function with given fields: _a0 -func (_m *Store) DeleteRepo(_a0 *model.Repo) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for DeleteRepo") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DeleteUser provides a mock function with given fields: _a0 -func (_m *Store) DeleteUser(_a0 *model.User) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for DeleteUser") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.User) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ForgeCreate provides a mock function with given fields: _a0 -func (_m *Store) ForgeCreate(_a0 *model.Forge) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ForgeCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Forge) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ForgeDelete provides a mock function with given fields: _a0 -func (_m *Store) ForgeDelete(_a0 *model.Forge) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ForgeDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Forge) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ForgeGet provides a mock function with given fields: _a0 -func (_m *Store) ForgeGet(_a0 int64) (*model.Forge, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ForgeGet") - } - - var r0 *model.Forge - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*model.Forge, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) *model.Forge); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Forge) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ForgeList provides a mock function with given fields: p -func (_m *Store) ForgeList(p *model.ListOptions) ([]*model.Forge, error) { - ret := _m.Called(p) - - if len(ret) == 0 { - panic("no return value specified for ForgeList") - } - - var r0 []*model.Forge - var r1 error - if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Forge, error)); ok { - return rf(p) - } - if rf, ok := ret.Get(0).(func(*model.ListOptions) []*model.Forge); ok { - r0 = rf(p) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Forge) - } - } - - if rf, ok := ret.Get(1).(func(*model.ListOptions) error); ok { - r1 = rf(p) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ForgeUpdate provides a mock function with given fields: _a0 -func (_m *Store) ForgeUpdate(_a0 *model.Forge) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ForgeUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Forge) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GetActivePipelineList provides a mock function with given fields: repo -func (_m *Store) GetActivePipelineList(repo *model.Repo) ([]*model.Pipeline, error) { - ret := _m.Called(repo) - - if len(ret) == 0 { - panic("no return value specified for GetActivePipelineList") - } - - var r0 []*model.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo) ([]*model.Pipeline, error)); ok { - return rf(repo) - } - if rf, ok := ret.Get(0).(func(*model.Repo) []*model.Pipeline); ok { - r0 = rf(repo) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo) error); ok { - r1 = rf(repo) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPipeline provides a mock function with given fields: _a0 -func (_m *Store) GetPipeline(_a0 int64) (*model.Pipeline, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetPipeline") - } - - var r0 *model.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*model.Pipeline, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) *model.Pipeline); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPipelineBadge provides a mock function with given fields: _a0, _a1 -func (_m *Store) GetPipelineBadge(_a0 *model.Repo, _a1 string) (*model.Pipeline, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for GetPipelineBadge") - } - - var r0 *model.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Pipeline, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, string) *model.Pipeline); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPipelineCount provides a mock function with no fields -func (_m *Store) GetPipelineCount() (int64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPipelineCount") - } - - var r0 int64 - var r1 error - if rf, ok := ret.Get(0).(func() (int64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPipelineLast provides a mock function with given fields: _a0, _a1 -func (_m *Store) GetPipelineLast(_a0 *model.Repo, _a1 string) (*model.Pipeline, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for GetPipelineLast") - } - - var r0 *model.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Pipeline, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, string) *model.Pipeline); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPipelineLastBefore provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Store) GetPipelineLastBefore(_a0 *model.Repo, _a1 string, _a2 int64) (*model.Pipeline, error) { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for GetPipelineLastBefore") - } - - var r0 *model.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, string, int64) (*model.Pipeline, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(*model.Repo, string, int64) *model.Pipeline); ok { - r0 = rf(_a0, _a1, _a2) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, string, int64) error); ok { - r1 = rf(_a0, _a1, _a2) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPipelineList provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Store) GetPipelineList(_a0 *model.Repo, _a1 *model.ListOptions, _a2 *model.PipelineFilter) ([]*model.Pipeline, error) { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for GetPipelineList") - } - - var r0 []*model.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions, *model.PipelineFilter) ([]*model.Pipeline, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions, *model.PipelineFilter) []*model.Pipeline); ok { - r0 = rf(_a0, _a1, _a2) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, *model.ListOptions, *model.PipelineFilter) error); ok { - r1 = rf(_a0, _a1, _a2) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPipelineNumber provides a mock function with given fields: _a0, _a1 -func (_m *Store) GetPipelineNumber(_a0 *model.Repo, _a1 int64) (*model.Pipeline, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for GetPipelineNumber") - } - - var r0 *model.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, int64) (*model.Pipeline, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, int64) *model.Pipeline); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, int64) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetPipelineQueue provides a mock function with no fields -func (_m *Store) GetPipelineQueue() ([]*model.Feed, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPipelineQueue") - } - - var r0 []*model.Feed - var r1 error - if rf, ok := ret.Get(0).(func() ([]*model.Feed, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []*model.Feed); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Feed) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetRepo provides a mock function with given fields: _a0 -func (_m *Store) GetRepo(_a0 int64) (*model.Repo, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRepo") - } - - var r0 *model.Repo - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*model.Repo, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) *model.Repo); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetRepoCount provides a mock function with no fields -func (_m *Store) GetRepoCount() (int64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetRepoCount") - } - - var r0 int64 - var r1 error - if rf, ok := ret.Get(0).(func() (int64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetRepoForgeID provides a mock function with given fields: _a0 -func (_m *Store) GetRepoForgeID(_a0 model.ForgeRemoteID) (*model.Repo, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRepoForgeID") - } - - var r0 *model.Repo - var r1 error - if rf, ok := ret.Get(0).(func(model.ForgeRemoteID) (*model.Repo, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(model.ForgeRemoteID) *model.Repo); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(model.ForgeRemoteID) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetRepoLatestPipelines provides a mock function with given fields: _a0 -func (_m *Store) GetRepoLatestPipelines(_a0 []int64) ([]*model.Pipeline, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRepoLatestPipelines") - } - - var r0 []*model.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func([]int64) ([]*model.Pipeline, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func([]int64) []*model.Pipeline); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func([]int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetRepoName provides a mock function with given fields: _a0 -func (_m *Store) GetRepoName(_a0 string) (*model.Repo, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRepoName") - } - - var r0 *model.Repo - var r1 error - if rf, ok := ret.Get(0).(func(string) (*model.Repo, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) *model.Repo); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetRepoNameFallback provides a mock function with given fields: remoteID, fullName -func (_m *Store) GetRepoNameFallback(remoteID model.ForgeRemoteID, fullName string) (*model.Repo, error) { - ret := _m.Called(remoteID, fullName) - - if len(ret) == 0 { - panic("no return value specified for GetRepoNameFallback") - } - - var r0 *model.Repo - var r1 error - if rf, ok := ret.Get(0).(func(model.ForgeRemoteID, string) (*model.Repo, error)); ok { - return rf(remoteID, fullName) - } - if rf, ok := ret.Get(0).(func(model.ForgeRemoteID, string) *model.Repo); ok { - r0 = rf(remoteID, fullName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(model.ForgeRemoteID, string) error); ok { - r1 = rf(remoteID, fullName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetUser provides a mock function with given fields: _a0 -func (_m *Store) GetUser(_a0 int64) (*model.User, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetUser") - } - - var r0 *model.User - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*model.User, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) *model.User); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.User) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetUserCount provides a mock function with no fields -func (_m *Store) GetUserCount() (int64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetUserCount") - } - - var r0 int64 - var r1 error - if rf, ok := ret.Get(0).(func() (int64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetUserList provides a mock function with given fields: p -func (_m *Store) GetUserList(p *model.ListOptions) ([]*model.User, error) { - ret := _m.Called(p) - - if len(ret) == 0 { - panic("no return value specified for GetUserList") - } - - var r0 []*model.User - var r1 error - if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.User, error)); ok { - return rf(p) - } - if rf, ok := ret.Get(0).(func(*model.ListOptions) []*model.User); ok { - r0 = rf(p) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.User) - } - } - - if rf, ok := ret.Get(1).(func(*model.ListOptions) error); ok { - r1 = rf(p) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetUserLogin provides a mock function with given fields: _a0 -func (_m *Store) GetUserLogin(_a0 string) (*model.User, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetUserLogin") - } - - var r0 *model.User - var r1 error - if rf, ok := ret.Get(0).(func(string) (*model.User, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) *model.User); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.User) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetUserRemoteID provides a mock function with given fields: _a0, _a1 -func (_m *Store) GetUserRemoteID(_a0 model.ForgeRemoteID, _a1 string) (*model.User, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for GetUserRemoteID") - } - - var r0 *model.User - var r1 error - if rf, ok := ret.Get(0).(func(model.ForgeRemoteID, string) (*model.User, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(model.ForgeRemoteID, string) *model.User); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.User) - } - } - - if rf, ok := ret.Get(1).(func(model.ForgeRemoteID, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalRegistryFind provides a mock function with given fields: _a0 -func (_m *Store) GlobalRegistryFind(_a0 string) (*model.Registry, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryFind") - } - - var r0 *model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(string) (*model.Registry, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) *model.Registry); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalRegistryList provides a mock function with given fields: _a0 -func (_m *Store) GlobalRegistryList(_a0 *model.ListOptions) ([]*model.Registry, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryList") - } - - var r0 []*model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Registry, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.ListOptions) []*model.Registry); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(*model.ListOptions) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalSecretFind provides a mock function with given fields: _a0 -func (_m *Store) GlobalSecretFind(_a0 string) (*model.Secret, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretFind") - } - - var r0 *model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(string) (*model.Secret, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) *model.Secret); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalSecretList provides a mock function with given fields: _a0 -func (_m *Store) GlobalSecretList(_a0 *model.ListOptions) ([]*model.Secret, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretList") - } - - var r0 []*model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Secret, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.ListOptions) []*model.Secret); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(*model.ListOptions) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// HasRedirectionForRepo provides a mock function with given fields: _a0, _a1 -func (_m *Store) HasRedirectionForRepo(_a0 int64, _a1 string) (bool, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for HasRedirectionForRepo") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(int64, string) (bool, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, string) bool); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(int64, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// LogAppend provides a mock function with given fields: _a0, _a1 -func (_m *Store) LogAppend(_a0 *model.Step, _a1 []*model.LogEntry) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for LogAppend") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Step, []*model.LogEntry) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// LogDelete provides a mock function with given fields: _a0 -func (_m *Store) LogDelete(_a0 *model.Step) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for LogDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Step) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// LogFind provides a mock function with given fields: _a0 -func (_m *Store) LogFind(_a0 *model.Step) ([]*model.LogEntry, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for LogFind") - } - - var r0 []*model.LogEntry - var r1 error - if rf, ok := ret.Get(0).(func(*model.Step) ([]*model.LogEntry, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.Step) []*model.LogEntry); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.LogEntry) - } - } - - if rf, ok := ret.Get(1).(func(*model.Step) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Migrate provides a mock function with given fields: _a0, _a1 -func (_m *Store) Migrate(_a0 context.Context, _a1 bool) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for Migrate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, bool) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgCreate provides a mock function with given fields: _a0 -func (_m *Store) OrgCreate(_a0 *model.Org) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for OrgCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Org) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgDelete provides a mock function with given fields: _a0 -func (_m *Store) OrgDelete(_a0 int64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for OrgDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgFindByName provides a mock function with given fields: _a0, _a1 -func (_m *Store) OrgFindByName(_a0 string, _a1 int64) (*model.Org, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgFindByName") - } - - var r0 *model.Org - var r1 error - if rf, ok := ret.Get(0).(func(string, int64) (*model.Org, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(string, int64) *model.Org); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Org) - } - } - - if rf, ok := ret.Get(1).(func(string, int64) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgGet provides a mock function with given fields: _a0 -func (_m *Store) OrgGet(_a0 int64) (*model.Org, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for OrgGet") - } - - var r0 *model.Org - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*model.Org, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) *model.Org); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Org) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgList provides a mock function with given fields: _a0 -func (_m *Store) OrgList(_a0 *model.ListOptions) ([]*model.Org, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for OrgList") - } - - var r0 []*model.Org - var r1 error - if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Org, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.ListOptions) []*model.Org); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Org) - } - } - - if rf, ok := ret.Get(1).(func(*model.ListOptions) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgRegistryFind provides a mock function with given fields: _a0, _a1 -func (_m *Store) OrgRegistryFind(_a0 int64, _a1 string) (*model.Registry, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryFind") - } - - var r0 *model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, string) (*model.Registry, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, string) *model.Registry); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgRegistryList provides a mock function with given fields: _a0, _a1 -func (_m *Store) OrgRegistryList(_a0 int64, _a1 *model.ListOptions) ([]*model.Registry, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryList") - } - - var r0 []*model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Registry, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Registry); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgRepoList provides a mock function with given fields: _a0, _a1 -func (_m *Store) OrgRepoList(_a0 *model.Org, _a1 *model.ListOptions) ([]*model.Repo, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgRepoList") - } - - var r0 []*model.Repo - var r1 error - if rf, ok := ret.Get(0).(func(*model.Org, *model.ListOptions) ([]*model.Repo, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Org, *model.ListOptions) []*model.Repo); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(*model.Org, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgSecretFind provides a mock function with given fields: _a0, _a1 -func (_m *Store) OrgSecretFind(_a0 int64, _a1 string) (*model.Secret, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretFind") - } - - var r0 *model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, string) (*model.Secret, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, string) *model.Secret); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgSecretList provides a mock function with given fields: _a0, _a1 -func (_m *Store) OrgSecretList(_a0 int64, _a1 *model.ListOptions) ([]*model.Secret, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretList") - } - - var r0 []*model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Secret, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) []*model.Secret); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgUpdate provides a mock function with given fields: _a0 -func (_m *Store) OrgUpdate(_a0 *model.Org) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for OrgUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Org) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// PermFind provides a mock function with given fields: user, repo -func (_m *Store) PermFind(user *model.User, repo *model.Repo) (*model.Perm, error) { - ret := _m.Called(user, repo) - - if len(ret) == 0 { - panic("no return value specified for PermFind") - } - - var r0 *model.Perm - var r1 error - if rf, ok := ret.Get(0).(func(*model.User, *model.Repo) (*model.Perm, error)); ok { - return rf(user, repo) - } - if rf, ok := ret.Get(0).(func(*model.User, *model.Repo) *model.Perm); ok { - r0 = rf(user, repo) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Perm) - } - } - - if rf, ok := ret.Get(1).(func(*model.User, *model.Repo) error); ok { - r1 = rf(user, repo) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PermUpsert provides a mock function with given fields: perm -func (_m *Store) PermUpsert(perm *model.Perm) error { - ret := _m.Called(perm) - - if len(ret) == 0 { - panic("no return value specified for PermUpsert") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Perm) error); ok { - r0 = rf(perm) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Ping provides a mock function with no fields -func (_m *Store) Ping() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Ping") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// PipelineConfigCreate provides a mock function with given fields: _a0 -func (_m *Store) PipelineConfigCreate(_a0 *model.PipelineConfig) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for PipelineConfigCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.PipelineConfig) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RegistryCreate provides a mock function with given fields: _a0 -func (_m *Store) RegistryCreate(_a0 *model.Registry) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for RegistryCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Registry) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RegistryDelete provides a mock function with given fields: _a0 -func (_m *Store) RegistryDelete(_a0 *model.Registry) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for RegistryDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Registry) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RegistryFind provides a mock function with given fields: _a0, _a1 -func (_m *Store) RegistryFind(_a0 *model.Repo, _a1 string) (*model.Registry, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for RegistryFind") - } - - var r0 *model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Registry, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, string) *model.Registry); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryList provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Store) RegistryList(_a0 *model.Repo, _a1 bool, _a2 *model.ListOptions) ([]*model.Registry, error) { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for RegistryList") - } - - var r0 []*model.Registry - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, bool, *model.ListOptions) ([]*model.Registry, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(*model.Repo, bool, *model.ListOptions) []*model.Registry); ok { - r0 = rf(_a0, _a1, _a2) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, bool, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1, _a2) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryListAll provides a mock function with no fields -func (_m *Store) RegistryListAll() ([]*model.Registry, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for RegistryListAll") - } - - var r0 []*model.Registry - var r1 error - if rf, ok := ret.Get(0).(func() ([]*model.Registry, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []*model.Registry); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Registry) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryUpdate provides a mock function with given fields: _a0 -func (_m *Store) RegistryUpdate(_a0 *model.Registry) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for RegistryUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Registry) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RepoList provides a mock function with given fields: user, owned, active -func (_m *Store) RepoList(user *model.User, owned bool, active bool) ([]*model.Repo, error) { - ret := _m.Called(user, owned, active) - - if len(ret) == 0 { - panic("no return value specified for RepoList") - } - - var r0 []*model.Repo - var r1 error - if rf, ok := ret.Get(0).(func(*model.User, bool, bool) ([]*model.Repo, error)); ok { - return rf(user, owned, active) - } - if rf, ok := ret.Get(0).(func(*model.User, bool, bool) []*model.Repo); ok { - r0 = rf(user, owned, active) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(*model.User, bool, bool) error); ok { - r1 = rf(user, owned, active) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RepoListAll provides a mock function with given fields: active, p -func (_m *Store) RepoListAll(active bool, p *model.ListOptions) ([]*model.Repo, error) { - ret := _m.Called(active, p) - - if len(ret) == 0 { - panic("no return value specified for RepoListAll") - } - - var r0 []*model.Repo - var r1 error - if rf, ok := ret.Get(0).(func(bool, *model.ListOptions) ([]*model.Repo, error)); ok { - return rf(active, p) - } - if rf, ok := ret.Get(0).(func(bool, *model.ListOptions) []*model.Repo); ok { - r0 = rf(active, p) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Repo) - } - } - - if rf, ok := ret.Get(1).(func(bool, *model.ListOptions) error); ok { - r1 = rf(active, p) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RepoListLatest provides a mock function with given fields: _a0 -func (_m *Store) RepoListLatest(_a0 *model.User) ([]*model.Feed, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for RepoListLatest") - } - - var r0 []*model.Feed - var r1 error - if rf, ok := ret.Get(0).(func(*model.User) ([]*model.Feed, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.User) []*model.Feed); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Feed) - } - } - - if rf, ok := ret.Get(1).(func(*model.User) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretCreate provides a mock function with given fields: _a0 -func (_m *Store) SecretCreate(_a0 *model.Secret) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SecretCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Secret) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SecretDelete provides a mock function with given fields: _a0 -func (_m *Store) SecretDelete(_a0 *model.Secret) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SecretDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Secret) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SecretFind provides a mock function with given fields: _a0, _a1 -func (_m *Store) SecretFind(_a0 *model.Repo, _a1 string) (*model.Secret, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for SecretFind") - } - - var r0 *model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Secret, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Repo, string) *model.Secret); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretList provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Store) SecretList(_a0 *model.Repo, _a1 bool, _a2 *model.ListOptions) ([]*model.Secret, error) { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for SecretList") - } - - var r0 []*model.Secret - var r1 error - if rf, ok := ret.Get(0).(func(*model.Repo, bool, *model.ListOptions) ([]*model.Secret, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(*model.Repo, bool, *model.ListOptions) []*model.Secret); ok { - r0 = rf(_a0, _a1, _a2) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func(*model.Repo, bool, *model.ListOptions) error); ok { - r1 = rf(_a0, _a1, _a2) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretListAll provides a mock function with no fields -func (_m *Store) SecretListAll() ([]*model.Secret, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for SecretListAll") - } - - var r0 []*model.Secret - var r1 error - if rf, ok := ret.Get(0).(func() ([]*model.Secret, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []*model.Secret); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Secret) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretUpdate provides a mock function with given fields: _a0 -func (_m *Store) SecretUpdate(_a0 *model.Secret) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SecretUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Secret) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ServerConfigDelete provides a mock function with given fields: _a0 -func (_m *Store) ServerConfigDelete(_a0 string) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ServerConfigDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ServerConfigGet provides a mock function with given fields: _a0 -func (_m *Store) ServerConfigGet(_a0 string) (string, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ServerConfigGet") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(string) (string, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) string); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ServerConfigSet provides a mock function with given fields: _a0, _a1 -func (_m *Store) ServerConfigSet(_a0 string, _a1 string) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for ServerConfigSet") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string, string) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// StepByUUID provides a mock function with given fields: _a0 -func (_m *Store) StepByUUID(_a0 string) (*model.Step, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StepByUUID") - } - - var r0 *model.Step - var r1 error - if rf, ok := ret.Get(0).(func(string) (*model.Step, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) *model.Step); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Step) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StepChild provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Store) StepChild(_a0 *model.Pipeline, _a1 int, _a2 string) (*model.Step, error) { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for StepChild") - } - - var r0 *model.Step - var r1 error - if rf, ok := ret.Get(0).(func(*model.Pipeline, int, string) (*model.Step, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(*model.Pipeline, int, string) *model.Step); ok { - r0 = rf(_a0, _a1, _a2) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Step) - } - } - - if rf, ok := ret.Get(1).(func(*model.Pipeline, int, string) error); ok { - r1 = rf(_a0, _a1, _a2) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StepFind provides a mock function with given fields: _a0, _a1 -func (_m *Store) StepFind(_a0 *model.Pipeline, _a1 int) (*model.Step, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for StepFind") - } - - var r0 *model.Step - var r1 error - if rf, ok := ret.Get(0).(func(*model.Pipeline, int) (*model.Step, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(*model.Pipeline, int) *model.Step); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Step) - } - } - - if rf, ok := ret.Get(1).(func(*model.Pipeline, int) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StepList provides a mock function with given fields: _a0 -func (_m *Store) StepList(_a0 *model.Pipeline) ([]*model.Step, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StepList") - } - - var r0 []*model.Step - var r1 error - if rf, ok := ret.Get(0).(func(*model.Pipeline) ([]*model.Step, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.Pipeline) []*model.Step); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Step) - } - } - - if rf, ok := ret.Get(1).(func(*model.Pipeline) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StepListFromWorkflowFind provides a mock function with given fields: _a0 -func (_m *Store) StepListFromWorkflowFind(_a0 *model.Workflow) ([]*model.Step, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StepListFromWorkflowFind") - } - - var r0 []*model.Step - var r1 error - if rf, ok := ret.Get(0).(func(*model.Workflow) ([]*model.Step, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.Workflow) []*model.Step); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Step) - } - } - - if rf, ok := ret.Get(1).(func(*model.Workflow) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StepLoad provides a mock function with given fields: _a0 -func (_m *Store) StepLoad(_a0 int64) (*model.Step, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StepLoad") - } - - var r0 *model.Step - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*model.Step, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) *model.Step); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Step) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StepUpdate provides a mock function with given fields: _a0 -func (_m *Store) StepUpdate(_a0 *model.Step) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StepUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Step) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TaskDelete provides a mock function with given fields: _a0 -func (_m *Store) TaskDelete(_a0 string) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for TaskDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TaskInsert provides a mock function with given fields: _a0 -func (_m *Store) TaskInsert(_a0 *model.Task) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for TaskInsert") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Task) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TaskList provides a mock function with no fields -func (_m *Store) TaskList() ([]*model.Task, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for TaskList") - } - - var r0 []*model.Task - var r1 error - if rf, ok := ret.Get(0).(func() ([]*model.Task, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []*model.Task); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Task) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UpdatePipeline provides a mock function with given fields: _a0 -func (_m *Store) UpdatePipeline(_a0 *model.Pipeline) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UpdatePipeline") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Pipeline) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UpdateRepo provides a mock function with given fields: _a0 -func (_m *Store) UpdateRepo(_a0 *model.Repo) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UpdateRepo") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Repo) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UpdateUser provides a mock function with given fields: _a0 -func (_m *Store) UpdateUser(_a0 *model.User) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UpdateUser") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.User) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UserFeed provides a mock function with given fields: _a0 -func (_m *Store) UserFeed(_a0 *model.User) ([]*model.Feed, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UserFeed") - } - - var r0 []*model.Feed - var r1 error - if rf, ok := ret.Get(0).(func(*model.User) ([]*model.Feed, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.User) []*model.Feed); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Feed) - } - } - - if rf, ok := ret.Get(1).(func(*model.User) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// WorkflowGetTree provides a mock function with given fields: _a0 -func (_m *Store) WorkflowGetTree(_a0 *model.Pipeline) ([]*model.Workflow, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for WorkflowGetTree") - } - - var r0 []*model.Workflow - var r1 error - if rf, ok := ret.Get(0).(func(*model.Pipeline) ([]*model.Workflow, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*model.Pipeline) []*model.Workflow); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*model.Workflow) - } - } - - if rf, ok := ret.Get(1).(func(*model.Pipeline) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// WorkflowLoad provides a mock function with given fields: _a0 -func (_m *Store) WorkflowLoad(_a0 int64) (*model.Workflow, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for WorkflowLoad") - } - - var r0 *model.Workflow - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*model.Workflow, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) *model.Workflow); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.Workflow) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// WorkflowUpdate provides a mock function with given fields: _a0 -func (_m *Store) WorkflowUpdate(_a0 *model.Workflow) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for WorkflowUpdate") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Workflow) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WorkflowsCreate provides a mock function with given fields: _a0 -func (_m *Store) WorkflowsCreate(_a0 []*model.Workflow) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for WorkflowsCreate") - } - - var r0 error - if rf, ok := ret.Get(0).(func([]*model.Workflow) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WorkflowsReplace provides a mock function with given fields: _a0, _a1 -func (_m *Store) WorkflowsReplace(_a0 *model.Pipeline, _a1 []*model.Workflow) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for WorkflowsReplace") - } - - var r0 error - if rf, ok := ret.Get(0).(func(*model.Pipeline, []*model.Workflow) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewStore creates a new instance of Store. 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 NewStore(t interface { - mock.TestingT - Cleanup(func()) -}) *Store { - mock := &Store{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/server/store/store.go b/server/store/store.go index 98fe07d1c..b848b4bf6 100644 --- a/server/store/store.go +++ b/server/store/store.go @@ -14,8 +14,6 @@ package store -//go:generate mockery --name Store --output mocks --case underscore --note "+build test" - import ( "context" diff --git a/woodpecker-go/woodpecker/interface.go b/woodpecker-go/woodpecker/interface.go index cad1c460c..abbfe647a 100644 --- a/woodpecker-go/woodpecker/interface.go +++ b/woodpecker-go/woodpecker/interface.go @@ -18,8 +18,6 @@ import ( "net/http" ) -//go:generate mockery --name Client --output mocks --case underscore --note "+build test" - // Client is used to communicate with a Woodpecker server. type Client interface { // SetClient sets the http.Client. diff --git a/woodpecker-go/woodpecker/mocks/client.go b/woodpecker-go/woodpecker/mocks/client.go deleted file mode 100644 index d94b4500b..000000000 --- a/woodpecker-go/woodpecker/mocks/client.go +++ /dev/null @@ -1,2160 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -//go:build test -// +build test - -package mocks - -import ( - http "net/http" - - mock "github.com/stretchr/testify/mock" - woodpecker "go.woodpecker-ci.org/woodpecker/v3/woodpecker-go/woodpecker" -) - -// Client is an autogenerated mock type for the Client type -type Client struct { - mock.Mock -} - -// Agent provides a mock function with given fields: _a0 -func (_m *Client) Agent(_a0 int64) (*woodpecker.Agent, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Agent") - } - - var r0 *woodpecker.Agent - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*woodpecker.Agent, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) *woodpecker.Agent); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Agent) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentCreate provides a mock function with given fields: _a0 -func (_m *Client) AgentCreate(_a0 *woodpecker.Agent) (*woodpecker.Agent, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AgentCreate") - } - - var r0 *woodpecker.Agent - var r1 error - if rf, ok := ret.Get(0).(func(*woodpecker.Agent) (*woodpecker.Agent, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*woodpecker.Agent) *woodpecker.Agent); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Agent) - } - } - - if rf, ok := ret.Get(1).(func(*woodpecker.Agent) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentDelete provides a mock function with given fields: _a0 -func (_m *Client) AgentDelete(_a0 int64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AgentDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// AgentList provides a mock function with no fields -func (_m *Client) AgentList() ([]*woodpecker.Agent, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for AgentList") - } - - var r0 []*woodpecker.Agent - var r1 error - if rf, ok := ret.Get(0).(func() ([]*woodpecker.Agent, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []*woodpecker.Agent); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Agent) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentTasksList provides a mock function with given fields: _a0 -func (_m *Client) AgentTasksList(_a0 int64) ([]*woodpecker.Task, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AgentTasksList") - } - - var r0 []*woodpecker.Task - var r1 error - if rf, ok := ret.Get(0).(func(int64) ([]*woodpecker.Task, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(int64) []*woodpecker.Task); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Task) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgentUpdate provides a mock function with given fields: _a0 -func (_m *Client) AgentUpdate(_a0 *woodpecker.Agent) (*woodpecker.Agent, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AgentUpdate") - } - - var r0 *woodpecker.Agent - var r1 error - if rf, ok := ret.Get(0).(func(*woodpecker.Agent) (*woodpecker.Agent, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*woodpecker.Agent) *woodpecker.Agent); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Agent) - } - } - - if rf, ok := ret.Get(1).(func(*woodpecker.Agent) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CronCreate provides a mock function with given fields: repoID, cron -func (_m *Client) CronCreate(repoID int64, cron *woodpecker.Cron) (*woodpecker.Cron, error) { - ret := _m.Called(repoID, cron) - - if len(ret) == 0 { - panic("no return value specified for CronCreate") - } - - var r0 *woodpecker.Cron - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Cron) (*woodpecker.Cron, error)); ok { - return rf(repoID, cron) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Cron) *woodpecker.Cron); ok { - r0 = rf(repoID, cron) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Cron) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Cron) error); ok { - r1 = rf(repoID, cron) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CronDelete provides a mock function with given fields: repoID, cronID -func (_m *Client) CronDelete(repoID int64, cronID int64) error { - ret := _m.Called(repoID, cronID) - - if len(ret) == 0 { - panic("no return value specified for CronDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, int64) error); ok { - r0 = rf(repoID, cronID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// CronGet provides a mock function with given fields: repoID, cronID -func (_m *Client) CronGet(repoID int64, cronID int64) (*woodpecker.Cron, error) { - ret := _m.Called(repoID, cronID) - - if len(ret) == 0 { - panic("no return value specified for CronGet") - } - - var r0 *woodpecker.Cron - var r1 error - if rf, ok := ret.Get(0).(func(int64, int64) (*woodpecker.Cron, error)); ok { - return rf(repoID, cronID) - } - if rf, ok := ret.Get(0).(func(int64, int64) *woodpecker.Cron); ok { - r0 = rf(repoID, cronID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Cron) - } - } - - if rf, ok := ret.Get(1).(func(int64, int64) error); ok { - r1 = rf(repoID, cronID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CronList provides a mock function with given fields: repoID, opt -func (_m *Client) CronList(repoID int64, opt woodpecker.CronListOptions) ([]*woodpecker.Cron, error) { - ret := _m.Called(repoID, opt) - - if len(ret) == 0 { - panic("no return value specified for CronList") - } - - var r0 []*woodpecker.Cron - var r1 error - if rf, ok := ret.Get(0).(func(int64, woodpecker.CronListOptions) ([]*woodpecker.Cron, error)); ok { - return rf(repoID, opt) - } - if rf, ok := ret.Get(0).(func(int64, woodpecker.CronListOptions) []*woodpecker.Cron); ok { - r0 = rf(repoID, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Cron) - } - } - - if rf, ok := ret.Get(1).(func(int64, woodpecker.CronListOptions) error); ok { - r1 = rf(repoID, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CronUpdate provides a mock function with given fields: repoID, cron -func (_m *Client) CronUpdate(repoID int64, cron *woodpecker.Cron) (*woodpecker.Cron, error) { - ret := _m.Called(repoID, cron) - - if len(ret) == 0 { - panic("no return value specified for CronUpdate") - } - - var r0 *woodpecker.Cron - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Cron) (*woodpecker.Cron, error)); ok { - return rf(repoID, cron) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Cron) *woodpecker.Cron); ok { - r0 = rf(repoID, cron) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Cron) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Cron) error); ok { - r1 = rf(repoID, cron) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Deploy provides a mock function with given fields: repoID, pipeline, opt -func (_m *Client) Deploy(repoID int64, pipeline int64, opt woodpecker.DeployOptions) (*woodpecker.Pipeline, error) { - ret := _m.Called(repoID, pipeline, opt) - - if len(ret) == 0 { - panic("no return value specified for Deploy") - } - - var r0 *woodpecker.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(int64, int64, woodpecker.DeployOptions) (*woodpecker.Pipeline, error)); ok { - return rf(repoID, pipeline, opt) - } - if rf, ok := ret.Get(0).(func(int64, int64, woodpecker.DeployOptions) *woodpecker.Pipeline); ok { - r0 = rf(repoID, pipeline, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(int64, int64, woodpecker.DeployOptions) error); ok { - r1 = rf(repoID, pipeline, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalRegistry provides a mock function with given fields: registry -func (_m *Client) GlobalRegistry(registry string) (*woodpecker.Registry, error) { - ret := _m.Called(registry) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistry") - } - - var r0 *woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(string) (*woodpecker.Registry, error)); ok { - return rf(registry) - } - if rf, ok := ret.Get(0).(func(string) *woodpecker.Registry); ok { - r0 = rf(registry) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(registry) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalRegistryCreate provides a mock function with given fields: registry -func (_m *Client) GlobalRegistryCreate(registry *woodpecker.Registry) (*woodpecker.Registry, error) { - ret := _m.Called(registry) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryCreate") - } - - var r0 *woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(*woodpecker.Registry) (*woodpecker.Registry, error)); ok { - return rf(registry) - } - if rf, ok := ret.Get(0).(func(*woodpecker.Registry) *woodpecker.Registry); ok { - r0 = rf(registry) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(*woodpecker.Registry) error); ok { - r1 = rf(registry) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalRegistryDelete provides a mock function with given fields: registry -func (_m *Client) GlobalRegistryDelete(registry string) error { - ret := _m.Called(registry) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(registry) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GlobalRegistryList provides a mock function with given fields: opt -func (_m *Client) GlobalRegistryList(opt woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error) { - ret := _m.Called(opt) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryList") - } - - var r0 []*woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error)); ok { - return rf(opt) - } - if rf, ok := ret.Get(0).(func(woodpecker.RegistryListOptions) []*woodpecker.Registry); ok { - r0 = rf(opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(woodpecker.RegistryListOptions) error); ok { - r1 = rf(opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalRegistryUpdate provides a mock function with given fields: registry -func (_m *Client) GlobalRegistryUpdate(registry *woodpecker.Registry) (*woodpecker.Registry, error) { - ret := _m.Called(registry) - - if len(ret) == 0 { - panic("no return value specified for GlobalRegistryUpdate") - } - - var r0 *woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(*woodpecker.Registry) (*woodpecker.Registry, error)); ok { - return rf(registry) - } - if rf, ok := ret.Get(0).(func(*woodpecker.Registry) *woodpecker.Registry); ok { - r0 = rf(registry) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(*woodpecker.Registry) error); ok { - r1 = rf(registry) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalSecret provides a mock function with given fields: secret -func (_m *Client) GlobalSecret(secret string) (*woodpecker.Secret, error) { - ret := _m.Called(secret) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecret") - } - - var r0 *woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(string) (*woodpecker.Secret, error)); ok { - return rf(secret) - } - if rf, ok := ret.Get(0).(func(string) *woodpecker.Secret); ok { - r0 = rf(secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalSecretCreate provides a mock function with given fields: secret -func (_m *Client) GlobalSecretCreate(secret *woodpecker.Secret) (*woodpecker.Secret, error) { - ret := _m.Called(secret) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretCreate") - } - - var r0 *woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(*woodpecker.Secret) (*woodpecker.Secret, error)); ok { - return rf(secret) - } - if rf, ok := ret.Get(0).(func(*woodpecker.Secret) *woodpecker.Secret); ok { - r0 = rf(secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(*woodpecker.Secret) error); ok { - r1 = rf(secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalSecretDelete provides a mock function with given fields: secret -func (_m *Client) GlobalSecretDelete(secret string) error { - ret := _m.Called(secret) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(secret) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// GlobalSecretList provides a mock function with given fields: opt -func (_m *Client) GlobalSecretList(opt woodpecker.SecretListOptions) ([]*woodpecker.Secret, error) { - ret := _m.Called(opt) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretList") - } - - var r0 []*woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(woodpecker.SecretListOptions) ([]*woodpecker.Secret, error)); ok { - return rf(opt) - } - if rf, ok := ret.Get(0).(func(woodpecker.SecretListOptions) []*woodpecker.Secret); ok { - r0 = rf(opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(woodpecker.SecretListOptions) error); ok { - r1 = rf(opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GlobalSecretUpdate provides a mock function with given fields: secret -func (_m *Client) GlobalSecretUpdate(secret *woodpecker.Secret) (*woodpecker.Secret, error) { - ret := _m.Called(secret) - - if len(ret) == 0 { - panic("no return value specified for GlobalSecretUpdate") - } - - var r0 *woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(*woodpecker.Secret) (*woodpecker.Secret, error)); ok { - return rf(secret) - } - if rf, ok := ret.Get(0).(func(*woodpecker.Secret) *woodpecker.Secret); ok { - r0 = rf(secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(*woodpecker.Secret) error); ok { - r1 = rf(secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// LogLevel provides a mock function with no fields -func (_m *Client) LogLevel() (*woodpecker.LogLevel, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for LogLevel") - } - - var r0 *woodpecker.LogLevel - var r1 error - if rf, ok := ret.Get(0).(func() (*woodpecker.LogLevel, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() *woodpecker.LogLevel); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.LogLevel) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// LogsPurge provides a mock function with given fields: repoID, pipeline -func (_m *Client) LogsPurge(repoID int64, pipeline int64) error { - ret := _m.Called(repoID, pipeline) - - if len(ret) == 0 { - panic("no return value specified for LogsPurge") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, int64) error); ok { - r0 = rf(repoID, pipeline) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Org provides a mock function with given fields: orgID -func (_m *Client) Org(orgID int64) (*woodpecker.Org, error) { - ret := _m.Called(orgID) - - if len(ret) == 0 { - panic("no return value specified for Org") - } - - var r0 *woodpecker.Org - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*woodpecker.Org, error)); ok { - return rf(orgID) - } - if rf, ok := ret.Get(0).(func(int64) *woodpecker.Org); ok { - r0 = rf(orgID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Org) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(orgID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgList provides a mock function with given fields: opt -func (_m *Client) OrgList(opt woodpecker.ListOptions) ([]*woodpecker.Org, error) { - ret := _m.Called(opt) - - if len(ret) == 0 { - panic("no return value specified for OrgList") - } - - var r0 []*woodpecker.Org - var r1 error - if rf, ok := ret.Get(0).(func(woodpecker.ListOptions) ([]*woodpecker.Org, error)); ok { - return rf(opt) - } - if rf, ok := ret.Get(0).(func(woodpecker.ListOptions) []*woodpecker.Org); ok { - r0 = rf(opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Org) - } - } - - if rf, ok := ret.Get(1).(func(woodpecker.ListOptions) error); ok { - r1 = rf(opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgLookup provides a mock function with given fields: orgName -func (_m *Client) OrgLookup(orgName string) (*woodpecker.Org, error) { - ret := _m.Called(orgName) - - if len(ret) == 0 { - panic("no return value specified for OrgLookup") - } - - var r0 *woodpecker.Org - var r1 error - if rf, ok := ret.Get(0).(func(string) (*woodpecker.Org, error)); ok { - return rf(orgName) - } - if rf, ok := ret.Get(0).(func(string) *woodpecker.Org); ok { - r0 = rf(orgName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Org) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(orgName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgRegistry provides a mock function with given fields: orgID, registry -func (_m *Client) OrgRegistry(orgID int64, registry string) (*woodpecker.Registry, error) { - ret := _m.Called(orgID, registry) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistry") - } - - var r0 *woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, string) (*woodpecker.Registry, error)); ok { - return rf(orgID, registry) - } - if rf, ok := ret.Get(0).(func(int64, string) *woodpecker.Registry); ok { - r0 = rf(orgID, registry) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, string) error); ok { - r1 = rf(orgID, registry) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgRegistryCreate provides a mock function with given fields: orgID, registry -func (_m *Client) OrgRegistryCreate(orgID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error) { - ret := _m.Called(orgID, registry) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryCreate") - } - - var r0 *woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Registry) (*woodpecker.Registry, error)); ok { - return rf(orgID, registry) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Registry) *woodpecker.Registry); ok { - r0 = rf(orgID, registry) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Registry) error); ok { - r1 = rf(orgID, registry) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgRegistryDelete provides a mock function with given fields: orgID, registry -func (_m *Client) OrgRegistryDelete(orgID int64, registry string) error { - ret := _m.Called(orgID, registry) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, string) error); ok { - r0 = rf(orgID, registry) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgRegistryList provides a mock function with given fields: orgID, opt -func (_m *Client) OrgRegistryList(orgID int64, opt woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error) { - ret := _m.Called(orgID, opt) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryList") - } - - var r0 []*woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error)); ok { - return rf(orgID, opt) - } - if rf, ok := ret.Get(0).(func(int64, woodpecker.RegistryListOptions) []*woodpecker.Registry); ok { - r0 = rf(orgID, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, woodpecker.RegistryListOptions) error); ok { - r1 = rf(orgID, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgRegistryUpdate provides a mock function with given fields: orgID, registry -func (_m *Client) OrgRegistryUpdate(orgID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error) { - ret := _m.Called(orgID, registry) - - if len(ret) == 0 { - panic("no return value specified for OrgRegistryUpdate") - } - - var r0 *woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Registry) (*woodpecker.Registry, error)); ok { - return rf(orgID, registry) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Registry) *woodpecker.Registry); ok { - r0 = rf(orgID, registry) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Registry) error); ok { - r1 = rf(orgID, registry) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgSecret provides a mock function with given fields: orgID, secret -func (_m *Client) OrgSecret(orgID int64, secret string) (*woodpecker.Secret, error) { - ret := _m.Called(orgID, secret) - - if len(ret) == 0 { - panic("no return value specified for OrgSecret") - } - - var r0 *woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, string) (*woodpecker.Secret, error)); ok { - return rf(orgID, secret) - } - if rf, ok := ret.Get(0).(func(int64, string) *woodpecker.Secret); ok { - r0 = rf(orgID, secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, string) error); ok { - r1 = rf(orgID, secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgSecretCreate provides a mock function with given fields: orgID, secret -func (_m *Client) OrgSecretCreate(orgID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error) { - ret := _m.Called(orgID, secret) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretCreate") - } - - var r0 *woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Secret) (*woodpecker.Secret, error)); ok { - return rf(orgID, secret) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Secret) *woodpecker.Secret); ok { - r0 = rf(orgID, secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Secret) error); ok { - r1 = rf(orgID, secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgSecretDelete provides a mock function with given fields: orgID, secret -func (_m *Client) OrgSecretDelete(orgID int64, secret string) error { - ret := _m.Called(orgID, secret) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, string) error); ok { - r0 = rf(orgID, secret) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// OrgSecretList provides a mock function with given fields: orgID, opt -func (_m *Client) OrgSecretList(orgID int64, opt woodpecker.SecretListOptions) ([]*woodpecker.Secret, error) { - ret := _m.Called(orgID, opt) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretList") - } - - var r0 []*woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, woodpecker.SecretListOptions) ([]*woodpecker.Secret, error)); ok { - return rf(orgID, opt) - } - if rf, ok := ret.Get(0).(func(int64, woodpecker.SecretListOptions) []*woodpecker.Secret); ok { - r0 = rf(orgID, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, woodpecker.SecretListOptions) error); ok { - r1 = rf(orgID, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OrgSecretUpdate provides a mock function with given fields: orgID, secret -func (_m *Client) OrgSecretUpdate(orgID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error) { - ret := _m.Called(orgID, secret) - - if len(ret) == 0 { - panic("no return value specified for OrgSecretUpdate") - } - - var r0 *woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Secret) (*woodpecker.Secret, error)); ok { - return rf(orgID, secret) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Secret) *woodpecker.Secret); ok { - r0 = rf(orgID, secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Secret) error); ok { - r1 = rf(orgID, secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Pipeline provides a mock function with given fields: repoID, pipeline -func (_m *Client) Pipeline(repoID int64, pipeline int64) (*woodpecker.Pipeline, error) { - ret := _m.Called(repoID, pipeline) - - if len(ret) == 0 { - panic("no return value specified for Pipeline") - } - - var r0 *woodpecker.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(int64, int64) (*woodpecker.Pipeline, error)); ok { - return rf(repoID, pipeline) - } - if rf, ok := ret.Get(0).(func(int64, int64) *woodpecker.Pipeline); ok { - r0 = rf(repoID, pipeline) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(int64, int64) error); ok { - r1 = rf(repoID, pipeline) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PipelineApprove provides a mock function with given fields: repoID, pipeline -func (_m *Client) PipelineApprove(repoID int64, pipeline int64) (*woodpecker.Pipeline, error) { - ret := _m.Called(repoID, pipeline) - - if len(ret) == 0 { - panic("no return value specified for PipelineApprove") - } - - var r0 *woodpecker.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(int64, int64) (*woodpecker.Pipeline, error)); ok { - return rf(repoID, pipeline) - } - if rf, ok := ret.Get(0).(func(int64, int64) *woodpecker.Pipeline); ok { - r0 = rf(repoID, pipeline) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(int64, int64) error); ok { - r1 = rf(repoID, pipeline) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PipelineCreate provides a mock function with given fields: repoID, opts -func (_m *Client) PipelineCreate(repoID int64, opts *woodpecker.PipelineOptions) (*woodpecker.Pipeline, error) { - ret := _m.Called(repoID, opts) - - if len(ret) == 0 { - panic("no return value specified for PipelineCreate") - } - - var r0 *woodpecker.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.PipelineOptions) (*woodpecker.Pipeline, error)); ok { - return rf(repoID, opts) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.PipelineOptions) *woodpecker.Pipeline); ok { - r0 = rf(repoID, opts) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.PipelineOptions) error); ok { - r1 = rf(repoID, opts) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PipelineDecline provides a mock function with given fields: repoID, pipeline -func (_m *Client) PipelineDecline(repoID int64, pipeline int64) (*woodpecker.Pipeline, error) { - ret := _m.Called(repoID, pipeline) - - if len(ret) == 0 { - panic("no return value specified for PipelineDecline") - } - - var r0 *woodpecker.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(int64, int64) (*woodpecker.Pipeline, error)); ok { - return rf(repoID, pipeline) - } - if rf, ok := ret.Get(0).(func(int64, int64) *woodpecker.Pipeline); ok { - r0 = rf(repoID, pipeline) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(int64, int64) error); ok { - r1 = rf(repoID, pipeline) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PipelineDelete provides a mock function with given fields: repoID, pipeline -func (_m *Client) PipelineDelete(repoID int64, pipeline int64) error { - ret := _m.Called(repoID, pipeline) - - if len(ret) == 0 { - panic("no return value specified for PipelineDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, int64) error); ok { - r0 = rf(repoID, pipeline) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// PipelineLast provides a mock function with given fields: repoID, opt -func (_m *Client) PipelineLast(repoID int64, opt woodpecker.PipelineLastOptions) (*woodpecker.Pipeline, error) { - ret := _m.Called(repoID, opt) - - if len(ret) == 0 { - panic("no return value specified for PipelineLast") - } - - var r0 *woodpecker.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(int64, woodpecker.PipelineLastOptions) (*woodpecker.Pipeline, error)); ok { - return rf(repoID, opt) - } - if rf, ok := ret.Get(0).(func(int64, woodpecker.PipelineLastOptions) *woodpecker.Pipeline); ok { - r0 = rf(repoID, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(int64, woodpecker.PipelineLastOptions) error); ok { - r1 = rf(repoID, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PipelineList provides a mock function with given fields: repoID, opt -func (_m *Client) PipelineList(repoID int64, opt woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error) { - ret := _m.Called(repoID, opt) - - if len(ret) == 0 { - panic("no return value specified for PipelineList") - } - - var r0 []*woodpecker.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(int64, woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error)); ok { - return rf(repoID, opt) - } - if rf, ok := ret.Get(0).(func(int64, woodpecker.PipelineListOptions) []*woodpecker.Pipeline); ok { - r0 = rf(repoID, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(int64, woodpecker.PipelineListOptions) error); ok { - r1 = rf(repoID, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PipelineMetadata provides a mock function with given fields: repoID, pipelineNumber -func (_m *Client) PipelineMetadata(repoID int64, pipelineNumber int) ([]byte, error) { - ret := _m.Called(repoID, pipelineNumber) - - if len(ret) == 0 { - panic("no return value specified for PipelineMetadata") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func(int64, int) ([]byte, error)); ok { - return rf(repoID, pipelineNumber) - } - if rf, ok := ret.Get(0).(func(int64, int) []byte); ok { - r0 = rf(repoID, pipelineNumber) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func(int64, int) error); ok { - r1 = rf(repoID, pipelineNumber) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PipelineQueue provides a mock function with no fields -func (_m *Client) PipelineQueue() ([]*woodpecker.Feed, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for PipelineQueue") - } - - var r0 []*woodpecker.Feed - var r1 error - if rf, ok := ret.Get(0).(func() ([]*woodpecker.Feed, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []*woodpecker.Feed); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Feed) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PipelineStart provides a mock function with given fields: repoID, num, opt -func (_m *Client) PipelineStart(repoID int64, num int64, opt woodpecker.PipelineStartOptions) (*woodpecker.Pipeline, error) { - ret := _m.Called(repoID, num, opt) - - if len(ret) == 0 { - panic("no return value specified for PipelineStart") - } - - var r0 *woodpecker.Pipeline - var r1 error - if rf, ok := ret.Get(0).(func(int64, int64, woodpecker.PipelineStartOptions) (*woodpecker.Pipeline, error)); ok { - return rf(repoID, num, opt) - } - if rf, ok := ret.Get(0).(func(int64, int64, woodpecker.PipelineStartOptions) *woodpecker.Pipeline); ok { - r0 = rf(repoID, num, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Pipeline) - } - } - - if rf, ok := ret.Get(1).(func(int64, int64, woodpecker.PipelineStartOptions) error); ok { - r1 = rf(repoID, num, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// PipelineStop provides a mock function with given fields: repoID, pipeline -func (_m *Client) PipelineStop(repoID int64, pipeline int64) error { - ret := _m.Called(repoID, pipeline) - - if len(ret) == 0 { - panic("no return value specified for PipelineStop") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, int64) error); ok { - r0 = rf(repoID, pipeline) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// QueueInfo provides a mock function with no fields -func (_m *Client) QueueInfo() (*woodpecker.Info, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for QueueInfo") - } - - var r0 *woodpecker.Info - var r1 error - if rf, ok := ret.Get(0).(func() (*woodpecker.Info, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() *woodpecker.Info); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Info) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Registry provides a mock function with given fields: repoID, hostname -func (_m *Client) Registry(repoID int64, hostname string) (*woodpecker.Registry, error) { - ret := _m.Called(repoID, hostname) - - if len(ret) == 0 { - panic("no return value specified for Registry") - } - - var r0 *woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, string) (*woodpecker.Registry, error)); ok { - return rf(repoID, hostname) - } - if rf, ok := ret.Get(0).(func(int64, string) *woodpecker.Registry); ok { - r0 = rf(repoID, hostname) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, string) error); ok { - r1 = rf(repoID, hostname) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryCreate provides a mock function with given fields: repoID, registry -func (_m *Client) RegistryCreate(repoID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error) { - ret := _m.Called(repoID, registry) - - if len(ret) == 0 { - panic("no return value specified for RegistryCreate") - } - - var r0 *woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Registry) (*woodpecker.Registry, error)); ok { - return rf(repoID, registry) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Registry) *woodpecker.Registry); ok { - r0 = rf(repoID, registry) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Registry) error); ok { - r1 = rf(repoID, registry) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryDelete provides a mock function with given fields: repoID, hostname -func (_m *Client) RegistryDelete(repoID int64, hostname string) error { - ret := _m.Called(repoID, hostname) - - if len(ret) == 0 { - panic("no return value specified for RegistryDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, string) error); ok { - r0 = rf(repoID, hostname) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RegistryList provides a mock function with given fields: repoID, opt -func (_m *Client) RegistryList(repoID int64, opt woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error) { - ret := _m.Called(repoID, opt) - - if len(ret) == 0 { - panic("no return value specified for RegistryList") - } - - var r0 []*woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error)); ok { - return rf(repoID, opt) - } - if rf, ok := ret.Get(0).(func(int64, woodpecker.RegistryListOptions) []*woodpecker.Registry); ok { - r0 = rf(repoID, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, woodpecker.RegistryListOptions) error); ok { - r1 = rf(repoID, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RegistryUpdate provides a mock function with given fields: repoID, registry -func (_m *Client) RegistryUpdate(repoID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error) { - ret := _m.Called(repoID, registry) - - if len(ret) == 0 { - panic("no return value specified for RegistryUpdate") - } - - var r0 *woodpecker.Registry - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Registry) (*woodpecker.Registry, error)); ok { - return rf(repoID, registry) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Registry) *woodpecker.Registry); ok { - r0 = rf(repoID, registry) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Registry) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Registry) error); ok { - r1 = rf(repoID, registry) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Repo provides a mock function with given fields: repoID -func (_m *Client) Repo(repoID int64) (*woodpecker.Repo, error) { - ret := _m.Called(repoID) - - if len(ret) == 0 { - panic("no return value specified for Repo") - } - - var r0 *woodpecker.Repo - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*woodpecker.Repo, error)); ok { - return rf(repoID) - } - if rf, ok := ret.Get(0).(func(int64) *woodpecker.Repo); ok { - r0 = rf(repoID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Repo) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(repoID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RepoChown provides a mock function with given fields: repoID -func (_m *Client) RepoChown(repoID int64) (*woodpecker.Repo, error) { - ret := _m.Called(repoID) - - if len(ret) == 0 { - panic("no return value specified for RepoChown") - } - - var r0 *woodpecker.Repo - var r1 error - if rf, ok := ret.Get(0).(func(int64) (*woodpecker.Repo, error)); ok { - return rf(repoID) - } - if rf, ok := ret.Get(0).(func(int64) *woodpecker.Repo); ok { - r0 = rf(repoID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Repo) - } - } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(repoID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RepoDel provides a mock function with given fields: repoID -func (_m *Client) RepoDel(repoID int64) error { - ret := _m.Called(repoID) - - if len(ret) == 0 { - panic("no return value specified for RepoDel") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64) error); ok { - r0 = rf(repoID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RepoList provides a mock function with given fields: opt -func (_m *Client) RepoList(opt woodpecker.RepoListOptions) ([]*woodpecker.Repo, error) { - ret := _m.Called(opt) - - if len(ret) == 0 { - panic("no return value specified for RepoList") - } - - var r0 []*woodpecker.Repo - var r1 error - if rf, ok := ret.Get(0).(func(woodpecker.RepoListOptions) ([]*woodpecker.Repo, error)); ok { - return rf(opt) - } - if rf, ok := ret.Get(0).(func(woodpecker.RepoListOptions) []*woodpecker.Repo); ok { - r0 = rf(opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Repo) - } - } - - if rf, ok := ret.Get(1).(func(woodpecker.RepoListOptions) error); ok { - r1 = rf(opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RepoLookup provides a mock function with given fields: repoFullName -func (_m *Client) RepoLookup(repoFullName string) (*woodpecker.Repo, error) { - ret := _m.Called(repoFullName) - - if len(ret) == 0 { - panic("no return value specified for RepoLookup") - } - - var r0 *woodpecker.Repo - var r1 error - if rf, ok := ret.Get(0).(func(string) (*woodpecker.Repo, error)); ok { - return rf(repoFullName) - } - if rf, ok := ret.Get(0).(func(string) *woodpecker.Repo); ok { - r0 = rf(repoFullName) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Repo) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(repoFullName) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RepoMove provides a mock function with given fields: repoID, opt -func (_m *Client) RepoMove(repoID int64, opt woodpecker.RepoMoveOptions) error { - ret := _m.Called(repoID, opt) - - if len(ret) == 0 { - panic("no return value specified for RepoMove") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, woodpecker.RepoMoveOptions) error); ok { - r0 = rf(repoID, opt) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// RepoPatch provides a mock function with given fields: repoID, repo -func (_m *Client) RepoPatch(repoID int64, repo *woodpecker.RepoPatch) (*woodpecker.Repo, error) { - ret := _m.Called(repoID, repo) - - if len(ret) == 0 { - panic("no return value specified for RepoPatch") - } - - var r0 *woodpecker.Repo - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.RepoPatch) (*woodpecker.Repo, error)); ok { - return rf(repoID, repo) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.RepoPatch) *woodpecker.Repo); ok { - r0 = rf(repoID, repo) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Repo) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.RepoPatch) error); ok { - r1 = rf(repoID, repo) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RepoPost provides a mock function with given fields: opt -func (_m *Client) RepoPost(opt woodpecker.RepoPostOptions) (*woodpecker.Repo, error) { - ret := _m.Called(opt) - - if len(ret) == 0 { - panic("no return value specified for RepoPost") - } - - var r0 *woodpecker.Repo - var r1 error - if rf, ok := ret.Get(0).(func(woodpecker.RepoPostOptions) (*woodpecker.Repo, error)); ok { - return rf(opt) - } - if rf, ok := ret.Get(0).(func(woodpecker.RepoPostOptions) *woodpecker.Repo); ok { - r0 = rf(opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Repo) - } - } - - if rf, ok := ret.Get(1).(func(woodpecker.RepoPostOptions) error); ok { - r1 = rf(opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RepoRepair provides a mock function with given fields: repoID -func (_m *Client) RepoRepair(repoID int64) error { - ret := _m.Called(repoID) - - if len(ret) == 0 { - panic("no return value specified for RepoRepair") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64) error); ok { - r0 = rf(repoID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Secret provides a mock function with given fields: repoID, secret -func (_m *Client) Secret(repoID int64, secret string) (*woodpecker.Secret, error) { - ret := _m.Called(repoID, secret) - - if len(ret) == 0 { - panic("no return value specified for Secret") - } - - var r0 *woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, string) (*woodpecker.Secret, error)); ok { - return rf(repoID, secret) - } - if rf, ok := ret.Get(0).(func(int64, string) *woodpecker.Secret); ok { - r0 = rf(repoID, secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, string) error); ok { - r1 = rf(repoID, secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretCreate provides a mock function with given fields: repoID, secret -func (_m *Client) SecretCreate(repoID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error) { - ret := _m.Called(repoID, secret) - - if len(ret) == 0 { - panic("no return value specified for SecretCreate") - } - - var r0 *woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Secret) (*woodpecker.Secret, error)); ok { - return rf(repoID, secret) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Secret) *woodpecker.Secret); ok { - r0 = rf(repoID, secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Secret) error); ok { - r1 = rf(repoID, secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretDelete provides a mock function with given fields: repoID, secret -func (_m *Client) SecretDelete(repoID int64, secret string) error { - ret := _m.Called(repoID, secret) - - if len(ret) == 0 { - panic("no return value specified for SecretDelete") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, string) error); ok { - r0 = rf(repoID, secret) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SecretList provides a mock function with given fields: repoID, opt -func (_m *Client) SecretList(repoID int64, opt woodpecker.SecretListOptions) ([]*woodpecker.Secret, error) { - ret := _m.Called(repoID, opt) - - if len(ret) == 0 { - panic("no return value specified for SecretList") - } - - var r0 []*woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, woodpecker.SecretListOptions) ([]*woodpecker.Secret, error)); ok { - return rf(repoID, opt) - } - if rf, ok := ret.Get(0).(func(int64, woodpecker.SecretListOptions) []*woodpecker.Secret); ok { - r0 = rf(repoID, opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, woodpecker.SecretListOptions) error); ok { - r1 = rf(repoID, opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SecretUpdate provides a mock function with given fields: repoID, secret -func (_m *Client) SecretUpdate(repoID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error) { - ret := _m.Called(repoID, secret) - - if len(ret) == 0 { - panic("no return value specified for SecretUpdate") - } - - var r0 *woodpecker.Secret - var r1 error - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Secret) (*woodpecker.Secret, error)); ok { - return rf(repoID, secret) - } - if rf, ok := ret.Get(0).(func(int64, *woodpecker.Secret) *woodpecker.Secret); ok { - r0 = rf(repoID, secret) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.Secret) - } - } - - if rf, ok := ret.Get(1).(func(int64, *woodpecker.Secret) error); ok { - r1 = rf(repoID, secret) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Self provides a mock function with no fields -func (_m *Client) Self() (*woodpecker.User, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Self") - } - - var r0 *woodpecker.User - var r1 error - if rf, ok := ret.Get(0).(func() (*woodpecker.User, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() *woodpecker.User); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.User) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SetAddress provides a mock function with given fields: _a0 -func (_m *Client) SetAddress(_a0 string) { - _m.Called(_a0) -} - -// SetClient provides a mock function with given fields: _a0 -func (_m *Client) SetClient(_a0 *http.Client) { - _m.Called(_a0) -} - -// SetLogLevel provides a mock function with given fields: logLevel -func (_m *Client) SetLogLevel(logLevel *woodpecker.LogLevel) (*woodpecker.LogLevel, error) { - ret := _m.Called(logLevel) - - if len(ret) == 0 { - panic("no return value specified for SetLogLevel") - } - - var r0 *woodpecker.LogLevel - var r1 error - if rf, ok := ret.Get(0).(func(*woodpecker.LogLevel) (*woodpecker.LogLevel, error)); ok { - return rf(logLevel) - } - if rf, ok := ret.Get(0).(func(*woodpecker.LogLevel) *woodpecker.LogLevel); ok { - r0 = rf(logLevel) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.LogLevel) - } - } - - if rf, ok := ret.Get(1).(func(*woodpecker.LogLevel) error); ok { - r1 = rf(logLevel) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StepLogEntries provides a mock function with given fields: repoID, pipeline, stepID -func (_m *Client) StepLogEntries(repoID int64, pipeline int64, stepID int64) ([]*woodpecker.LogEntry, error) { - ret := _m.Called(repoID, pipeline, stepID) - - if len(ret) == 0 { - panic("no return value specified for StepLogEntries") - } - - var r0 []*woodpecker.LogEntry - var r1 error - if rf, ok := ret.Get(0).(func(int64, int64, int64) ([]*woodpecker.LogEntry, error)); ok { - return rf(repoID, pipeline, stepID) - } - if rf, ok := ret.Get(0).(func(int64, int64, int64) []*woodpecker.LogEntry); ok { - r0 = rf(repoID, pipeline, stepID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.LogEntry) - } - } - - if rf, ok := ret.Get(1).(func(int64, int64, int64) error); ok { - r1 = rf(repoID, pipeline, stepID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// StepLogsPurge provides a mock function with given fields: repoID, pipelineNumber, stepID -func (_m *Client) StepLogsPurge(repoID int64, pipelineNumber int64, stepID int64) error { - ret := _m.Called(repoID, pipelineNumber, stepID) - - if len(ret) == 0 { - panic("no return value specified for StepLogsPurge") - } - - var r0 error - if rf, ok := ret.Get(0).(func(int64, int64, int64) error); ok { - r0 = rf(repoID, pipelineNumber, stepID) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// User provides a mock function with given fields: _a0 -func (_m *Client) User(_a0 string) (*woodpecker.User, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for User") - } - - var r0 *woodpecker.User - var r1 error - if rf, ok := ret.Get(0).(func(string) (*woodpecker.User, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(string) *woodpecker.User); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.User) - } - } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserDel provides a mock function with given fields: _a0 -func (_m *Client) UserDel(_a0 string) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UserDel") - } - - var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UserList provides a mock function with given fields: opt -func (_m *Client) UserList(opt woodpecker.UserListOptions) ([]*woodpecker.User, error) { - ret := _m.Called(opt) - - if len(ret) == 0 { - panic("no return value specified for UserList") - } - - var r0 []*woodpecker.User - var r1 error - if rf, ok := ret.Get(0).(func(woodpecker.UserListOptions) ([]*woodpecker.User, error)); ok { - return rf(opt) - } - if rf, ok := ret.Get(0).(func(woodpecker.UserListOptions) []*woodpecker.User); ok { - r0 = rf(opt) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*woodpecker.User) - } - } - - if rf, ok := ret.Get(1).(func(woodpecker.UserListOptions) error); ok { - r1 = rf(opt) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserPatch provides a mock function with given fields: _a0 -func (_m *Client) UserPatch(_a0 *woodpecker.User) (*woodpecker.User, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UserPatch") - } - - var r0 *woodpecker.User - var r1 error - if rf, ok := ret.Get(0).(func(*woodpecker.User) (*woodpecker.User, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*woodpecker.User) *woodpecker.User); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.User) - } - } - - if rf, ok := ret.Get(1).(func(*woodpecker.User) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// UserPost provides a mock function with given fields: _a0 -func (_m *Client) UserPost(_a0 *woodpecker.User) (*woodpecker.User, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UserPost") - } - - var r0 *woodpecker.User - var r1 error - if rf, ok := ret.Get(0).(func(*woodpecker.User) (*woodpecker.User, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(*woodpecker.User) *woodpecker.User); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*woodpecker.User) - } - } - - if rf, ok := ret.Get(1).(func(*woodpecker.User) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewClient creates a new instance of Client. 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 NewClient(t interface { - mock.TestingT - Cleanup(func()) -}) *Client { - mock := &Client{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/woodpecker-go/woodpecker/mocks/mock_Client.go b/woodpecker-go/woodpecker/mocks/mock_Client.go new file mode 100644 index 000000000..e119679bf --- /dev/null +++ b/woodpecker-go/woodpecker/mocks/mock_Client.go @@ -0,0 +1,4952 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package mocks + +import ( + "net/http" + + mock "github.com/stretchr/testify/mock" + "go.woodpecker-ci.org/woodpecker/v3/woodpecker-go/woodpecker" +) + +// NewMockClient creates a new instance of MockClient. 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 NewMockClient(t interface { + mock.TestingT + Cleanup(func()) +}) *MockClient { + mock := &MockClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockClient is an autogenerated mock type for the Client type +type MockClient struct { + mock.Mock +} + +type MockClient_Expecter struct { + mock *mock.Mock +} + +func (_m *MockClient) EXPECT() *MockClient_Expecter { + return &MockClient_Expecter{mock: &_m.Mock} +} + +// Agent provides a mock function for the type MockClient +func (_mock *MockClient) Agent(n int64) (*woodpecker.Agent, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for Agent") + } + + var r0 *woodpecker.Agent + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*woodpecker.Agent, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) *woodpecker.Agent); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Agent) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_Agent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Agent' +type MockClient_Agent_Call struct { + *mock.Call +} + +// Agent is a helper method to define mock.On call +// - n int64 +func (_e *MockClient_Expecter) Agent(n interface{}) *MockClient_Agent_Call { + return &MockClient_Agent_Call{Call: _e.mock.On("Agent", n)} +} + +func (_c *MockClient_Agent_Call) Run(run func(n int64)) *MockClient_Agent_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_Agent_Call) Return(agent *woodpecker.Agent, err error) *MockClient_Agent_Call { + _c.Call.Return(agent, err) + return _c +} + +func (_c *MockClient_Agent_Call) RunAndReturn(run func(n int64) (*woodpecker.Agent, error)) *MockClient_Agent_Call { + _c.Call.Return(run) + return _c +} + +// AgentCreate provides a mock function for the type MockClient +func (_mock *MockClient) AgentCreate(agent *woodpecker.Agent) (*woodpecker.Agent, error) { + ret := _mock.Called(agent) + + if len(ret) == 0 { + panic("no return value specified for AgentCreate") + } + + var r0 *woodpecker.Agent + var r1 error + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Agent) (*woodpecker.Agent, error)); ok { + return returnFunc(agent) + } + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Agent) *woodpecker.Agent); ok { + r0 = returnFunc(agent) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Agent) + } + } + if returnFunc, ok := ret.Get(1).(func(*woodpecker.Agent) error); ok { + r1 = returnFunc(agent) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_AgentCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentCreate' +type MockClient_AgentCreate_Call struct { + *mock.Call +} + +// AgentCreate is a helper method to define mock.On call +// - agent *woodpecker.Agent +func (_e *MockClient_Expecter) AgentCreate(agent interface{}) *MockClient_AgentCreate_Call { + return &MockClient_AgentCreate_Call{Call: _e.mock.On("AgentCreate", agent)} +} + +func (_c *MockClient_AgentCreate_Call) Run(run func(agent *woodpecker.Agent)) *MockClient_AgentCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *woodpecker.Agent + if args[0] != nil { + arg0 = args[0].(*woodpecker.Agent) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_AgentCreate_Call) Return(agent1 *woodpecker.Agent, err error) *MockClient_AgentCreate_Call { + _c.Call.Return(agent1, err) + return _c +} + +func (_c *MockClient_AgentCreate_Call) RunAndReturn(run func(agent *woodpecker.Agent) (*woodpecker.Agent, error)) *MockClient_AgentCreate_Call { + _c.Call.Return(run) + return _c +} + +// AgentDelete provides a mock function for the type MockClient +func (_mock *MockClient) AgentDelete(n int64) error { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for AgentDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64) error); ok { + r0 = returnFunc(n) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_AgentDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentDelete' +type MockClient_AgentDelete_Call struct { + *mock.Call +} + +// AgentDelete is a helper method to define mock.On call +// - n int64 +func (_e *MockClient_Expecter) AgentDelete(n interface{}) *MockClient_AgentDelete_Call { + return &MockClient_AgentDelete_Call{Call: _e.mock.On("AgentDelete", n)} +} + +func (_c *MockClient_AgentDelete_Call) Run(run func(n int64)) *MockClient_AgentDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_AgentDelete_Call) Return(err error) *MockClient_AgentDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_AgentDelete_Call) RunAndReturn(run func(n int64) error) *MockClient_AgentDelete_Call { + _c.Call.Return(run) + return _c +} + +// AgentList provides a mock function for the type MockClient +func (_mock *MockClient) AgentList() ([]*woodpecker.Agent, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for AgentList") + } + + var r0 []*woodpecker.Agent + var r1 error + if returnFunc, ok := ret.Get(0).(func() ([]*woodpecker.Agent, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []*woodpecker.Agent); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Agent) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_AgentList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentList' +type MockClient_AgentList_Call struct { + *mock.Call +} + +// AgentList is a helper method to define mock.On call +func (_e *MockClient_Expecter) AgentList() *MockClient_AgentList_Call { + return &MockClient_AgentList_Call{Call: _e.mock.On("AgentList")} +} + +func (_c *MockClient_AgentList_Call) Run(run func()) *MockClient_AgentList_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClient_AgentList_Call) Return(agents []*woodpecker.Agent, err error) *MockClient_AgentList_Call { + _c.Call.Return(agents, err) + return _c +} + +func (_c *MockClient_AgentList_Call) RunAndReturn(run func() ([]*woodpecker.Agent, error)) *MockClient_AgentList_Call { + _c.Call.Return(run) + return _c +} + +// AgentTasksList provides a mock function for the type MockClient +func (_mock *MockClient) AgentTasksList(n int64) ([]*woodpecker.Task, error) { + ret := _mock.Called(n) + + if len(ret) == 0 { + panic("no return value specified for AgentTasksList") + } + + var r0 []*woodpecker.Task + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) ([]*woodpecker.Task, error)); ok { + return returnFunc(n) + } + if returnFunc, ok := ret.Get(0).(func(int64) []*woodpecker.Task); ok { + r0 = returnFunc(n) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Task) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_AgentTasksList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentTasksList' +type MockClient_AgentTasksList_Call struct { + *mock.Call +} + +// AgentTasksList is a helper method to define mock.On call +// - n int64 +func (_e *MockClient_Expecter) AgentTasksList(n interface{}) *MockClient_AgentTasksList_Call { + return &MockClient_AgentTasksList_Call{Call: _e.mock.On("AgentTasksList", n)} +} + +func (_c *MockClient_AgentTasksList_Call) Run(run func(n int64)) *MockClient_AgentTasksList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_AgentTasksList_Call) Return(tasks []*woodpecker.Task, err error) *MockClient_AgentTasksList_Call { + _c.Call.Return(tasks, err) + return _c +} + +func (_c *MockClient_AgentTasksList_Call) RunAndReturn(run func(n int64) ([]*woodpecker.Task, error)) *MockClient_AgentTasksList_Call { + _c.Call.Return(run) + return _c +} + +// AgentUpdate provides a mock function for the type MockClient +func (_mock *MockClient) AgentUpdate(agent *woodpecker.Agent) (*woodpecker.Agent, error) { + ret := _mock.Called(agent) + + if len(ret) == 0 { + panic("no return value specified for AgentUpdate") + } + + var r0 *woodpecker.Agent + var r1 error + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Agent) (*woodpecker.Agent, error)); ok { + return returnFunc(agent) + } + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Agent) *woodpecker.Agent); ok { + r0 = returnFunc(agent) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Agent) + } + } + if returnFunc, ok := ret.Get(1).(func(*woodpecker.Agent) error); ok { + r1 = returnFunc(agent) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_AgentUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AgentUpdate' +type MockClient_AgentUpdate_Call struct { + *mock.Call +} + +// AgentUpdate is a helper method to define mock.On call +// - agent *woodpecker.Agent +func (_e *MockClient_Expecter) AgentUpdate(agent interface{}) *MockClient_AgentUpdate_Call { + return &MockClient_AgentUpdate_Call{Call: _e.mock.On("AgentUpdate", agent)} +} + +func (_c *MockClient_AgentUpdate_Call) Run(run func(agent *woodpecker.Agent)) *MockClient_AgentUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *woodpecker.Agent + if args[0] != nil { + arg0 = args[0].(*woodpecker.Agent) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_AgentUpdate_Call) Return(agent1 *woodpecker.Agent, err error) *MockClient_AgentUpdate_Call { + _c.Call.Return(agent1, err) + return _c +} + +func (_c *MockClient_AgentUpdate_Call) RunAndReturn(run func(agent *woodpecker.Agent) (*woodpecker.Agent, error)) *MockClient_AgentUpdate_Call { + _c.Call.Return(run) + return _c +} + +// CronCreate provides a mock function for the type MockClient +func (_mock *MockClient) CronCreate(repoID int64, cron *woodpecker.Cron) (*woodpecker.Cron, error) { + ret := _mock.Called(repoID, cron) + + if len(ret) == 0 { + panic("no return value specified for CronCreate") + } + + var r0 *woodpecker.Cron + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Cron) (*woodpecker.Cron, error)); ok { + return returnFunc(repoID, cron) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Cron) *woodpecker.Cron); ok { + r0 = returnFunc(repoID, cron) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Cron) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Cron) error); ok { + r1 = returnFunc(repoID, cron) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CronCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronCreate' +type MockClient_CronCreate_Call struct { + *mock.Call +} + +// CronCreate is a helper method to define mock.On call +// - repoID int64 +// - cron *woodpecker.Cron +func (_e *MockClient_Expecter) CronCreate(repoID interface{}, cron interface{}) *MockClient_CronCreate_Call { + return &MockClient_CronCreate_Call{Call: _e.mock.On("CronCreate", repoID, cron)} +} + +func (_c *MockClient_CronCreate_Call) Run(run func(repoID int64, cron *woodpecker.Cron)) *MockClient_CronCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Cron + if args[1] != nil { + arg1 = args[1].(*woodpecker.Cron) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_CronCreate_Call) Return(cron1 *woodpecker.Cron, err error) *MockClient_CronCreate_Call { + _c.Call.Return(cron1, err) + return _c +} + +func (_c *MockClient_CronCreate_Call) RunAndReturn(run func(repoID int64, cron *woodpecker.Cron) (*woodpecker.Cron, error)) *MockClient_CronCreate_Call { + _c.Call.Return(run) + return _c +} + +// CronDelete provides a mock function for the type MockClient +func (_mock *MockClient) CronDelete(repoID int64, cronID int64) error { + ret := _mock.Called(repoID, cronID) + + if len(ret) == 0 { + panic("no return value specified for CronDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, int64) error); ok { + r0 = returnFunc(repoID, cronID) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_CronDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronDelete' +type MockClient_CronDelete_Call struct { + *mock.Call +} + +// CronDelete is a helper method to define mock.On call +// - repoID int64 +// - cronID int64 +func (_e *MockClient_Expecter) CronDelete(repoID interface{}, cronID interface{}) *MockClient_CronDelete_Call { + return &MockClient_CronDelete_Call{Call: _e.mock.On("CronDelete", repoID, cronID)} +} + +func (_c *MockClient_CronDelete_Call) Run(run func(repoID int64, cronID int64)) *MockClient_CronDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_CronDelete_Call) Return(err error) *MockClient_CronDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_CronDelete_Call) RunAndReturn(run func(repoID int64, cronID int64) error) *MockClient_CronDelete_Call { + _c.Call.Return(run) + return _c +} + +// CronGet provides a mock function for the type MockClient +func (_mock *MockClient) CronGet(repoID int64, cronID int64) (*woodpecker.Cron, error) { + ret := _mock.Called(repoID, cronID) + + if len(ret) == 0 { + panic("no return value specified for CronGet") + } + + var r0 *woodpecker.Cron + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, int64) (*woodpecker.Cron, error)); ok { + return returnFunc(repoID, cronID) + } + if returnFunc, ok := ret.Get(0).(func(int64, int64) *woodpecker.Cron); ok { + r0 = returnFunc(repoID, cronID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Cron) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, int64) error); ok { + r1 = returnFunc(repoID, cronID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CronGet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronGet' +type MockClient_CronGet_Call struct { + *mock.Call +} + +// CronGet is a helper method to define mock.On call +// - repoID int64 +// - cronID int64 +func (_e *MockClient_Expecter) CronGet(repoID interface{}, cronID interface{}) *MockClient_CronGet_Call { + return &MockClient_CronGet_Call{Call: _e.mock.On("CronGet", repoID, cronID)} +} + +func (_c *MockClient_CronGet_Call) Run(run func(repoID int64, cronID int64)) *MockClient_CronGet_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_CronGet_Call) Return(cron *woodpecker.Cron, err error) *MockClient_CronGet_Call { + _c.Call.Return(cron, err) + return _c +} + +func (_c *MockClient_CronGet_Call) RunAndReturn(run func(repoID int64, cronID int64) (*woodpecker.Cron, error)) *MockClient_CronGet_Call { + _c.Call.Return(run) + return _c +} + +// CronList provides a mock function for the type MockClient +func (_mock *MockClient) CronList(repoID int64, opt woodpecker.CronListOptions) ([]*woodpecker.Cron, error) { + ret := _mock.Called(repoID, opt) + + if len(ret) == 0 { + panic("no return value specified for CronList") + } + + var r0 []*woodpecker.Cron + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.CronListOptions) ([]*woodpecker.Cron, error)); ok { + return returnFunc(repoID, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.CronListOptions) []*woodpecker.Cron); ok { + r0 = returnFunc(repoID, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Cron) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, woodpecker.CronListOptions) error); ok { + r1 = returnFunc(repoID, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CronList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronList' +type MockClient_CronList_Call struct { + *mock.Call +} + +// CronList is a helper method to define mock.On call +// - repoID int64 +// - opt woodpecker.CronListOptions +func (_e *MockClient_Expecter) CronList(repoID interface{}, opt interface{}) *MockClient_CronList_Call { + return &MockClient_CronList_Call{Call: _e.mock.On("CronList", repoID, opt)} +} + +func (_c *MockClient_CronList_Call) Run(run func(repoID int64, opt woodpecker.CronListOptions)) *MockClient_CronList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 woodpecker.CronListOptions + if args[1] != nil { + arg1 = args[1].(woodpecker.CronListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_CronList_Call) Return(crons []*woodpecker.Cron, err error) *MockClient_CronList_Call { + _c.Call.Return(crons, err) + return _c +} + +func (_c *MockClient_CronList_Call) RunAndReturn(run func(repoID int64, opt woodpecker.CronListOptions) ([]*woodpecker.Cron, error)) *MockClient_CronList_Call { + _c.Call.Return(run) + return _c +} + +// CronUpdate provides a mock function for the type MockClient +func (_mock *MockClient) CronUpdate(repoID int64, cron *woodpecker.Cron) (*woodpecker.Cron, error) { + ret := _mock.Called(repoID, cron) + + if len(ret) == 0 { + panic("no return value specified for CronUpdate") + } + + var r0 *woodpecker.Cron + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Cron) (*woodpecker.Cron, error)); ok { + return returnFunc(repoID, cron) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Cron) *woodpecker.Cron); ok { + r0 = returnFunc(repoID, cron) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Cron) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Cron) error); ok { + r1 = returnFunc(repoID, cron) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CronUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CronUpdate' +type MockClient_CronUpdate_Call struct { + *mock.Call +} + +// CronUpdate is a helper method to define mock.On call +// - repoID int64 +// - cron *woodpecker.Cron +func (_e *MockClient_Expecter) CronUpdate(repoID interface{}, cron interface{}) *MockClient_CronUpdate_Call { + return &MockClient_CronUpdate_Call{Call: _e.mock.On("CronUpdate", repoID, cron)} +} + +func (_c *MockClient_CronUpdate_Call) Run(run func(repoID int64, cron *woodpecker.Cron)) *MockClient_CronUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Cron + if args[1] != nil { + arg1 = args[1].(*woodpecker.Cron) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_CronUpdate_Call) Return(cron1 *woodpecker.Cron, err error) *MockClient_CronUpdate_Call { + _c.Call.Return(cron1, err) + return _c +} + +func (_c *MockClient_CronUpdate_Call) RunAndReturn(run func(repoID int64, cron *woodpecker.Cron) (*woodpecker.Cron, error)) *MockClient_CronUpdate_Call { + _c.Call.Return(run) + return _c +} + +// Deploy provides a mock function for the type MockClient +func (_mock *MockClient) Deploy(repoID int64, pipeline int64, opt woodpecker.DeployOptions) (*woodpecker.Pipeline, error) { + ret := _mock.Called(repoID, pipeline, opt) + + if len(ret) == 0 { + panic("no return value specified for Deploy") + } + + var r0 *woodpecker.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, int64, woodpecker.DeployOptions) (*woodpecker.Pipeline, error)); ok { + return returnFunc(repoID, pipeline, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, int64, woodpecker.DeployOptions) *woodpecker.Pipeline); ok { + r0 = returnFunc(repoID, pipeline, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, int64, woodpecker.DeployOptions) error); ok { + r1 = returnFunc(repoID, pipeline, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_Deploy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deploy' +type MockClient_Deploy_Call struct { + *mock.Call +} + +// Deploy is a helper method to define mock.On call +// - repoID int64 +// - pipeline int64 +// - opt woodpecker.DeployOptions +func (_e *MockClient_Expecter) Deploy(repoID interface{}, pipeline interface{}, opt interface{}) *MockClient_Deploy_Call { + return &MockClient_Deploy_Call{Call: _e.mock.On("Deploy", repoID, pipeline, opt)} +} + +func (_c *MockClient_Deploy_Call) Run(run func(repoID int64, pipeline int64, opt woodpecker.DeployOptions)) *MockClient_Deploy_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + var arg2 woodpecker.DeployOptions + if args[2] != nil { + arg2 = args[2].(woodpecker.DeployOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockClient_Deploy_Call) Return(pipeline1 *woodpecker.Pipeline, err error) *MockClient_Deploy_Call { + _c.Call.Return(pipeline1, err) + return _c +} + +func (_c *MockClient_Deploy_Call) RunAndReturn(run func(repoID int64, pipeline int64, opt woodpecker.DeployOptions) (*woodpecker.Pipeline, error)) *MockClient_Deploy_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistry provides a mock function for the type MockClient +func (_mock *MockClient) GlobalRegistry(registry string) (*woodpecker.Registry, error) { + ret := _mock.Called(registry) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistry") + } + + var r0 *woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*woodpecker.Registry, error)); ok { + return returnFunc(registry) + } + if returnFunc, ok := ret.Get(0).(func(string) *woodpecker.Registry); ok { + r0 = returnFunc(registry) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(registry) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_GlobalRegistry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistry' +type MockClient_GlobalRegistry_Call struct { + *mock.Call +} + +// GlobalRegistry is a helper method to define mock.On call +// - registry string +func (_e *MockClient_Expecter) GlobalRegistry(registry interface{}) *MockClient_GlobalRegistry_Call { + return &MockClient_GlobalRegistry_Call{Call: _e.mock.On("GlobalRegistry", registry)} +} + +func (_c *MockClient_GlobalRegistry_Call) Run(run func(registry string)) *MockClient_GlobalRegistry_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalRegistry_Call) Return(registry1 *woodpecker.Registry, err error) *MockClient_GlobalRegistry_Call { + _c.Call.Return(registry1, err) + return _c +} + +func (_c *MockClient_GlobalRegistry_Call) RunAndReturn(run func(registry string) (*woodpecker.Registry, error)) *MockClient_GlobalRegistry_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryCreate provides a mock function for the type MockClient +func (_mock *MockClient) GlobalRegistryCreate(registry *woodpecker.Registry) (*woodpecker.Registry, error) { + ret := _mock.Called(registry) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryCreate") + } + + var r0 *woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Registry) (*woodpecker.Registry, error)); ok { + return returnFunc(registry) + } + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Registry) *woodpecker.Registry); ok { + r0 = returnFunc(registry) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*woodpecker.Registry) error); ok { + r1 = returnFunc(registry) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_GlobalRegistryCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryCreate' +type MockClient_GlobalRegistryCreate_Call struct { + *mock.Call +} + +// GlobalRegistryCreate is a helper method to define mock.On call +// - registry *woodpecker.Registry +func (_e *MockClient_Expecter) GlobalRegistryCreate(registry interface{}) *MockClient_GlobalRegistryCreate_Call { + return &MockClient_GlobalRegistryCreate_Call{Call: _e.mock.On("GlobalRegistryCreate", registry)} +} + +func (_c *MockClient_GlobalRegistryCreate_Call) Run(run func(registry *woodpecker.Registry)) *MockClient_GlobalRegistryCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *woodpecker.Registry + if args[0] != nil { + arg0 = args[0].(*woodpecker.Registry) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalRegistryCreate_Call) Return(registry1 *woodpecker.Registry, err error) *MockClient_GlobalRegistryCreate_Call { + _c.Call.Return(registry1, err) + return _c +} + +func (_c *MockClient_GlobalRegistryCreate_Call) RunAndReturn(run func(registry *woodpecker.Registry) (*woodpecker.Registry, error)) *MockClient_GlobalRegistryCreate_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryDelete provides a mock function for the type MockClient +func (_mock *MockClient) GlobalRegistryDelete(registry string) error { + ret := _mock.Called(registry) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_GlobalRegistryDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryDelete' +type MockClient_GlobalRegistryDelete_Call struct { + *mock.Call +} + +// GlobalRegistryDelete is a helper method to define mock.On call +// - registry string +func (_e *MockClient_Expecter) GlobalRegistryDelete(registry interface{}) *MockClient_GlobalRegistryDelete_Call { + return &MockClient_GlobalRegistryDelete_Call{Call: _e.mock.On("GlobalRegistryDelete", registry)} +} + +func (_c *MockClient_GlobalRegistryDelete_Call) Run(run func(registry string)) *MockClient_GlobalRegistryDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalRegistryDelete_Call) Return(err error) *MockClient_GlobalRegistryDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_GlobalRegistryDelete_Call) RunAndReturn(run func(registry string) error) *MockClient_GlobalRegistryDelete_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryList provides a mock function for the type MockClient +func (_mock *MockClient) GlobalRegistryList(opt woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error) { + ret := _mock.Called(opt) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryList") + } + + var r0 []*woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error)); ok { + return returnFunc(opt) + } + if returnFunc, ok := ret.Get(0).(func(woodpecker.RegistryListOptions) []*woodpecker.Registry); ok { + r0 = returnFunc(opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(woodpecker.RegistryListOptions) error); ok { + r1 = returnFunc(opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_GlobalRegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryList' +type MockClient_GlobalRegistryList_Call struct { + *mock.Call +} + +// GlobalRegistryList is a helper method to define mock.On call +// - opt woodpecker.RegistryListOptions +func (_e *MockClient_Expecter) GlobalRegistryList(opt interface{}) *MockClient_GlobalRegistryList_Call { + return &MockClient_GlobalRegistryList_Call{Call: _e.mock.On("GlobalRegistryList", opt)} +} + +func (_c *MockClient_GlobalRegistryList_Call) Run(run func(opt woodpecker.RegistryListOptions)) *MockClient_GlobalRegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 woodpecker.RegistryListOptions + if args[0] != nil { + arg0 = args[0].(woodpecker.RegistryListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalRegistryList_Call) Return(registrys []*woodpecker.Registry, err error) *MockClient_GlobalRegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockClient_GlobalRegistryList_Call) RunAndReturn(run func(opt woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error)) *MockClient_GlobalRegistryList_Call { + _c.Call.Return(run) + return _c +} + +// GlobalRegistryUpdate provides a mock function for the type MockClient +func (_mock *MockClient) GlobalRegistryUpdate(registry *woodpecker.Registry) (*woodpecker.Registry, error) { + ret := _mock.Called(registry) + + if len(ret) == 0 { + panic("no return value specified for GlobalRegistryUpdate") + } + + var r0 *woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Registry) (*woodpecker.Registry, error)); ok { + return returnFunc(registry) + } + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Registry) *woodpecker.Registry); ok { + r0 = returnFunc(registry) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(*woodpecker.Registry) error); ok { + r1 = returnFunc(registry) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_GlobalRegistryUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalRegistryUpdate' +type MockClient_GlobalRegistryUpdate_Call struct { + *mock.Call +} + +// GlobalRegistryUpdate is a helper method to define mock.On call +// - registry *woodpecker.Registry +func (_e *MockClient_Expecter) GlobalRegistryUpdate(registry interface{}) *MockClient_GlobalRegistryUpdate_Call { + return &MockClient_GlobalRegistryUpdate_Call{Call: _e.mock.On("GlobalRegistryUpdate", registry)} +} + +func (_c *MockClient_GlobalRegistryUpdate_Call) Run(run func(registry *woodpecker.Registry)) *MockClient_GlobalRegistryUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *woodpecker.Registry + if args[0] != nil { + arg0 = args[0].(*woodpecker.Registry) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalRegistryUpdate_Call) Return(registry1 *woodpecker.Registry, err error) *MockClient_GlobalRegistryUpdate_Call { + _c.Call.Return(registry1, err) + return _c +} + +func (_c *MockClient_GlobalRegistryUpdate_Call) RunAndReturn(run func(registry *woodpecker.Registry) (*woodpecker.Registry, error)) *MockClient_GlobalRegistryUpdate_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecret provides a mock function for the type MockClient +func (_mock *MockClient) GlobalSecret(secret string) (*woodpecker.Secret, error) { + ret := _mock.Called(secret) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecret") + } + + var r0 *woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*woodpecker.Secret, error)); ok { + return returnFunc(secret) + } + if returnFunc, ok := ret.Get(0).(func(string) *woodpecker.Secret); ok { + r0 = returnFunc(secret) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_GlobalSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecret' +type MockClient_GlobalSecret_Call struct { + *mock.Call +} + +// GlobalSecret is a helper method to define mock.On call +// - secret string +func (_e *MockClient_Expecter) GlobalSecret(secret interface{}) *MockClient_GlobalSecret_Call { + return &MockClient_GlobalSecret_Call{Call: _e.mock.On("GlobalSecret", secret)} +} + +func (_c *MockClient_GlobalSecret_Call) Run(run func(secret string)) *MockClient_GlobalSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalSecret_Call) Return(secret1 *woodpecker.Secret, err error) *MockClient_GlobalSecret_Call { + _c.Call.Return(secret1, err) + return _c +} + +func (_c *MockClient_GlobalSecret_Call) RunAndReturn(run func(secret string) (*woodpecker.Secret, error)) *MockClient_GlobalSecret_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretCreate provides a mock function for the type MockClient +func (_mock *MockClient) GlobalSecretCreate(secret *woodpecker.Secret) (*woodpecker.Secret, error) { + ret := _mock.Called(secret) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretCreate") + } + + var r0 *woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Secret) (*woodpecker.Secret, error)); ok { + return returnFunc(secret) + } + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Secret) *woodpecker.Secret); ok { + r0 = returnFunc(secret) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(*woodpecker.Secret) error); ok { + r1 = returnFunc(secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_GlobalSecretCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretCreate' +type MockClient_GlobalSecretCreate_Call struct { + *mock.Call +} + +// GlobalSecretCreate is a helper method to define mock.On call +// - secret *woodpecker.Secret +func (_e *MockClient_Expecter) GlobalSecretCreate(secret interface{}) *MockClient_GlobalSecretCreate_Call { + return &MockClient_GlobalSecretCreate_Call{Call: _e.mock.On("GlobalSecretCreate", secret)} +} + +func (_c *MockClient_GlobalSecretCreate_Call) Run(run func(secret *woodpecker.Secret)) *MockClient_GlobalSecretCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *woodpecker.Secret + if args[0] != nil { + arg0 = args[0].(*woodpecker.Secret) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalSecretCreate_Call) Return(secret1 *woodpecker.Secret, err error) *MockClient_GlobalSecretCreate_Call { + _c.Call.Return(secret1, err) + return _c +} + +func (_c *MockClient_GlobalSecretCreate_Call) RunAndReturn(run func(secret *woodpecker.Secret) (*woodpecker.Secret, error)) *MockClient_GlobalSecretCreate_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretDelete provides a mock function for the type MockClient +func (_mock *MockClient) GlobalSecretDelete(secret string) error { + ret := _mock.Called(secret) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_GlobalSecretDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretDelete' +type MockClient_GlobalSecretDelete_Call struct { + *mock.Call +} + +// GlobalSecretDelete is a helper method to define mock.On call +// - secret string +func (_e *MockClient_Expecter) GlobalSecretDelete(secret interface{}) *MockClient_GlobalSecretDelete_Call { + return &MockClient_GlobalSecretDelete_Call{Call: _e.mock.On("GlobalSecretDelete", secret)} +} + +func (_c *MockClient_GlobalSecretDelete_Call) Run(run func(secret string)) *MockClient_GlobalSecretDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalSecretDelete_Call) Return(err error) *MockClient_GlobalSecretDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_GlobalSecretDelete_Call) RunAndReturn(run func(secret string) error) *MockClient_GlobalSecretDelete_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretList provides a mock function for the type MockClient +func (_mock *MockClient) GlobalSecretList(opt woodpecker.SecretListOptions) ([]*woodpecker.Secret, error) { + ret := _mock.Called(opt) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretList") + } + + var r0 []*woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(woodpecker.SecretListOptions) ([]*woodpecker.Secret, error)); ok { + return returnFunc(opt) + } + if returnFunc, ok := ret.Get(0).(func(woodpecker.SecretListOptions) []*woodpecker.Secret); ok { + r0 = returnFunc(opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(woodpecker.SecretListOptions) error); ok { + r1 = returnFunc(opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_GlobalSecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretList' +type MockClient_GlobalSecretList_Call struct { + *mock.Call +} + +// GlobalSecretList is a helper method to define mock.On call +// - opt woodpecker.SecretListOptions +func (_e *MockClient_Expecter) GlobalSecretList(opt interface{}) *MockClient_GlobalSecretList_Call { + return &MockClient_GlobalSecretList_Call{Call: _e.mock.On("GlobalSecretList", opt)} +} + +func (_c *MockClient_GlobalSecretList_Call) Run(run func(opt woodpecker.SecretListOptions)) *MockClient_GlobalSecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 woodpecker.SecretListOptions + if args[0] != nil { + arg0 = args[0].(woodpecker.SecretListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalSecretList_Call) Return(secrets []*woodpecker.Secret, err error) *MockClient_GlobalSecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockClient_GlobalSecretList_Call) RunAndReturn(run func(opt woodpecker.SecretListOptions) ([]*woodpecker.Secret, error)) *MockClient_GlobalSecretList_Call { + _c.Call.Return(run) + return _c +} + +// GlobalSecretUpdate provides a mock function for the type MockClient +func (_mock *MockClient) GlobalSecretUpdate(secret *woodpecker.Secret) (*woodpecker.Secret, error) { + ret := _mock.Called(secret) + + if len(ret) == 0 { + panic("no return value specified for GlobalSecretUpdate") + } + + var r0 *woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Secret) (*woodpecker.Secret, error)); ok { + return returnFunc(secret) + } + if returnFunc, ok := ret.Get(0).(func(*woodpecker.Secret) *woodpecker.Secret); ok { + r0 = returnFunc(secret) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(*woodpecker.Secret) error); ok { + r1 = returnFunc(secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_GlobalSecretUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GlobalSecretUpdate' +type MockClient_GlobalSecretUpdate_Call struct { + *mock.Call +} + +// GlobalSecretUpdate is a helper method to define mock.On call +// - secret *woodpecker.Secret +func (_e *MockClient_Expecter) GlobalSecretUpdate(secret interface{}) *MockClient_GlobalSecretUpdate_Call { + return &MockClient_GlobalSecretUpdate_Call{Call: _e.mock.On("GlobalSecretUpdate", secret)} +} + +func (_c *MockClient_GlobalSecretUpdate_Call) Run(run func(secret *woodpecker.Secret)) *MockClient_GlobalSecretUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *woodpecker.Secret + if args[0] != nil { + arg0 = args[0].(*woodpecker.Secret) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_GlobalSecretUpdate_Call) Return(secret1 *woodpecker.Secret, err error) *MockClient_GlobalSecretUpdate_Call { + _c.Call.Return(secret1, err) + return _c +} + +func (_c *MockClient_GlobalSecretUpdate_Call) RunAndReturn(run func(secret *woodpecker.Secret) (*woodpecker.Secret, error)) *MockClient_GlobalSecretUpdate_Call { + _c.Call.Return(run) + return _c +} + +// LogLevel provides a mock function for the type MockClient +func (_mock *MockClient) LogLevel() (*woodpecker.LogLevel, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for LogLevel") + } + + var r0 *woodpecker.LogLevel + var r1 error + if returnFunc, ok := ret.Get(0).(func() (*woodpecker.LogLevel, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() *woodpecker.LogLevel); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.LogLevel) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_LogLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogLevel' +type MockClient_LogLevel_Call struct { + *mock.Call +} + +// LogLevel is a helper method to define mock.On call +func (_e *MockClient_Expecter) LogLevel() *MockClient_LogLevel_Call { + return &MockClient_LogLevel_Call{Call: _e.mock.On("LogLevel")} +} + +func (_c *MockClient_LogLevel_Call) Run(run func()) *MockClient_LogLevel_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClient_LogLevel_Call) Return(logLevel *woodpecker.LogLevel, err error) *MockClient_LogLevel_Call { + _c.Call.Return(logLevel, err) + return _c +} + +func (_c *MockClient_LogLevel_Call) RunAndReturn(run func() (*woodpecker.LogLevel, error)) *MockClient_LogLevel_Call { + _c.Call.Return(run) + return _c +} + +// LogsPurge provides a mock function for the type MockClient +func (_mock *MockClient) LogsPurge(repoID int64, pipeline int64) error { + ret := _mock.Called(repoID, pipeline) + + if len(ret) == 0 { + panic("no return value specified for LogsPurge") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, int64) error); ok { + r0 = returnFunc(repoID, pipeline) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_LogsPurge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LogsPurge' +type MockClient_LogsPurge_Call struct { + *mock.Call +} + +// LogsPurge is a helper method to define mock.On call +// - repoID int64 +// - pipeline int64 +func (_e *MockClient_Expecter) LogsPurge(repoID interface{}, pipeline interface{}) *MockClient_LogsPurge_Call { + return &MockClient_LogsPurge_Call{Call: _e.mock.On("LogsPurge", repoID, pipeline)} +} + +func (_c *MockClient_LogsPurge_Call) Run(run func(repoID int64, pipeline int64)) *MockClient_LogsPurge_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_LogsPurge_Call) Return(err error) *MockClient_LogsPurge_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_LogsPurge_Call) RunAndReturn(run func(repoID int64, pipeline int64) error) *MockClient_LogsPurge_Call { + _c.Call.Return(run) + return _c +} + +// Org provides a mock function for the type MockClient +func (_mock *MockClient) Org(orgID int64) (*woodpecker.Org, error) { + ret := _mock.Called(orgID) + + if len(ret) == 0 { + panic("no return value specified for Org") + } + + var r0 *woodpecker.Org + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*woodpecker.Org, error)); ok { + return returnFunc(orgID) + } + if returnFunc, ok := ret.Get(0).(func(int64) *woodpecker.Org); ok { + r0 = returnFunc(orgID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Org) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(orgID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_Org_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Org' +type MockClient_Org_Call struct { + *mock.Call +} + +// Org is a helper method to define mock.On call +// - orgID int64 +func (_e *MockClient_Expecter) Org(orgID interface{}) *MockClient_Org_Call { + return &MockClient_Org_Call{Call: _e.mock.On("Org", orgID)} +} + +func (_c *MockClient_Org_Call) Run(run func(orgID int64)) *MockClient_Org_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_Org_Call) Return(org *woodpecker.Org, err error) *MockClient_Org_Call { + _c.Call.Return(org, err) + return _c +} + +func (_c *MockClient_Org_Call) RunAndReturn(run func(orgID int64) (*woodpecker.Org, error)) *MockClient_Org_Call { + _c.Call.Return(run) + return _c +} + +// OrgList provides a mock function for the type MockClient +func (_mock *MockClient) OrgList(opt woodpecker.ListOptions) ([]*woodpecker.Org, error) { + ret := _mock.Called(opt) + + if len(ret) == 0 { + panic("no return value specified for OrgList") + } + + var r0 []*woodpecker.Org + var r1 error + if returnFunc, ok := ret.Get(0).(func(woodpecker.ListOptions) ([]*woodpecker.Org, error)); ok { + return returnFunc(opt) + } + if returnFunc, ok := ret.Get(0).(func(woodpecker.ListOptions) []*woodpecker.Org); ok { + r0 = returnFunc(opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Org) + } + } + if returnFunc, ok := ret.Get(1).(func(woodpecker.ListOptions) error); ok { + r1 = returnFunc(opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgList' +type MockClient_OrgList_Call struct { + *mock.Call +} + +// OrgList is a helper method to define mock.On call +// - opt woodpecker.ListOptions +func (_e *MockClient_Expecter) OrgList(opt interface{}) *MockClient_OrgList_Call { + return &MockClient_OrgList_Call{Call: _e.mock.On("OrgList", opt)} +} + +func (_c *MockClient_OrgList_Call) Run(run func(opt woodpecker.ListOptions)) *MockClient_OrgList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 woodpecker.ListOptions + if args[0] != nil { + arg0 = args[0].(woodpecker.ListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_OrgList_Call) Return(orgs []*woodpecker.Org, err error) *MockClient_OrgList_Call { + _c.Call.Return(orgs, err) + return _c +} + +func (_c *MockClient_OrgList_Call) RunAndReturn(run func(opt woodpecker.ListOptions) ([]*woodpecker.Org, error)) *MockClient_OrgList_Call { + _c.Call.Return(run) + return _c +} + +// OrgLookup provides a mock function for the type MockClient +func (_mock *MockClient) OrgLookup(orgName string) (*woodpecker.Org, error) { + ret := _mock.Called(orgName) + + if len(ret) == 0 { + panic("no return value specified for OrgLookup") + } + + var r0 *woodpecker.Org + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*woodpecker.Org, error)); ok { + return returnFunc(orgName) + } + if returnFunc, ok := ret.Get(0).(func(string) *woodpecker.Org); ok { + r0 = returnFunc(orgName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Org) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(orgName) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgLookup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgLookup' +type MockClient_OrgLookup_Call struct { + *mock.Call +} + +// OrgLookup is a helper method to define mock.On call +// - orgName string +func (_e *MockClient_Expecter) OrgLookup(orgName interface{}) *MockClient_OrgLookup_Call { + return &MockClient_OrgLookup_Call{Call: _e.mock.On("OrgLookup", orgName)} +} + +func (_c *MockClient_OrgLookup_Call) Run(run func(orgName string)) *MockClient_OrgLookup_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_OrgLookup_Call) Return(org *woodpecker.Org, err error) *MockClient_OrgLookup_Call { + _c.Call.Return(org, err) + return _c +} + +func (_c *MockClient_OrgLookup_Call) RunAndReturn(run func(orgName string) (*woodpecker.Org, error)) *MockClient_OrgLookup_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistry provides a mock function for the type MockClient +func (_mock *MockClient) OrgRegistry(orgID int64, registry string) (*woodpecker.Registry, error) { + ret := _mock.Called(orgID, registry) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistry") + } + + var r0 *woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, string) (*woodpecker.Registry, error)); ok { + return returnFunc(orgID, registry) + } + if returnFunc, ok := ret.Get(0).(func(int64, string) *woodpecker.Registry); ok { + r0 = returnFunc(orgID, registry) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, string) error); ok { + r1 = returnFunc(orgID, registry) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgRegistry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistry' +type MockClient_OrgRegistry_Call struct { + *mock.Call +} + +// OrgRegistry is a helper method to define mock.On call +// - orgID int64 +// - registry string +func (_e *MockClient_Expecter) OrgRegistry(orgID interface{}, registry interface{}) *MockClient_OrgRegistry_Call { + return &MockClient_OrgRegistry_Call{Call: _e.mock.On("OrgRegistry", orgID, registry)} +} + +func (_c *MockClient_OrgRegistry_Call) Run(run func(orgID int64, registry string)) *MockClient_OrgRegistry_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgRegistry_Call) Return(registry1 *woodpecker.Registry, err error) *MockClient_OrgRegistry_Call { + _c.Call.Return(registry1, err) + return _c +} + +func (_c *MockClient_OrgRegistry_Call) RunAndReturn(run func(orgID int64, registry string) (*woodpecker.Registry, error)) *MockClient_OrgRegistry_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryCreate provides a mock function for the type MockClient +func (_mock *MockClient) OrgRegistryCreate(orgID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error) { + ret := _mock.Called(orgID, registry) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryCreate") + } + + var r0 *woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Registry) (*woodpecker.Registry, error)); ok { + return returnFunc(orgID, registry) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Registry) *woodpecker.Registry); ok { + r0 = returnFunc(orgID, registry) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Registry) error); ok { + r1 = returnFunc(orgID, registry) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgRegistryCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryCreate' +type MockClient_OrgRegistryCreate_Call struct { + *mock.Call +} + +// OrgRegistryCreate is a helper method to define mock.On call +// - orgID int64 +// - registry *woodpecker.Registry +func (_e *MockClient_Expecter) OrgRegistryCreate(orgID interface{}, registry interface{}) *MockClient_OrgRegistryCreate_Call { + return &MockClient_OrgRegistryCreate_Call{Call: _e.mock.On("OrgRegistryCreate", orgID, registry)} +} + +func (_c *MockClient_OrgRegistryCreate_Call) Run(run func(orgID int64, registry *woodpecker.Registry)) *MockClient_OrgRegistryCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Registry + if args[1] != nil { + arg1 = args[1].(*woodpecker.Registry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgRegistryCreate_Call) Return(registry1 *woodpecker.Registry, err error) *MockClient_OrgRegistryCreate_Call { + _c.Call.Return(registry1, err) + return _c +} + +func (_c *MockClient_OrgRegistryCreate_Call) RunAndReturn(run func(orgID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error)) *MockClient_OrgRegistryCreate_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryDelete provides a mock function for the type MockClient +func (_mock *MockClient) OrgRegistryDelete(orgID int64, registry string) error { + ret := _mock.Called(orgID, registry) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, string) error); ok { + r0 = returnFunc(orgID, registry) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_OrgRegistryDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryDelete' +type MockClient_OrgRegistryDelete_Call struct { + *mock.Call +} + +// OrgRegistryDelete is a helper method to define mock.On call +// - orgID int64 +// - registry string +func (_e *MockClient_Expecter) OrgRegistryDelete(orgID interface{}, registry interface{}) *MockClient_OrgRegistryDelete_Call { + return &MockClient_OrgRegistryDelete_Call{Call: _e.mock.On("OrgRegistryDelete", orgID, registry)} +} + +func (_c *MockClient_OrgRegistryDelete_Call) Run(run func(orgID int64, registry string)) *MockClient_OrgRegistryDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgRegistryDelete_Call) Return(err error) *MockClient_OrgRegistryDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_OrgRegistryDelete_Call) RunAndReturn(run func(orgID int64, registry string) error) *MockClient_OrgRegistryDelete_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryList provides a mock function for the type MockClient +func (_mock *MockClient) OrgRegistryList(orgID int64, opt woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error) { + ret := _mock.Called(orgID, opt) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryList") + } + + var r0 []*woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error)); ok { + return returnFunc(orgID, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.RegistryListOptions) []*woodpecker.Registry); ok { + r0 = returnFunc(orgID, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, woodpecker.RegistryListOptions) error); ok { + r1 = returnFunc(orgID, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgRegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryList' +type MockClient_OrgRegistryList_Call struct { + *mock.Call +} + +// OrgRegistryList is a helper method to define mock.On call +// - orgID int64 +// - opt woodpecker.RegistryListOptions +func (_e *MockClient_Expecter) OrgRegistryList(orgID interface{}, opt interface{}) *MockClient_OrgRegistryList_Call { + return &MockClient_OrgRegistryList_Call{Call: _e.mock.On("OrgRegistryList", orgID, opt)} +} + +func (_c *MockClient_OrgRegistryList_Call) Run(run func(orgID int64, opt woodpecker.RegistryListOptions)) *MockClient_OrgRegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 woodpecker.RegistryListOptions + if args[1] != nil { + arg1 = args[1].(woodpecker.RegistryListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgRegistryList_Call) Return(registrys []*woodpecker.Registry, err error) *MockClient_OrgRegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockClient_OrgRegistryList_Call) RunAndReturn(run func(orgID int64, opt woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error)) *MockClient_OrgRegistryList_Call { + _c.Call.Return(run) + return _c +} + +// OrgRegistryUpdate provides a mock function for the type MockClient +func (_mock *MockClient) OrgRegistryUpdate(orgID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error) { + ret := _mock.Called(orgID, registry) + + if len(ret) == 0 { + panic("no return value specified for OrgRegistryUpdate") + } + + var r0 *woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Registry) (*woodpecker.Registry, error)); ok { + return returnFunc(orgID, registry) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Registry) *woodpecker.Registry); ok { + r0 = returnFunc(orgID, registry) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Registry) error); ok { + r1 = returnFunc(orgID, registry) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgRegistryUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgRegistryUpdate' +type MockClient_OrgRegistryUpdate_Call struct { + *mock.Call +} + +// OrgRegistryUpdate is a helper method to define mock.On call +// - orgID int64 +// - registry *woodpecker.Registry +func (_e *MockClient_Expecter) OrgRegistryUpdate(orgID interface{}, registry interface{}) *MockClient_OrgRegistryUpdate_Call { + return &MockClient_OrgRegistryUpdate_Call{Call: _e.mock.On("OrgRegistryUpdate", orgID, registry)} +} + +func (_c *MockClient_OrgRegistryUpdate_Call) Run(run func(orgID int64, registry *woodpecker.Registry)) *MockClient_OrgRegistryUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Registry + if args[1] != nil { + arg1 = args[1].(*woodpecker.Registry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgRegistryUpdate_Call) Return(registry1 *woodpecker.Registry, err error) *MockClient_OrgRegistryUpdate_Call { + _c.Call.Return(registry1, err) + return _c +} + +func (_c *MockClient_OrgRegistryUpdate_Call) RunAndReturn(run func(orgID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error)) *MockClient_OrgRegistryUpdate_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecret provides a mock function for the type MockClient +func (_mock *MockClient) OrgSecret(orgID int64, secret string) (*woodpecker.Secret, error) { + ret := _mock.Called(orgID, secret) + + if len(ret) == 0 { + panic("no return value specified for OrgSecret") + } + + var r0 *woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, string) (*woodpecker.Secret, error)); ok { + return returnFunc(orgID, secret) + } + if returnFunc, ok := ret.Get(0).(func(int64, string) *woodpecker.Secret); ok { + r0 = returnFunc(orgID, secret) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, string) error); ok { + r1 = returnFunc(orgID, secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecret' +type MockClient_OrgSecret_Call struct { + *mock.Call +} + +// OrgSecret is a helper method to define mock.On call +// - orgID int64 +// - secret string +func (_e *MockClient_Expecter) OrgSecret(orgID interface{}, secret interface{}) *MockClient_OrgSecret_Call { + return &MockClient_OrgSecret_Call{Call: _e.mock.On("OrgSecret", orgID, secret)} +} + +func (_c *MockClient_OrgSecret_Call) Run(run func(orgID int64, secret string)) *MockClient_OrgSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgSecret_Call) Return(secret1 *woodpecker.Secret, err error) *MockClient_OrgSecret_Call { + _c.Call.Return(secret1, err) + return _c +} + +func (_c *MockClient_OrgSecret_Call) RunAndReturn(run func(orgID int64, secret string) (*woodpecker.Secret, error)) *MockClient_OrgSecret_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretCreate provides a mock function for the type MockClient +func (_mock *MockClient) OrgSecretCreate(orgID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error) { + ret := _mock.Called(orgID, secret) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretCreate") + } + + var r0 *woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Secret) (*woodpecker.Secret, error)); ok { + return returnFunc(orgID, secret) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Secret) *woodpecker.Secret); ok { + r0 = returnFunc(orgID, secret) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Secret) error); ok { + r1 = returnFunc(orgID, secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgSecretCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretCreate' +type MockClient_OrgSecretCreate_Call struct { + *mock.Call +} + +// OrgSecretCreate is a helper method to define mock.On call +// - orgID int64 +// - secret *woodpecker.Secret +func (_e *MockClient_Expecter) OrgSecretCreate(orgID interface{}, secret interface{}) *MockClient_OrgSecretCreate_Call { + return &MockClient_OrgSecretCreate_Call{Call: _e.mock.On("OrgSecretCreate", orgID, secret)} +} + +func (_c *MockClient_OrgSecretCreate_Call) Run(run func(orgID int64, secret *woodpecker.Secret)) *MockClient_OrgSecretCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Secret + if args[1] != nil { + arg1 = args[1].(*woodpecker.Secret) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgSecretCreate_Call) Return(secret1 *woodpecker.Secret, err error) *MockClient_OrgSecretCreate_Call { + _c.Call.Return(secret1, err) + return _c +} + +func (_c *MockClient_OrgSecretCreate_Call) RunAndReturn(run func(orgID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error)) *MockClient_OrgSecretCreate_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretDelete provides a mock function for the type MockClient +func (_mock *MockClient) OrgSecretDelete(orgID int64, secret string) error { + ret := _mock.Called(orgID, secret) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, string) error); ok { + r0 = returnFunc(orgID, secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_OrgSecretDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretDelete' +type MockClient_OrgSecretDelete_Call struct { + *mock.Call +} + +// OrgSecretDelete is a helper method to define mock.On call +// - orgID int64 +// - secret string +func (_e *MockClient_Expecter) OrgSecretDelete(orgID interface{}, secret interface{}) *MockClient_OrgSecretDelete_Call { + return &MockClient_OrgSecretDelete_Call{Call: _e.mock.On("OrgSecretDelete", orgID, secret)} +} + +func (_c *MockClient_OrgSecretDelete_Call) Run(run func(orgID int64, secret string)) *MockClient_OrgSecretDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgSecretDelete_Call) Return(err error) *MockClient_OrgSecretDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_OrgSecretDelete_Call) RunAndReturn(run func(orgID int64, secret string) error) *MockClient_OrgSecretDelete_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretList provides a mock function for the type MockClient +func (_mock *MockClient) OrgSecretList(orgID int64, opt woodpecker.SecretListOptions) ([]*woodpecker.Secret, error) { + ret := _mock.Called(orgID, opt) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretList") + } + + var r0 []*woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.SecretListOptions) ([]*woodpecker.Secret, error)); ok { + return returnFunc(orgID, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.SecretListOptions) []*woodpecker.Secret); ok { + r0 = returnFunc(orgID, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, woodpecker.SecretListOptions) error); ok { + r1 = returnFunc(orgID, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgSecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretList' +type MockClient_OrgSecretList_Call struct { + *mock.Call +} + +// OrgSecretList is a helper method to define mock.On call +// - orgID int64 +// - opt woodpecker.SecretListOptions +func (_e *MockClient_Expecter) OrgSecretList(orgID interface{}, opt interface{}) *MockClient_OrgSecretList_Call { + return &MockClient_OrgSecretList_Call{Call: _e.mock.On("OrgSecretList", orgID, opt)} +} + +func (_c *MockClient_OrgSecretList_Call) Run(run func(orgID int64, opt woodpecker.SecretListOptions)) *MockClient_OrgSecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 woodpecker.SecretListOptions + if args[1] != nil { + arg1 = args[1].(woodpecker.SecretListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgSecretList_Call) Return(secrets []*woodpecker.Secret, err error) *MockClient_OrgSecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockClient_OrgSecretList_Call) RunAndReturn(run func(orgID int64, opt woodpecker.SecretListOptions) ([]*woodpecker.Secret, error)) *MockClient_OrgSecretList_Call { + _c.Call.Return(run) + return _c +} + +// OrgSecretUpdate provides a mock function for the type MockClient +func (_mock *MockClient) OrgSecretUpdate(orgID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error) { + ret := _mock.Called(orgID, secret) + + if len(ret) == 0 { + panic("no return value specified for OrgSecretUpdate") + } + + var r0 *woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Secret) (*woodpecker.Secret, error)); ok { + return returnFunc(orgID, secret) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Secret) *woodpecker.Secret); ok { + r0 = returnFunc(orgID, secret) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Secret) error); ok { + r1 = returnFunc(orgID, secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_OrgSecretUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OrgSecretUpdate' +type MockClient_OrgSecretUpdate_Call struct { + *mock.Call +} + +// OrgSecretUpdate is a helper method to define mock.On call +// - orgID int64 +// - secret *woodpecker.Secret +func (_e *MockClient_Expecter) OrgSecretUpdate(orgID interface{}, secret interface{}) *MockClient_OrgSecretUpdate_Call { + return &MockClient_OrgSecretUpdate_Call{Call: _e.mock.On("OrgSecretUpdate", orgID, secret)} +} + +func (_c *MockClient_OrgSecretUpdate_Call) Run(run func(orgID int64, secret *woodpecker.Secret)) *MockClient_OrgSecretUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Secret + if args[1] != nil { + arg1 = args[1].(*woodpecker.Secret) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_OrgSecretUpdate_Call) Return(secret1 *woodpecker.Secret, err error) *MockClient_OrgSecretUpdate_Call { + _c.Call.Return(secret1, err) + return _c +} + +func (_c *MockClient_OrgSecretUpdate_Call) RunAndReturn(run func(orgID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error)) *MockClient_OrgSecretUpdate_Call { + _c.Call.Return(run) + return _c +} + +// Pipeline provides a mock function for the type MockClient +func (_mock *MockClient) Pipeline(repoID int64, pipeline int64) (*woodpecker.Pipeline, error) { + ret := _mock.Called(repoID, pipeline) + + if len(ret) == 0 { + panic("no return value specified for Pipeline") + } + + var r0 *woodpecker.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, int64) (*woodpecker.Pipeline, error)); ok { + return returnFunc(repoID, pipeline) + } + if returnFunc, ok := ret.Get(0).(func(int64, int64) *woodpecker.Pipeline); ok { + r0 = returnFunc(repoID, pipeline) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, int64) error); ok { + r1 = returnFunc(repoID, pipeline) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_Pipeline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pipeline' +type MockClient_Pipeline_Call struct { + *mock.Call +} + +// Pipeline is a helper method to define mock.On call +// - repoID int64 +// - pipeline int64 +func (_e *MockClient_Expecter) Pipeline(repoID interface{}, pipeline interface{}) *MockClient_Pipeline_Call { + return &MockClient_Pipeline_Call{Call: _e.mock.On("Pipeline", repoID, pipeline)} +} + +func (_c *MockClient_Pipeline_Call) Run(run func(repoID int64, pipeline int64)) *MockClient_Pipeline_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_Pipeline_Call) Return(pipeline1 *woodpecker.Pipeline, err error) *MockClient_Pipeline_Call { + _c.Call.Return(pipeline1, err) + return _c +} + +func (_c *MockClient_Pipeline_Call) RunAndReturn(run func(repoID int64, pipeline int64) (*woodpecker.Pipeline, error)) *MockClient_Pipeline_Call { + _c.Call.Return(run) + return _c +} + +// PipelineApprove provides a mock function for the type MockClient +func (_mock *MockClient) PipelineApprove(repoID int64, pipeline int64) (*woodpecker.Pipeline, error) { + ret := _mock.Called(repoID, pipeline) + + if len(ret) == 0 { + panic("no return value specified for PipelineApprove") + } + + var r0 *woodpecker.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, int64) (*woodpecker.Pipeline, error)); ok { + return returnFunc(repoID, pipeline) + } + if returnFunc, ok := ret.Get(0).(func(int64, int64) *woodpecker.Pipeline); ok { + r0 = returnFunc(repoID, pipeline) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, int64) error); ok { + r1 = returnFunc(repoID, pipeline) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_PipelineApprove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineApprove' +type MockClient_PipelineApprove_Call struct { + *mock.Call +} + +// PipelineApprove is a helper method to define mock.On call +// - repoID int64 +// - pipeline int64 +func (_e *MockClient_Expecter) PipelineApprove(repoID interface{}, pipeline interface{}) *MockClient_PipelineApprove_Call { + return &MockClient_PipelineApprove_Call{Call: _e.mock.On("PipelineApprove", repoID, pipeline)} +} + +func (_c *MockClient_PipelineApprove_Call) Run(run func(repoID int64, pipeline int64)) *MockClient_PipelineApprove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_PipelineApprove_Call) Return(pipeline1 *woodpecker.Pipeline, err error) *MockClient_PipelineApprove_Call { + _c.Call.Return(pipeline1, err) + return _c +} + +func (_c *MockClient_PipelineApprove_Call) RunAndReturn(run func(repoID int64, pipeline int64) (*woodpecker.Pipeline, error)) *MockClient_PipelineApprove_Call { + _c.Call.Return(run) + return _c +} + +// PipelineCreate provides a mock function for the type MockClient +func (_mock *MockClient) PipelineCreate(repoID int64, opts *woodpecker.PipelineOptions) (*woodpecker.Pipeline, error) { + ret := _mock.Called(repoID, opts) + + if len(ret) == 0 { + panic("no return value specified for PipelineCreate") + } + + var r0 *woodpecker.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.PipelineOptions) (*woodpecker.Pipeline, error)); ok { + return returnFunc(repoID, opts) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.PipelineOptions) *woodpecker.Pipeline); ok { + r0 = returnFunc(repoID, opts) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.PipelineOptions) error); ok { + r1 = returnFunc(repoID, opts) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_PipelineCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineCreate' +type MockClient_PipelineCreate_Call struct { + *mock.Call +} + +// PipelineCreate is a helper method to define mock.On call +// - repoID int64 +// - opts *woodpecker.PipelineOptions +func (_e *MockClient_Expecter) PipelineCreate(repoID interface{}, opts interface{}) *MockClient_PipelineCreate_Call { + return &MockClient_PipelineCreate_Call{Call: _e.mock.On("PipelineCreate", repoID, opts)} +} + +func (_c *MockClient_PipelineCreate_Call) Run(run func(repoID int64, opts *woodpecker.PipelineOptions)) *MockClient_PipelineCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.PipelineOptions + if args[1] != nil { + arg1 = args[1].(*woodpecker.PipelineOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_PipelineCreate_Call) Return(pipeline *woodpecker.Pipeline, err error) *MockClient_PipelineCreate_Call { + _c.Call.Return(pipeline, err) + return _c +} + +func (_c *MockClient_PipelineCreate_Call) RunAndReturn(run func(repoID int64, opts *woodpecker.PipelineOptions) (*woodpecker.Pipeline, error)) *MockClient_PipelineCreate_Call { + _c.Call.Return(run) + return _c +} + +// PipelineDecline provides a mock function for the type MockClient +func (_mock *MockClient) PipelineDecline(repoID int64, pipeline int64) (*woodpecker.Pipeline, error) { + ret := _mock.Called(repoID, pipeline) + + if len(ret) == 0 { + panic("no return value specified for PipelineDecline") + } + + var r0 *woodpecker.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, int64) (*woodpecker.Pipeline, error)); ok { + return returnFunc(repoID, pipeline) + } + if returnFunc, ok := ret.Get(0).(func(int64, int64) *woodpecker.Pipeline); ok { + r0 = returnFunc(repoID, pipeline) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, int64) error); ok { + r1 = returnFunc(repoID, pipeline) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_PipelineDecline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineDecline' +type MockClient_PipelineDecline_Call struct { + *mock.Call +} + +// PipelineDecline is a helper method to define mock.On call +// - repoID int64 +// - pipeline int64 +func (_e *MockClient_Expecter) PipelineDecline(repoID interface{}, pipeline interface{}) *MockClient_PipelineDecline_Call { + return &MockClient_PipelineDecline_Call{Call: _e.mock.On("PipelineDecline", repoID, pipeline)} +} + +func (_c *MockClient_PipelineDecline_Call) Run(run func(repoID int64, pipeline int64)) *MockClient_PipelineDecline_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_PipelineDecline_Call) Return(pipeline1 *woodpecker.Pipeline, err error) *MockClient_PipelineDecline_Call { + _c.Call.Return(pipeline1, err) + return _c +} + +func (_c *MockClient_PipelineDecline_Call) RunAndReturn(run func(repoID int64, pipeline int64) (*woodpecker.Pipeline, error)) *MockClient_PipelineDecline_Call { + _c.Call.Return(run) + return _c +} + +// PipelineDelete provides a mock function for the type MockClient +func (_mock *MockClient) PipelineDelete(repoID int64, pipeline int64) error { + ret := _mock.Called(repoID, pipeline) + + if len(ret) == 0 { + panic("no return value specified for PipelineDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, int64) error); ok { + r0 = returnFunc(repoID, pipeline) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_PipelineDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineDelete' +type MockClient_PipelineDelete_Call struct { + *mock.Call +} + +// PipelineDelete is a helper method to define mock.On call +// - repoID int64 +// - pipeline int64 +func (_e *MockClient_Expecter) PipelineDelete(repoID interface{}, pipeline interface{}) *MockClient_PipelineDelete_Call { + return &MockClient_PipelineDelete_Call{Call: _e.mock.On("PipelineDelete", repoID, pipeline)} +} + +func (_c *MockClient_PipelineDelete_Call) Run(run func(repoID int64, pipeline int64)) *MockClient_PipelineDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_PipelineDelete_Call) Return(err error) *MockClient_PipelineDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_PipelineDelete_Call) RunAndReturn(run func(repoID int64, pipeline int64) error) *MockClient_PipelineDelete_Call { + _c.Call.Return(run) + return _c +} + +// PipelineLast provides a mock function for the type MockClient +func (_mock *MockClient) PipelineLast(repoID int64, opt woodpecker.PipelineLastOptions) (*woodpecker.Pipeline, error) { + ret := _mock.Called(repoID, opt) + + if len(ret) == 0 { + panic("no return value specified for PipelineLast") + } + + var r0 *woodpecker.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.PipelineLastOptions) (*woodpecker.Pipeline, error)); ok { + return returnFunc(repoID, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.PipelineLastOptions) *woodpecker.Pipeline); ok { + r0 = returnFunc(repoID, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, woodpecker.PipelineLastOptions) error); ok { + r1 = returnFunc(repoID, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_PipelineLast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineLast' +type MockClient_PipelineLast_Call struct { + *mock.Call +} + +// PipelineLast is a helper method to define mock.On call +// - repoID int64 +// - opt woodpecker.PipelineLastOptions +func (_e *MockClient_Expecter) PipelineLast(repoID interface{}, opt interface{}) *MockClient_PipelineLast_Call { + return &MockClient_PipelineLast_Call{Call: _e.mock.On("PipelineLast", repoID, opt)} +} + +func (_c *MockClient_PipelineLast_Call) Run(run func(repoID int64, opt woodpecker.PipelineLastOptions)) *MockClient_PipelineLast_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 woodpecker.PipelineLastOptions + if args[1] != nil { + arg1 = args[1].(woodpecker.PipelineLastOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_PipelineLast_Call) Return(pipeline *woodpecker.Pipeline, err error) *MockClient_PipelineLast_Call { + _c.Call.Return(pipeline, err) + return _c +} + +func (_c *MockClient_PipelineLast_Call) RunAndReturn(run func(repoID int64, opt woodpecker.PipelineLastOptions) (*woodpecker.Pipeline, error)) *MockClient_PipelineLast_Call { + _c.Call.Return(run) + return _c +} + +// PipelineList provides a mock function for the type MockClient +func (_mock *MockClient) PipelineList(repoID int64, opt woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error) { + ret := _mock.Called(repoID, opt) + + if len(ret) == 0 { + panic("no return value specified for PipelineList") + } + + var r0 []*woodpecker.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error)); ok { + return returnFunc(repoID, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.PipelineListOptions) []*woodpecker.Pipeline); ok { + r0 = returnFunc(repoID, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, woodpecker.PipelineListOptions) error); ok { + r1 = returnFunc(repoID, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_PipelineList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineList' +type MockClient_PipelineList_Call struct { + *mock.Call +} + +// PipelineList is a helper method to define mock.On call +// - repoID int64 +// - opt woodpecker.PipelineListOptions +func (_e *MockClient_Expecter) PipelineList(repoID interface{}, opt interface{}) *MockClient_PipelineList_Call { + return &MockClient_PipelineList_Call{Call: _e.mock.On("PipelineList", repoID, opt)} +} + +func (_c *MockClient_PipelineList_Call) Run(run func(repoID int64, opt woodpecker.PipelineListOptions)) *MockClient_PipelineList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 woodpecker.PipelineListOptions + if args[1] != nil { + arg1 = args[1].(woodpecker.PipelineListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_PipelineList_Call) Return(pipelines []*woodpecker.Pipeline, err error) *MockClient_PipelineList_Call { + _c.Call.Return(pipelines, err) + return _c +} + +func (_c *MockClient_PipelineList_Call) RunAndReturn(run func(repoID int64, opt woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error)) *MockClient_PipelineList_Call { + _c.Call.Return(run) + return _c +} + +// PipelineMetadata provides a mock function for the type MockClient +func (_mock *MockClient) PipelineMetadata(repoID int64, pipelineNumber int) ([]byte, error) { + ret := _mock.Called(repoID, pipelineNumber) + + if len(ret) == 0 { + panic("no return value specified for PipelineMetadata") + } + + var r0 []byte + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, int) ([]byte, error)); ok { + return returnFunc(repoID, pipelineNumber) + } + if returnFunc, ok := ret.Get(0).(func(int64, int) []byte); ok { + r0 = returnFunc(repoID, pipelineNumber) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, int) error); ok { + r1 = returnFunc(repoID, pipelineNumber) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_PipelineMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineMetadata' +type MockClient_PipelineMetadata_Call struct { + *mock.Call +} + +// PipelineMetadata is a helper method to define mock.On call +// - repoID int64 +// - pipelineNumber int +func (_e *MockClient_Expecter) PipelineMetadata(repoID interface{}, pipelineNumber interface{}) *MockClient_PipelineMetadata_Call { + return &MockClient_PipelineMetadata_Call{Call: _e.mock.On("PipelineMetadata", repoID, pipelineNumber)} +} + +func (_c *MockClient_PipelineMetadata_Call) Run(run func(repoID int64, pipelineNumber int)) *MockClient_PipelineMetadata_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int + if args[1] != nil { + arg1 = args[1].(int) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_PipelineMetadata_Call) Return(bytes []byte, err error) *MockClient_PipelineMetadata_Call { + _c.Call.Return(bytes, err) + return _c +} + +func (_c *MockClient_PipelineMetadata_Call) RunAndReturn(run func(repoID int64, pipelineNumber int) ([]byte, error)) *MockClient_PipelineMetadata_Call { + _c.Call.Return(run) + return _c +} + +// PipelineQueue provides a mock function for the type MockClient +func (_mock *MockClient) PipelineQueue() ([]*woodpecker.Feed, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for PipelineQueue") + } + + var r0 []*woodpecker.Feed + var r1 error + if returnFunc, ok := ret.Get(0).(func() ([]*woodpecker.Feed, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() []*woodpecker.Feed); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Feed) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_PipelineQueue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineQueue' +type MockClient_PipelineQueue_Call struct { + *mock.Call +} + +// PipelineQueue is a helper method to define mock.On call +func (_e *MockClient_Expecter) PipelineQueue() *MockClient_PipelineQueue_Call { + return &MockClient_PipelineQueue_Call{Call: _e.mock.On("PipelineQueue")} +} + +func (_c *MockClient_PipelineQueue_Call) Run(run func()) *MockClient_PipelineQueue_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClient_PipelineQueue_Call) Return(feeds []*woodpecker.Feed, err error) *MockClient_PipelineQueue_Call { + _c.Call.Return(feeds, err) + return _c +} + +func (_c *MockClient_PipelineQueue_Call) RunAndReturn(run func() ([]*woodpecker.Feed, error)) *MockClient_PipelineQueue_Call { + _c.Call.Return(run) + return _c +} + +// PipelineStart provides a mock function for the type MockClient +func (_mock *MockClient) PipelineStart(repoID int64, num int64, opt woodpecker.PipelineStartOptions) (*woodpecker.Pipeline, error) { + ret := _mock.Called(repoID, num, opt) + + if len(ret) == 0 { + panic("no return value specified for PipelineStart") + } + + var r0 *woodpecker.Pipeline + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, int64, woodpecker.PipelineStartOptions) (*woodpecker.Pipeline, error)); ok { + return returnFunc(repoID, num, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, int64, woodpecker.PipelineStartOptions) *woodpecker.Pipeline); ok { + r0 = returnFunc(repoID, num, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Pipeline) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, int64, woodpecker.PipelineStartOptions) error); ok { + r1 = returnFunc(repoID, num, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_PipelineStart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineStart' +type MockClient_PipelineStart_Call struct { + *mock.Call +} + +// PipelineStart is a helper method to define mock.On call +// - repoID int64 +// - num int64 +// - opt woodpecker.PipelineStartOptions +func (_e *MockClient_Expecter) PipelineStart(repoID interface{}, num interface{}, opt interface{}) *MockClient_PipelineStart_Call { + return &MockClient_PipelineStart_Call{Call: _e.mock.On("PipelineStart", repoID, num, opt)} +} + +func (_c *MockClient_PipelineStart_Call) Run(run func(repoID int64, num int64, opt woodpecker.PipelineStartOptions)) *MockClient_PipelineStart_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + var arg2 woodpecker.PipelineStartOptions + if args[2] != nil { + arg2 = args[2].(woodpecker.PipelineStartOptions) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockClient_PipelineStart_Call) Return(pipeline *woodpecker.Pipeline, err error) *MockClient_PipelineStart_Call { + _c.Call.Return(pipeline, err) + return _c +} + +func (_c *MockClient_PipelineStart_Call) RunAndReturn(run func(repoID int64, num int64, opt woodpecker.PipelineStartOptions) (*woodpecker.Pipeline, error)) *MockClient_PipelineStart_Call { + _c.Call.Return(run) + return _c +} + +// PipelineStop provides a mock function for the type MockClient +func (_mock *MockClient) PipelineStop(repoID int64, pipeline int64) error { + ret := _mock.Called(repoID, pipeline) + + if len(ret) == 0 { + panic("no return value specified for PipelineStop") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, int64) error); ok { + r0 = returnFunc(repoID, pipeline) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_PipelineStop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PipelineStop' +type MockClient_PipelineStop_Call struct { + *mock.Call +} + +// PipelineStop is a helper method to define mock.On call +// - repoID int64 +// - pipeline int64 +func (_e *MockClient_Expecter) PipelineStop(repoID interface{}, pipeline interface{}) *MockClient_PipelineStop_Call { + return &MockClient_PipelineStop_Call{Call: _e.mock.On("PipelineStop", repoID, pipeline)} +} + +func (_c *MockClient_PipelineStop_Call) Run(run func(repoID int64, pipeline int64)) *MockClient_PipelineStop_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_PipelineStop_Call) Return(err error) *MockClient_PipelineStop_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_PipelineStop_Call) RunAndReturn(run func(repoID int64, pipeline int64) error) *MockClient_PipelineStop_Call { + _c.Call.Return(run) + return _c +} + +// QueueInfo provides a mock function for the type MockClient +func (_mock *MockClient) QueueInfo() (*woodpecker.Info, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for QueueInfo") + } + + var r0 *woodpecker.Info + var r1 error + if returnFunc, ok := ret.Get(0).(func() (*woodpecker.Info, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() *woodpecker.Info); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Info) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_QueueInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueueInfo' +type MockClient_QueueInfo_Call struct { + *mock.Call +} + +// QueueInfo is a helper method to define mock.On call +func (_e *MockClient_Expecter) QueueInfo() *MockClient_QueueInfo_Call { + return &MockClient_QueueInfo_Call{Call: _e.mock.On("QueueInfo")} +} + +func (_c *MockClient_QueueInfo_Call) Run(run func()) *MockClient_QueueInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClient_QueueInfo_Call) Return(info *woodpecker.Info, err error) *MockClient_QueueInfo_Call { + _c.Call.Return(info, err) + return _c +} + +func (_c *MockClient_QueueInfo_Call) RunAndReturn(run func() (*woodpecker.Info, error)) *MockClient_QueueInfo_Call { + _c.Call.Return(run) + return _c +} + +// Registry provides a mock function for the type MockClient +func (_mock *MockClient) Registry(repoID int64, hostname string) (*woodpecker.Registry, error) { + ret := _mock.Called(repoID, hostname) + + if len(ret) == 0 { + panic("no return value specified for Registry") + } + + var r0 *woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, string) (*woodpecker.Registry, error)); ok { + return returnFunc(repoID, hostname) + } + if returnFunc, ok := ret.Get(0).(func(int64, string) *woodpecker.Registry); ok { + r0 = returnFunc(repoID, hostname) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, string) error); ok { + r1 = returnFunc(repoID, hostname) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_Registry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Registry' +type MockClient_Registry_Call struct { + *mock.Call +} + +// Registry is a helper method to define mock.On call +// - repoID int64 +// - hostname string +func (_e *MockClient_Expecter) Registry(repoID interface{}, hostname interface{}) *MockClient_Registry_Call { + return &MockClient_Registry_Call{Call: _e.mock.On("Registry", repoID, hostname)} +} + +func (_c *MockClient_Registry_Call) Run(run func(repoID int64, hostname string)) *MockClient_Registry_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_Registry_Call) Return(registry *woodpecker.Registry, err error) *MockClient_Registry_Call { + _c.Call.Return(registry, err) + return _c +} + +func (_c *MockClient_Registry_Call) RunAndReturn(run func(repoID int64, hostname string) (*woodpecker.Registry, error)) *MockClient_Registry_Call { + _c.Call.Return(run) + return _c +} + +// RegistryCreate provides a mock function for the type MockClient +func (_mock *MockClient) RegistryCreate(repoID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error) { + ret := _mock.Called(repoID, registry) + + if len(ret) == 0 { + panic("no return value specified for RegistryCreate") + } + + var r0 *woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Registry) (*woodpecker.Registry, error)); ok { + return returnFunc(repoID, registry) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Registry) *woodpecker.Registry); ok { + r0 = returnFunc(repoID, registry) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Registry) error); ok { + r1 = returnFunc(repoID, registry) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_RegistryCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryCreate' +type MockClient_RegistryCreate_Call struct { + *mock.Call +} + +// RegistryCreate is a helper method to define mock.On call +// - repoID int64 +// - registry *woodpecker.Registry +func (_e *MockClient_Expecter) RegistryCreate(repoID interface{}, registry interface{}) *MockClient_RegistryCreate_Call { + return &MockClient_RegistryCreate_Call{Call: _e.mock.On("RegistryCreate", repoID, registry)} +} + +func (_c *MockClient_RegistryCreate_Call) Run(run func(repoID int64, registry *woodpecker.Registry)) *MockClient_RegistryCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Registry + if args[1] != nil { + arg1 = args[1].(*woodpecker.Registry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_RegistryCreate_Call) Return(registry1 *woodpecker.Registry, err error) *MockClient_RegistryCreate_Call { + _c.Call.Return(registry1, err) + return _c +} + +func (_c *MockClient_RegistryCreate_Call) RunAndReturn(run func(repoID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error)) *MockClient_RegistryCreate_Call { + _c.Call.Return(run) + return _c +} + +// RegistryDelete provides a mock function for the type MockClient +func (_mock *MockClient) RegistryDelete(repoID int64, hostname string) error { + ret := _mock.Called(repoID, hostname) + + if len(ret) == 0 { + panic("no return value specified for RegistryDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, string) error); ok { + r0 = returnFunc(repoID, hostname) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_RegistryDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryDelete' +type MockClient_RegistryDelete_Call struct { + *mock.Call +} + +// RegistryDelete is a helper method to define mock.On call +// - repoID int64 +// - hostname string +func (_e *MockClient_Expecter) RegistryDelete(repoID interface{}, hostname interface{}) *MockClient_RegistryDelete_Call { + return &MockClient_RegistryDelete_Call{Call: _e.mock.On("RegistryDelete", repoID, hostname)} +} + +func (_c *MockClient_RegistryDelete_Call) Run(run func(repoID int64, hostname string)) *MockClient_RegistryDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_RegistryDelete_Call) Return(err error) *MockClient_RegistryDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_RegistryDelete_Call) RunAndReturn(run func(repoID int64, hostname string) error) *MockClient_RegistryDelete_Call { + _c.Call.Return(run) + return _c +} + +// RegistryList provides a mock function for the type MockClient +func (_mock *MockClient) RegistryList(repoID int64, opt woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error) { + ret := _mock.Called(repoID, opt) + + if len(ret) == 0 { + panic("no return value specified for RegistryList") + } + + var r0 []*woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error)); ok { + return returnFunc(repoID, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.RegistryListOptions) []*woodpecker.Registry); ok { + r0 = returnFunc(repoID, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, woodpecker.RegistryListOptions) error); ok { + r1 = returnFunc(repoID, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_RegistryList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryList' +type MockClient_RegistryList_Call struct { + *mock.Call +} + +// RegistryList is a helper method to define mock.On call +// - repoID int64 +// - opt woodpecker.RegistryListOptions +func (_e *MockClient_Expecter) RegistryList(repoID interface{}, opt interface{}) *MockClient_RegistryList_Call { + return &MockClient_RegistryList_Call{Call: _e.mock.On("RegistryList", repoID, opt)} +} + +func (_c *MockClient_RegistryList_Call) Run(run func(repoID int64, opt woodpecker.RegistryListOptions)) *MockClient_RegistryList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 woodpecker.RegistryListOptions + if args[1] != nil { + arg1 = args[1].(woodpecker.RegistryListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_RegistryList_Call) Return(registrys []*woodpecker.Registry, err error) *MockClient_RegistryList_Call { + _c.Call.Return(registrys, err) + return _c +} + +func (_c *MockClient_RegistryList_Call) RunAndReturn(run func(repoID int64, opt woodpecker.RegistryListOptions) ([]*woodpecker.Registry, error)) *MockClient_RegistryList_Call { + _c.Call.Return(run) + return _c +} + +// RegistryUpdate provides a mock function for the type MockClient +func (_mock *MockClient) RegistryUpdate(repoID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error) { + ret := _mock.Called(repoID, registry) + + if len(ret) == 0 { + panic("no return value specified for RegistryUpdate") + } + + var r0 *woodpecker.Registry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Registry) (*woodpecker.Registry, error)); ok { + return returnFunc(repoID, registry) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Registry) *woodpecker.Registry); ok { + r0 = returnFunc(repoID, registry) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Registry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Registry) error); ok { + r1 = returnFunc(repoID, registry) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_RegistryUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegistryUpdate' +type MockClient_RegistryUpdate_Call struct { + *mock.Call +} + +// RegistryUpdate is a helper method to define mock.On call +// - repoID int64 +// - registry *woodpecker.Registry +func (_e *MockClient_Expecter) RegistryUpdate(repoID interface{}, registry interface{}) *MockClient_RegistryUpdate_Call { + return &MockClient_RegistryUpdate_Call{Call: _e.mock.On("RegistryUpdate", repoID, registry)} +} + +func (_c *MockClient_RegistryUpdate_Call) Run(run func(repoID int64, registry *woodpecker.Registry)) *MockClient_RegistryUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Registry + if args[1] != nil { + arg1 = args[1].(*woodpecker.Registry) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_RegistryUpdate_Call) Return(registry1 *woodpecker.Registry, err error) *MockClient_RegistryUpdate_Call { + _c.Call.Return(registry1, err) + return _c +} + +func (_c *MockClient_RegistryUpdate_Call) RunAndReturn(run func(repoID int64, registry *woodpecker.Registry) (*woodpecker.Registry, error)) *MockClient_RegistryUpdate_Call { + _c.Call.Return(run) + return _c +} + +// Repo provides a mock function for the type MockClient +func (_mock *MockClient) Repo(repoID int64) (*woodpecker.Repo, error) { + ret := _mock.Called(repoID) + + if len(ret) == 0 { + panic("no return value specified for Repo") + } + + var r0 *woodpecker.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*woodpecker.Repo, error)); ok { + return returnFunc(repoID) + } + if returnFunc, ok := ret.Get(0).(func(int64) *woodpecker.Repo); ok { + r0 = returnFunc(repoID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(repoID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_Repo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Repo' +type MockClient_Repo_Call struct { + *mock.Call +} + +// Repo is a helper method to define mock.On call +// - repoID int64 +func (_e *MockClient_Expecter) Repo(repoID interface{}) *MockClient_Repo_Call { + return &MockClient_Repo_Call{Call: _e.mock.On("Repo", repoID)} +} + +func (_c *MockClient_Repo_Call) Run(run func(repoID int64)) *MockClient_Repo_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_Repo_Call) Return(repo *woodpecker.Repo, err error) *MockClient_Repo_Call { + _c.Call.Return(repo, err) + return _c +} + +func (_c *MockClient_Repo_Call) RunAndReturn(run func(repoID int64) (*woodpecker.Repo, error)) *MockClient_Repo_Call { + _c.Call.Return(run) + return _c +} + +// RepoChown provides a mock function for the type MockClient +func (_mock *MockClient) RepoChown(repoID int64) (*woodpecker.Repo, error) { + ret := _mock.Called(repoID) + + if len(ret) == 0 { + panic("no return value specified for RepoChown") + } + + var r0 *woodpecker.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64) (*woodpecker.Repo, error)); ok { + return returnFunc(repoID) + } + if returnFunc, ok := ret.Get(0).(func(int64) *woodpecker.Repo); ok { + r0 = returnFunc(repoID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(repoID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_RepoChown_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoChown' +type MockClient_RepoChown_Call struct { + *mock.Call +} + +// RepoChown is a helper method to define mock.On call +// - repoID int64 +func (_e *MockClient_Expecter) RepoChown(repoID interface{}) *MockClient_RepoChown_Call { + return &MockClient_RepoChown_Call{Call: _e.mock.On("RepoChown", repoID)} +} + +func (_c *MockClient_RepoChown_Call) Run(run func(repoID int64)) *MockClient_RepoChown_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_RepoChown_Call) Return(repo *woodpecker.Repo, err error) *MockClient_RepoChown_Call { + _c.Call.Return(repo, err) + return _c +} + +func (_c *MockClient_RepoChown_Call) RunAndReturn(run func(repoID int64) (*woodpecker.Repo, error)) *MockClient_RepoChown_Call { + _c.Call.Return(run) + return _c +} + +// RepoDel provides a mock function for the type MockClient +func (_mock *MockClient) RepoDel(repoID int64) error { + ret := _mock.Called(repoID) + + if len(ret) == 0 { + panic("no return value specified for RepoDel") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64) error); ok { + r0 = returnFunc(repoID) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_RepoDel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoDel' +type MockClient_RepoDel_Call struct { + *mock.Call +} + +// RepoDel is a helper method to define mock.On call +// - repoID int64 +func (_e *MockClient_Expecter) RepoDel(repoID interface{}) *MockClient_RepoDel_Call { + return &MockClient_RepoDel_Call{Call: _e.mock.On("RepoDel", repoID)} +} + +func (_c *MockClient_RepoDel_Call) Run(run func(repoID int64)) *MockClient_RepoDel_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_RepoDel_Call) Return(err error) *MockClient_RepoDel_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_RepoDel_Call) RunAndReturn(run func(repoID int64) error) *MockClient_RepoDel_Call { + _c.Call.Return(run) + return _c +} + +// RepoList provides a mock function for the type MockClient +func (_mock *MockClient) RepoList(opt woodpecker.RepoListOptions) ([]*woodpecker.Repo, error) { + ret := _mock.Called(opt) + + if len(ret) == 0 { + panic("no return value specified for RepoList") + } + + var r0 []*woodpecker.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(woodpecker.RepoListOptions) ([]*woodpecker.Repo, error)); ok { + return returnFunc(opt) + } + if returnFunc, ok := ret.Get(0).(func(woodpecker.RepoListOptions) []*woodpecker.Repo); ok { + r0 = returnFunc(opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(woodpecker.RepoListOptions) error); ok { + r1 = returnFunc(opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_RepoList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoList' +type MockClient_RepoList_Call struct { + *mock.Call +} + +// RepoList is a helper method to define mock.On call +// - opt woodpecker.RepoListOptions +func (_e *MockClient_Expecter) RepoList(opt interface{}) *MockClient_RepoList_Call { + return &MockClient_RepoList_Call{Call: _e.mock.On("RepoList", opt)} +} + +func (_c *MockClient_RepoList_Call) Run(run func(opt woodpecker.RepoListOptions)) *MockClient_RepoList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 woodpecker.RepoListOptions + if args[0] != nil { + arg0 = args[0].(woodpecker.RepoListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_RepoList_Call) Return(repos []*woodpecker.Repo, err error) *MockClient_RepoList_Call { + _c.Call.Return(repos, err) + return _c +} + +func (_c *MockClient_RepoList_Call) RunAndReturn(run func(opt woodpecker.RepoListOptions) ([]*woodpecker.Repo, error)) *MockClient_RepoList_Call { + _c.Call.Return(run) + return _c +} + +// RepoLookup provides a mock function for the type MockClient +func (_mock *MockClient) RepoLookup(repoFullName string) (*woodpecker.Repo, error) { + ret := _mock.Called(repoFullName) + + if len(ret) == 0 { + panic("no return value specified for RepoLookup") + } + + var r0 *woodpecker.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*woodpecker.Repo, error)); ok { + return returnFunc(repoFullName) + } + if returnFunc, ok := ret.Get(0).(func(string) *woodpecker.Repo); ok { + r0 = returnFunc(repoFullName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(repoFullName) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_RepoLookup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoLookup' +type MockClient_RepoLookup_Call struct { + *mock.Call +} + +// RepoLookup is a helper method to define mock.On call +// - repoFullName string +func (_e *MockClient_Expecter) RepoLookup(repoFullName interface{}) *MockClient_RepoLookup_Call { + return &MockClient_RepoLookup_Call{Call: _e.mock.On("RepoLookup", repoFullName)} +} + +func (_c *MockClient_RepoLookup_Call) Run(run func(repoFullName string)) *MockClient_RepoLookup_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_RepoLookup_Call) Return(repo *woodpecker.Repo, err error) *MockClient_RepoLookup_Call { + _c.Call.Return(repo, err) + return _c +} + +func (_c *MockClient_RepoLookup_Call) RunAndReturn(run func(repoFullName string) (*woodpecker.Repo, error)) *MockClient_RepoLookup_Call { + _c.Call.Return(run) + return _c +} + +// RepoMove provides a mock function for the type MockClient +func (_mock *MockClient) RepoMove(repoID int64, opt woodpecker.RepoMoveOptions) error { + ret := _mock.Called(repoID, opt) + + if len(ret) == 0 { + panic("no return value specified for RepoMove") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.RepoMoveOptions) error); ok { + r0 = returnFunc(repoID, opt) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_RepoMove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoMove' +type MockClient_RepoMove_Call struct { + *mock.Call +} + +// RepoMove is a helper method to define mock.On call +// - repoID int64 +// - opt woodpecker.RepoMoveOptions +func (_e *MockClient_Expecter) RepoMove(repoID interface{}, opt interface{}) *MockClient_RepoMove_Call { + return &MockClient_RepoMove_Call{Call: _e.mock.On("RepoMove", repoID, opt)} +} + +func (_c *MockClient_RepoMove_Call) Run(run func(repoID int64, opt woodpecker.RepoMoveOptions)) *MockClient_RepoMove_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 woodpecker.RepoMoveOptions + if args[1] != nil { + arg1 = args[1].(woodpecker.RepoMoveOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_RepoMove_Call) Return(err error) *MockClient_RepoMove_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_RepoMove_Call) RunAndReturn(run func(repoID int64, opt woodpecker.RepoMoveOptions) error) *MockClient_RepoMove_Call { + _c.Call.Return(run) + return _c +} + +// RepoPatch provides a mock function for the type MockClient +func (_mock *MockClient) RepoPatch(repoID int64, repo *woodpecker.RepoPatch) (*woodpecker.Repo, error) { + ret := _mock.Called(repoID, repo) + + if len(ret) == 0 { + panic("no return value specified for RepoPatch") + } + + var r0 *woodpecker.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.RepoPatch) (*woodpecker.Repo, error)); ok { + return returnFunc(repoID, repo) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.RepoPatch) *woodpecker.Repo); ok { + r0 = returnFunc(repoID, repo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.RepoPatch) error); ok { + r1 = returnFunc(repoID, repo) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_RepoPatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoPatch' +type MockClient_RepoPatch_Call struct { + *mock.Call +} + +// RepoPatch is a helper method to define mock.On call +// - repoID int64 +// - repo *woodpecker.RepoPatch +func (_e *MockClient_Expecter) RepoPatch(repoID interface{}, repo interface{}) *MockClient_RepoPatch_Call { + return &MockClient_RepoPatch_Call{Call: _e.mock.On("RepoPatch", repoID, repo)} +} + +func (_c *MockClient_RepoPatch_Call) Run(run func(repoID int64, repo *woodpecker.RepoPatch)) *MockClient_RepoPatch_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.RepoPatch + if args[1] != nil { + arg1 = args[1].(*woodpecker.RepoPatch) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_RepoPatch_Call) Return(repo1 *woodpecker.Repo, err error) *MockClient_RepoPatch_Call { + _c.Call.Return(repo1, err) + return _c +} + +func (_c *MockClient_RepoPatch_Call) RunAndReturn(run func(repoID int64, repo *woodpecker.RepoPatch) (*woodpecker.Repo, error)) *MockClient_RepoPatch_Call { + _c.Call.Return(run) + return _c +} + +// RepoPost provides a mock function for the type MockClient +func (_mock *MockClient) RepoPost(opt woodpecker.RepoPostOptions) (*woodpecker.Repo, error) { + ret := _mock.Called(opt) + + if len(ret) == 0 { + panic("no return value specified for RepoPost") + } + + var r0 *woodpecker.Repo + var r1 error + if returnFunc, ok := ret.Get(0).(func(woodpecker.RepoPostOptions) (*woodpecker.Repo, error)); ok { + return returnFunc(opt) + } + if returnFunc, ok := ret.Get(0).(func(woodpecker.RepoPostOptions) *woodpecker.Repo); ok { + r0 = returnFunc(opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Repo) + } + } + if returnFunc, ok := ret.Get(1).(func(woodpecker.RepoPostOptions) error); ok { + r1 = returnFunc(opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_RepoPost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoPost' +type MockClient_RepoPost_Call struct { + *mock.Call +} + +// RepoPost is a helper method to define mock.On call +// - opt woodpecker.RepoPostOptions +func (_e *MockClient_Expecter) RepoPost(opt interface{}) *MockClient_RepoPost_Call { + return &MockClient_RepoPost_Call{Call: _e.mock.On("RepoPost", opt)} +} + +func (_c *MockClient_RepoPost_Call) Run(run func(opt woodpecker.RepoPostOptions)) *MockClient_RepoPost_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 woodpecker.RepoPostOptions + if args[0] != nil { + arg0 = args[0].(woodpecker.RepoPostOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_RepoPost_Call) Return(repo *woodpecker.Repo, err error) *MockClient_RepoPost_Call { + _c.Call.Return(repo, err) + return _c +} + +func (_c *MockClient_RepoPost_Call) RunAndReturn(run func(opt woodpecker.RepoPostOptions) (*woodpecker.Repo, error)) *MockClient_RepoPost_Call { + _c.Call.Return(run) + return _c +} + +// RepoRepair provides a mock function for the type MockClient +func (_mock *MockClient) RepoRepair(repoID int64) error { + ret := _mock.Called(repoID) + + if len(ret) == 0 { + panic("no return value specified for RepoRepair") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64) error); ok { + r0 = returnFunc(repoID) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_RepoRepair_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RepoRepair' +type MockClient_RepoRepair_Call struct { + *mock.Call +} + +// RepoRepair is a helper method to define mock.On call +// - repoID int64 +func (_e *MockClient_Expecter) RepoRepair(repoID interface{}) *MockClient_RepoRepair_Call { + return &MockClient_RepoRepair_Call{Call: _e.mock.On("RepoRepair", repoID)} +} + +func (_c *MockClient_RepoRepair_Call) Run(run func(repoID int64)) *MockClient_RepoRepair_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_RepoRepair_Call) Return(err error) *MockClient_RepoRepair_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_RepoRepair_Call) RunAndReturn(run func(repoID int64) error) *MockClient_RepoRepair_Call { + _c.Call.Return(run) + return _c +} + +// Secret provides a mock function for the type MockClient +func (_mock *MockClient) Secret(repoID int64, secret string) (*woodpecker.Secret, error) { + ret := _mock.Called(repoID, secret) + + if len(ret) == 0 { + panic("no return value specified for Secret") + } + + var r0 *woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, string) (*woodpecker.Secret, error)); ok { + return returnFunc(repoID, secret) + } + if returnFunc, ok := ret.Get(0).(func(int64, string) *woodpecker.Secret); ok { + r0 = returnFunc(repoID, secret) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, string) error); ok { + r1 = returnFunc(repoID, secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_Secret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Secret' +type MockClient_Secret_Call struct { + *mock.Call +} + +// Secret is a helper method to define mock.On call +// - repoID int64 +// - secret string +func (_e *MockClient_Expecter) Secret(repoID interface{}, secret interface{}) *MockClient_Secret_Call { + return &MockClient_Secret_Call{Call: _e.mock.On("Secret", repoID, secret)} +} + +func (_c *MockClient_Secret_Call) Run(run func(repoID int64, secret string)) *MockClient_Secret_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_Secret_Call) Return(secret1 *woodpecker.Secret, err error) *MockClient_Secret_Call { + _c.Call.Return(secret1, err) + return _c +} + +func (_c *MockClient_Secret_Call) RunAndReturn(run func(repoID int64, secret string) (*woodpecker.Secret, error)) *MockClient_Secret_Call { + _c.Call.Return(run) + return _c +} + +// SecretCreate provides a mock function for the type MockClient +func (_mock *MockClient) SecretCreate(repoID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error) { + ret := _mock.Called(repoID, secret) + + if len(ret) == 0 { + panic("no return value specified for SecretCreate") + } + + var r0 *woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Secret) (*woodpecker.Secret, error)); ok { + return returnFunc(repoID, secret) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Secret) *woodpecker.Secret); ok { + r0 = returnFunc(repoID, secret) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Secret) error); ok { + r1 = returnFunc(repoID, secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_SecretCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretCreate' +type MockClient_SecretCreate_Call struct { + *mock.Call +} + +// SecretCreate is a helper method to define mock.On call +// - repoID int64 +// - secret *woodpecker.Secret +func (_e *MockClient_Expecter) SecretCreate(repoID interface{}, secret interface{}) *MockClient_SecretCreate_Call { + return &MockClient_SecretCreate_Call{Call: _e.mock.On("SecretCreate", repoID, secret)} +} + +func (_c *MockClient_SecretCreate_Call) Run(run func(repoID int64, secret *woodpecker.Secret)) *MockClient_SecretCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Secret + if args[1] != nil { + arg1 = args[1].(*woodpecker.Secret) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_SecretCreate_Call) Return(secret1 *woodpecker.Secret, err error) *MockClient_SecretCreate_Call { + _c.Call.Return(secret1, err) + return _c +} + +func (_c *MockClient_SecretCreate_Call) RunAndReturn(run func(repoID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error)) *MockClient_SecretCreate_Call { + _c.Call.Return(run) + return _c +} + +// SecretDelete provides a mock function for the type MockClient +func (_mock *MockClient) SecretDelete(repoID int64, secret string) error { + ret := _mock.Called(repoID, secret) + + if len(ret) == 0 { + panic("no return value specified for SecretDelete") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, string) error); ok { + r0 = returnFunc(repoID, secret) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_SecretDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretDelete' +type MockClient_SecretDelete_Call struct { + *mock.Call +} + +// SecretDelete is a helper method to define mock.On call +// - repoID int64 +// - secret string +func (_e *MockClient_Expecter) SecretDelete(repoID interface{}, secret interface{}) *MockClient_SecretDelete_Call { + return &MockClient_SecretDelete_Call{Call: _e.mock.On("SecretDelete", repoID, secret)} +} + +func (_c *MockClient_SecretDelete_Call) Run(run func(repoID int64, secret string)) *MockClient_SecretDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_SecretDelete_Call) Return(err error) *MockClient_SecretDelete_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_SecretDelete_Call) RunAndReturn(run func(repoID int64, secret string) error) *MockClient_SecretDelete_Call { + _c.Call.Return(run) + return _c +} + +// SecretList provides a mock function for the type MockClient +func (_mock *MockClient) SecretList(repoID int64, opt woodpecker.SecretListOptions) ([]*woodpecker.Secret, error) { + ret := _mock.Called(repoID, opt) + + if len(ret) == 0 { + panic("no return value specified for SecretList") + } + + var r0 []*woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.SecretListOptions) ([]*woodpecker.Secret, error)); ok { + return returnFunc(repoID, opt) + } + if returnFunc, ok := ret.Get(0).(func(int64, woodpecker.SecretListOptions) []*woodpecker.Secret); ok { + r0 = returnFunc(repoID, opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, woodpecker.SecretListOptions) error); ok { + r1 = returnFunc(repoID, opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_SecretList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretList' +type MockClient_SecretList_Call struct { + *mock.Call +} + +// SecretList is a helper method to define mock.On call +// - repoID int64 +// - opt woodpecker.SecretListOptions +func (_e *MockClient_Expecter) SecretList(repoID interface{}, opt interface{}) *MockClient_SecretList_Call { + return &MockClient_SecretList_Call{Call: _e.mock.On("SecretList", repoID, opt)} +} + +func (_c *MockClient_SecretList_Call) Run(run func(repoID int64, opt woodpecker.SecretListOptions)) *MockClient_SecretList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 woodpecker.SecretListOptions + if args[1] != nil { + arg1 = args[1].(woodpecker.SecretListOptions) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_SecretList_Call) Return(secrets []*woodpecker.Secret, err error) *MockClient_SecretList_Call { + _c.Call.Return(secrets, err) + return _c +} + +func (_c *MockClient_SecretList_Call) RunAndReturn(run func(repoID int64, opt woodpecker.SecretListOptions) ([]*woodpecker.Secret, error)) *MockClient_SecretList_Call { + _c.Call.Return(run) + return _c +} + +// SecretUpdate provides a mock function for the type MockClient +func (_mock *MockClient) SecretUpdate(repoID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error) { + ret := _mock.Called(repoID, secret) + + if len(ret) == 0 { + panic("no return value specified for SecretUpdate") + } + + var r0 *woodpecker.Secret + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Secret) (*woodpecker.Secret, error)); ok { + return returnFunc(repoID, secret) + } + if returnFunc, ok := ret.Get(0).(func(int64, *woodpecker.Secret) *woodpecker.Secret); ok { + r0 = returnFunc(repoID, secret) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.Secret) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, *woodpecker.Secret) error); ok { + r1 = returnFunc(repoID, secret) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_SecretUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SecretUpdate' +type MockClient_SecretUpdate_Call struct { + *mock.Call +} + +// SecretUpdate is a helper method to define mock.On call +// - repoID int64 +// - secret *woodpecker.Secret +func (_e *MockClient_Expecter) SecretUpdate(repoID interface{}, secret interface{}) *MockClient_SecretUpdate_Call { + return &MockClient_SecretUpdate_Call{Call: _e.mock.On("SecretUpdate", repoID, secret)} +} + +func (_c *MockClient_SecretUpdate_Call) Run(run func(repoID int64, secret *woodpecker.Secret)) *MockClient_SecretUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 *woodpecker.Secret + if args[1] != nil { + arg1 = args[1].(*woodpecker.Secret) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_SecretUpdate_Call) Return(secret1 *woodpecker.Secret, err error) *MockClient_SecretUpdate_Call { + _c.Call.Return(secret1, err) + return _c +} + +func (_c *MockClient_SecretUpdate_Call) RunAndReturn(run func(repoID int64, secret *woodpecker.Secret) (*woodpecker.Secret, error)) *MockClient_SecretUpdate_Call { + _c.Call.Return(run) + return _c +} + +// Self provides a mock function for the type MockClient +func (_mock *MockClient) Self() (*woodpecker.User, error) { + ret := _mock.Called() + + if len(ret) == 0 { + panic("no return value specified for Self") + } + + var r0 *woodpecker.User + var r1 error + if returnFunc, ok := ret.Get(0).(func() (*woodpecker.User, error)); ok { + return returnFunc() + } + if returnFunc, ok := ret.Get(0).(func() *woodpecker.User); ok { + r0 = returnFunc() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.User) + } + } + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_Self_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Self' +type MockClient_Self_Call struct { + *mock.Call +} + +// Self is a helper method to define mock.On call +func (_e *MockClient_Expecter) Self() *MockClient_Self_Call { + return &MockClient_Self_Call{Call: _e.mock.On("Self")} +} + +func (_c *MockClient_Self_Call) Run(run func()) *MockClient_Self_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClient_Self_Call) Return(user *woodpecker.User, err error) *MockClient_Self_Call { + _c.Call.Return(user, err) + return _c +} + +func (_c *MockClient_Self_Call) RunAndReturn(run func() (*woodpecker.User, error)) *MockClient_Self_Call { + _c.Call.Return(run) + return _c +} + +// SetAddress provides a mock function for the type MockClient +func (_mock *MockClient) SetAddress(s string) { + _mock.Called(s) + return +} + +// MockClient_SetAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAddress' +type MockClient_SetAddress_Call struct { + *mock.Call +} + +// SetAddress is a helper method to define mock.On call +// - s string +func (_e *MockClient_Expecter) SetAddress(s interface{}) *MockClient_SetAddress_Call { + return &MockClient_SetAddress_Call{Call: _e.mock.On("SetAddress", s)} +} + +func (_c *MockClient_SetAddress_Call) Run(run func(s string)) *MockClient_SetAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_SetAddress_Call) Return() *MockClient_SetAddress_Call { + _c.Call.Return() + return _c +} + +func (_c *MockClient_SetAddress_Call) RunAndReturn(run func(s string)) *MockClient_SetAddress_Call { + _c.Run(run) + return _c +} + +// SetClient provides a mock function for the type MockClient +func (_mock *MockClient) SetClient(client *http.Client) { + _mock.Called(client) + return +} + +// MockClient_SetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetClient' +type MockClient_SetClient_Call struct { + *mock.Call +} + +// SetClient is a helper method to define mock.On call +// - client *http.Client +func (_e *MockClient_Expecter) SetClient(client interface{}) *MockClient_SetClient_Call { + return &MockClient_SetClient_Call{Call: _e.mock.On("SetClient", client)} +} + +func (_c *MockClient_SetClient_Call) Run(run func(client *http.Client)) *MockClient_SetClient_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *http.Client + if args[0] != nil { + arg0 = args[0].(*http.Client) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_SetClient_Call) Return() *MockClient_SetClient_Call { + _c.Call.Return() + return _c +} + +func (_c *MockClient_SetClient_Call) RunAndReturn(run func(client *http.Client)) *MockClient_SetClient_Call { + _c.Run(run) + return _c +} + +// SetLogLevel provides a mock function for the type MockClient +func (_mock *MockClient) SetLogLevel(logLevel *woodpecker.LogLevel) (*woodpecker.LogLevel, error) { + ret := _mock.Called(logLevel) + + if len(ret) == 0 { + panic("no return value specified for SetLogLevel") + } + + var r0 *woodpecker.LogLevel + var r1 error + if returnFunc, ok := ret.Get(0).(func(*woodpecker.LogLevel) (*woodpecker.LogLevel, error)); ok { + return returnFunc(logLevel) + } + if returnFunc, ok := ret.Get(0).(func(*woodpecker.LogLevel) *woodpecker.LogLevel); ok { + r0 = returnFunc(logLevel) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.LogLevel) + } + } + if returnFunc, ok := ret.Get(1).(func(*woodpecker.LogLevel) error); ok { + r1 = returnFunc(logLevel) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_SetLogLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLogLevel' +type MockClient_SetLogLevel_Call struct { + *mock.Call +} + +// SetLogLevel is a helper method to define mock.On call +// - logLevel *woodpecker.LogLevel +func (_e *MockClient_Expecter) SetLogLevel(logLevel interface{}) *MockClient_SetLogLevel_Call { + return &MockClient_SetLogLevel_Call{Call: _e.mock.On("SetLogLevel", logLevel)} +} + +func (_c *MockClient_SetLogLevel_Call) Run(run func(logLevel *woodpecker.LogLevel)) *MockClient_SetLogLevel_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *woodpecker.LogLevel + if args[0] != nil { + arg0 = args[0].(*woodpecker.LogLevel) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_SetLogLevel_Call) Return(logLevel1 *woodpecker.LogLevel, err error) *MockClient_SetLogLevel_Call { + _c.Call.Return(logLevel1, err) + return _c +} + +func (_c *MockClient_SetLogLevel_Call) RunAndReturn(run func(logLevel *woodpecker.LogLevel) (*woodpecker.LogLevel, error)) *MockClient_SetLogLevel_Call { + _c.Call.Return(run) + return _c +} + +// StepLogEntries provides a mock function for the type MockClient +func (_mock *MockClient) StepLogEntries(repoID int64, pipeline int64, stepID int64) ([]*woodpecker.LogEntry, error) { + ret := _mock.Called(repoID, pipeline, stepID) + + if len(ret) == 0 { + panic("no return value specified for StepLogEntries") + } + + var r0 []*woodpecker.LogEntry + var r1 error + if returnFunc, ok := ret.Get(0).(func(int64, int64, int64) ([]*woodpecker.LogEntry, error)); ok { + return returnFunc(repoID, pipeline, stepID) + } + if returnFunc, ok := ret.Get(0).(func(int64, int64, int64) []*woodpecker.LogEntry); ok { + r0 = returnFunc(repoID, pipeline, stepID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.LogEntry) + } + } + if returnFunc, ok := ret.Get(1).(func(int64, int64, int64) error); ok { + r1 = returnFunc(repoID, pipeline, stepID) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_StepLogEntries_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StepLogEntries' +type MockClient_StepLogEntries_Call struct { + *mock.Call +} + +// StepLogEntries is a helper method to define mock.On call +// - repoID int64 +// - pipeline int64 +// - stepID int64 +func (_e *MockClient_Expecter) StepLogEntries(repoID interface{}, pipeline interface{}, stepID interface{}) *MockClient_StepLogEntries_Call { + return &MockClient_StepLogEntries_Call{Call: _e.mock.On("StepLogEntries", repoID, pipeline, stepID)} +} + +func (_c *MockClient_StepLogEntries_Call) Run(run func(repoID int64, pipeline int64, stepID int64)) *MockClient_StepLogEntries_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + var arg2 int64 + if args[2] != nil { + arg2 = args[2].(int64) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockClient_StepLogEntries_Call) Return(logEntrys []*woodpecker.LogEntry, err error) *MockClient_StepLogEntries_Call { + _c.Call.Return(logEntrys, err) + return _c +} + +func (_c *MockClient_StepLogEntries_Call) RunAndReturn(run func(repoID int64, pipeline int64, stepID int64) ([]*woodpecker.LogEntry, error)) *MockClient_StepLogEntries_Call { + _c.Call.Return(run) + return _c +} + +// StepLogsPurge provides a mock function for the type MockClient +func (_mock *MockClient) StepLogsPurge(repoID int64, pipelineNumber int64, stepID int64) error { + ret := _mock.Called(repoID, pipelineNumber, stepID) + + if len(ret) == 0 { + panic("no return value specified for StepLogsPurge") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(int64, int64, int64) error); ok { + r0 = returnFunc(repoID, pipelineNumber, stepID) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_StepLogsPurge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StepLogsPurge' +type MockClient_StepLogsPurge_Call struct { + *mock.Call +} + +// StepLogsPurge is a helper method to define mock.On call +// - repoID int64 +// - pipelineNumber int64 +// - stepID int64 +func (_e *MockClient_Expecter) StepLogsPurge(repoID interface{}, pipelineNumber interface{}, stepID interface{}) *MockClient_StepLogsPurge_Call { + return &MockClient_StepLogsPurge_Call{Call: _e.mock.On("StepLogsPurge", repoID, pipelineNumber, stepID)} +} + +func (_c *MockClient_StepLogsPurge_Call) Run(run func(repoID int64, pipelineNumber int64, stepID int64)) *MockClient_StepLogsPurge_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 int64 + if args[0] != nil { + arg0 = args[0].(int64) + } + var arg1 int64 + if args[1] != nil { + arg1 = args[1].(int64) + } + var arg2 int64 + if args[2] != nil { + arg2 = args[2].(int64) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockClient_StepLogsPurge_Call) Return(err error) *MockClient_StepLogsPurge_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_StepLogsPurge_Call) RunAndReturn(run func(repoID int64, pipelineNumber int64, stepID int64) error) *MockClient_StepLogsPurge_Call { + _c.Call.Return(run) + return _c +} + +// User provides a mock function for the type MockClient +func (_mock *MockClient) User(s string) (*woodpecker.User, error) { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for User") + } + + var r0 *woodpecker.User + var r1 error + if returnFunc, ok := ret.Get(0).(func(string) (*woodpecker.User, error)); ok { + return returnFunc(s) + } + if returnFunc, ok := ret.Get(0).(func(string) *woodpecker.User); ok { + r0 = returnFunc(s) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.User) + } + } + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(s) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_User_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'User' +type MockClient_User_Call struct { + *mock.Call +} + +// User is a helper method to define mock.On call +// - s string +func (_e *MockClient_Expecter) User(s interface{}) *MockClient_User_Call { + return &MockClient_User_Call{Call: _e.mock.On("User", s)} +} + +func (_c *MockClient_User_Call) Run(run func(s string)) *MockClient_User_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_User_Call) Return(user *woodpecker.User, err error) *MockClient_User_Call { + _c.Call.Return(user, err) + return _c +} + +func (_c *MockClient_User_Call) RunAndReturn(run func(s string) (*woodpecker.User, error)) *MockClient_User_Call { + _c.Call.Return(run) + return _c +} + +// UserDel provides a mock function for the type MockClient +func (_mock *MockClient) UserDel(s string) error { + ret := _mock.Called(s) + + if len(ret) == 0 { + panic("no return value specified for UserDel") + } + + var r0 error + if returnFunc, ok := ret.Get(0).(func(string) error); ok { + r0 = returnFunc(s) + } else { + r0 = ret.Error(0) + } + return r0 +} + +// MockClient_UserDel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserDel' +type MockClient_UserDel_Call struct { + *mock.Call +} + +// UserDel is a helper method to define mock.On call +// - s string +func (_e *MockClient_Expecter) UserDel(s interface{}) *MockClient_UserDel_Call { + return &MockClient_UserDel_Call{Call: _e.mock.On("UserDel", s)} +} + +func (_c *MockClient_UserDel_Call) Run(run func(s string)) *MockClient_UserDel_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 string + if args[0] != nil { + arg0 = args[0].(string) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_UserDel_Call) Return(err error) *MockClient_UserDel_Call { + _c.Call.Return(err) + return _c +} + +func (_c *MockClient_UserDel_Call) RunAndReturn(run func(s string) error) *MockClient_UserDel_Call { + _c.Call.Return(run) + return _c +} + +// UserList provides a mock function for the type MockClient +func (_mock *MockClient) UserList(opt woodpecker.UserListOptions) ([]*woodpecker.User, error) { + ret := _mock.Called(opt) + + if len(ret) == 0 { + panic("no return value specified for UserList") + } + + var r0 []*woodpecker.User + var r1 error + if returnFunc, ok := ret.Get(0).(func(woodpecker.UserListOptions) ([]*woodpecker.User, error)); ok { + return returnFunc(opt) + } + if returnFunc, ok := ret.Get(0).(func(woodpecker.UserListOptions) []*woodpecker.User); ok { + r0 = returnFunc(opt) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*woodpecker.User) + } + } + if returnFunc, ok := ret.Get(1).(func(woodpecker.UserListOptions) error); ok { + r1 = returnFunc(opt) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_UserList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserList' +type MockClient_UserList_Call struct { + *mock.Call +} + +// UserList is a helper method to define mock.On call +// - opt woodpecker.UserListOptions +func (_e *MockClient_Expecter) UserList(opt interface{}) *MockClient_UserList_Call { + return &MockClient_UserList_Call{Call: _e.mock.On("UserList", opt)} +} + +func (_c *MockClient_UserList_Call) Run(run func(opt woodpecker.UserListOptions)) *MockClient_UserList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 woodpecker.UserListOptions + if args[0] != nil { + arg0 = args[0].(woodpecker.UserListOptions) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_UserList_Call) Return(users []*woodpecker.User, err error) *MockClient_UserList_Call { + _c.Call.Return(users, err) + return _c +} + +func (_c *MockClient_UserList_Call) RunAndReturn(run func(opt woodpecker.UserListOptions) ([]*woodpecker.User, error)) *MockClient_UserList_Call { + _c.Call.Return(run) + return _c +} + +// UserPatch provides a mock function for the type MockClient +func (_mock *MockClient) UserPatch(user *woodpecker.User) (*woodpecker.User, error) { + ret := _mock.Called(user) + + if len(ret) == 0 { + panic("no return value specified for UserPatch") + } + + var r0 *woodpecker.User + var r1 error + if returnFunc, ok := ret.Get(0).(func(*woodpecker.User) (*woodpecker.User, error)); ok { + return returnFunc(user) + } + if returnFunc, ok := ret.Get(0).(func(*woodpecker.User) *woodpecker.User); ok { + r0 = returnFunc(user) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.User) + } + } + if returnFunc, ok := ret.Get(1).(func(*woodpecker.User) error); ok { + r1 = returnFunc(user) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_UserPatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserPatch' +type MockClient_UserPatch_Call struct { + *mock.Call +} + +// UserPatch is a helper method to define mock.On call +// - user *woodpecker.User +func (_e *MockClient_Expecter) UserPatch(user interface{}) *MockClient_UserPatch_Call { + return &MockClient_UserPatch_Call{Call: _e.mock.On("UserPatch", user)} +} + +func (_c *MockClient_UserPatch_Call) Run(run func(user *woodpecker.User)) *MockClient_UserPatch_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *woodpecker.User + if args[0] != nil { + arg0 = args[0].(*woodpecker.User) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_UserPatch_Call) Return(user1 *woodpecker.User, err error) *MockClient_UserPatch_Call { + _c.Call.Return(user1, err) + return _c +} + +func (_c *MockClient_UserPatch_Call) RunAndReturn(run func(user *woodpecker.User) (*woodpecker.User, error)) *MockClient_UserPatch_Call { + _c.Call.Return(run) + return _c +} + +// UserPost provides a mock function for the type MockClient +func (_mock *MockClient) UserPost(user *woodpecker.User) (*woodpecker.User, error) { + ret := _mock.Called(user) + + if len(ret) == 0 { + panic("no return value specified for UserPost") + } + + var r0 *woodpecker.User + var r1 error + if returnFunc, ok := ret.Get(0).(func(*woodpecker.User) (*woodpecker.User, error)); ok { + return returnFunc(user) + } + if returnFunc, ok := ret.Get(0).(func(*woodpecker.User) *woodpecker.User); ok { + r0 = returnFunc(user) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*woodpecker.User) + } + } + if returnFunc, ok := ret.Get(1).(func(*woodpecker.User) error); ok { + r1 = returnFunc(user) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_UserPost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserPost' +type MockClient_UserPost_Call struct { + *mock.Call +} + +// UserPost is a helper method to define mock.On call +// - user *woodpecker.User +func (_e *MockClient_Expecter) UserPost(user interface{}) *MockClient_UserPost_Call { + return &MockClient_UserPost_Call{Call: _e.mock.On("UserPost", user)} +} + +func (_c *MockClient_UserPost_Call) Run(run func(user *woodpecker.User)) *MockClient_UserPost_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 *woodpecker.User + if args[0] != nil { + arg0 = args[0].(*woodpecker.User) + } + run( + arg0, + ) + }) + return _c +} + +func (_c *MockClient_UserPost_Call) Return(user1 *woodpecker.User, err error) *MockClient_UserPost_Call { + _c.Call.Return(user1, err) + return _c +} + +func (_c *MockClient_UserPost_Call) RunAndReturn(run func(user *woodpecker.User) (*woodpecker.User, error)) *MockClient_UserPost_Call { + _c.Call.Return(run) + return _c +}