internal/vulnerability/mock_instances_provider.go (112 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" ec2 "github.com/elastic/cloudbeat/internal/resources/providers/awslib/ec2" mock "github.com/stretchr/testify/mock" ) // mockInstancesProvider is an autogenerated mock type for the instancesProvider type type mockInstancesProvider struct { mock.Mock } type mockInstancesProvider_Expecter struct { mock *mock.Mock } func (_m *mockInstancesProvider) EXPECT() *mockInstancesProvider_Expecter { return &mockInstancesProvider_Expecter{mock: &_m.Mock} } // DescribeInstances provides a mock function with given fields: ctx func (_m *mockInstancesProvider) DescribeInstances(ctx context.Context) ([]*ec2.Ec2Instance, error) { ret := _m.Called(ctx) if len(ret) == 0 { panic("no return value specified for DescribeInstances") } var r0 []*ec2.Ec2Instance var r1 error if rf, ok := ret.Get(0).(func(context.Context) ([]*ec2.Ec2Instance, error)); ok { return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) []*ec2.Ec2Instance); ok { r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*ec2.Ec2Instance) } } if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // mockInstancesProvider_DescribeInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeInstances' type mockInstancesProvider_DescribeInstances_Call struct { *mock.Call } // DescribeInstances is a helper method to define mock.On call // - ctx context.Context func (_e *mockInstancesProvider_Expecter) DescribeInstances(ctx interface{}) *mockInstancesProvider_DescribeInstances_Call { return &mockInstancesProvider_DescribeInstances_Call{Call: _e.mock.On("DescribeInstances", ctx)} } func (_c *mockInstancesProvider_DescribeInstances_Call) Run(run func(ctx context.Context)) *mockInstancesProvider_DescribeInstances_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } func (_c *mockInstancesProvider_DescribeInstances_Call) Return(_a0 []*ec2.Ec2Instance, _a1 error) *mockInstancesProvider_DescribeInstances_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *mockInstancesProvider_DescribeInstances_Call) RunAndReturn(run func(context.Context) ([]*ec2.Ec2Instance, error)) *mockInstancesProvider_DescribeInstances_Call { _c.Call.Return(run) return _c } // DescribeVolumes provides a mock function with given fields: ctx, instances func (_m *mockInstancesProvider) DescribeVolumes(ctx context.Context, instances []*ec2.Ec2Instance) ([]*ec2.Volume, error) { ret := _m.Called(ctx, instances) if len(ret) == 0 { panic("no return value specified for DescribeVolumes") } var r0 []*ec2.Volume var r1 error if rf, ok := ret.Get(0).(func(context.Context, []*ec2.Ec2Instance) ([]*ec2.Volume, error)); ok { return rf(ctx, instances) } if rf, ok := ret.Get(0).(func(context.Context, []*ec2.Ec2Instance) []*ec2.Volume); ok { r0 = rf(ctx, instances) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*ec2.Volume) } } if rf, ok := ret.Get(1).(func(context.Context, []*ec2.Ec2Instance) error); ok { r1 = rf(ctx, instances) } else { r1 = ret.Error(1) } return r0, r1 } // mockInstancesProvider_DescribeVolumes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeVolumes' type mockInstancesProvider_DescribeVolumes_Call struct { *mock.Call } // DescribeVolumes is a helper method to define mock.On call // - ctx context.Context // - instances []*ec2.Ec2Instance func (_e *mockInstancesProvider_Expecter) DescribeVolumes(ctx interface{}, instances interface{}) *mockInstancesProvider_DescribeVolumes_Call { return &mockInstancesProvider_DescribeVolumes_Call{Call: _e.mock.On("DescribeVolumes", ctx, instances)} } func (_c *mockInstancesProvider_DescribeVolumes_Call) Run(run func(ctx context.Context, instances []*ec2.Ec2Instance)) *mockInstancesProvider_DescribeVolumes_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].([]*ec2.Ec2Instance)) }) return _c } func (_c *mockInstancesProvider_DescribeVolumes_Call) Return(_a0 []*ec2.Volume, _a1 error) *mockInstancesProvider_DescribeVolumes_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *mockInstancesProvider_DescribeVolumes_Call) RunAndReturn(run func(context.Context, []*ec2.Ec2Instance) ([]*ec2.Volume, error)) *mockInstancesProvider_DescribeVolumes_Call { _c.Call.Return(run) return _c } // newMockInstancesProvider creates a new instance of mockInstancesProvider. 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 newMockInstancesProvider(t interface { mock.TestingT Cleanup(func()) }) *mockInstancesProvider { mock := &mockInstancesProvider{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock }