From 4850541a3cbf8137e5f4d627003c3ba71d7f2545 Mon Sep 17 00:00:00 2001 From: Josef Andersson Date: Sat, 1 Feb 2025 18:23:54 +0100 Subject: [PATCH 1/3] ci: add pre gen mock code Signed-off-by: Josef Andersson --- .conform.yaml | 2 +- .github/workflows/test.yml | 2 - .gitignore | 2 +- .goreleaser.yaml | 2 - .../mocks/mockgitlab/ClientOptionFunc.go | 81 ++++ generated/mocks/mockgitlab/RateLimiter.go | 82 ++++ .../mocks/mockgitlab/RequestOptionFunc.go | 81 ++++ generated/mocks/mockgogit/BranchManager.go | 178 +++++++ generated/mocks/mockgogit/CommandExecutor.go | 173 +++++++ generated/mocks/mockgogit/FilterServicer.go | 102 ++++ generated/mocks/mockgogit/GitInterface.go | 191 ++++++++ generated/mocks/mockgogit/GitLibOperation.go | 350 +++++++++++++ generated/mocks/mockgogit/GitProvider.go | 458 ++++++++++++++++++ generated/mocks/mockgogit/GitRemote.go | 186 +++++++ generated/mocks/mockgogit/GitRepository.go | 282 +++++++++++ generated/mocks/mockgogit/MirrorWriter.go | 134 +++++ generated/mocks/mockgogit/ProjectServicer.go | 269 ++++++++++ .../mocks/mockgogit/ProtectionServicer.go | 133 +++++ generated/mocks/mockgogit/ProviderServicer.go | 269 ++++++++++ generated/mocks/mockgogit/SourceReader.go | 95 ++++ generated/mocks/mockgogit/TargetWriter.go | 87 ++++ 21 files changed, 3153 insertions(+), 6 deletions(-) create mode 100644 generated/mocks/mockgitlab/ClientOptionFunc.go create mode 100644 generated/mocks/mockgitlab/RateLimiter.go create mode 100644 generated/mocks/mockgitlab/RequestOptionFunc.go create mode 100644 generated/mocks/mockgogit/BranchManager.go create mode 100644 generated/mocks/mockgogit/CommandExecutor.go create mode 100644 generated/mocks/mockgogit/FilterServicer.go create mode 100644 generated/mocks/mockgogit/GitInterface.go create mode 100644 generated/mocks/mockgogit/GitLibOperation.go create mode 100644 generated/mocks/mockgogit/GitProvider.go create mode 100644 generated/mocks/mockgogit/GitRemote.go create mode 100644 generated/mocks/mockgogit/GitRepository.go create mode 100644 generated/mocks/mockgogit/MirrorWriter.go create mode 100644 generated/mocks/mockgogit/ProjectServicer.go create mode 100644 generated/mocks/mockgogit/ProtectionServicer.go create mode 100644 generated/mocks/mockgogit/ProviderServicer.go create mode 100644 generated/mocks/mockgogit/SourceReader.go create mode 100644 generated/mocks/mockgogit/TargetWriter.go diff --git a/.conform.yaml b/.conform.yaml index 6255519..02e0aeb 100644 --- a/.conform.yaml +++ b/.conform.yaml @@ -10,7 +10,7 @@ policies: gpg: required: true header: - length: 120 + length: 140 header: lower imperative: true invalidLastCharacters: . diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6e6dbc..9b73b1f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,9 +35,7 @@ jobs: - name: Go test run run: | - go install github.com/vektra/mockery/v2@v2.50.0 go mod tidy - ./scripts/generatemock.sh # shellcheck disable=SC2046 go test -count=1 $(go list './...' | grep -v generated) -v -coverprofile=coverage.txt go tool cover -func=coverage.txt -o=coverage.out diff --git a/.gitignore b/.gitignore index 78a5549..db305aa 100644 --- a/.gitignore +++ b/.gitignore @@ -31,5 +31,5 @@ go.work /dist ./.env /gitprovidersync.yaml -generated +# generated /gitprovidersync diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 72adddc..0302eca 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -15,8 +15,6 @@ env: before: hooks: - go mod tidy - - go install github.com/vektra/mockery/v2@v2.46.0 - - ./scripts/generatemock.sh - ./scripts/manpage.sh - ./scripts/completions.sh diff --git a/generated/mocks/mockgitlab/ClientOptionFunc.go b/generated/mocks/mockgitlab/ClientOptionFunc.go new file mode 100644 index 0000000..be29556 --- /dev/null +++ b/generated/mocks/mockgitlab/ClientOptionFunc.go @@ -0,0 +1,81 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + gitlab "gitlab.com/gitlab-org/api/client-go" +) + +// ClientOptionFunc is an autogenerated mock type for the ClientOptionFunc type +type ClientOptionFunc struct { + mock.Mock +} + +type ClientOptionFunc_Expecter struct { + mock *mock.Mock +} + +func (_m *ClientOptionFunc) EXPECT() *ClientOptionFunc_Expecter { + return &ClientOptionFunc_Expecter{mock: &_m.Mock} +} + +// Execute provides a mock function with given fields: _a0 +func (_m *ClientOptionFunc) Execute(_a0 *gitlab.Client) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Execute") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*gitlab.Client) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ClientOptionFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' +type ClientOptionFunc_Execute_Call struct { + *mock.Call +} + +// Execute is a helper method to define mock.On call +// - _a0 *gitlab.Client +func (_e *ClientOptionFunc_Expecter) Execute(_a0 interface{}) *ClientOptionFunc_Execute_Call { + return &ClientOptionFunc_Execute_Call{Call: _e.mock.On("Execute", _a0)} +} + +func (_c *ClientOptionFunc_Execute_Call) Run(run func(_a0 *gitlab.Client)) *ClientOptionFunc_Execute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*gitlab.Client)) + }) + return _c +} + +func (_c *ClientOptionFunc_Execute_Call) Return(_a0 error) *ClientOptionFunc_Execute_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ClientOptionFunc_Execute_Call) RunAndReturn(run func(*gitlab.Client) error) *ClientOptionFunc_Execute_Call { + _c.Call.Return(run) + return _c +} + +// NewClientOptionFunc creates a new instance of ClientOptionFunc. 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 NewClientOptionFunc(t interface { + mock.TestingT + Cleanup(func()) +}) *ClientOptionFunc { + mock := &ClientOptionFunc{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgitlab/RateLimiter.go b/generated/mocks/mockgitlab/RateLimiter.go new file mode 100644 index 0000000..3f2eea1 --- /dev/null +++ b/generated/mocks/mockgitlab/RateLimiter.go @@ -0,0 +1,82 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// RateLimiter is an autogenerated mock type for the RateLimiter type +type RateLimiter struct { + mock.Mock +} + +type RateLimiter_Expecter struct { + mock *mock.Mock +} + +func (_m *RateLimiter) EXPECT() *RateLimiter_Expecter { + return &RateLimiter_Expecter{mock: &_m.Mock} +} + +// Wait provides a mock function with given fields: _a0 +func (_m *RateLimiter) Wait(_a0 context.Context) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Wait") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// RateLimiter_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait' +type RateLimiter_Wait_Call struct { + *mock.Call +} + +// Wait is a helper method to define mock.On call +// - _a0 context.Context +func (_e *RateLimiter_Expecter) Wait(_a0 interface{}) *RateLimiter_Wait_Call { + return &RateLimiter_Wait_Call{Call: _e.mock.On("Wait", _a0)} +} + +func (_c *RateLimiter_Wait_Call) Run(run func(_a0 context.Context)) *RateLimiter_Wait_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RateLimiter_Wait_Call) Return(_a0 error) *RateLimiter_Wait_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RateLimiter_Wait_Call) RunAndReturn(run func(context.Context) error) *RateLimiter_Wait_Call { + _c.Call.Return(run) + return _c +} + +// NewRateLimiter creates a new instance of RateLimiter. 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 NewRateLimiter(t interface { + mock.TestingT + Cleanup(func()) +}) *RateLimiter { + mock := &RateLimiter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgitlab/RequestOptionFunc.go b/generated/mocks/mockgitlab/RequestOptionFunc.go new file mode 100644 index 0000000..ae34392 --- /dev/null +++ b/generated/mocks/mockgitlab/RequestOptionFunc.go @@ -0,0 +1,81 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + retryablehttp "github.com/hashicorp/go-retryablehttp" + mock "github.com/stretchr/testify/mock" +) + +// RequestOptionFunc is an autogenerated mock type for the RequestOptionFunc type +type RequestOptionFunc struct { + mock.Mock +} + +type RequestOptionFunc_Expecter struct { + mock *mock.Mock +} + +func (_m *RequestOptionFunc) EXPECT() *RequestOptionFunc_Expecter { + return &RequestOptionFunc_Expecter{mock: &_m.Mock} +} + +// Execute provides a mock function with given fields: _a0 +func (_m *RequestOptionFunc) Execute(_a0 *retryablehttp.Request) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Execute") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*retryablehttp.Request) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// RequestOptionFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' +type RequestOptionFunc_Execute_Call struct { + *mock.Call +} + +// Execute is a helper method to define mock.On call +// - _a0 *retryablehttp.Request +func (_e *RequestOptionFunc_Expecter) Execute(_a0 interface{}) *RequestOptionFunc_Execute_Call { + return &RequestOptionFunc_Execute_Call{Call: _e.mock.On("Execute", _a0)} +} + +func (_c *RequestOptionFunc_Execute_Call) Run(run func(_a0 *retryablehttp.Request)) *RequestOptionFunc_Execute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*retryablehttp.Request)) + }) + return _c +} + +func (_c *RequestOptionFunc_Execute_Call) Return(_a0 error) *RequestOptionFunc_Execute_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RequestOptionFunc_Execute_Call) RunAndReturn(run func(*retryablehttp.Request) error) *RequestOptionFunc_Execute_Call { + _c.Call.Return(run) + return _c +} + +// NewRequestOptionFunc creates a new instance of RequestOptionFunc. 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 NewRequestOptionFunc(t interface { + mock.TestingT + Cleanup(func()) +}) *RequestOptionFunc { + mock := &RequestOptionFunc{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/BranchManager.go b/generated/mocks/mockgogit/BranchManager.go new file mode 100644 index 0000000..07a6c8b --- /dev/null +++ b/generated/mocks/mockgogit/BranchManager.go @@ -0,0 +1,178 @@ +// Code generated by mockery v2.46.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// BranchManager is an autogenerated mock type for the BranchManager type +type BranchManager struct { + mock.Mock +} + +type BranchManager_Expecter struct { + mock *mock.Mock +} + +func (_m *BranchManager) EXPECT() *BranchManager_Expecter { + return &BranchManager_Expecter{mock: &_m.Mock} +} + +// CreateTrackingBranches provides a mock function with given fields: ctx, repoPath +func (_m *BranchManager) CreateTrackingBranches(ctx context.Context, repoPath string) error { + ret := _m.Called(ctx, repoPath) + + if len(ret) == 0 { + panic("no return value specified for CreateTrackingBranches") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, repoPath) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BranchManager_CreateTrackingBranches_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTrackingBranches' +type BranchManager_CreateTrackingBranches_Call struct { + *mock.Call +} + +// CreateTrackingBranches is a helper method to define mock.On call +// - ctx context.Context +// - repoPath string +func (_e *BranchManager_Expecter) CreateTrackingBranches(ctx interface{}, repoPath interface{}) *BranchManager_CreateTrackingBranches_Call { + return &BranchManager_CreateTrackingBranches_Call{Call: _e.mock.On("CreateTrackingBranches", ctx, repoPath)} +} + +func (_c *BranchManager_CreateTrackingBranches_Call) Run(run func(ctx context.Context, repoPath string)) *BranchManager_CreateTrackingBranches_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *BranchManager_CreateTrackingBranches_Call) Return(_a0 error) *BranchManager_CreateTrackingBranches_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BranchManager_CreateTrackingBranches_Call) RunAndReturn(run func(context.Context, string) error) *BranchManager_CreateTrackingBranches_Call { + _c.Call.Return(run) + return _c +} + +// Fetch provides a mock function with given fields: ctx, workingDirPath +func (_m *BranchManager) Fetch(ctx context.Context, workingDirPath string) error { + ret := _m.Called(ctx, workingDirPath) + + if len(ret) == 0 { + panic("no return value specified for Fetch") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, workingDirPath) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BranchManager_Fetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fetch' +type BranchManager_Fetch_Call struct { + *mock.Call +} + +// Fetch is a helper method to define mock.On call +// - ctx context.Context +// - workingDirPath string +func (_e *BranchManager_Expecter) Fetch(ctx interface{}, workingDirPath interface{}) *BranchManager_Fetch_Call { + return &BranchManager_Fetch_Call{Call: _e.mock.On("Fetch", ctx, workingDirPath)} +} + +func (_c *BranchManager_Fetch_Call) Run(run func(ctx context.Context, workingDirPath string)) *BranchManager_Fetch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *BranchManager_Fetch_Call) Return(_a0 error) *BranchManager_Fetch_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BranchManager_Fetch_Call) RunAndReturn(run func(context.Context, string) error) *BranchManager_Fetch_Call { + _c.Call.Return(run) + return _c +} + +// ProcessTrackingBranches provides a mock function with given fields: ctx, targetPath, input +func (_m *BranchManager) ProcessTrackingBranches(ctx context.Context, targetPath string, input []byte) error { + ret := _m.Called(ctx, targetPath, input) + + if len(ret) == 0 { + panic("no return value specified for ProcessTrackingBranches") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok { + r0 = rf(ctx, targetPath, input) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BranchManager_ProcessTrackingBranches_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessTrackingBranches' +type BranchManager_ProcessTrackingBranches_Call struct { + *mock.Call +} + +// ProcessTrackingBranches is a helper method to define mock.On call +// - ctx context.Context +// - targetPath string +// - input []byte +func (_e *BranchManager_Expecter) ProcessTrackingBranches(ctx interface{}, targetPath interface{}, input interface{}) *BranchManager_ProcessTrackingBranches_Call { + return &BranchManager_ProcessTrackingBranches_Call{Call: _e.mock.On("ProcessTrackingBranches", ctx, targetPath, input)} +} + +func (_c *BranchManager_ProcessTrackingBranches_Call) Run(run func(ctx context.Context, targetPath string, input []byte)) *BranchManager_ProcessTrackingBranches_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte)) + }) + return _c +} + +func (_c *BranchManager_ProcessTrackingBranches_Call) Return(_a0 error) *BranchManager_ProcessTrackingBranches_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BranchManager_ProcessTrackingBranches_Call) RunAndReturn(run func(context.Context, string, []byte) error) *BranchManager_ProcessTrackingBranches_Call { + _c.Call.Return(run) + return _c +} + +// NewBranchManager creates a new instance of BranchManager. 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 NewBranchManager(t interface { + mock.TestingT + Cleanup(func()) +}) *BranchManager { + mock := &BranchManager{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/CommandExecutor.go b/generated/mocks/mockgogit/CommandExecutor.go new file mode 100644 index 0000000..c352649 --- /dev/null +++ b/generated/mocks/mockgogit/CommandExecutor.go @@ -0,0 +1,173 @@ +// Code generated by mockery v2.46.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// CommandExecutor is an autogenerated mock type for the CommandExecutor type +type CommandExecutor struct { + mock.Mock +} + +type CommandExecutor_Expecter struct { + mock *mock.Mock +} + +func (_m *CommandExecutor) EXPECT() *CommandExecutor_Expecter { + return &CommandExecutor_Expecter{mock: &_m.Mock} +} + +// RunGitCommand provides a mock function with given fields: ctx, env, workingDir, args +func (_m *CommandExecutor) RunGitCommand(ctx context.Context, env []string, workingDir string, args ...string) error { + _va := make([]interface{}, len(args)) + for _i := range args { + _va[_i] = args[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, env, workingDir) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for RunGitCommand") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, []string, string, ...string) error); ok { + r0 = rf(ctx, env, workingDir, args...) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// CommandExecutor_RunGitCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunGitCommand' +type CommandExecutor_RunGitCommand_Call struct { + *mock.Call +} + +// RunGitCommand is a helper method to define mock.On call +// - ctx context.Context +// - env []string +// - workingDir string +// - args ...string +func (_e *CommandExecutor_Expecter) RunGitCommand(ctx interface{}, env interface{}, workingDir interface{}, args ...interface{}) *CommandExecutor_RunGitCommand_Call { + return &CommandExecutor_RunGitCommand_Call{Call: _e.mock.On("RunGitCommand", + append([]interface{}{ctx, env, workingDir}, args...)...)} +} + +func (_c *CommandExecutor_RunGitCommand_Call) Run(run func(ctx context.Context, env []string, workingDir string, args ...string)) *CommandExecutor_RunGitCommand_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-3) + for i, a := range args[3:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(context.Context), args[1].([]string), args[2].(string), variadicArgs...) + }) + return _c +} + +func (_c *CommandExecutor_RunGitCommand_Call) Return(_a0 error) *CommandExecutor_RunGitCommand_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *CommandExecutor_RunGitCommand_Call) RunAndReturn(run func(context.Context, []string, string, ...string) error) *CommandExecutor_RunGitCommand_Call { + _c.Call.Return(run) + return _c +} + +// RunGitCommandWithOutput provides a mock function with given fields: ctx, workingDir, args +func (_m *CommandExecutor) RunGitCommandWithOutput(ctx context.Context, workingDir string, args ...string) ([]byte, error) { + _va := make([]interface{}, len(args)) + for _i := range args { + _va[_i] = args[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, workingDir) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for RunGitCommandWithOutput") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, ...string) ([]byte, error)); ok { + return rf(ctx, workingDir, args...) + } + if rf, ok := ret.Get(0).(func(context.Context, string, ...string) []byte); ok { + r0 = rf(ctx, workingDir, args...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, ...string) error); ok { + r1 = rf(ctx, workingDir, args...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// CommandExecutor_RunGitCommandWithOutput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunGitCommandWithOutput' +type CommandExecutor_RunGitCommandWithOutput_Call struct { + *mock.Call +} + +// RunGitCommandWithOutput is a helper method to define mock.On call +// - ctx context.Context +// - workingDir string +// - args ...string +func (_e *CommandExecutor_Expecter) RunGitCommandWithOutput(ctx interface{}, workingDir interface{}, args ...interface{}) *CommandExecutor_RunGitCommandWithOutput_Call { + return &CommandExecutor_RunGitCommandWithOutput_Call{Call: _e.mock.On("RunGitCommandWithOutput", + append([]interface{}{ctx, workingDir}, args...)...)} +} + +func (_c *CommandExecutor_RunGitCommandWithOutput_Call) Run(run func(ctx context.Context, workingDir string, args ...string)) *CommandExecutor_RunGitCommandWithOutput_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]string, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(string) + } + } + run(args[0].(context.Context), args[1].(string), variadicArgs...) + }) + return _c +} + +func (_c *CommandExecutor_RunGitCommandWithOutput_Call) Return(_a0 []byte, _a1 error) *CommandExecutor_RunGitCommandWithOutput_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *CommandExecutor_RunGitCommandWithOutput_Call) RunAndReturn(run func(context.Context, string, ...string) ([]byte, error)) *CommandExecutor_RunGitCommandWithOutput_Call { + _c.Call.Return(run) + return _c +} + +// NewCommandExecutor creates a new instance of CommandExecutor. 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 NewCommandExecutor(t interface { + mock.TestingT + Cleanup(func()) +}) *CommandExecutor { + mock := &CommandExecutor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/FilterServicer.go b/generated/mocks/mockgogit/FilterServicer.go new file mode 100644 index 0000000..8b92f72 --- /dev/null +++ b/generated/mocks/mockgogit/FilterServicer.go @@ -0,0 +1,102 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + functiondefinition "itiquette/git-provider-sync/internal/functiondefinition" + interfaces "itiquette/git-provider-sync/internal/interfaces" + + mock "github.com/stretchr/testify/mock" + + model "itiquette/git-provider-sync/internal/model" +) + +// FilterServicer is an autogenerated mock type for the FilterServicer type +type FilterServicer struct { + mock.Mock +} + +type FilterServicer_Expecter struct { + mock *mock.Mock +} + +func (_m *FilterServicer) EXPECT() *FilterServicer_Expecter { + return &FilterServicer_Expecter{mock: &_m.Mock} +} + +// FilterProjectinfos provides a mock function with given fields: ctx, opt, projectinfos, filterExcludedIncludedFunc, isInInterval +func (_m *FilterServicer) FilterProjectinfos(ctx context.Context, opt model.ProviderOption, projectinfos []model.ProjectInfo, filterExcludedIncludedFunc functiondefinition.FilterIncludedExcludedFunc, isInInterval interfaces.IsInIntervalFunc) ([]model.ProjectInfo, error) { + ret := _m.Called(ctx, opt, projectinfos, filterExcludedIncludedFunc, isInInterval) + + if len(ret) == 0 { + panic("no return value specified for FilterProjectinfos") + } + + var r0 []model.ProjectInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, model.ProviderOption, []model.ProjectInfo, functiondefinition.FilterIncludedExcludedFunc, interfaces.IsInIntervalFunc) ([]model.ProjectInfo, error)); ok { + return rf(ctx, opt, projectinfos, filterExcludedIncludedFunc, isInInterval) + } + if rf, ok := ret.Get(0).(func(context.Context, model.ProviderOption, []model.ProjectInfo, functiondefinition.FilterIncludedExcludedFunc, interfaces.IsInIntervalFunc) []model.ProjectInfo); ok { + r0 = rf(ctx, opt, projectinfos, filterExcludedIncludedFunc, isInInterval) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.ProjectInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, model.ProviderOption, []model.ProjectInfo, functiondefinition.FilterIncludedExcludedFunc, interfaces.IsInIntervalFunc) error); ok { + r1 = rf(ctx, opt, projectinfos, filterExcludedIncludedFunc, isInInterval) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// FilterServicer_FilterProjectinfos_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FilterProjectinfos' +type FilterServicer_FilterProjectinfos_Call struct { + *mock.Call +} + +// FilterProjectinfos is a helper method to define mock.On call +// - ctx context.Context +// - opt model.ProviderOption +// - projectinfos []model.ProjectInfo +// - filterExcludedIncludedFunc functiondefinition.FilterIncludedExcludedFunc +// - isInInterval interfaces.IsInIntervalFunc +func (_e *FilterServicer_Expecter) FilterProjectinfos(ctx interface{}, opt interface{}, projectinfos interface{}, filterExcludedIncludedFunc interface{}, isInInterval interface{}) *FilterServicer_FilterProjectinfos_Call { + return &FilterServicer_FilterProjectinfos_Call{Call: _e.mock.On("FilterProjectinfos", ctx, opt, projectinfos, filterExcludedIncludedFunc, isInInterval)} +} + +func (_c *FilterServicer_FilterProjectinfos_Call) Run(run func(ctx context.Context, opt model.ProviderOption, projectinfos []model.ProjectInfo, filterExcludedIncludedFunc functiondefinition.FilterIncludedExcludedFunc, isInInterval interfaces.IsInIntervalFunc)) *FilterServicer_FilterProjectinfos_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.ProviderOption), args[2].([]model.ProjectInfo), args[3].(functiondefinition.FilterIncludedExcludedFunc), args[4].(interfaces.IsInIntervalFunc)) + }) + return _c +} + +func (_c *FilterServicer_FilterProjectinfos_Call) Return(_a0 []model.ProjectInfo, _a1 error) *FilterServicer_FilterProjectinfos_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FilterServicer_FilterProjectinfos_Call) RunAndReturn(run func(context.Context, model.ProviderOption, []model.ProjectInfo, functiondefinition.FilterIncludedExcludedFunc, interfaces.IsInIntervalFunc) ([]model.ProjectInfo, error)) *FilterServicer_FilterProjectinfos_Call { + _c.Call.Return(run) + return _c +} + +// NewFilterServicer creates a new instance of FilterServicer. 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 NewFilterServicer(t interface { + mock.TestingT + Cleanup(func()) +}) *FilterServicer { + mock := &FilterServicer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/GitInterface.go b/generated/mocks/mockgogit/GitInterface.go new file mode 100644 index 0000000..d9f5f1a --- /dev/null +++ b/generated/mocks/mockgogit/GitInterface.go @@ -0,0 +1,191 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + interfaces "itiquette/git-provider-sync/internal/interfaces" + + mock "github.com/stretchr/testify/mock" + + model "itiquette/git-provider-sync/internal/model" +) + +// GitInterface is an autogenerated mock type for the GitInterface type +type GitInterface struct { + mock.Mock +} + +type GitInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *GitInterface) EXPECT() *GitInterface_Expecter { + return &GitInterface_Expecter{mock: &_m.Mock} +} + +// Clone provides a mock function with given fields: ctx, option +func (_m *GitInterface) Clone(ctx context.Context, option model.CloneOption) (model.Repository, error) { + ret := _m.Called(ctx, option) + + if len(ret) == 0 { + panic("no return value specified for Clone") + } + + var r0 model.Repository + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, model.CloneOption) (model.Repository, error)); ok { + return rf(ctx, option) + } + if rf, ok := ret.Get(0).(func(context.Context, model.CloneOption) model.Repository); ok { + r0 = rf(ctx, option) + } else { + r0 = ret.Get(0).(model.Repository) + } + + if rf, ok := ret.Get(1).(func(context.Context, model.CloneOption) error); ok { + r1 = rf(ctx, option) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GitInterface_Clone_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Clone' +type GitInterface_Clone_Call struct { + *mock.Call +} + +// Clone is a helper method to define mock.On call +// - ctx context.Context +// - option model.CloneOption +func (_e *GitInterface_Expecter) Clone(ctx interface{}, option interface{}) *GitInterface_Clone_Call { + return &GitInterface_Clone_Call{Call: _e.mock.On("Clone", ctx, option)} +} + +func (_c *GitInterface_Clone_Call) Run(run func(ctx context.Context, option model.CloneOption)) *GitInterface_Clone_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.CloneOption)) + }) + return _c +} + +func (_c *GitInterface_Clone_Call) Return(_a0 model.Repository, _a1 error) *GitInterface_Clone_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GitInterface_Clone_Call) RunAndReturn(run func(context.Context, model.CloneOption) (model.Repository, error)) *GitInterface_Clone_Call { + _c.Call.Return(run) + return _c +} + +// Pull provides a mock function with given fields: ctx, opt +func (_m *GitInterface) Pull(ctx context.Context, opt model.PullOption) error { + ret := _m.Called(ctx, opt) + + if len(ret) == 0 { + panic("no return value specified for Pull") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, model.PullOption) error); ok { + r0 = rf(ctx, opt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitInterface_Pull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pull' +type GitInterface_Pull_Call struct { + *mock.Call +} + +// Pull is a helper method to define mock.On call +// - ctx context.Context +// - opt model.PullOption +func (_e *GitInterface_Expecter) Pull(ctx interface{}, opt interface{}) *GitInterface_Pull_Call { + return &GitInterface_Pull_Call{Call: _e.mock.On("Pull", ctx, opt)} +} + +func (_c *GitInterface_Pull_Call) Run(run func(ctx context.Context, opt model.PullOption)) *GitInterface_Pull_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.PullOption)) + }) + return _c +} + +func (_c *GitInterface_Pull_Call) Return(_a0 error) *GitInterface_Pull_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitInterface_Pull_Call) RunAndReturn(run func(context.Context, model.PullOption) error) *GitInterface_Pull_Call { + _c.Call.Return(run) + return _c +} + +// Push provides a mock function with given fields: ctx, repository, opt +func (_m *GitInterface) Push(ctx context.Context, repository interfaces.GitRepository, opt model.PushOption) error { + ret := _m.Called(ctx, repository, opt) + + if len(ret) == 0 { + panic("no return value specified for Push") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, interfaces.GitRepository, model.PushOption) error); ok { + r0 = rf(ctx, repository, opt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitInterface_Push_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Push' +type GitInterface_Push_Call struct { + *mock.Call +} + +// Push is a helper method to define mock.On call +// - ctx context.Context +// - repository interfaces.GitRepository +// - opt model.PushOption +func (_e *GitInterface_Expecter) Push(ctx interface{}, repository interface{}, opt interface{}) *GitInterface_Push_Call { + return &GitInterface_Push_Call{Call: _e.mock.On("Push", ctx, repository, opt)} +} + +func (_c *GitInterface_Push_Call) Run(run func(ctx context.Context, repository interfaces.GitRepository, opt model.PushOption)) *GitInterface_Push_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interfaces.GitRepository), args[2].(model.PushOption)) + }) + return _c +} + +func (_c *GitInterface_Push_Call) Return(_a0 error) *GitInterface_Push_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitInterface_Push_Call) RunAndReturn(run func(context.Context, interfaces.GitRepository, model.PushOption) error) *GitInterface_Push_Call { + _c.Call.Return(run) + return _c +} + +// NewGitInterface creates a new instance of GitInterface. 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 NewGitInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *GitInterface { + mock := &GitInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/GitLibOperation.go b/generated/mocks/mockgogit/GitLibOperation.go new file mode 100644 index 0000000..4de9eb9 --- /dev/null +++ b/generated/mocks/mockgogit/GitLibOperation.go @@ -0,0 +1,350 @@ +// Code generated by mockery v2.46.2. DO NOT EDIT. + +package mocks + +import ( + context "context" + + git "github.com/go-git/go-git/v5" + mock "github.com/stretchr/testify/mock" + + transport "github.com/go-git/go-git/v5/plumbing/transport" +) + +// GitLibOperation is an autogenerated mock type for the GitLibOperation type +type GitLibOperation struct { + mock.Mock +} + +type GitLibOperation_Expecter struct { + mock *mock.Mock +} + +func (_m *GitLibOperation) EXPECT() *GitLibOperation_Expecter { + return &GitLibOperation_Expecter{mock: &_m.Mock} +} + +// CreateRemote provides a mock function with given fields: ctx, repo, name, urls +func (_m *GitLibOperation) CreateRemote(ctx context.Context, repo *git.Repository, name string, urls []string) error { + ret := _m.Called(ctx, repo, name, urls) + + if len(ret) == 0 { + panic("no return value specified for CreateRemote") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *git.Repository, string, []string) error); ok { + r0 = rf(ctx, repo, name, urls) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitLibOperation_CreateRemote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRemote' +type GitLibOperation_CreateRemote_Call struct { + *mock.Call +} + +// CreateRemote is a helper method to define mock.On call +// - ctx context.Context +// - repo *git.Repository +// - name string +// - urls []string +func (_e *GitLibOperation_Expecter) CreateRemote(ctx interface{}, repo interface{}, name interface{}, urls interface{}) *GitLibOperation_CreateRemote_Call { + return &GitLibOperation_CreateRemote_Call{Call: _e.mock.On("CreateRemote", ctx, repo, name, urls)} +} + +func (_c *GitLibOperation_CreateRemote_Call) Run(run func(ctx context.Context, repo *git.Repository, name string, urls []string)) *GitLibOperation_CreateRemote_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*git.Repository), args[2].(string), args[3].([]string)) + }) + return _c +} + +func (_c *GitLibOperation_CreateRemote_Call) Return(_a0 error) *GitLibOperation_CreateRemote_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitLibOperation_CreateRemote_Call) RunAndReturn(run func(context.Context, *git.Repository, string, []string) error) *GitLibOperation_CreateRemote_Call { + _c.Call.Return(run) + return _c +} + +// FetchBranches provides a mock function with given fields: ctx, repo, auth, name +func (_m *GitLibOperation) FetchBranches(ctx context.Context, repo *git.Repository, auth transport.AuthMethod, name string) error { + ret := _m.Called(ctx, repo, auth, name) + + if len(ret) == 0 { + panic("no return value specified for FetchBranches") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *git.Repository, transport.AuthMethod, string) error); ok { + r0 = rf(ctx, repo, auth, name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitLibOperation_FetchBranches_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchBranches' +type GitLibOperation_FetchBranches_Call struct { + *mock.Call +} + +// FetchBranches is a helper method to define mock.On call +// - ctx context.Context +// - repo *git.Repository +// - auth transport.AuthMethod +// - name string +func (_e *GitLibOperation_Expecter) FetchBranches(ctx interface{}, repo interface{}, auth interface{}, name interface{}) *GitLibOperation_FetchBranches_Call { + return &GitLibOperation_FetchBranches_Call{Call: _e.mock.On("FetchBranches", ctx, repo, auth, name)} +} + +func (_c *GitLibOperation_FetchBranches_Call) Run(run func(ctx context.Context, repo *git.Repository, auth transport.AuthMethod, name string)) *GitLibOperation_FetchBranches_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*git.Repository), args[2].(transport.AuthMethod), args[3].(string)) + }) + return _c +} + +func (_c *GitLibOperation_FetchBranches_Call) Return(_a0 error) *GitLibOperation_FetchBranches_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitLibOperation_FetchBranches_Call) RunAndReturn(run func(context.Context, *git.Repository, transport.AuthMethod, string) error) *GitLibOperation_FetchBranches_Call { + _c.Call.Return(run) + return _c +} + +// GetWorktree provides a mock function with given fields: ctx, repo +func (_m *GitLibOperation) GetWorktree(ctx context.Context, repo *git.Repository) (*git.Worktree, error) { + ret := _m.Called(ctx, repo) + + if len(ret) == 0 { + panic("no return value specified for GetWorktree") + } + + var r0 *git.Worktree + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *git.Repository) (*git.Worktree, error)); ok { + return rf(ctx, repo) + } + if rf, ok := ret.Get(0).(func(context.Context, *git.Repository) *git.Worktree); ok { + r0 = rf(ctx, repo) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*git.Worktree) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *git.Repository) error); ok { + r1 = rf(ctx, repo) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GitLibOperation_GetWorktree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorktree' +type GitLibOperation_GetWorktree_Call struct { + *mock.Call +} + +// GetWorktree is a helper method to define mock.On call +// - ctx context.Context +// - repo *git.Repository +func (_e *GitLibOperation_Expecter) GetWorktree(ctx interface{}, repo interface{}) *GitLibOperation_GetWorktree_Call { + return &GitLibOperation_GetWorktree_Call{Call: _e.mock.On("GetWorktree", ctx, repo)} +} + +func (_c *GitLibOperation_GetWorktree_Call) Run(run func(ctx context.Context, repo *git.Repository)) *GitLibOperation_GetWorktree_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*git.Repository)) + }) + return _c +} + +func (_c *GitLibOperation_GetWorktree_Call) Return(_a0 *git.Worktree, _a1 error) *GitLibOperation_GetWorktree_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GitLibOperation_GetWorktree_Call) RunAndReturn(run func(context.Context, *git.Repository) (*git.Worktree, error)) *GitLibOperation_GetWorktree_Call { + _c.Call.Return(run) + return _c +} + +// Open provides a mock function with given fields: ctx, path +func (_m *GitLibOperation) Open(ctx context.Context, path string) (*git.Repository, error) { + ret := _m.Called(ctx, path) + + if len(ret) == 0 { + panic("no return value specified for Open") + } + + var r0 *git.Repository + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*git.Repository, error)); ok { + return rf(ctx, path) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *git.Repository); ok { + r0 = rf(ctx, path) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*git.Repository) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, path) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GitLibOperation_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open' +type GitLibOperation_Open_Call struct { + *mock.Call +} + +// Open is a helper method to define mock.On call +// - ctx context.Context +// - path string +func (_e *GitLibOperation_Expecter) Open(ctx interface{}, path interface{}) *GitLibOperation_Open_Call { + return &GitLibOperation_Open_Call{Call: _e.mock.On("Open", ctx, path)} +} + +func (_c *GitLibOperation_Open_Call) Run(run func(ctx context.Context, path string)) *GitLibOperation_Open_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *GitLibOperation_Open_Call) Return(_a0 *git.Repository, _a1 error) *GitLibOperation_Open_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GitLibOperation_Open_Call) RunAndReturn(run func(context.Context, string) (*git.Repository, error)) *GitLibOperation_Open_Call { + _c.Call.Return(run) + return _c +} + +// SetDefaultBranch provides a mock function with given fields: ctx, repo, branchName +func (_m *GitLibOperation) SetDefaultBranch(ctx context.Context, repo *git.Repository, branchName string) error { + ret := _m.Called(ctx, repo, branchName) + + if len(ret) == 0 { + panic("no return value specified for SetDefaultBranch") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *git.Repository, string) error); ok { + r0 = rf(ctx, repo, branchName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitLibOperation_SetDefaultBranch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDefaultBranch' +type GitLibOperation_SetDefaultBranch_Call struct { + *mock.Call +} + +// SetDefaultBranch is a helper method to define mock.On call +// - ctx context.Context +// - repo *git.Repository +// - branchName string +func (_e *GitLibOperation_Expecter) SetDefaultBranch(ctx interface{}, repo interface{}, branchName interface{}) *GitLibOperation_SetDefaultBranch_Call { + return &GitLibOperation_SetDefaultBranch_Call{Call: _e.mock.On("SetDefaultBranch", ctx, repo, branchName)} +} + +func (_c *GitLibOperation_SetDefaultBranch_Call) Run(run func(ctx context.Context, repo *git.Repository, branchName string)) *GitLibOperation_SetDefaultBranch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*git.Repository), args[2].(string)) + }) + return _c +} + +func (_c *GitLibOperation_SetDefaultBranch_Call) Return(_a0 error) *GitLibOperation_SetDefaultBranch_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitLibOperation_SetDefaultBranch_Call) RunAndReturn(run func(context.Context, *git.Repository, string) error) *GitLibOperation_SetDefaultBranch_Call { + _c.Call.Return(run) + return _c +} + +// WorktreeStatus provides a mock function with given fields: ctx, wt +func (_m *GitLibOperation) WorktreeStatus(ctx context.Context, wt *git.Worktree) error { + ret := _m.Called(ctx, wt) + + if len(ret) == 0 { + panic("no return value specified for WorktreeStatus") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *git.Worktree) error); ok { + r0 = rf(ctx, wt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitLibOperation_WorktreeStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WorktreeStatus' +type GitLibOperation_WorktreeStatus_Call struct { + *mock.Call +} + +// WorktreeStatus is a helper method to define mock.On call +// - ctx context.Context +// - wt *git.Worktree +func (_e *GitLibOperation_Expecter) WorktreeStatus(ctx interface{}, wt interface{}) *GitLibOperation_WorktreeStatus_Call { + return &GitLibOperation_WorktreeStatus_Call{Call: _e.mock.On("WorktreeStatus", ctx, wt)} +} + +func (_c *GitLibOperation_WorktreeStatus_Call) Run(run func(ctx context.Context, wt *git.Worktree)) *GitLibOperation_WorktreeStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*git.Worktree)) + }) + return _c +} + +func (_c *GitLibOperation_WorktreeStatus_Call) Return(_a0 error) *GitLibOperation_WorktreeStatus_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitLibOperation_WorktreeStatus_Call) RunAndReturn(run func(context.Context, *git.Worktree) error) *GitLibOperation_WorktreeStatus_Call { + _c.Call.Return(run) + return _c +} + +// NewGitLibOperation creates a new instance of GitLibOperation. 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 NewGitLibOperation(t interface { + mock.TestingT + Cleanup(func()) +}) *GitLibOperation { + mock := &GitLibOperation{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/GitProvider.go b/generated/mocks/mockgogit/GitProvider.go new file mode 100644 index 0000000..323bc28 --- /dev/null +++ b/generated/mocks/mockgogit/GitProvider.go @@ -0,0 +1,458 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + model "itiquette/git-provider-sync/internal/model" +) + +// GitProvider is an autogenerated mock type for the GitProvider type +type GitProvider struct { + mock.Mock +} + +type GitProvider_Expecter struct { + mock *mock.Mock +} + +func (_m *GitProvider) EXPECT() *GitProvider_Expecter { + return &GitProvider_Expecter{mock: &_m.Mock} +} + +// CreateProject provides a mock function with given fields: ctx, opt +func (_m *GitProvider) CreateProject(ctx context.Context, opt model.CreateProjectOption) (string, error) { + ret := _m.Called(ctx, opt) + + if len(ret) == 0 { + panic("no return value specified for CreateProject") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, model.CreateProjectOption) (string, error)); ok { + return rf(ctx, opt) + } + if rf, ok := ret.Get(0).(func(context.Context, model.CreateProjectOption) string); ok { + r0 = rf(ctx, opt) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, model.CreateProjectOption) error); ok { + r1 = rf(ctx, opt) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GitProvider_CreateProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProject' +type GitProvider_CreateProject_Call struct { + *mock.Call +} + +// CreateProject is a helper method to define mock.On call +// - ctx context.Context +// - opt model.CreateProjectOption +func (_e *GitProvider_Expecter) CreateProject(ctx interface{}, opt interface{}) *GitProvider_CreateProject_Call { + return &GitProvider_CreateProject_Call{Call: _e.mock.On("CreateProject", ctx, opt)} +} + +func (_c *GitProvider_CreateProject_Call) Run(run func(ctx context.Context, opt model.CreateProjectOption)) *GitProvider_CreateProject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.CreateProjectOption)) + }) + return _c +} + +func (_c *GitProvider_CreateProject_Call) Return(_a0 string, _a1 error) *GitProvider_CreateProject_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GitProvider_CreateProject_Call) RunAndReturn(run func(context.Context, model.CreateProjectOption) (string, error)) *GitProvider_CreateProject_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectInfos provides a mock function with given fields: ctx, providerOpt, filtering +func (_m *GitProvider) GetProjectInfos(ctx context.Context, providerOpt model.ProviderOption, filtering bool) ([]model.ProjectInfo, error) { + ret := _m.Called(ctx, providerOpt, filtering) + + if len(ret) == 0 { + panic("no return value specified for GetProjectInfos") + } + + var r0 []model.ProjectInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, model.ProviderOption, bool) ([]model.ProjectInfo, error)); ok { + return rf(ctx, providerOpt, filtering) + } + if rf, ok := ret.Get(0).(func(context.Context, model.ProviderOption, bool) []model.ProjectInfo); ok { + r0 = rf(ctx, providerOpt, filtering) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.ProjectInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, model.ProviderOption, bool) error); ok { + r1 = rf(ctx, providerOpt, filtering) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GitProvider_GetProjectInfos_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectInfos' +type GitProvider_GetProjectInfos_Call struct { + *mock.Call +} + +// GetProjectInfos is a helper method to define mock.On call +// - ctx context.Context +// - providerOpt model.ProviderOption +// - filtering bool +func (_e *GitProvider_Expecter) GetProjectInfos(ctx interface{}, providerOpt interface{}, filtering interface{}) *GitProvider_GetProjectInfos_Call { + return &GitProvider_GetProjectInfos_Call{Call: _e.mock.On("GetProjectInfos", ctx, providerOpt, filtering)} +} + +func (_c *GitProvider_GetProjectInfos_Call) Run(run func(ctx context.Context, providerOpt model.ProviderOption, filtering bool)) *GitProvider_GetProjectInfos_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.ProviderOption), args[2].(bool)) + }) + return _c +} + +func (_c *GitProvider_GetProjectInfos_Call) Return(_a0 []model.ProjectInfo, _a1 error) *GitProvider_GetProjectInfos_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GitProvider_GetProjectInfos_Call) RunAndReturn(run func(context.Context, model.ProviderOption, bool) ([]model.ProjectInfo, error)) *GitProvider_GetProjectInfos_Call { + _c.Call.Return(run) + return _c +} + +// IsValidProjectName provides a mock function with given fields: ctx, name +func (_m *GitProvider) IsValidProjectName(ctx context.Context, name string) bool { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for IsValidProjectName") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { + r0 = rf(ctx, name) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// GitProvider_IsValidProjectName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsValidProjectName' +type GitProvider_IsValidProjectName_Call struct { + *mock.Call +} + +// IsValidProjectName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *GitProvider_Expecter) IsValidProjectName(ctx interface{}, name interface{}) *GitProvider_IsValidProjectName_Call { + return &GitProvider_IsValidProjectName_Call{Call: _e.mock.On("IsValidProjectName", ctx, name)} +} + +func (_c *GitProvider_IsValidProjectName_Call) Run(run func(ctx context.Context, name string)) *GitProvider_IsValidProjectName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *GitProvider_IsValidProjectName_Call) Return(_a0 bool) *GitProvider_IsValidProjectName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitProvider_IsValidProjectName_Call) RunAndReturn(run func(context.Context, string) bool) *GitProvider_IsValidProjectName_Call { + _c.Call.Return(run) + return _c +} + +// Name provides a mock function with no fields +func (_m *GitProvider) 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 +} + +// GitProvider_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name' +type GitProvider_Name_Call struct { + *mock.Call +} + +// Name is a helper method to define mock.On call +func (_e *GitProvider_Expecter) Name() *GitProvider_Name_Call { + return &GitProvider_Name_Call{Call: _e.mock.On("Name")} +} + +func (_c *GitProvider_Name_Call) Run(run func()) *GitProvider_Name_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GitProvider_Name_Call) Return(_a0 string) *GitProvider_Name_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitProvider_Name_Call) RunAndReturn(run func() string) *GitProvider_Name_Call { + _c.Call.Return(run) + return _c +} + +// ProjectExists provides a mock function with given fields: ctx, owner, repo +func (_m *GitProvider) ProjectExists(ctx context.Context, owner string, repo string) (bool, string, error) { + ret := _m.Called(ctx, owner, repo) + + if len(ret) == 0 { + panic("no return value specified for ProjectExists") + } + + var r0 bool + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, string, error)); ok { + return rf(ctx, owner, repo) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { + r0 = rf(ctx, owner, repo) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok { + r1 = rf(ctx, owner, repo) + } else { + r1 = ret.Get(1).(string) + } + + if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok { + r2 = rf(ctx, owner, repo) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// GitProvider_ProjectExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProjectExists' +type GitProvider_ProjectExists_Call struct { + *mock.Call +} + +// ProjectExists is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - repo string +func (_e *GitProvider_Expecter) ProjectExists(ctx interface{}, owner interface{}, repo interface{}) *GitProvider_ProjectExists_Call { + return &GitProvider_ProjectExists_Call{Call: _e.mock.On("ProjectExists", ctx, owner, repo)} +} + +func (_c *GitProvider_ProjectExists_Call) Run(run func(ctx context.Context, owner string, repo string)) *GitProvider_ProjectExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *GitProvider_ProjectExists_Call) Return(_a0 bool, _a1 string, _a2 error) *GitProvider_ProjectExists_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *GitProvider_ProjectExists_Call) RunAndReturn(run func(context.Context, string, string) (bool, string, error)) *GitProvider_ProjectExists_Call { + _c.Call.Return(run) + return _c +} + +// Protect provides a mock function with given fields: ctx, owner, defaultBranch, projectIDstr +func (_m *GitProvider) Protect(ctx context.Context, owner string, defaultBranch string, projectIDstr string) error { + ret := _m.Called(ctx, owner, defaultBranch, projectIDstr) + + if len(ret) == 0 { + panic("no return value specified for Protect") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok { + r0 = rf(ctx, owner, defaultBranch, projectIDstr) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitProvider_Protect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Protect' +type GitProvider_Protect_Call struct { + *mock.Call +} + +// Protect is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - defaultBranch string +// - projectIDstr string +func (_e *GitProvider_Expecter) Protect(ctx interface{}, owner interface{}, defaultBranch interface{}, projectIDstr interface{}) *GitProvider_Protect_Call { + return &GitProvider_Protect_Call{Call: _e.mock.On("Protect", ctx, owner, defaultBranch, projectIDstr)} +} + +func (_c *GitProvider_Protect_Call) Run(run func(ctx context.Context, owner string, defaultBranch string, projectIDstr string)) *GitProvider_Protect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *GitProvider_Protect_Call) Return(_a0 error) *GitProvider_Protect_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitProvider_Protect_Call) RunAndReturn(run func(context.Context, string, string, string) error) *GitProvider_Protect_Call { + _c.Call.Return(run) + return _c +} + +// SetDefaultBranch provides a mock function with given fields: ctx, owner, name, branch +func (_m *GitProvider) SetDefaultBranch(ctx context.Context, owner string, name string, branch string) error { + ret := _m.Called(ctx, owner, name, branch) + + if len(ret) == 0 { + panic("no return value specified for SetDefaultBranch") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok { + r0 = rf(ctx, owner, name, branch) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitProvider_SetDefaultBranch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDefaultBranch' +type GitProvider_SetDefaultBranch_Call struct { + *mock.Call +} + +// SetDefaultBranch is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - name string +// - branch string +func (_e *GitProvider_Expecter) SetDefaultBranch(ctx interface{}, owner interface{}, name interface{}, branch interface{}) *GitProvider_SetDefaultBranch_Call { + return &GitProvider_SetDefaultBranch_Call{Call: _e.mock.On("SetDefaultBranch", ctx, owner, name, branch)} +} + +func (_c *GitProvider_SetDefaultBranch_Call) Run(run func(ctx context.Context, owner string, name string, branch string)) *GitProvider_SetDefaultBranch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *GitProvider_SetDefaultBranch_Call) Return(_a0 error) *GitProvider_SetDefaultBranch_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitProvider_SetDefaultBranch_Call) RunAndReturn(run func(context.Context, string, string, string) error) *GitProvider_SetDefaultBranch_Call { + _c.Call.Return(run) + return _c +} + +// Unprotect provides a mock function with given fields: ctx, defaultBranch, projectIDStr +func (_m *GitProvider) Unprotect(ctx context.Context, defaultBranch string, projectIDStr string) error { + ret := _m.Called(ctx, defaultBranch, projectIDStr) + + if len(ret) == 0 { + panic("no return value specified for Unprotect") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, defaultBranch, projectIDStr) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitProvider_Unprotect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unprotect' +type GitProvider_Unprotect_Call struct { + *mock.Call +} + +// Unprotect is a helper method to define mock.On call +// - ctx context.Context +// - defaultBranch string +// - projectIDStr string +func (_e *GitProvider_Expecter) Unprotect(ctx interface{}, defaultBranch interface{}, projectIDStr interface{}) *GitProvider_Unprotect_Call { + return &GitProvider_Unprotect_Call{Call: _e.mock.On("Unprotect", ctx, defaultBranch, projectIDStr)} +} + +func (_c *GitProvider_Unprotect_Call) Run(run func(ctx context.Context, defaultBranch string, projectIDStr string)) *GitProvider_Unprotect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *GitProvider_Unprotect_Call) Return(_a0 error) *GitProvider_Unprotect_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitProvider_Unprotect_Call) RunAndReturn(run func(context.Context, string, string) error) *GitProvider_Unprotect_Call { + _c.Call.Return(run) + return _c +} + +// NewGitProvider creates a new instance of GitProvider. 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 NewGitProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *GitProvider { + mock := &GitProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/GitRemote.go b/generated/mocks/mockgogit/GitRemote.go new file mode 100644 index 0000000..751da93 --- /dev/null +++ b/generated/mocks/mockgogit/GitRemote.go @@ -0,0 +1,186 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + model "itiquette/git-provider-sync/internal/model" + + mock "github.com/stretchr/testify/mock" +) + +// GitRemote is an autogenerated mock type for the GitRemote type +type GitRemote struct { + mock.Mock +} + +type GitRemote_Expecter struct { + mock *mock.Mock +} + +func (_m *GitRemote) EXPECT() *GitRemote_Expecter { + return &GitRemote_Expecter{mock: &_m.Mock} +} + +// CreateRemote provides a mock function with given fields: name, url, isMirror +func (_m *GitRemote) CreateRemote(name string, url string, isMirror bool) error { + ret := _m.Called(name, url, isMirror) + + if len(ret) == 0 { + panic("no return value specified for CreateRemote") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string, bool) error); ok { + r0 = rf(name, url, isMirror) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitRemote_CreateRemote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRemote' +type GitRemote_CreateRemote_Call struct { + *mock.Call +} + +// CreateRemote is a helper method to define mock.On call +// - name string +// - url string +// - isMirror bool +func (_e *GitRemote_Expecter) CreateRemote(name interface{}, url interface{}, isMirror interface{}) *GitRemote_CreateRemote_Call { + return &GitRemote_CreateRemote_Call{Call: _e.mock.On("CreateRemote", name, url, isMirror)} +} + +func (_c *GitRemote_CreateRemote_Call) Run(run func(name string, url string, isMirror bool)) *GitRemote_CreateRemote_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(bool)) + }) + return _c +} + +func (_c *GitRemote_CreateRemote_Call) Return(_a0 error) *GitRemote_CreateRemote_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitRemote_CreateRemote_Call) RunAndReturn(run func(string, string, bool) error) *GitRemote_CreateRemote_Call { + _c.Call.Return(run) + return _c +} + +// DeleteRemote provides a mock function with given fields: name +func (_m *GitRemote) DeleteRemote(name string) error { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for DeleteRemote") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitRemote_DeleteRemote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRemote' +type GitRemote_DeleteRemote_Call struct { + *mock.Call +} + +// DeleteRemote is a helper method to define mock.On call +// - name string +func (_e *GitRemote_Expecter) DeleteRemote(name interface{}) *GitRemote_DeleteRemote_Call { + return &GitRemote_DeleteRemote_Call{Call: _e.mock.On("DeleteRemote", name)} +} + +func (_c *GitRemote_DeleteRemote_Call) Run(run func(name string)) *GitRemote_DeleteRemote_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *GitRemote_DeleteRemote_Call) Return(_a0 error) *GitRemote_DeleteRemote_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitRemote_DeleteRemote_Call) RunAndReturn(run func(string) error) *GitRemote_DeleteRemote_Call { + _c.Call.Return(run) + return _c +} + +// Remote provides a mock function with given fields: name +func (_m *GitRemote) Remote(name string) (model.Remote, error) { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for Remote") + } + + var r0 model.Remote + var r1 error + if rf, ok := ret.Get(0).(func(string) (model.Remote, error)); ok { + return rf(name) + } + if rf, ok := ret.Get(0).(func(string) model.Remote); ok { + r0 = rf(name) + } else { + r0 = ret.Get(0).(model.Remote) + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GitRemote_Remote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remote' +type GitRemote_Remote_Call struct { + *mock.Call +} + +// Remote is a helper method to define mock.On call +// - name string +func (_e *GitRemote_Expecter) Remote(name interface{}) *GitRemote_Remote_Call { + return &GitRemote_Remote_Call{Call: _e.mock.On("Remote", name)} +} + +func (_c *GitRemote_Remote_Call) Run(run func(name string)) *GitRemote_Remote_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *GitRemote_Remote_Call) Return(_a0 model.Remote, _a1 error) *GitRemote_Remote_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GitRemote_Remote_Call) RunAndReturn(run func(string) (model.Remote, error)) *GitRemote_Remote_Call { + _c.Call.Return(run) + return _c +} + +// NewGitRemote creates a new instance of GitRemote. 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 NewGitRemote(t interface { + mock.TestingT + Cleanup(func()) +}) *GitRemote { + mock := &GitRemote{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/GitRepository.go b/generated/mocks/mockgogit/GitRepository.go new file mode 100644 index 0000000..5dbac96 --- /dev/null +++ b/generated/mocks/mockgogit/GitRepository.go @@ -0,0 +1,282 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + git "github.com/go-git/go-git/v5" + + mock "github.com/stretchr/testify/mock" + + model "itiquette/git-provider-sync/internal/model" +) + +// GitRepository is an autogenerated mock type for the GitRepository type +type GitRepository struct { + mock.Mock +} + +type GitRepository_Expecter struct { + mock *mock.Mock +} + +func (_m *GitRepository) EXPECT() *GitRepository_Expecter { + return &GitRepository_Expecter{mock: &_m.Mock} +} + +// CreateRemote provides a mock function with given fields: name, url, isMirror +func (_m *GitRepository) CreateRemote(name string, url string, isMirror bool) error { + ret := _m.Called(name, url, isMirror) + + if len(ret) == 0 { + panic("no return value specified for CreateRemote") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, string, bool) error); ok { + r0 = rf(name, url, isMirror) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitRepository_CreateRemote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRemote' +type GitRepository_CreateRemote_Call struct { + *mock.Call +} + +// CreateRemote is a helper method to define mock.On call +// - name string +// - url string +// - isMirror bool +func (_e *GitRepository_Expecter) CreateRemote(name interface{}, url interface{}, isMirror interface{}) *GitRepository_CreateRemote_Call { + return &GitRepository_CreateRemote_Call{Call: _e.mock.On("CreateRemote", name, url, isMirror)} +} + +func (_c *GitRepository_CreateRemote_Call) Run(run func(name string, url string, isMirror bool)) *GitRepository_CreateRemote_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(bool)) + }) + return _c +} + +func (_c *GitRepository_CreateRemote_Call) Return(_a0 error) *GitRepository_CreateRemote_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitRepository_CreateRemote_Call) RunAndReturn(run func(string, string, bool) error) *GitRepository_CreateRemote_Call { + _c.Call.Return(run) + return _c +} + +// DeleteRemote provides a mock function with given fields: name +func (_m *GitRepository) DeleteRemote(name string) error { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for DeleteRemote") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// GitRepository_DeleteRemote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRemote' +type GitRepository_DeleteRemote_Call struct { + *mock.Call +} + +// DeleteRemote is a helper method to define mock.On call +// - name string +func (_e *GitRepository_Expecter) DeleteRemote(name interface{}) *GitRepository_DeleteRemote_Call { + return &GitRepository_DeleteRemote_Call{Call: _e.mock.On("DeleteRemote", name)} +} + +func (_c *GitRepository_DeleteRemote_Call) Run(run func(name string)) *GitRepository_DeleteRemote_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *GitRepository_DeleteRemote_Call) Return(_a0 error) *GitRepository_DeleteRemote_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitRepository_DeleteRemote_Call) RunAndReturn(run func(string) error) *GitRepository_DeleteRemote_Call { + _c.Call.Return(run) + return _c +} + +// GoGitRepository provides a mock function with no fields +func (_m *GitRepository) GoGitRepository() *git.Repository { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GoGitRepository") + } + + var r0 *git.Repository + if rf, ok := ret.Get(0).(func() *git.Repository); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*git.Repository) + } + } + + return r0 +} + +// GitRepository_GoGitRepository_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GoGitRepository' +type GitRepository_GoGitRepository_Call struct { + *mock.Call +} + +// GoGitRepository is a helper method to define mock.On call +func (_e *GitRepository_Expecter) GoGitRepository() *GitRepository_GoGitRepository_Call { + return &GitRepository_GoGitRepository_Call{Call: _e.mock.On("GoGitRepository")} +} + +func (_c *GitRepository_GoGitRepository_Call) Run(run func()) *GitRepository_GoGitRepository_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GitRepository_GoGitRepository_Call) Return(_a0 *git.Repository) *GitRepository_GoGitRepository_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitRepository_GoGitRepository_Call) RunAndReturn(run func() *git.Repository) *GitRepository_GoGitRepository_Call { + _c.Call.Return(run) + return _c +} + +// ProjectInfo provides a mock function with no fields +func (_m *GitRepository) ProjectInfo() *model.ProjectInfo { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ProjectInfo") + } + + var r0 *model.ProjectInfo + if rf, ok := ret.Get(0).(func() *model.ProjectInfo); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.ProjectInfo) + } + } + + return r0 +} + +// GitRepository_ProjectInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProjectInfo' +type GitRepository_ProjectInfo_Call struct { + *mock.Call +} + +// ProjectInfo is a helper method to define mock.On call +func (_e *GitRepository_Expecter) ProjectInfo() *GitRepository_ProjectInfo_Call { + return &GitRepository_ProjectInfo_Call{Call: _e.mock.On("ProjectInfo")} +} + +func (_c *GitRepository_ProjectInfo_Call) Run(run func()) *GitRepository_ProjectInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GitRepository_ProjectInfo_Call) Return(_a0 *model.ProjectInfo) *GitRepository_ProjectInfo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GitRepository_ProjectInfo_Call) RunAndReturn(run func() *model.ProjectInfo) *GitRepository_ProjectInfo_Call { + _c.Call.Return(run) + return _c +} + +// Remote provides a mock function with given fields: name +func (_m *GitRepository) Remote(name string) (model.Remote, error) { + ret := _m.Called(name) + + if len(ret) == 0 { + panic("no return value specified for Remote") + } + + var r0 model.Remote + var r1 error + if rf, ok := ret.Get(0).(func(string) (model.Remote, error)); ok { + return rf(name) + } + if rf, ok := ret.Get(0).(func(string) model.Remote); ok { + r0 = rf(name) + } else { + r0 = ret.Get(0).(model.Remote) + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GitRepository_Remote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remote' +type GitRepository_Remote_Call struct { + *mock.Call +} + +// Remote is a helper method to define mock.On call +// - name string +func (_e *GitRepository_Expecter) Remote(name interface{}) *GitRepository_Remote_Call { + return &GitRepository_Remote_Call{Call: _e.mock.On("Remote", name)} +} + +func (_c *GitRepository_Remote_Call) Run(run func(name string)) *GitRepository_Remote_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *GitRepository_Remote_Call) Return(_a0 model.Remote, _a1 error) *GitRepository_Remote_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GitRepository_Remote_Call) RunAndReturn(run func(string) (model.Remote, error)) *GitRepository_Remote_Call { + _c.Call.Return(run) + return _c +} + +// NewGitRepository creates a new instance of GitRepository. 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 NewGitRepository(t interface { + mock.TestingT + Cleanup(func()) +}) *GitRepository { + mock := &GitRepository{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/MirrorWriter.go b/generated/mocks/mockgogit/MirrorWriter.go new file mode 100644 index 0000000..55e3af3 --- /dev/null +++ b/generated/mocks/mockgogit/MirrorWriter.go @@ -0,0 +1,134 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + interfaces "itiquette/git-provider-sync/internal/interfaces" + + mock "github.com/stretchr/testify/mock" + + model "itiquette/git-provider-sync/internal/model" +) + +// MirrorWriter is an autogenerated mock type for the MirrorWriter type +type MirrorWriter struct { + mock.Mock +} + +type MirrorWriter_Expecter struct { + mock *mock.Mock +} + +func (_m *MirrorWriter) EXPECT() *MirrorWriter_Expecter { + return &MirrorWriter_Expecter{mock: &_m.Mock} +} + +// Pull provides a mock function with given fields: ctx, opt +func (_m *MirrorWriter) Pull(ctx context.Context, opt model.PullOption) error { + ret := _m.Called(ctx, opt) + + if len(ret) == 0 { + panic("no return value specified for Pull") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, model.PullOption) error); ok { + r0 = rf(ctx, opt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MirrorWriter_Pull_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pull' +type MirrorWriter_Pull_Call struct { + *mock.Call +} + +// Pull is a helper method to define mock.On call +// - ctx context.Context +// - opt model.PullOption +func (_e *MirrorWriter_Expecter) Pull(ctx interface{}, opt interface{}) *MirrorWriter_Pull_Call { + return &MirrorWriter_Pull_Call{Call: _e.mock.On("Pull", ctx, opt)} +} + +func (_c *MirrorWriter_Pull_Call) Run(run func(ctx context.Context, opt model.PullOption)) *MirrorWriter_Pull_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.PullOption)) + }) + return _c +} + +func (_c *MirrorWriter_Pull_Call) Return(_a0 error) *MirrorWriter_Pull_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MirrorWriter_Pull_Call) RunAndReturn(run func(context.Context, model.PullOption) error) *MirrorWriter_Pull_Call { + _c.Call.Return(run) + return _c +} + +// Push provides a mock function with given fields: ctx, repository, opt +func (_m *MirrorWriter) Push(ctx context.Context, repository interfaces.GitRepository, opt model.PushOption) error { + ret := _m.Called(ctx, repository, opt) + + if len(ret) == 0 { + panic("no return value specified for Push") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, interfaces.GitRepository, model.PushOption) error); ok { + r0 = rf(ctx, repository, opt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MirrorWriter_Push_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Push' +type MirrorWriter_Push_Call struct { + *mock.Call +} + +// Push is a helper method to define mock.On call +// - ctx context.Context +// - repository interfaces.GitRepository +// - opt model.PushOption +func (_e *MirrorWriter_Expecter) Push(ctx interface{}, repository interface{}, opt interface{}) *MirrorWriter_Push_Call { + return &MirrorWriter_Push_Call{Call: _e.mock.On("Push", ctx, repository, opt)} +} + +func (_c *MirrorWriter_Push_Call) Run(run func(ctx context.Context, repository interfaces.GitRepository, opt model.PushOption)) *MirrorWriter_Push_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interfaces.GitRepository), args[2].(model.PushOption)) + }) + return _c +} + +func (_c *MirrorWriter_Push_Call) Return(_a0 error) *MirrorWriter_Push_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MirrorWriter_Push_Call) RunAndReturn(run func(context.Context, interfaces.GitRepository, model.PushOption) error) *MirrorWriter_Push_Call { + _c.Call.Return(run) + return _c +} + +// NewMirrorWriter creates a new instance of MirrorWriter. 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 NewMirrorWriter(t interface { + mock.TestingT + Cleanup(func()) +}) *MirrorWriter { + mock := &MirrorWriter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/ProjectServicer.go b/generated/mocks/mockgogit/ProjectServicer.go new file mode 100644 index 0000000..90006e7 --- /dev/null +++ b/generated/mocks/mockgogit/ProjectServicer.go @@ -0,0 +1,269 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + model "itiquette/git-provider-sync/internal/model" +) + +// ProjectServicer is an autogenerated mock type for the ProjectServicer type +type ProjectServicer struct { + mock.Mock +} + +type ProjectServicer_Expecter struct { + mock *mock.Mock +} + +func (_m *ProjectServicer) EXPECT() *ProjectServicer_Expecter { + return &ProjectServicer_Expecter{mock: &_m.Mock} +} + +// CreateProject provides a mock function with given fields: ctx, opt +func (_m *ProjectServicer) CreateProject(ctx context.Context, opt model.CreateProjectOption) (string, error) { + ret := _m.Called(ctx, opt) + + if len(ret) == 0 { + panic("no return value specified for CreateProject") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, model.CreateProjectOption) (string, error)); ok { + return rf(ctx, opt) + } + if rf, ok := ret.Get(0).(func(context.Context, model.CreateProjectOption) string); ok { + r0 = rf(ctx, opt) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, model.CreateProjectOption) error); ok { + r1 = rf(ctx, opt) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProjectServicer_CreateProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProject' +type ProjectServicer_CreateProject_Call struct { + *mock.Call +} + +// CreateProject is a helper method to define mock.On call +// - ctx context.Context +// - opt model.CreateProjectOption +func (_e *ProjectServicer_Expecter) CreateProject(ctx interface{}, opt interface{}) *ProjectServicer_CreateProject_Call { + return &ProjectServicer_CreateProject_Call{Call: _e.mock.On("CreateProject", ctx, opt)} +} + +func (_c *ProjectServicer_CreateProject_Call) Run(run func(ctx context.Context, opt model.CreateProjectOption)) *ProjectServicer_CreateProject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.CreateProjectOption)) + }) + return _c +} + +func (_c *ProjectServicer_CreateProject_Call) Return(_a0 string, _a1 error) *ProjectServicer_CreateProject_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProjectServicer_CreateProject_Call) RunAndReturn(run func(context.Context, model.CreateProjectOption) (string, error)) *ProjectServicer_CreateProject_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectInfos provides a mock function with given fields: ctx, providerOpt, filtering +func (_m *ProjectServicer) GetProjectInfos(ctx context.Context, providerOpt model.ProviderOption, filtering bool) ([]model.ProjectInfo, error) { + ret := _m.Called(ctx, providerOpt, filtering) + + if len(ret) == 0 { + panic("no return value specified for GetProjectInfos") + } + + var r0 []model.ProjectInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, model.ProviderOption, bool) ([]model.ProjectInfo, error)); ok { + return rf(ctx, providerOpt, filtering) + } + if rf, ok := ret.Get(0).(func(context.Context, model.ProviderOption, bool) []model.ProjectInfo); ok { + r0 = rf(ctx, providerOpt, filtering) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.ProjectInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, model.ProviderOption, bool) error); ok { + r1 = rf(ctx, providerOpt, filtering) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProjectServicer_GetProjectInfos_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectInfos' +type ProjectServicer_GetProjectInfos_Call struct { + *mock.Call +} + +// GetProjectInfos is a helper method to define mock.On call +// - ctx context.Context +// - providerOpt model.ProviderOption +// - filtering bool +func (_e *ProjectServicer_Expecter) GetProjectInfos(ctx interface{}, providerOpt interface{}, filtering interface{}) *ProjectServicer_GetProjectInfos_Call { + return &ProjectServicer_GetProjectInfos_Call{Call: _e.mock.On("GetProjectInfos", ctx, providerOpt, filtering)} +} + +func (_c *ProjectServicer_GetProjectInfos_Call) Run(run func(ctx context.Context, providerOpt model.ProviderOption, filtering bool)) *ProjectServicer_GetProjectInfos_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.ProviderOption), args[2].(bool)) + }) + return _c +} + +func (_c *ProjectServicer_GetProjectInfos_Call) Return(_a0 []model.ProjectInfo, _a1 error) *ProjectServicer_GetProjectInfos_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProjectServicer_GetProjectInfos_Call) RunAndReturn(run func(context.Context, model.ProviderOption, bool) ([]model.ProjectInfo, error)) *ProjectServicer_GetProjectInfos_Call { + _c.Call.Return(run) + return _c +} + +// ProjectExists provides a mock function with given fields: ctx, owner, repo +func (_m *ProjectServicer) ProjectExists(ctx context.Context, owner string, repo string) (bool, string, error) { + ret := _m.Called(ctx, owner, repo) + + if len(ret) == 0 { + panic("no return value specified for ProjectExists") + } + + var r0 bool + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, string, error)); ok { + return rf(ctx, owner, repo) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { + r0 = rf(ctx, owner, repo) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok { + r1 = rf(ctx, owner, repo) + } else { + r1 = ret.Get(1).(string) + } + + if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok { + r2 = rf(ctx, owner, repo) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ProjectServicer_ProjectExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProjectExists' +type ProjectServicer_ProjectExists_Call struct { + *mock.Call +} + +// ProjectExists is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - repo string +func (_e *ProjectServicer_Expecter) ProjectExists(ctx interface{}, owner interface{}, repo interface{}) *ProjectServicer_ProjectExists_Call { + return &ProjectServicer_ProjectExists_Call{Call: _e.mock.On("ProjectExists", ctx, owner, repo)} +} + +func (_c *ProjectServicer_ProjectExists_Call) Run(run func(ctx context.Context, owner string, repo string)) *ProjectServicer_ProjectExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ProjectServicer_ProjectExists_Call) Return(_a0 bool, _a1 string, _a2 error) *ProjectServicer_ProjectExists_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ProjectServicer_ProjectExists_Call) RunAndReturn(run func(context.Context, string, string) (bool, string, error)) *ProjectServicer_ProjectExists_Call { + _c.Call.Return(run) + return _c +} + +// SetDefaultBranch provides a mock function with given fields: ctx, owner, projectName, branch +func (_m *ProjectServicer) SetDefaultBranch(ctx context.Context, owner string, projectName string, branch string) error { + ret := _m.Called(ctx, owner, projectName, branch) + + if len(ret) == 0 { + panic("no return value specified for SetDefaultBranch") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok { + r0 = rf(ctx, owner, projectName, branch) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ProjectServicer_SetDefaultBranch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDefaultBranch' +type ProjectServicer_SetDefaultBranch_Call struct { + *mock.Call +} + +// SetDefaultBranch is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - projectName string +// - branch string +func (_e *ProjectServicer_Expecter) SetDefaultBranch(ctx interface{}, owner interface{}, projectName interface{}, branch interface{}) *ProjectServicer_SetDefaultBranch_Call { + return &ProjectServicer_SetDefaultBranch_Call{Call: _e.mock.On("SetDefaultBranch", ctx, owner, projectName, branch)} +} + +func (_c *ProjectServicer_SetDefaultBranch_Call) Run(run func(ctx context.Context, owner string, projectName string, branch string)) *ProjectServicer_SetDefaultBranch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *ProjectServicer_SetDefaultBranch_Call) Return(_a0 error) *ProjectServicer_SetDefaultBranch_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProjectServicer_SetDefaultBranch_Call) RunAndReturn(run func(context.Context, string, string, string) error) *ProjectServicer_SetDefaultBranch_Call { + _c.Call.Return(run) + return _c +} + +// NewProjectServicer creates a new instance of ProjectServicer. 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 NewProjectServicer(t interface { + mock.TestingT + Cleanup(func()) +}) *ProjectServicer { + mock := &ProjectServicer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/ProtectionServicer.go b/generated/mocks/mockgogit/ProtectionServicer.go new file mode 100644 index 0000000..6a9d853 --- /dev/null +++ b/generated/mocks/mockgogit/ProtectionServicer.go @@ -0,0 +1,133 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// ProtectionServicer is an autogenerated mock type for the ProtectionServicer type +type ProtectionServicer struct { + mock.Mock +} + +type ProtectionServicer_Expecter struct { + mock *mock.Mock +} + +func (_m *ProtectionServicer) EXPECT() *ProtectionServicer_Expecter { + return &ProtectionServicer_Expecter{mock: &_m.Mock} +} + +// Protect provides a mock function with given fields: ctx, owner, defaultBranch, projectIDstr +func (_m *ProtectionServicer) Protect(ctx context.Context, owner string, defaultBranch string, projectIDstr string) error { + ret := _m.Called(ctx, owner, defaultBranch, projectIDstr) + + if len(ret) == 0 { + panic("no return value specified for Protect") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok { + r0 = rf(ctx, owner, defaultBranch, projectIDstr) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ProtectionServicer_Protect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Protect' +type ProtectionServicer_Protect_Call struct { + *mock.Call +} + +// Protect is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - defaultBranch string +// - projectIDstr string +func (_e *ProtectionServicer_Expecter) Protect(ctx interface{}, owner interface{}, defaultBranch interface{}, projectIDstr interface{}) *ProtectionServicer_Protect_Call { + return &ProtectionServicer_Protect_Call{Call: _e.mock.On("Protect", ctx, owner, defaultBranch, projectIDstr)} +} + +func (_c *ProtectionServicer_Protect_Call) Run(run func(ctx context.Context, owner string, defaultBranch string, projectIDstr string)) *ProtectionServicer_Protect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *ProtectionServicer_Protect_Call) Return(_a0 error) *ProtectionServicer_Protect_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProtectionServicer_Protect_Call) RunAndReturn(run func(context.Context, string, string, string) error) *ProtectionServicer_Protect_Call { + _c.Call.Return(run) + return _c +} + +// Unprotect provides a mock function with given fields: ctx, defaultBranch, projectIDStr +func (_m *ProtectionServicer) Unprotect(ctx context.Context, defaultBranch string, projectIDStr string) error { + ret := _m.Called(ctx, defaultBranch, projectIDStr) + + if len(ret) == 0 { + panic("no return value specified for Unprotect") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, defaultBranch, projectIDStr) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ProtectionServicer_Unprotect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unprotect' +type ProtectionServicer_Unprotect_Call struct { + *mock.Call +} + +// Unprotect is a helper method to define mock.On call +// - ctx context.Context +// - defaultBranch string +// - projectIDStr string +func (_e *ProtectionServicer_Expecter) Unprotect(ctx interface{}, defaultBranch interface{}, projectIDStr interface{}) *ProtectionServicer_Unprotect_Call { + return &ProtectionServicer_Unprotect_Call{Call: _e.mock.On("Unprotect", ctx, defaultBranch, projectIDStr)} +} + +func (_c *ProtectionServicer_Unprotect_Call) Run(run func(ctx context.Context, defaultBranch string, projectIDStr string)) *ProtectionServicer_Unprotect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ProtectionServicer_Unprotect_Call) Return(_a0 error) *ProtectionServicer_Unprotect_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProtectionServicer_Unprotect_Call) RunAndReturn(run func(context.Context, string, string) error) *ProtectionServicer_Unprotect_Call { + _c.Call.Return(run) + return _c +} + +// NewProtectionServicer creates a new instance of ProtectionServicer. 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 NewProtectionServicer(t interface { + mock.TestingT + Cleanup(func()) +}) *ProtectionServicer { + mock := &ProtectionServicer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/ProviderServicer.go b/generated/mocks/mockgogit/ProviderServicer.go new file mode 100644 index 0000000..0462c13 --- /dev/null +++ b/generated/mocks/mockgogit/ProviderServicer.go @@ -0,0 +1,269 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + model "itiquette/git-provider-sync/internal/model" +) + +// ProviderServicer is an autogenerated mock type for the ProviderServicer type +type ProviderServicer struct { + mock.Mock +} + +type ProviderServicer_Expecter struct { + mock *mock.Mock +} + +func (_m *ProviderServicer) EXPECT() *ProviderServicer_Expecter { + return &ProviderServicer_Expecter{mock: &_m.Mock} +} + +// CreateProject provides a mock function with given fields: ctx, opt +func (_m *ProviderServicer) CreateProject(ctx context.Context, opt model.CreateProjectOption) (string, error) { + ret := _m.Called(ctx, opt) + + if len(ret) == 0 { + panic("no return value specified for CreateProject") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, model.CreateProjectOption) (string, error)); ok { + return rf(ctx, opt) + } + if rf, ok := ret.Get(0).(func(context.Context, model.CreateProjectOption) string); ok { + r0 = rf(ctx, opt) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, model.CreateProjectOption) error); ok { + r1 = rf(ctx, opt) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProviderServicer_CreateProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProject' +type ProviderServicer_CreateProject_Call struct { + *mock.Call +} + +// CreateProject is a helper method to define mock.On call +// - ctx context.Context +// - opt model.CreateProjectOption +func (_e *ProviderServicer_Expecter) CreateProject(ctx interface{}, opt interface{}) *ProviderServicer_CreateProject_Call { + return &ProviderServicer_CreateProject_Call{Call: _e.mock.On("CreateProject", ctx, opt)} +} + +func (_c *ProviderServicer_CreateProject_Call) Run(run func(ctx context.Context, opt model.CreateProjectOption)) *ProviderServicer_CreateProject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.CreateProjectOption)) + }) + return _c +} + +func (_c *ProviderServicer_CreateProject_Call) Return(_a0 string, _a1 error) *ProviderServicer_CreateProject_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProviderServicer_CreateProject_Call) RunAndReturn(run func(context.Context, model.CreateProjectOption) (string, error)) *ProviderServicer_CreateProject_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectInfos provides a mock function with given fields: ctx, providerOpt, filtering +func (_m *ProviderServicer) GetProjectInfos(ctx context.Context, providerOpt model.ProviderOption, filtering bool) ([]model.ProjectInfo, error) { + ret := _m.Called(ctx, providerOpt, filtering) + + if len(ret) == 0 { + panic("no return value specified for GetProjectInfos") + } + + var r0 []model.ProjectInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, model.ProviderOption, bool) ([]model.ProjectInfo, error)); ok { + return rf(ctx, providerOpt, filtering) + } + if rf, ok := ret.Get(0).(func(context.Context, model.ProviderOption, bool) []model.ProjectInfo); ok { + r0 = rf(ctx, providerOpt, filtering) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.ProjectInfo) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, model.ProviderOption, bool) error); ok { + r1 = rf(ctx, providerOpt, filtering) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ProviderServicer_GetProjectInfos_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectInfos' +type ProviderServicer_GetProjectInfos_Call struct { + *mock.Call +} + +// GetProjectInfos is a helper method to define mock.On call +// - ctx context.Context +// - providerOpt model.ProviderOption +// - filtering bool +func (_e *ProviderServicer_Expecter) GetProjectInfos(ctx interface{}, providerOpt interface{}, filtering interface{}) *ProviderServicer_GetProjectInfos_Call { + return &ProviderServicer_GetProjectInfos_Call{Call: _e.mock.On("GetProjectInfos", ctx, providerOpt, filtering)} +} + +func (_c *ProviderServicer_GetProjectInfos_Call) Run(run func(ctx context.Context, providerOpt model.ProviderOption, filtering bool)) *ProviderServicer_GetProjectInfos_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.ProviderOption), args[2].(bool)) + }) + return _c +} + +func (_c *ProviderServicer_GetProjectInfos_Call) Return(_a0 []model.ProjectInfo, _a1 error) *ProviderServicer_GetProjectInfos_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProviderServicer_GetProjectInfos_Call) RunAndReturn(run func(context.Context, model.ProviderOption, bool) ([]model.ProjectInfo, error)) *ProviderServicer_GetProjectInfos_Call { + _c.Call.Return(run) + return _c +} + +// ProjectExists provides a mock function with given fields: ctx, owner, repo +func (_m *ProviderServicer) ProjectExists(ctx context.Context, owner string, repo string) (bool, string, error) { + ret := _m.Called(ctx, owner, repo) + + if len(ret) == 0 { + panic("no return value specified for ProjectExists") + } + + var r0 bool + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, string, error)); ok { + return rf(ctx, owner, repo) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { + r0 = rf(ctx, owner, repo) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok { + r1 = rf(ctx, owner, repo) + } else { + r1 = ret.Get(1).(string) + } + + if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok { + r2 = rf(ctx, owner, repo) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ProviderServicer_ProjectExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProjectExists' +type ProviderServicer_ProjectExists_Call struct { + *mock.Call +} + +// ProjectExists is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - repo string +func (_e *ProviderServicer_Expecter) ProjectExists(ctx interface{}, owner interface{}, repo interface{}) *ProviderServicer_ProjectExists_Call { + return &ProviderServicer_ProjectExists_Call{Call: _e.mock.On("ProjectExists", ctx, owner, repo)} +} + +func (_c *ProviderServicer_ProjectExists_Call) Run(run func(ctx context.Context, owner string, repo string)) *ProviderServicer_ProjectExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ProviderServicer_ProjectExists_Call) Return(_a0 bool, _a1 string, _a2 error) *ProviderServicer_ProjectExists_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ProviderServicer_ProjectExists_Call) RunAndReturn(run func(context.Context, string, string) (bool, string, error)) *ProviderServicer_ProjectExists_Call { + _c.Call.Return(run) + return _c +} + +// SetDefaultBranch provides a mock function with given fields: ctx, owner, projectName, branch +func (_m *ProviderServicer) SetDefaultBranch(ctx context.Context, owner string, projectName string, branch string) error { + ret := _m.Called(ctx, owner, projectName, branch) + + if len(ret) == 0 { + panic("no return value specified for SetDefaultBranch") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok { + r0 = rf(ctx, owner, projectName, branch) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ProviderServicer_SetDefaultBranch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDefaultBranch' +type ProviderServicer_SetDefaultBranch_Call struct { + *mock.Call +} + +// SetDefaultBranch is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - projectName string +// - branch string +func (_e *ProviderServicer_Expecter) SetDefaultBranch(ctx interface{}, owner interface{}, projectName interface{}, branch interface{}) *ProviderServicer_SetDefaultBranch_Call { + return &ProviderServicer_SetDefaultBranch_Call{Call: _e.mock.On("SetDefaultBranch", ctx, owner, projectName, branch)} +} + +func (_c *ProviderServicer_SetDefaultBranch_Call) Run(run func(ctx context.Context, owner string, projectName string, branch string)) *ProviderServicer_SetDefaultBranch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *ProviderServicer_SetDefaultBranch_Call) Return(_a0 error) *ProviderServicer_SetDefaultBranch_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProviderServicer_SetDefaultBranch_Call) RunAndReturn(run func(context.Context, string, string, string) error) *ProviderServicer_SetDefaultBranch_Call { + _c.Call.Return(run) + return _c +} + +// NewProviderServicer creates a new instance of ProviderServicer. 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 NewProviderServicer(t interface { + mock.TestingT + Cleanup(func()) +}) *ProviderServicer { + mock := &ProviderServicer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/SourceReader.go b/generated/mocks/mockgogit/SourceReader.go new file mode 100644 index 0000000..8ffafa8 --- /dev/null +++ b/generated/mocks/mockgogit/SourceReader.go @@ -0,0 +1,95 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + model "itiquette/git-provider-sync/internal/model" +) + +// SourceReader is an autogenerated mock type for the SourceReader type +type SourceReader struct { + mock.Mock +} + +type SourceReader_Expecter struct { + mock *mock.Mock +} + +func (_m *SourceReader) EXPECT() *SourceReader_Expecter { + return &SourceReader_Expecter{mock: &_m.Mock} +} + +// Clone provides a mock function with given fields: ctx, option +func (_m *SourceReader) Clone(ctx context.Context, option model.CloneOption) (model.Repository, error) { + ret := _m.Called(ctx, option) + + if len(ret) == 0 { + panic("no return value specified for Clone") + } + + var r0 model.Repository + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, model.CloneOption) (model.Repository, error)); ok { + return rf(ctx, option) + } + if rf, ok := ret.Get(0).(func(context.Context, model.CloneOption) model.Repository); ok { + r0 = rf(ctx, option) + } else { + r0 = ret.Get(0).(model.Repository) + } + + if rf, ok := ret.Get(1).(func(context.Context, model.CloneOption) error); ok { + r1 = rf(ctx, option) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// SourceReader_Clone_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Clone' +type SourceReader_Clone_Call struct { + *mock.Call +} + +// Clone is a helper method to define mock.On call +// - ctx context.Context +// - option model.CloneOption +func (_e *SourceReader_Expecter) Clone(ctx interface{}, option interface{}) *SourceReader_Clone_Call { + return &SourceReader_Clone_Call{Call: _e.mock.On("Clone", ctx, option)} +} + +func (_c *SourceReader_Clone_Call) Run(run func(ctx context.Context, option model.CloneOption)) *SourceReader_Clone_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(model.CloneOption)) + }) + return _c +} + +func (_c *SourceReader_Clone_Call) Return(_a0 model.Repository, _a1 error) *SourceReader_Clone_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SourceReader_Clone_Call) RunAndReturn(run func(context.Context, model.CloneOption) (model.Repository, error)) *SourceReader_Clone_Call { + _c.Call.Return(run) + return _c +} + +// NewSourceReader creates a new instance of SourceReader. 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 NewSourceReader(t interface { + mock.TestingT + Cleanup(func()) +}) *SourceReader { + mock := &SourceReader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/generated/mocks/mockgogit/TargetWriter.go b/generated/mocks/mockgogit/TargetWriter.go new file mode 100644 index 0000000..5e06158 --- /dev/null +++ b/generated/mocks/mockgogit/TargetWriter.go @@ -0,0 +1,87 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + interfaces "itiquette/git-provider-sync/internal/interfaces" + + mock "github.com/stretchr/testify/mock" + + model "itiquette/git-provider-sync/internal/model" +) + +// TargetWriter is an autogenerated mock type for the TargetWriter type +type TargetWriter struct { + mock.Mock +} + +type TargetWriter_Expecter struct { + mock *mock.Mock +} + +func (_m *TargetWriter) EXPECT() *TargetWriter_Expecter { + return &TargetWriter_Expecter{mock: &_m.Mock} +} + +// Push provides a mock function with given fields: ctx, repository, opt +func (_m *TargetWriter) Push(ctx context.Context, repository interfaces.GitRepository, opt model.PushOption) error { + ret := _m.Called(ctx, repository, opt) + + if len(ret) == 0 { + panic("no return value specified for Push") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, interfaces.GitRepository, model.PushOption) error); ok { + r0 = rf(ctx, repository, opt) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// TargetWriter_Push_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Push' +type TargetWriter_Push_Call struct { + *mock.Call +} + +// Push is a helper method to define mock.On call +// - ctx context.Context +// - repository interfaces.GitRepository +// - opt model.PushOption +func (_e *TargetWriter_Expecter) Push(ctx interface{}, repository interface{}, opt interface{}) *TargetWriter_Push_Call { + return &TargetWriter_Push_Call{Call: _e.mock.On("Push", ctx, repository, opt)} +} + +func (_c *TargetWriter_Push_Call) Run(run func(ctx context.Context, repository interfaces.GitRepository, opt model.PushOption)) *TargetWriter_Push_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(interfaces.GitRepository), args[2].(model.PushOption)) + }) + return _c +} + +func (_c *TargetWriter_Push_Call) Return(_a0 error) *TargetWriter_Push_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *TargetWriter_Push_Call) RunAndReturn(run func(context.Context, interfaces.GitRepository, model.PushOption) error) *TargetWriter_Push_Call { + _c.Call.Return(run) + return _c +} + +// NewTargetWriter creates a new instance of TargetWriter. 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 NewTargetWriter(t interface { + mock.TestingT + Cleanup(func()) +}) *TargetWriter { + mock := &TargetWriter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} From 584fbd4292fd1804b1afde6c9a168d153296ec0f Mon Sep 17 00:00:00 2001 From: Josef Andersson Date: Sat, 1 Feb 2025 18:30:57 +0100 Subject: [PATCH 2/3] ci: remove fuzz pr Signed-off-by: Josef Andersson --- .github/workflows/fuzz-pr.yml | 47 ----------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 .github/workflows/fuzz-pr.yml diff --git a/.github/workflows/fuzz-pr.yml b/.github/workflows/fuzz-pr.yml deleted file mode 100644 index 5a6e5a4..0000000 --- a/.github/workflows/fuzz-pr.yml +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-FileCopyrightText: Josef Andersson -# -# SPDX-License-Identifier: CC0-1.0 - -name: Fuzzing - PR -on: - pull_request: - paths: - - "**.go" # Only run on Go files paths: - -permissions: - contents: read - -jobs: - PR: - runs-on: ubuntu-latest - permissions: - security-events: write - pull-requests: read - concurrency: - group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ github.ref }} - cancel-in-progress: true - strategy: - fail-fast: false - matrix: - sanitizer: - - address - - memory - - steps: - - name: Build Fuzzers (${{ matrix.sanitizer }}) - id: build - uses: google/clusterfuzzlite/actions/build_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1 - with: - language: go - github-token: ${{ secrets.GITHUB_TOKEN }} - sanitizer: ${{ matrix.sanitizer }} - - - name: Run Fuzzers (${{ matrix.sanitizer }}) - id: run - uses: google/clusterfuzzlite/actions/run_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - fuzz-seconds: 600 - mode: "code-change" - sanitizer: ${{ matrix.sanitizer }} - output-sarif: true From 99a31197c612ccdc8b4243e405d4277641c35c26 Mon Sep 17 00:00:00 2001 From: Josef Andersson Date: Sat, 1 Feb 2025 18:41:01 +0100 Subject: [PATCH 3/3] chore: add headers to mock code Signed-off-by: Josef Andersson --- generated/mocks/mockgitlab/ClientOptionFunc.go | 4 ++++ generated/mocks/mockgitlab/RateLimiter.go | 4 ++++ generated/mocks/mockgitlab/RequestOptionFunc.go | 4 ++++ generated/mocks/mockgogit/BranchManager.go | 4 ++++ generated/mocks/mockgogit/CommandExecutor.go | 4 ++++ generated/mocks/mockgogit/FilterServicer.go | 4 ++++ generated/mocks/mockgogit/GitInterface.go | 4 ++++ generated/mocks/mockgogit/GitLibOperation.go | 4 ++++ generated/mocks/mockgogit/GitProvider.go | 4 ++++ generated/mocks/mockgogit/GitRemote.go | 4 ++++ generated/mocks/mockgogit/GitRepository.go | 4 ++++ generated/mocks/mockgogit/MirrorWriter.go | 4 ++++ generated/mocks/mockgogit/ProjectServicer.go | 4 ++++ generated/mocks/mockgogit/ProtectionServicer.go | 4 ++++ generated/mocks/mockgogit/ProviderServicer.go | 4 ++++ generated/mocks/mockgogit/SourceReader.go | 4 ++++ generated/mocks/mockgogit/TargetWriter.go | 4 ++++ 17 files changed, 68 insertions(+) diff --git a/generated/mocks/mockgitlab/ClientOptionFunc.go b/generated/mocks/mockgitlab/ClientOptionFunc.go index be29556..c47e775 100644 --- a/generated/mocks/mockgitlab/ClientOptionFunc.go +++ b/generated/mocks/mockgitlab/ClientOptionFunc.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgitlab/RateLimiter.go b/generated/mocks/mockgitlab/RateLimiter.go index 3f2eea1..98659ed 100644 --- a/generated/mocks/mockgitlab/RateLimiter.go +++ b/generated/mocks/mockgitlab/RateLimiter.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgitlab/RequestOptionFunc.go b/generated/mocks/mockgitlab/RequestOptionFunc.go index ae34392..fb07895 100644 --- a/generated/mocks/mockgitlab/RequestOptionFunc.go +++ b/generated/mocks/mockgitlab/RequestOptionFunc.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/BranchManager.go b/generated/mocks/mockgogit/BranchManager.go index 07a6c8b..81484bf 100644 --- a/generated/mocks/mockgogit/BranchManager.go +++ b/generated/mocks/mockgogit/BranchManager.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/CommandExecutor.go b/generated/mocks/mockgogit/CommandExecutor.go index c352649..301ba9b 100644 --- a/generated/mocks/mockgogit/CommandExecutor.go +++ b/generated/mocks/mockgogit/CommandExecutor.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/FilterServicer.go b/generated/mocks/mockgogit/FilterServicer.go index 8b92f72..7203cb9 100644 --- a/generated/mocks/mockgogit/FilterServicer.go +++ b/generated/mocks/mockgogit/FilterServicer.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/GitInterface.go b/generated/mocks/mockgogit/GitInterface.go index d9f5f1a..001f66d 100644 --- a/generated/mocks/mockgogit/GitInterface.go +++ b/generated/mocks/mockgogit/GitInterface.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/GitLibOperation.go b/generated/mocks/mockgogit/GitLibOperation.go index 4de9eb9..225b477 100644 --- a/generated/mocks/mockgogit/GitLibOperation.go +++ b/generated/mocks/mockgogit/GitLibOperation.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.46.2. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/GitProvider.go b/generated/mocks/mockgogit/GitProvider.go index 323bc28..5b508ba 100644 --- a/generated/mocks/mockgogit/GitProvider.go +++ b/generated/mocks/mockgogit/GitProvider.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/GitRemote.go b/generated/mocks/mockgogit/GitRemote.go index 751da93..4b47fed 100644 --- a/generated/mocks/mockgogit/GitRemote.go +++ b/generated/mocks/mockgogit/GitRemote.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/GitRepository.go b/generated/mocks/mockgogit/GitRepository.go index 5dbac96..be4d664 100644 --- a/generated/mocks/mockgogit/GitRepository.go +++ b/generated/mocks/mockgogit/GitRepository.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/MirrorWriter.go b/generated/mocks/mockgogit/MirrorWriter.go index 55e3af3..bc98f67 100644 --- a/generated/mocks/mockgogit/MirrorWriter.go +++ b/generated/mocks/mockgogit/MirrorWriter.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/ProjectServicer.go b/generated/mocks/mockgogit/ProjectServicer.go index 90006e7..c089460 100644 --- a/generated/mocks/mockgogit/ProjectServicer.go +++ b/generated/mocks/mockgogit/ProjectServicer.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/ProtectionServicer.go b/generated/mocks/mockgogit/ProtectionServicer.go index 6a9d853..063652b 100644 --- a/generated/mocks/mockgogit/ProtectionServicer.go +++ b/generated/mocks/mockgogit/ProtectionServicer.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/ProviderServicer.go b/generated/mocks/mockgogit/ProviderServicer.go index 0462c13..97a892e 100644 --- a/generated/mocks/mockgogit/ProviderServicer.go +++ b/generated/mocks/mockgogit/ProviderServicer.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/SourceReader.go b/generated/mocks/mockgogit/SourceReader.go index 8ffafa8..b8959fa 100644 --- a/generated/mocks/mockgogit/SourceReader.go +++ b/generated/mocks/mockgogit/SourceReader.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks diff --git a/generated/mocks/mockgogit/TargetWriter.go b/generated/mocks/mockgogit/TargetWriter.go index 5e06158..95d7129 100644 --- a/generated/mocks/mockgogit/TargetWriter.go +++ b/generated/mocks/mockgogit/TargetWriter.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 Josef Andersson +// +// SPDX-License-Identifier: EUPL-1.2 + // Code generated by mockery v2.50.0. DO NOT EDIT. package mocks