mock

package
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyExpectations

func ApplyExpectations(t *testing.T, mock interface{}, expectations ...*Expectation)

ApplyExpectation applies the specified expectations on a given mock.

Types

type Enqueuer

type Enqueuer struct {
	mock.Mock
}

func NewEnqueuer

func NewEnqueuer() *Enqueuer

func (*Enqueuer) Enqueue

func (em *Enqueuer) Enqueue(request harbor.ScanRequest) (job.ScanJob, error)

type Expectation

type Expectation struct {
	Method     string
	Args       []interface{}
	ReturnArgs []interface{}
}

Expectation represents an expectation of a method being called and its return values.

type Store

type Store struct {
	mock.Mock
}

func NewStore

func NewStore() *Store

func (*Store) Create

func (s *Store) Create(scanJob job.ScanJob) error

func (*Store) Get

func (s *Store) Get(scanJobID string) (*job.ScanJob, error)

func (*Store) UpdateReport

func (s *Store) UpdateReport(scanJobID string, report harbor.ScanReport) error

func (*Store) UpdateStatus

func (s *Store) UpdateStatus(scanJobID string, newStatus job.ScanJobStatus, error ...string) error

type Transformer

type Transformer struct {
	mock.Mock
}

func NewTransformer

func NewTransformer() *Transformer

func (*Transformer) Transform

func (t *Transformer) Transform(artifact harbor.Artifact, source []trivy.Vulnerability) harbor.ScanReport

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL