mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-01 21:47:57 +01:00
chore(preheat):add mock policy enforcer (#12414)
Signed-off-by: Steven Zou <szou@vmware.com>
This commit is contained in:
parent
b56a49efe2
commit
b87aa3b9d5
60
src/testing/controller/p2p/preheat/enforcer.go
Normal file
60
src/testing/controller/p2p/preheat/enforcer.go
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
// Code generated by mockery v2.0.3. DO NOT EDIT.
|
||||||
|
|
||||||
|
package preheat
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
|
||||||
|
artifact "github.com/goharbor/harbor/src/controller/artifact"
|
||||||
|
|
||||||
|
mock "github.com/stretchr/testify/mock"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FakeEnforcer is an autogenerated mock type for the Enforcer type
|
||||||
|
type FakeEnforcer struct {
|
||||||
|
mock.Mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EnforcePolicy provides a mock function with given fields: ctx, policyID
|
||||||
|
func (_m *FakeEnforcer) EnforcePolicy(ctx context.Context, policyID int64) (int64, error) {
|
||||||
|
ret := _m.Called(ctx, policyID)
|
||||||
|
|
||||||
|
var r0 int64
|
||||||
|
if rf, ok := ret.Get(0).(func(context.Context, int64) int64); ok {
|
||||||
|
r0 = rf(ctx, policyID)
|
||||||
|
} else {
|
||||||
|
r0 = ret.Get(0).(int64)
|
||||||
|
}
|
||||||
|
|
||||||
|
var r1 error
|
||||||
|
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
|
||||||
|
r1 = rf(ctx, policyID)
|
||||||
|
} else {
|
||||||
|
r1 = ret.Error(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
return r0, r1
|
||||||
|
}
|
||||||
|
|
||||||
|
// PreheatArtifact provides a mock function with given fields: ctx, art
|
||||||
|
func (_m *FakeEnforcer) PreheatArtifact(ctx context.Context, art *artifact.Artifact) ([]int64, error) {
|
||||||
|
ret := _m.Called(ctx, art)
|
||||||
|
|
||||||
|
var r0 []int64
|
||||||
|
if rf, ok := ret.Get(0).(func(context.Context, *artifact.Artifact) []int64); ok {
|
||||||
|
r0 = rf(ctx, art)
|
||||||
|
} else {
|
||||||
|
if ret.Get(0) != nil {
|
||||||
|
r0 = ret.Get(0).([]int64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var r1 error
|
||||||
|
if rf, ok := ret.Get(1).(func(context.Context, *artifact.Artifact) error); ok {
|
||||||
|
r1 = rf(ctx, art)
|
||||||
|
} else {
|
||||||
|
r1 = ret.Error(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
return r0, r1
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user