mirror of
https://github.com/harness/drone.git
synced 2025-05-03 18:12:09 +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
35 lines
813 B
Go
35 lines
813 B
Go
package mocks
|
|
|
|
import (
|
|
"context"
|
|
|
|
registryevents "github.com/harness/gitness/registry/app/events"
|
|
|
|
"github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// Reporter is a mock implementation of registryevents.Reporter
|
|
type Reporter struct {
|
|
mock.Mock
|
|
}
|
|
|
|
func NewReporter() *Reporter {
|
|
return &Reporter{}
|
|
}
|
|
|
|
// Report provides a mock function
|
|
func (m *Reporter) Report(ctx context.Context, event interface{}) error {
|
|
args := m.Called(ctx, event)
|
|
return args.Error(0)
|
|
}
|
|
|
|
// ArtifactCreated provides a mock function
|
|
func (m *Reporter) ArtifactCreated(ctx context.Context, payload *registryevents.ArtifactCreatedPayload) {
|
|
m.Called(ctx, payload)
|
|
}
|
|
|
|
// ArtifactDeleted provides a mock function
|
|
func (m *Reporter) ArtifactDeleted(ctx context.Context, payload *registryevents.ArtifactDeletedPayload) {
|
|
m.Called(ctx, payload)
|
|
}
|