internal/vulnerability/mock_snapshot_creator_deleter.go (138 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"
iter "iter"
ec2 "github.com/elastic/cloudbeat/internal/resources/providers/awslib/ec2"
mock "github.com/stretchr/testify/mock"
time "time"
)
// mockSnapshotCreatorDeleter is an autogenerated mock type for the snapshotCreatorDeleter type
type mockSnapshotCreatorDeleter struct {
mock.Mock
}
type mockSnapshotCreatorDeleter_Expecter struct {
mock *mock.Mock
}
func (_m *mockSnapshotCreatorDeleter) EXPECT() *mockSnapshotCreatorDeleter_Expecter {
return &mockSnapshotCreatorDeleter_Expecter{mock: &_m.Mock}
}
// CreateSnapshots provides a mock function with given fields: ctx, ins
func (_m *mockSnapshotCreatorDeleter) CreateSnapshots(ctx context.Context, ins *ec2.Ec2Instance) ([]ec2.EBSSnapshot, error) {
ret := _m.Called(ctx, ins)
if len(ret) == 0 {
panic("no return value specified for CreateSnapshots")
}
var r0 []ec2.EBSSnapshot
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *ec2.Ec2Instance) ([]ec2.EBSSnapshot, error)); ok {
return rf(ctx, ins)
}
if rf, ok := ret.Get(0).(func(context.Context, *ec2.Ec2Instance) []ec2.EBSSnapshot); ok {
r0 = rf(ctx, ins)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]ec2.EBSSnapshot)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *ec2.Ec2Instance) error); ok {
r1 = rf(ctx, ins)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// mockSnapshotCreatorDeleter_CreateSnapshots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSnapshots'
type mockSnapshotCreatorDeleter_CreateSnapshots_Call struct {
*mock.Call
}
// CreateSnapshots is a helper method to define mock.On call
// - ctx context.Context
// - ins *ec2.Ec2Instance
func (_e *mockSnapshotCreatorDeleter_Expecter) CreateSnapshots(ctx interface{}, ins interface{}) *mockSnapshotCreatorDeleter_CreateSnapshots_Call {
return &mockSnapshotCreatorDeleter_CreateSnapshots_Call{Call: _e.mock.On("CreateSnapshots", ctx, ins)}
}
func (_c *mockSnapshotCreatorDeleter_CreateSnapshots_Call) Run(run func(ctx context.Context, ins *ec2.Ec2Instance)) *mockSnapshotCreatorDeleter_CreateSnapshots_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*ec2.Ec2Instance))
})
return _c
}
func (_c *mockSnapshotCreatorDeleter_CreateSnapshots_Call) Return(_a0 []ec2.EBSSnapshot, _a1 error) *mockSnapshotCreatorDeleter_CreateSnapshots_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *mockSnapshotCreatorDeleter_CreateSnapshots_Call) RunAndReturn(run func(context.Context, *ec2.Ec2Instance) ([]ec2.EBSSnapshot, error)) *mockSnapshotCreatorDeleter_CreateSnapshots_Call {
_c.Call.Return(run)
return _c
}
// DeleteSnapshot provides a mock function with given fields: ctx, snapshot
func (_m *mockSnapshotCreatorDeleter) DeleteSnapshot(ctx context.Context, snapshot ec2.EBSSnapshot) error {
ret := _m.Called(ctx, snapshot)
if len(ret) == 0 {
panic("no return value specified for DeleteSnapshot")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, ec2.EBSSnapshot) error); ok {
r0 = rf(ctx, snapshot)
} else {
r0 = ret.Error(0)
}
return r0
}
// mockSnapshotCreatorDeleter_DeleteSnapshot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSnapshot'
type mockSnapshotCreatorDeleter_DeleteSnapshot_Call struct {
*mock.Call
}
// DeleteSnapshot is a helper method to define mock.On call
// - ctx context.Context
// - snapshot ec2.EBSSnapshot
func (_e *mockSnapshotCreatorDeleter_Expecter) DeleteSnapshot(ctx interface{}, snapshot interface{}) *mockSnapshotCreatorDeleter_DeleteSnapshot_Call {
return &mockSnapshotCreatorDeleter_DeleteSnapshot_Call{Call: _e.mock.On("DeleteSnapshot", ctx, snapshot)}
}
func (_c *mockSnapshotCreatorDeleter_DeleteSnapshot_Call) Run(run func(ctx context.Context, snapshot ec2.EBSSnapshot)) *mockSnapshotCreatorDeleter_DeleteSnapshot_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(ec2.EBSSnapshot))
})
return _c
}
func (_c *mockSnapshotCreatorDeleter_DeleteSnapshot_Call) Return(_a0 error) *mockSnapshotCreatorDeleter_DeleteSnapshot_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockSnapshotCreatorDeleter_DeleteSnapshot_Call) RunAndReturn(run func(context.Context, ec2.EBSSnapshot) error) *mockSnapshotCreatorDeleter_DeleteSnapshot_Call {
_c.Call.Return(run)
return _c
}
// IterOwnedSnapshots provides a mock function with given fields: ctx, before
func (_m *mockSnapshotCreatorDeleter) IterOwnedSnapshots(ctx context.Context, before time.Time) iter.Seq[ec2.EBSSnapshot] {
ret := _m.Called(ctx, before)
if len(ret) == 0 {
panic("no return value specified for IterOwnedSnapshots")
}
var r0 iter.Seq[ec2.EBSSnapshot]
if rf, ok := ret.Get(0).(func(context.Context, time.Time) iter.Seq[ec2.EBSSnapshot]); ok {
r0 = rf(ctx, before)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(iter.Seq[ec2.EBSSnapshot])
}
}
return r0
}
// mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IterOwnedSnapshots'
type mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call struct {
*mock.Call
}
// IterOwnedSnapshots is a helper method to define mock.On call
// - ctx context.Context
// - before time.Time
func (_e *mockSnapshotCreatorDeleter_Expecter) IterOwnedSnapshots(ctx interface{}, before interface{}) *mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call {
return &mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call{Call: _e.mock.On("IterOwnedSnapshots", ctx, before)}
}
func (_c *mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call) Run(run func(ctx context.Context, before time.Time)) *mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(time.Time))
})
return _c
}
func (_c *mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call) Return(_a0 iter.Seq[ec2.EBSSnapshot]) *mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call) RunAndReturn(run func(context.Context, time.Time) iter.Seq[ec2.EBSSnapshot]) *mockSnapshotCreatorDeleter_IterOwnedSnapshots_Call {
_c.Call.Return(run)
return _c
}
// newMockSnapshotCreatorDeleter creates a new instance of mockSnapshotCreatorDeleter. 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 newMockSnapshotCreatorDeleter(t interface {
mock.TestingT
Cleanup(func())
}) *mockSnapshotCreatorDeleter {
mock := &mockSnapshotCreatorDeleter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}