mirror of
https://github.com/harness/drone.git
synced 2025-05-03 18:30:11 +08:00

* fix merge conflicts * fix merge conflicts * fix review comment * fix review comment * fix review comment * fix: [AH-771]: gitness unit test refactoring * fix: [AH-771]: resolved review comments * fix: [AH-771]: resolved review comments * fix: [AH-771] Registry test refactoring and improvements - Refactored registry metadata test implementations - Improved code organization and readability - Fixed line length issues in test files - Removed unused fields from request.go - Added proper license headers - Fixed linting issues in mock files - Simplified test setup and assertions - Updated wire generation for cmd package - Added nolint:exhaustive directive for package type switch fix: [AH-771] Registry test refactoring and improvements - Refactored registry metadata test implementations - Improved code organization and readability - Fixed line length issues in test files - Removed unused fields from request.go - Added proper license headers - Fixed linting issues in mock files - Simplifi
131 lines
2.8 KiB
Go
131 lines
2.8 KiB
Go
// Code generated by testify. DO NOT EDIT.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/harness/gitness/types"
|
|
|
|
"github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// SpaceFinder is a mock of SpaceFinder interface.
|
|
type SpaceFinder struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Find provides a mock function
|
|
func (m *SpaceFinder) Find(ctx context.Context, id int64) (*types.SpaceCore, error) {
|
|
ret := m.Called(ctx, id)
|
|
|
|
var r0 *types.SpaceCore
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) *types.SpaceCore); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.SpaceCore)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
|
|
r1 = rf(ctx, id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// FindByRef provides a mock function
|
|
func (m *SpaceFinder) FindByID(ctx context.Context, id int64) (*types.SpaceCore, error) {
|
|
ret := m.Called(ctx, id)
|
|
|
|
var r0 *types.SpaceCore
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) *types.SpaceCore); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.SpaceCore)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
|
|
r1 = rf(ctx, id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
func (m *SpaceFinder) FindByRef(ctx context.Context, ref string) (*types.SpaceCore, error) {
|
|
ret := m.Called(ctx, ref)
|
|
|
|
var r0 *types.SpaceCore
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *types.SpaceCore); ok {
|
|
r0 = rf(ctx, ref)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.SpaceCore)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, ref)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// FindByPath provides a mock function
|
|
func (m *SpaceFinder) FindByPath(ctx context.Context, path string) (*types.SpaceCore, error) {
|
|
ret := m.Called(ctx, path)
|
|
|
|
var r0 *types.SpaceCore
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *types.SpaceCore); ok {
|
|
r0 = rf(ctx, path)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.SpaceCore)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, path)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// FindByIdentifier provides a mock function
|
|
func (m *SpaceFinder) FindByIdentifier(ctx context.Context, identifier string) (*types.SpaceCore, error) {
|
|
ret := m.Called(ctx, identifier)
|
|
|
|
var r0 *types.SpaceCore
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *types.SpaceCore); ok {
|
|
r0 = rf(ctx, identifier)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.SpaceCore)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, identifier)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|