chore(preheat):add mock policy enforcer (#12414)

Signed-off-by: Steven Zou <szou@vmware.com>
This commit is contained in:
Steven Zou 2020-07-08 09:45:14 +08:00 committed by GitHub
parent b56a49efe2
commit b87aa3b9d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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
}