drone/registry/app/api/controller/mocks/file_manager.go
Manjunatha EN a73113f8e6 fix: [AH-771]: gitness unit test refactoring (#3589)
* 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
2025-04-22 14:49:24 +00:00

68 lines
2.6 KiB
Go

// Code generated by mockery. DO NOT EDIT.
package mocks
import (
"context"
"io"
"mime/multipart"
"github.com/harness/gitness/registry/app/storage"
"github.com/harness/gitness/registry/types"
"github.com/stretchr/testify/mock"
)
// FileManager is a mock type for filemanager.FileManager
type FileManager struct {
mock.Mock
}
// UploadFile provides a mock function
func (m *FileManager) UploadFile(ctx context.Context, filePath string, regName string, regID int64, rootParentID int64, rootIdentifier string, file multipart.File, fileReader io.Reader, filename string) (types.FileInfo, error) {
args := m.Called(ctx, filePath, regName, regID, rootParentID, rootIdentifier, file, fileReader, filename)
return args.Get(0).(types.FileInfo), args.Error(1)
}
// DownloadFile provides a mock function
func (m *FileManager) DownloadFile(ctx context.Context, filePath string, regInfo types.Registry, rootIdentifier string) (*storage.FileReader, int64, string, error) {
args := m.Called(ctx, filePath, regInfo, rootIdentifier)
return args.Get(0).(*storage.FileReader), args.Get(1).(int64), args.Get(2).(string), args.Error(3)
}
// DeleteFile provides a mock function
func (m *FileManager) DeleteFile(ctx context.Context, filePath string, regID int) error {
args := m.Called(ctx, filePath, regID)
return args.Error(0)
}
// HeadFile provides a mock function
func (m *FileManager) HeadFile(ctx context.Context, filePath string, regID int64) (string, error) {
args := m.Called(ctx, filePath, regID)
return args.String(0), args.Error(1)
}
// GetFileMetadata provides a mock function
func (m *FileManager) GetFileMetadata(ctx context.Context, filePath string, regID int64) (types.FileInfo, error) {
args := m.Called(ctx, filePath, regID)
return args.Get(0).(types.FileInfo), args.Error(1)
}
// DeleteFileByRegistryID provides a mock function
func (m *FileManager) DeleteFileByRegistryID(ctx context.Context, regID int64, regName string) error {
args := m.Called(ctx, regID, regName)
return args.Error(0)
}
// GetFilesMetadata provides a mock function
func (m *FileManager) GetFilesMetadata(ctx context.Context, filePath string, regID int64, sortByField string, sortByOrder string, limit int, offset int, search string) (*[]types.FileNodeMetadata, error) {
args := m.Called(ctx, filePath, regID, sortByField, sortByOrder, limit, offset, search)
return args.Get(0).(*[]types.FileNodeMetadata), args.Error(1)
}
// CountFilesByPath provides a mock function
func (m *FileManager) CountFilesByPath(ctx context.Context, filePath string, regID int64) (int64, error) {
args := m.Called(ctx, filePath, regID)
return args.Get(0).(int64), args.Error(1)
}