drone/registry/app/api/controller/mocks/generic_blob_repository.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

165 lines
4.2 KiB
Go

// Code generated by mockery v2.53.3. DO NOT EDIT.
package mocks
import (
context "context"
types "github.com/harness/gitness/registry/types"
mock "github.com/stretchr/testify/mock"
)
// GenericBlobRepository is an autogenerated mock type for the GenericBlobRepository type
type GenericBlobRepository struct {
mock.Mock
}
// Create provides a mock function with given fields: ctx, gb
func (_m *GenericBlobRepository) Create(ctx context.Context, gb *types.GenericBlob) (bool, error) {
ret := _m.Called(ctx, gb)
if len(ret) == 0 {
panic("no return value specified for Create")
}
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *types.GenericBlob) (bool, error)); ok {
return rf(ctx, gb)
}
if rf, ok := ret.Get(0).(func(context.Context, *types.GenericBlob) bool); ok {
r0 = rf(ctx, gb)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(context.Context, *types.GenericBlob) error); ok {
r1 = rf(ctx, gb)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteByID provides a mock function with given fields: ctx, id
func (_m *GenericBlobRepository) DeleteByID(ctx context.Context, id string) error {
ret := _m.Called(ctx, id)
if len(ret) == 0 {
panic("no return value specified for DeleteByID")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// FindByID provides a mock function with given fields: ctx, id
func (_m *GenericBlobRepository) FindByID(ctx context.Context, id string) (*types.GenericBlob, error) {
ret := _m.Called(ctx, id)
if len(ret) == 0 {
panic("no return value specified for FindByID")
}
var r0 *types.GenericBlob
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*types.GenericBlob, error)); ok {
return rf(ctx, id)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *types.GenericBlob); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.GenericBlob)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FindBySha256AndRootParentID provides a mock function with given fields: ctx, sha256, rootParentID
func (_m *GenericBlobRepository) FindBySha256AndRootParentID(ctx context.Context, sha256 string, rootParentID int64) (*types.GenericBlob, error) {
ret := _m.Called(ctx, sha256, rootParentID)
if len(ret) == 0 {
panic("no return value specified for FindBySha256AndRootParentID")
}
var r0 *types.GenericBlob
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, int64) (*types.GenericBlob, error)); ok {
return rf(ctx, sha256, rootParentID)
}
if rf, ok := ret.Get(0).(func(context.Context, string, int64) *types.GenericBlob); ok {
r0 = rf(ctx, sha256, rootParentID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.GenericBlob)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, int64) error); ok {
r1 = rf(ctx, sha256, rootParentID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// TotalSizeByRootParentID provides a mock function with given fields: ctx, id
func (_m *GenericBlobRepository) TotalSizeByRootParentID(ctx context.Context, id int64) (int64, error) {
ret := _m.Called(ctx, id)
if len(ret) == 0 {
panic("no return value specified for TotalSizeByRootParentID")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int64) (int64, error)); ok {
return rf(ctx, id)
}
if rf, ok := ret.Get(0).(func(context.Context, int64) int64); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewGenericBlobRepository creates a new instance of GenericBlobRepository. 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 NewGenericBlobRepository(t interface {
mock.TestingT
Cleanup(func())
}) *GenericBlobRepository {
mock := &GenericBlobRepository{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}