mirror of
https://github.com/harness/drone.git
synced 2025-05-03 12:12:22 +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
113 lines
2.8 KiB
Go
113 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"
|
|
)
|
|
|
|
// WebhooksExecutionRepository is a mock of store.WebhooksExecutionRepository interface.
|
|
type WebhooksExecutionRepository struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Find provides a mock function
|
|
func (m *WebhooksExecutionRepository) Find(ctx context.Context, id int64) (*types.WebhookExecutionCore, error) {
|
|
ret := m.Called(ctx, id)
|
|
|
|
var r0 *types.WebhookExecutionCore
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) *types.WebhookExecutionCore); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*types.WebhookExecutionCore)
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// Create provides a mock function
|
|
func (m *WebhooksExecutionRepository) Create(ctx context.Context, hook *types.WebhookExecutionCore) error {
|
|
ret := m.Called(ctx, hook)
|
|
return ret.Error(0)
|
|
}
|
|
|
|
// ListForWebhook provides a mock function
|
|
func (m *WebhooksExecutionRepository) ListForWebhook(ctx context.Context, webhookID int64, limit int, page int, size int) ([]*types.WebhookExecutionCore, error) {
|
|
ret := m.Called(ctx, webhookID, limit, page, size)
|
|
|
|
var r0 []*types.WebhookExecutionCore
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64, int, int, int) []*types.WebhookExecutionCore); ok {
|
|
r0 = rf(ctx, webhookID, limit, page, size)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*types.WebhookExecutionCore)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64, int, int, int) error); ok {
|
|
r1 = rf(ctx, webhookID, limit, page, size)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// CountForWebhook provides a mock function
|
|
func (m *WebhooksExecutionRepository) CountForWebhook(ctx context.Context, webhookID int64) (int64, error) {
|
|
ret := m.Called(ctx, webhookID)
|
|
|
|
var r0 int64
|
|
if rf, ok := ret.Get(0).(func(context.Context, int64) int64); ok {
|
|
r0 = rf(ctx, webhookID)
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
|
|
r1 = rf(ctx, webhookID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// ListForTrigger provides a mock function
|
|
func (m *WebhooksExecutionRepository) ListForTrigger(ctx context.Context, triggerID string) ([]*types.WebhookExecutionCore, error) {
|
|
ret := m.Called(ctx, triggerID)
|
|
|
|
var r0 []*types.WebhookExecutionCore
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) []*types.WebhookExecutionCore); ok {
|
|
r0 = rf(ctx, triggerID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*types.WebhookExecutionCore)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, triggerID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|