• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elastic / cloudbeat / 17852480664

19 Sep 2025 08:07AM UTC coverage: 49.802% (-26.3%) from 76.148%
17852480664

push

github

web-flow
Switch to mockery v3 (#3600)

### Summary of your changes
- Migrates to new config syntax
- Renames mock files to be easier to track which mock file corresponds to which code file.
- Mocking functions is not supported in v3 anymore. aws_org_preset_test.go has been updated and internal/flavors/repeater_func_mock_old.go was kept with the code produced by old mockery to avoid having to fix repeater_test.go (CNVM only).
- Make sure we do not directly import testify libraries in our built binary with the `release` tag. Trivy and kiota still import it so fixes need to be sent there. Verified cloudbeat does not directly import testify with:
```shell
$ godepgraph -tags=release ./ | grep testify
"github.com/aquasecurity/trivy-db/pkg/db" -> "github.com/stretchr/testify/mock";
"github.com/microsoft/kiota-serialization-text-go" -> "github.com/stretchr/testify/assert";
"github.com/stretchr/testify/assert" [label="github.com/stretchr/testify/assert" color="paleturquoise" URL="https://godoc.org/github.com/stretchr/testify/assert" target="_blank"];
"github.com/stretchr/testify/assert" -> "bufio";
"github.com/stretchr/testify/assert" -> "bytes";
"github.com/stretchr/testify/assert" -> "encoding/json";
"github.com/stretchr/testify/assert" -> "errors";
"github.com/stretchr/testify/assert" -> "fmt";
"github.com/stretchr/testify/assert" -> "github.com/davecgh/go-spew/spew";
"github.com/stretchr/testify/assert" -> "github.com/pmezard/go-difflib/difflib";
"github.com/stretchr/testify/assert" -> "github.com/stretchr/testify/assert/yaml";
"github.com/stretchr/testify/assert" -> "math";
"github.com/stretchr/testify/assert" -> "net/http";
"github.com/stretchr/testify/assert" -> "net/http/httptest";
"github.com/stretchr/testify/assert" -> "net/url";
"github.com/stretchr/testify/assert" -> "os";
"github.com/stretchr/testify/assert" -> "reflect";
"github.com/stretchr/testify/assert" -> "regexp";
"github.com/stretchr/testify/assert" -> "runtime";
"github.com/stretchr/testify/assert... (continued)

3071 of 11934 new or added lines in 88 files covered. (25.73%)

2 existing lines in 1 file now uncovered.

14243 of 28599 relevant lines covered (49.8%)

9.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

32.69
/internal/resources/providers/awslib/securityhub/securityhub_mock.go
1
// Licensed to Elasticsearch B.V. under one or more contributor
2
// license agreements. See the NOTICE file distributed with
3
// this work for additional information regarding copyright
4
// ownership. Elasticsearch B.V. licenses this file to you under
5
// the Apache License, Version 2.0 (the "License"); you may
6
// not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
//     http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
//go:build !release
18

19
// Code generated by mockery; DO NOT EDIT.
20
// github.com/vektra/mockery
21
// template: testify
22

23
package securityhub
24

25
import (
26
        "context"
27

28
        mock "github.com/stretchr/testify/mock"
29
)
30

31
// NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
32
// The first argument is typically a *testing.T value.
33
func NewMockService(t interface {
34
        mock.TestingT
35
        Cleanup(func())
NEW
36
}) *MockService {
×
NEW
37
        mock := &MockService{}
×
NEW
38
        mock.Mock.Test(t)
×
NEW
39

×
NEW
40
        t.Cleanup(func() { mock.AssertExpectations(t) })
×
41

NEW
42
        return mock
×
43
}
44

45
// MockService is an autogenerated mock type for the Service type
46
type MockService struct {
47
        mock.Mock
48
}
49

50
type MockService_Expecter struct {
51
        mock *mock.Mock
52
}
53

54
func (_m *MockService) EXPECT() *MockService_Expecter {
×
55
        return &MockService_Expecter{mock: &_m.Mock}
×
56
}
×
57

58
// Describe provides a mock function for the type MockService
59
func (_mock *MockService) Describe(ctx context.Context) ([]SecurityHub, error) {
3✔
60
        ret := _mock.Called(ctx)
3✔
61

3✔
62
        if len(ret) == 0 {
3✔
63
                panic("no return value specified for Describe")
×
64
        }
65

66
        var r0 []SecurityHub
3✔
67
        var r1 error
3✔
68
        if returnFunc, ok := ret.Get(0).(func(context.Context) ([]SecurityHub, error)); ok {
3✔
NEW
69
                return returnFunc(ctx)
×
70
        }
×
71
        if returnFunc, ok := ret.Get(0).(func(context.Context) []SecurityHub); ok {
3✔
NEW
72
                r0 = returnFunc(ctx)
×
73
        } else {
3✔
74
                if ret.Get(0) != nil {
6✔
75
                        r0 = ret.Get(0).([]SecurityHub)
3✔
76
                }
3✔
77
        }
78
        if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
3✔
NEW
79
                r1 = returnFunc(ctx)
×
80
        } else {
3✔
81
                r1 = ret.Error(1)
3✔
82
        }
3✔
83
        return r0, r1
3✔
84
}
85

86
// MockService_Describe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Describe'
87
type MockService_Describe_Call struct {
88
        *mock.Call
89
}
90

91
// Describe is a helper method to define mock.On call
92
//   - ctx context.Context
93
func (_e *MockService_Expecter) Describe(ctx interface{}) *MockService_Describe_Call {
×
94
        return &MockService_Describe_Call{Call: _e.mock.On("Describe", ctx)}
×
95
}
×
96

97
func (_c *MockService_Describe_Call) Run(run func(ctx context.Context)) *MockService_Describe_Call {
×
98
        _c.Call.Run(func(args mock.Arguments) {
×
NEW
99
                var arg0 context.Context
×
NEW
100
                if args[0] != nil {
×
NEW
101
                        arg0 = args[0].(context.Context)
×
NEW
102
                }
×
NEW
103
                run(
×
NEW
104
                        arg0,
×
NEW
105
                )
×
106
        })
107
        return _c
×
108
}
109

NEW
110
func (_c *MockService_Describe_Call) Return(securityHubs []SecurityHub, err error) *MockService_Describe_Call {
×
NEW
111
        _c.Call.Return(securityHubs, err)
×
112
        return _c
×
113
}
×
114

NEW
115
func (_c *MockService_Describe_Call) RunAndReturn(run func(ctx context.Context) ([]SecurityHub, error)) *MockService_Describe_Call {
×
116
        _c.Call.Return(run)
×
117
        return _c
×
118
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc