2020-07-22 03:59:32 +02:00
|
|
|
// Code generated by mockery v2.1.0. DO NOT EDIT.
|
2020-02-22 06:29:58 +01:00
|
|
|
|
|
|
|
package scan
|
|
|
|
|
|
|
|
import (
|
2020-03-12 12:30:12 +01:00
|
|
|
context "context"
|
|
|
|
|
2020-12-14 06:34:35 +01:00
|
|
|
artifact "github.com/goharbor/harbor/src/controller/artifact"
|
2020-02-22 06:29:58 +01:00
|
|
|
|
2020-12-14 06:34:35 +01:00
|
|
|
daoscan "github.com/goharbor/harbor/src/pkg/scan/dao/scan"
|
2020-02-22 06:29:58 +01:00
|
|
|
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
|
2021-05-18 08:01:59 +02:00
|
|
|
models "github.com/goharbor/harbor/src/pkg/allowlist/models"
|
2020-12-14 06:34:35 +01:00
|
|
|
|
2020-03-24 13:45:45 +01:00
|
|
|
scan "github.com/goharbor/harbor/src/controller/scan"
|
2020-02-22 06:29:58 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// Controller is an autogenerated mock type for the Controller type
|
|
|
|
type Controller struct {
|
|
|
|
mock.Mock
|
|
|
|
}
|
|
|
|
|
2020-12-14 06:34:35 +01:00
|
|
|
// DeleteReports provides a mock function with given fields: ctx, digests
|
|
|
|
func (_m *Controller) DeleteReports(ctx context.Context, digests ...string) error {
|
2020-02-22 06:29:58 +01:00
|
|
|
_va := make([]interface{}, len(digests))
|
|
|
|
for _i := range digests {
|
|
|
|
_va[_i] = digests[_i]
|
|
|
|
}
|
|
|
|
var _ca []interface{}
|
2020-12-14 06:34:35 +01:00
|
|
|
_ca = append(_ca, ctx)
|
2020-02-22 06:29:58 +01:00
|
|
|
_ca = append(_ca, _va...)
|
|
|
|
ret := _m.Called(_ca...)
|
|
|
|
|
|
|
|
var r0 error
|
2020-12-14 06:34:35 +01:00
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, ...string) error); ok {
|
|
|
|
r0 = rf(ctx, digests...)
|
2020-02-22 06:29:58 +01:00
|
|
|
} else {
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0
|
|
|
|
}
|
|
|
|
|
2020-03-12 12:30:12 +01:00
|
|
|
// GetReport provides a mock function with given fields: ctx, _a1, mimeTypes
|
|
|
|
func (_m *Controller) GetReport(ctx context.Context, _a1 *artifact.Artifact, mimeTypes []string) ([]*daoscan.Report, error) {
|
|
|
|
ret := _m.Called(ctx, _a1, mimeTypes)
|
2020-02-22 06:29:58 +01:00
|
|
|
|
|
|
|
var r0 []*daoscan.Report
|
2020-03-12 12:30:12 +01:00
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *artifact.Artifact, []string) []*daoscan.Report); ok {
|
|
|
|
r0 = rf(ctx, _a1, mimeTypes)
|
2020-02-22 06:29:58 +01:00
|
|
|
} else {
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
r0 = ret.Get(0).([]*daoscan.Report)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
2020-03-12 12:30:12 +01:00
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *artifact.Artifact, []string) error); ok {
|
|
|
|
r1 = rf(ctx, _a1, mimeTypes)
|
2020-02-22 06:29:58 +01:00
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
}
|
|
|
|
|
2020-12-14 06:34:35 +01:00
|
|
|
// GetScanLog provides a mock function with given fields: ctx, uuid
|
|
|
|
func (_m *Controller) GetScanLog(ctx context.Context, uuid string) ([]byte, error) {
|
|
|
|
ret := _m.Called(ctx, uuid)
|
2020-02-22 06:29:58 +01:00
|
|
|
|
|
|
|
var r0 []byte
|
2020-12-14 06:34:35 +01:00
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
|
|
|
|
r0 = rf(ctx, uuid)
|
2020-02-22 06:29:58 +01:00
|
|
|
} else {
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
r0 = ret.Get(0).([]byte)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
2020-12-14 06:34:35 +01:00
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
|
|
r1 = rf(ctx, uuid)
|
2020-02-22 06:29:58 +01:00
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
}
|
|
|
|
|
2021-05-18 08:01:59 +02:00
|
|
|
// GetSummary provides a mock function with given fields: ctx, _a1, mimeTypes
|
|
|
|
func (_m *Controller) GetSummary(ctx context.Context, _a1 *artifact.Artifact, mimeTypes []string) (map[string]interface{}, error) {
|
|
|
|
ret := _m.Called(ctx, _a1, mimeTypes)
|
2020-02-22 06:29:58 +01:00
|
|
|
|
|
|
|
var r0 map[string]interface{}
|
2021-05-18 08:01:59 +02:00
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *artifact.Artifact, []string) map[string]interface{}); ok {
|
|
|
|
r0 = rf(ctx, _a1, mimeTypes)
|
2020-02-22 06:29:58 +01:00
|
|
|
} else {
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
r0 = ret.Get(0).(map[string]interface{})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
2021-05-18 08:01:59 +02:00
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *artifact.Artifact, []string) error); ok {
|
|
|
|
r1 = rf(ctx, _a1, mimeTypes)
|
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetVulnerable provides a mock function with given fields: ctx, _a1, allowlist
|
|
|
|
func (_m *Controller) GetVulnerable(ctx context.Context, _a1 *artifact.Artifact, allowlist models.CVESet) (*scan.Vulnerable, error) {
|
|
|
|
ret := _m.Called(ctx, _a1, allowlist)
|
|
|
|
|
|
|
|
var r0 *scan.Vulnerable
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *artifact.Artifact, models.CVESet) *scan.Vulnerable); ok {
|
|
|
|
r0 = rf(ctx, _a1, allowlist)
|
|
|
|
} else {
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
r0 = ret.Get(0).(*scan.Vulnerable)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *artifact.Artifact, models.CVESet) error); ok {
|
|
|
|
r1 = rf(ctx, _a1, allowlist)
|
2020-02-22 06:29:58 +01:00
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
}
|
|
|
|
|
2020-03-12 12:30:12 +01:00
|
|
|
// Scan provides a mock function with given fields: ctx, _a1, options
|
|
|
|
func (_m *Controller) Scan(ctx context.Context, _a1 *artifact.Artifact, options ...scan.Option) error {
|
2020-02-22 06:29:58 +01:00
|
|
|
_va := make([]interface{}, len(options))
|
|
|
|
for _i := range options {
|
|
|
|
_va[_i] = options[_i]
|
|
|
|
}
|
|
|
|
var _ca []interface{}
|
2020-03-12 12:30:12 +01:00
|
|
|
_ca = append(_ca, ctx, _a1)
|
2020-02-22 06:29:58 +01:00
|
|
|
_ca = append(_ca, _va...)
|
|
|
|
ret := _m.Called(_ca...)
|
|
|
|
|
|
|
|
var r0 error
|
2020-03-12 12:30:12 +01:00
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *artifact.Artifact, ...scan.Option) error); ok {
|
|
|
|
r0 = rf(ctx, _a1, options...)
|
2020-02-22 06:29:58 +01:00
|
|
|
} else {
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0
|
|
|
|
}
|
2020-12-14 06:34:35 +01:00
|
|
|
|
|
|
|
// ScanAll provides a mock function with given fields: ctx, trigger, async
|
|
|
|
func (_m *Controller) ScanAll(ctx context.Context, trigger string, async bool) (int64, error) {
|
|
|
|
ret := _m.Called(ctx, trigger, async)
|
|
|
|
|
|
|
|
var r0 int64
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, bool) int64); ok {
|
|
|
|
r0 = rf(ctx, trigger, async)
|
|
|
|
} else {
|
|
|
|
r0 = ret.Get(0).(int64)
|
|
|
|
}
|
|
|
|
|
|
|
|
var r1 error
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok {
|
|
|
|
r1 = rf(ctx, trigger, async)
|
|
|
|
} else {
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
}
|
2021-08-15 11:21:39 +02:00
|
|
|
|
|
|
|
// Stop provides a mock function with given fields: ctx, _a1
|
|
|
|
func (_m *Controller) Stop(ctx context.Context, _a1 *artifact.Artifact) error {
|
|
|
|
ret := _m.Called(ctx, _a1)
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
if rf, ok := ret.Get(0).(func(context.Context, *artifact.Artifact) error); ok {
|
|
|
|
r0 = rf(ctx, _a1)
|
|
|
|
} else {
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
return r0
|
|
|
|
}
|