internal/vulnerability/mock_runner_interface.go (175 lines of code) (raw):
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
// Code generated by mockery v2.53.3. DO NOT EDIT.
package vulnerability
import (
context "context"
flag "github.com/aquasecurity/trivy/pkg/flag"
mock "github.com/stretchr/testify/mock"
types "github.com/aquasecurity/trivy/pkg/types"
)
// mockRunnerInterface is an autogenerated mock type for the runnerInterface type
type mockRunnerInterface struct {
mock.Mock
}
type mockRunnerInterface_Expecter struct {
mock *mock.Mock
}
func (_m *mockRunnerInterface) EXPECT() *mockRunnerInterface_Expecter {
return &mockRunnerInterface_Expecter{mock: &_m.Mock}
}
// Close provides a mock function with given fields: ctx
func (_m *mockRunnerInterface) Close(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Close")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// mockRunnerInterface_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type mockRunnerInterface_Close_Call struct {
*mock.Call
}
// Close is a helper method to define mock.On call
// - ctx context.Context
func (_e *mockRunnerInterface_Expecter) Close(ctx interface{}) *mockRunnerInterface_Close_Call {
return &mockRunnerInterface_Close_Call{Call: _e.mock.On("Close", ctx)}
}
func (_c *mockRunnerInterface_Close_Call) Run(run func(ctx context.Context)) *mockRunnerInterface_Close_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *mockRunnerInterface_Close_Call) Return(_a0 error) *mockRunnerInterface_Close_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockRunnerInterface_Close_Call) RunAndReturn(run func(context.Context) error) *mockRunnerInterface_Close_Call {
_c.Call.Return(run)
return _c
}
// Filter provides a mock function with given fields: ctx, opts, report
func (_m *mockRunnerInterface) Filter(ctx context.Context, opts flag.Options, report types.Report) (types.Report, error) {
ret := _m.Called(ctx, opts, report)
if len(ret) == 0 {
panic("no return value specified for Filter")
}
var r0 types.Report
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, flag.Options, types.Report) (types.Report, error)); ok {
return rf(ctx, opts, report)
}
if rf, ok := ret.Get(0).(func(context.Context, flag.Options, types.Report) types.Report); ok {
r0 = rf(ctx, opts, report)
} else {
r0 = ret.Get(0).(types.Report)
}
if rf, ok := ret.Get(1).(func(context.Context, flag.Options, types.Report) error); ok {
r1 = rf(ctx, opts, report)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockRunnerInterface_Filter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Filter'
type mockRunnerInterface_Filter_Call struct {
*mock.Call
}
// Filter is a helper method to define mock.On call
// - ctx context.Context
// - opts flag.Options
// - report types.Report
func (_e *mockRunnerInterface_Expecter) Filter(ctx interface{}, opts interface{}, report interface{}) *mockRunnerInterface_Filter_Call {
return &mockRunnerInterface_Filter_Call{Call: _e.mock.On("Filter", ctx, opts, report)}
}
func (_c *mockRunnerInterface_Filter_Call) Run(run func(ctx context.Context, opts flag.Options, report types.Report)) *mockRunnerInterface_Filter_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(flag.Options), args[2].(types.Report))
})
return _c
}
func (_c *mockRunnerInterface_Filter_Call) Return(_a0 types.Report, _a1 error) *mockRunnerInterface_Filter_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockRunnerInterface_Filter_Call) RunAndReturn(run func(context.Context, flag.Options, types.Report) (types.Report, error)) *mockRunnerInterface_Filter_Call {
_c.Call.Return(run)
return _c
}
// Report provides a mock function with given fields: ctx, opts, report
func (_m *mockRunnerInterface) Report(ctx context.Context, opts flag.Options, report types.Report) error {
ret := _m.Called(ctx, opts, report)
if len(ret) == 0 {
panic("no return value specified for Report")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, flag.Options, types.Report) error); ok {
r0 = rf(ctx, opts, report)
} else {
r0 = ret.Error(0)
}
return r0
}
// mockRunnerInterface_Report_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Report'
type mockRunnerInterface_Report_Call struct {
*mock.Call
}
// Report is a helper method to define mock.On call
// - ctx context.Context
// - opts flag.Options
// - report types.Report
func (_e *mockRunnerInterface_Expecter) Report(ctx interface{}, opts interface{}, report interface{}) *mockRunnerInterface_Report_Call {
return &mockRunnerInterface_Report_Call{Call: _e.mock.On("Report", ctx, opts, report)}
}
func (_c *mockRunnerInterface_Report_Call) Run(run func(ctx context.Context, opts flag.Options, report types.Report)) *mockRunnerInterface_Report_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(flag.Options), args[2].(types.Report))
})
return _c
}
func (_c *mockRunnerInterface_Report_Call) Return(_a0 error) *mockRunnerInterface_Report_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockRunnerInterface_Report_Call) RunAndReturn(run func(context.Context, flag.Options, types.Report) error) *mockRunnerInterface_Report_Call {
_c.Call.Return(run)
return _c
}
// ScanVM provides a mock function with given fields: ctx, opts
func (_m *mockRunnerInterface) ScanVM(ctx context.Context, opts flag.Options) (types.Report, error) {
ret := _m.Called(ctx, opts)
if len(ret) == 0 {
panic("no return value specified for ScanVM")
}
var r0 types.Report
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, flag.Options) (types.Report, error)); ok {
return rf(ctx, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, flag.Options) types.Report); ok {
r0 = rf(ctx, opts)
} else {
r0 = ret.Get(0).(types.Report)
}
if rf, ok := ret.Get(1).(func(context.Context, flag.Options) error); ok {
r1 = rf(ctx, opts)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockRunnerInterface_ScanVM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScanVM'
type mockRunnerInterface_ScanVM_Call struct {
*mock.Call
}
// ScanVM is a helper method to define mock.On call
// - ctx context.Context
// - opts flag.Options
func (_e *mockRunnerInterface_Expecter) ScanVM(ctx interface{}, opts interface{}) *mockRunnerInterface_ScanVM_Call {
return &mockRunnerInterface_ScanVM_Call{Call: _e.mock.On("ScanVM", ctx, opts)}
}
func (_c *mockRunnerInterface_ScanVM_Call) Run(run func(ctx context.Context, opts flag.Options)) *mockRunnerInterface_ScanVM_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(flag.Options))
})
return _c
}
func (_c *mockRunnerInterface_ScanVM_Call) Return(_a0 types.Report, _a1 error) *mockRunnerInterface_ScanVM_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockRunnerInterface_ScanVM_Call) RunAndReturn(run func(context.Context, flag.Options) (types.Report, error)) *mockRunnerInterface_ScanVM_Call {
_c.Call.Return(run)
return _c
}
// newMockRunnerInterface creates a new instance of mockRunnerInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func newMockRunnerInterface(t interface {
mock.TestingT
Cleanup(func())
}) *mockRunnerInterface {
mock := &mockRunnerInterface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}