mirror of
https://github.com/harness/drone.git
synced 2025-05-03 12:49:44 +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
177 lines
5.1 KiB
Go
177 lines
5.1 KiB
Go
package mocks
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/harness/gitness/registry/types"
|
|
|
|
"github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// UpstreamProxyStore is an autogenerated mock type for the UpstreamProxyConfigRepository type
|
|
type UpstreamProxyStore struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Get provides a mock function with given fields: ctx, id
|
|
func (m *UpstreamProxyStore) Get(ctx context.Context, id int64) (*types.UpstreamProxy, error) {
|
|
ret := m.Called(ctx, id)
|
|
|
|
var r0 *types.UpstreamProxy
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) *types.UpstreamProxy); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.UpstreamProxy)
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// GetByRegistryIdentifier provides a mock function with given fields: ctx, parentID, repoKey
|
|
func (m *UpstreamProxyStore) GetByRegistryIdentifier(ctx context.Context, parentID int64, repoKey string) (*types.UpstreamProxy, error) {
|
|
ret := m.Called(ctx, parentID, repoKey)
|
|
|
|
var r0 *types.UpstreamProxy
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, string) *types.UpstreamProxy); ok {
|
|
r0 = rf(ctx, parentID, repoKey)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.UpstreamProxy)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64, string) error); ok {
|
|
r1 = rf(ctx, parentID, repoKey)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetByParentID provides a mock function with given fields: ctx, parentID
|
|
func (m *UpstreamProxyStore) GetByParentID(ctx context.Context, parentID string) (*[]types.UpstreamProxy, error) {
|
|
ret := m.Called(ctx, parentID)
|
|
|
|
var r0 *[]types.UpstreamProxy
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *[]types.UpstreamProxy); ok {
|
|
r0 = rf(ctx, parentID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*[]types.UpstreamProxy)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, parentID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Create provides a mock function with given fields: ctx, upstreamproxyRecord
|
|
func (m *UpstreamProxyStore) Create(ctx context.Context, upstreamproxyRecord *types.UpstreamProxyConfig) (int64, error) {
|
|
ret := m.Called(ctx, upstreamproxyRecord)
|
|
|
|
var r0 int64
|
|
if rf, ok := ret.Get(0).(func(context.Context, *types.UpstreamProxyConfig) int64); ok {
|
|
r0 = rf(ctx, upstreamproxyRecord)
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, *types.UpstreamProxyConfig) error); ok {
|
|
r1 = rf(ctx, upstreamproxyRecord)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Delete provides a mock function with given fields: ctx, parentID, repoKey
|
|
func (m *UpstreamProxyStore) Delete(ctx context.Context, parentID int64, repoKey string) error {
|
|
ret := m.Called(ctx, parentID, repoKey)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, string) error); ok {
|
|
r0 = rf(ctx, parentID, repoKey)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Update provides a mock function with given fields: ctx, upstreamproxyRecord
|
|
func (m *UpstreamProxyStore) Update(ctx context.Context, upstreamproxyRecord *types.UpstreamProxyConfig) error {
|
|
ret := m.Called(ctx, upstreamproxyRecord)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *types.UpstreamProxyConfig) error); ok {
|
|
r0 = rf(ctx, upstreamproxyRecord)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// GetAll provides a mock function with given fields: ctx, parentID, packageTypes, sortByField, sortByOrder, limit, offset, search
|
|
func (m *UpstreamProxyStore) GetAll(ctx context.Context, parentID int64, packageTypes []string, sortByField string, sortByOrder string, limit int, offset int, search string) (*[]types.UpstreamProxy, error) {
|
|
ret := m.Called(ctx, parentID, packageTypes, sortByField, sortByOrder, limit, offset, search)
|
|
|
|
var r0 *[]types.UpstreamProxy
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, []string, string, string, int, int, string) *[]types.UpstreamProxy); ok {
|
|
r0 = rf(ctx, parentID, packageTypes, sortByField, sortByOrder, limit, offset, search)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*[]types.UpstreamProxy)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64, []string, string, string, int, int, string) error); ok {
|
|
r1 = rf(ctx, parentID, packageTypes, sortByField, sortByOrder, limit, offset, search)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// CountAll provides a mock function with given fields: ctx, parentID, packageTypes, search
|
|
func (m *UpstreamProxyStore) CountAll(ctx context.Context, parentID string, packageTypes []string, search string) (int64, error) {
|
|
ret := m.Called(ctx, parentID, packageTypes, search)
|
|
|
|
var r0 int64
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, []string, string) int64); ok {
|
|
r0 = rf(ctx, parentID, packageTypes, search)
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, []string, string) error); ok {
|
|
r1 = rf(ctx, parentID, packageTypes, search)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|