internal/vulnerability/mock_snapshot_describer.go (68 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"
)
// mockSnapshotDescriber is an autogenerated mock type for the snapshotDescriber type
type mockSnapshotDescriber struct {
mock.Mock
}
type mockSnapshotDescriber_Expecter struct {
mock *mock.Mock
}
func (_m *mockSnapshotDescriber) EXPECT() *mockSnapshotDescriber_Expecter {
return &mockSnapshotDescriber_Expecter{mock: &_m.Mock}
}
// DescribeSnapshots provides a mock function with given fields: ctx, snap
func (_m *mockSnapshotDescriber) DescribeSnapshots(ctx context.Context, snap ec2.EBSSnapshot) ([]ec2.EBSSnapshot, error) {
ret := _m.Called(ctx, snap)
if len(ret) == 0 {
panic("no return value specified for DescribeSnapshots")
}
var r0 []ec2.EBSSnapshot
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, ec2.EBSSnapshot) ([]ec2.EBSSnapshot, error)); ok {
return rf(ctx, snap)
}
if rf, ok := ret.Get(0).(func(context.Context, ec2.EBSSnapshot) []ec2.EBSSnapshot); ok {
r0 = rf(ctx, snap)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]ec2.EBSSnapshot)
}
}
if rf, ok := ret.Get(1).(func(context.Context, ec2.EBSSnapshot) error); ok {
r1 = rf(ctx, snap)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockSnapshotDescriber_DescribeSnapshots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeSnapshots'
type mockSnapshotDescriber_DescribeSnapshots_Call struct {
*mock.Call
}
// DescribeSnapshots is a helper method to define mock.On call
// - ctx context.Context
// - snap ec2.EBSSnapshot
func (_e *mockSnapshotDescriber_Expecter) DescribeSnapshots(ctx interface{}, snap interface{}) *mockSnapshotDescriber_DescribeSnapshots_Call {
return &mockSnapshotDescriber_DescribeSnapshots_Call{Call: _e.mock.On("DescribeSnapshots", ctx, snap)}
}
func (_c *mockSnapshotDescriber_DescribeSnapshots_Call) Run(run func(ctx context.Context, snap ec2.EBSSnapshot)) *mockSnapshotDescriber_DescribeSnapshots_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(ec2.EBSSnapshot))
})
return _c
}
func (_c *mockSnapshotDescriber_DescribeSnapshots_Call) Return(_a0 []ec2.EBSSnapshot, _a1 error) *mockSnapshotDescriber_DescribeSnapshots_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockSnapshotDescriber_DescribeSnapshots_Call) RunAndReturn(run func(context.Context, ec2.EBSSnapshot) ([]ec2.EBSSnapshot, error)) *mockSnapshotDescriber_DescribeSnapshots_Call {
_c.Call.Return(run)
return _c
}
// newMockSnapshotDescriber creates a new instance of mockSnapshotDescriber. 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 newMockSnapshotDescriber(t interface {
mock.TestingT
Cleanup(func())
}) *mockSnapshotDescriber {
mock := &mockSnapshotDescriber{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}