From d66c1cac4cf403ca59a14e821729cdd1410a5bdc Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Mon, 2 Mar 2026 15:20:49 -0600 Subject: [PATCH] mockgen deprecated: use uber-go/mock instead Migrate from the archived github.com/golang/mock to the actively maintained go.uber.org/mock. Updates all imports, regenerates mocks, and fixes the InOrder API change in utils_test.go. --- go.mod | 2 +- go.sum | 8 +- pkg/aws/actuator/actuator_test.go | 2 +- pkg/aws/mock/client_generated.go | 278 +++++++++--------- pkg/azure/actuator_test.go | 2 +- pkg/azure/mock/client_generated.go | 77 +++-- .../provisioning/aws/create-iam-roles_test.go | 2 +- .../aws/create_identity_provider_test.go | 2 +- .../azure/create_managed_identities_test.go | 2 +- .../azure/create_oidc_issuer_test.go | 2 +- .../gcp/create_service_accounts_test.go | 2 +- .../gcp/create_workload_identity_pool_test.go | 2 +- .../create_workload_identity_provider_test.go | 2 +- .../ibmcloud/create_service_id_test.go | 2 +- .../ibmcloud/delete_service_id_test.go | 2 +- .../ibmcloud/refresh-keys_test.go | 2 +- pkg/gcp/mock/client_generated.go | 76 ++--- pkg/ibmcloud/mock/client_generated.go | 26 +- .../cleanup/cleanup_controller_test.go | 2 +- ...redentialsrequest_controller_azure_test.go | 2 +- .../credentialsrequest_controller_gcp_test.go | 2 +- .../credentialsrequest_controller_test.go | 2 +- ...dentialsrequest_controller_vsphere_test.go | 2 +- .../credentialsrequest/status_test.go | 2 +- .../podidentitywebhook_controller_test.go | 2 +- .../secretannotator/aws/reconciler_test.go | 2 +- .../azure/mock/adal_generated.go | 2 +- .../secretannotator/gcp/reconciler_test.go | 2 +- .../vsphere/reconciler_test.go | 2 +- pkg/operator/utils/gcp/utils_test.go | 4 +- vendor/github.com/golang/mock/CONTRIBUTORS | 37 --- .../golang => go.uber.org}/mock/AUTHORS | 0 .../golang => go.uber.org}/mock/LICENSE | 0 .../mock/gomock/call.go | 95 ++++-- .../mock/gomock/callset.go | 59 +++- .../mock/gomock/controller.go | 116 +++++--- .../golang => go.uber.org}/mock/gomock/doc.go | 41 +-- .../mock/gomock/matchers.go | 178 ++++++++--- vendor/go.uber.org/mock/gomock/string.go | 36 +++ vendor/modules.txt | 6 +- 40 files changed, 667 insertions(+), 418 deletions(-) delete mode 100644 vendor/github.com/golang/mock/CONTRIBUTORS rename vendor/{github.com/golang => go.uber.org}/mock/AUTHORS (100%) rename vendor/{github.com/golang => go.uber.org}/mock/LICENSE (100%) rename vendor/{github.com/golang => go.uber.org}/mock/gomock/call.go (86%) rename vendor/{github.com/golang => go.uber.org}/mock/gomock/callset.go (70%) rename vendor/{github.com/golang => go.uber.org}/mock/gomock/controller.go (70%) rename vendor/{github.com/golang => go.uber.org}/mock/gomock/doc.go (63%) rename vendor/{github.com/golang => go.uber.org}/mock/gomock/matchers.go (62%) create mode 100644 vendor/go.uber.org/mock/gomock/string.go diff --git a/go.mod b/go.mod index 44597733fa..abf0e6f794 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,6 @@ require ( github.com/go-jose/go-jose/v4 v4.1.3 github.com/go-logr/logr v1.4.3 github.com/golang/glog v1.2.5 - github.com/golang/mock v1.7.0-rc.1 github.com/google/go-cmp v0.7.0 github.com/google/go-github/v57 v57.0.0 github.com/google/uuid v1.6.0 @@ -49,6 +48,7 @@ require ( github.com/spf13/pflag v1.0.10 github.com/stretchr/testify v1.11.1 github.com/tidwall/gjson v1.18.0 + go.uber.org/mock v0.6.0 golang.org/x/mod v0.33.0 golang.org/x/oauth2 v0.35.0 golang.org/x/time v0.14.0 diff --git a/go.sum b/go.sum index 8dc98386bb..c3b61243d0 100644 --- a/go.sum +++ b/go.sum @@ -349,8 +349,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U= -github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -645,7 +643,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss= go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= @@ -681,6 +678,8 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -739,7 +738,6 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= @@ -832,7 +830,6 @@ golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -940,7 +937,6 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= diff --git a/pkg/aws/actuator/actuator_test.go b/pkg/aws/actuator/actuator_test.go index 869cf96431..d026ebcfb8 100644 --- a/pkg/aws/actuator/actuator_test.go +++ b/pkg/aws/actuator/actuator_test.go @@ -23,9 +23,9 @@ import ( "strings" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" configv1 "github.com/openshift/api/config/v1" operatorv1 "github.com/openshift/api/operator/v1" diff --git a/pkg/aws/mock/client_generated.go b/pkg/aws/mock/client_generated.go index dcf5e3fafa..4d1b3d864a 100644 --- a/pkg/aws/mock/client_generated.go +++ b/pkg/aws/mock/client_generated.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: ./client.go +// +// Generated by this command: +// +// mockgen -source=./client.go -destination=./mock/client_generated.go -package=mock +// // Package mock is a generated GoMock package. package mock @@ -11,13 +16,14 @@ import ( cloudfront "github.com/aws/aws-sdk-go-v2/service/cloudfront" iam "github.com/aws/aws-sdk-go-v2/service/iam" s3 "github.com/aws/aws-sdk-go-v2/service/s3" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockClient is a mock of Client interface. type MockClient struct { ctrl *gomock.Controller recorder *MockClientMockRecorder + isgomock struct{} } // MockClientMockRecorder is the mock recorder for MockClient. @@ -40,7 +46,7 @@ func (m *MockClient) EXPECT() *MockClientMockRecorder { // CreateAccessKey mocks base method. func (m *MockClient) CreateAccessKey(arg0 context.Context, arg1 *iam.CreateAccessKeyInput, arg2 ...func(*iam.Options)) (*iam.CreateAccessKeyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -51,16 +57,16 @@ func (m *MockClient) CreateAccessKey(arg0 context.Context, arg1 *iam.CreateAcces } // CreateAccessKey indicates an expected call of CreateAccessKey. -func (mr *MockClientMockRecorder) CreateAccessKey(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateAccessKey(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccessKey", reflect.TypeOf((*MockClient)(nil).CreateAccessKey), varargs...) } // CreateBucket mocks base method. func (m *MockClient) CreateBucket(arg0 context.Context, arg1 *s3.CreateBucketInput, arg2 ...func(*s3.Options)) (*s3.CreateBucketOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -71,16 +77,16 @@ func (m *MockClient) CreateBucket(arg0 context.Context, arg1 *s3.CreateBucketInp } // CreateBucket indicates an expected call of CreateBucket. -func (mr *MockClientMockRecorder) CreateBucket(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateBucket(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBucket", reflect.TypeOf((*MockClient)(nil).CreateBucket), varargs...) } // CreateCloudFrontOriginAccessIdentity mocks base method. func (m *MockClient) CreateCloudFrontOriginAccessIdentity(arg0 context.Context, arg1 *cloudfront.CreateCloudFrontOriginAccessIdentityInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.CreateCloudFrontOriginAccessIdentityOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -91,16 +97,16 @@ func (m *MockClient) CreateCloudFrontOriginAccessIdentity(arg0 context.Context, } // CreateCloudFrontOriginAccessIdentity indicates an expected call of CreateCloudFrontOriginAccessIdentity. -func (mr *MockClientMockRecorder) CreateCloudFrontOriginAccessIdentity(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateCloudFrontOriginAccessIdentity(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCloudFrontOriginAccessIdentity", reflect.TypeOf((*MockClient)(nil).CreateCloudFrontOriginAccessIdentity), varargs...) } // CreateDistributionWithTags mocks base method. func (m *MockClient) CreateDistributionWithTags(arg0 context.Context, arg1 *cloudfront.CreateDistributionWithTagsInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.CreateDistributionWithTagsOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -111,16 +117,16 @@ func (m *MockClient) CreateDistributionWithTags(arg0 context.Context, arg1 *clou } // CreateDistributionWithTags indicates an expected call of CreateDistributionWithTags. -func (mr *MockClientMockRecorder) CreateDistributionWithTags(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateDistributionWithTags(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDistributionWithTags", reflect.TypeOf((*MockClient)(nil).CreateDistributionWithTags), varargs...) } // CreateOpenIDConnectProvider mocks base method. func (m *MockClient) CreateOpenIDConnectProvider(arg0 context.Context, arg1 *iam.CreateOpenIDConnectProviderInput, arg2 ...func(*iam.Options)) (*iam.CreateOpenIDConnectProviderOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -131,16 +137,16 @@ func (m *MockClient) CreateOpenIDConnectProvider(arg0 context.Context, arg1 *iam } // CreateOpenIDConnectProvider indicates an expected call of CreateOpenIDConnectProvider. -func (mr *MockClientMockRecorder) CreateOpenIDConnectProvider(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateOpenIDConnectProvider(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOpenIDConnectProvider", reflect.TypeOf((*MockClient)(nil).CreateOpenIDConnectProvider), varargs...) } // CreateRole mocks base method. func (m *MockClient) CreateRole(arg0 context.Context, arg1 *iam.CreateRoleInput, arg2 ...func(*iam.Options)) (*iam.CreateRoleOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -151,16 +157,16 @@ func (m *MockClient) CreateRole(arg0 context.Context, arg1 *iam.CreateRoleInput, } // CreateRole indicates an expected call of CreateRole. -func (mr *MockClientMockRecorder) CreateRole(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateRole(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRole", reflect.TypeOf((*MockClient)(nil).CreateRole), varargs...) } // CreateUser mocks base method. func (m *MockClient) CreateUser(arg0 context.Context, arg1 *iam.CreateUserInput, arg2 ...func(*iam.Options)) (*iam.CreateUserOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -171,16 +177,16 @@ func (m *MockClient) CreateUser(arg0 context.Context, arg1 *iam.CreateUserInput, } // CreateUser indicates an expected call of CreateUser. -func (mr *MockClientMockRecorder) CreateUser(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateUser(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*MockClient)(nil).CreateUser), varargs...) } // DeleteAccessKey mocks base method. func (m *MockClient) DeleteAccessKey(arg0 context.Context, arg1 *iam.DeleteAccessKeyInput, arg2 ...func(*iam.Options)) (*iam.DeleteAccessKeyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -191,16 +197,16 @@ func (m *MockClient) DeleteAccessKey(arg0 context.Context, arg1 *iam.DeleteAcces } // DeleteAccessKey indicates an expected call of DeleteAccessKey. -func (mr *MockClientMockRecorder) DeleteAccessKey(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteAccessKey(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAccessKey", reflect.TypeOf((*MockClient)(nil).DeleteAccessKey), varargs...) } // DeleteBucket mocks base method. func (m *MockClient) DeleteBucket(arg0 context.Context, arg1 *s3.DeleteBucketInput, arg2 ...func(*s3.Options)) (*s3.DeleteBucketOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -211,16 +217,16 @@ func (m *MockClient) DeleteBucket(arg0 context.Context, arg1 *s3.DeleteBucketInp } // DeleteBucket indicates an expected call of DeleteBucket. -func (mr *MockClientMockRecorder) DeleteBucket(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteBucket(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBucket", reflect.TypeOf((*MockClient)(nil).DeleteBucket), varargs...) } // DeleteCloudFrontOriginAccessIdentity mocks base method. func (m *MockClient) DeleteCloudFrontOriginAccessIdentity(arg0 context.Context, arg1 *cloudfront.DeleteCloudFrontOriginAccessIdentityInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.DeleteCloudFrontOriginAccessIdentityOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -231,16 +237,16 @@ func (m *MockClient) DeleteCloudFrontOriginAccessIdentity(arg0 context.Context, } // DeleteCloudFrontOriginAccessIdentity indicates an expected call of DeleteCloudFrontOriginAccessIdentity. -func (mr *MockClientMockRecorder) DeleteCloudFrontOriginAccessIdentity(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteCloudFrontOriginAccessIdentity(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCloudFrontOriginAccessIdentity", reflect.TypeOf((*MockClient)(nil).DeleteCloudFrontOriginAccessIdentity), varargs...) } // DeleteDistribution mocks base method. func (m *MockClient) DeleteDistribution(arg0 context.Context, arg1 *cloudfront.DeleteDistributionInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.DeleteDistributionOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -251,16 +257,16 @@ func (m *MockClient) DeleteDistribution(arg0 context.Context, arg1 *cloudfront.D } // DeleteDistribution indicates an expected call of DeleteDistribution. -func (mr *MockClientMockRecorder) DeleteDistribution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteDistribution(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDistribution", reflect.TypeOf((*MockClient)(nil).DeleteDistribution), varargs...) } // DeleteObject mocks base method. func (m *MockClient) DeleteObject(arg0 context.Context, arg1 *s3.DeleteObjectInput, arg2 ...func(*s3.Options)) (*s3.DeleteObjectOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -271,16 +277,16 @@ func (m *MockClient) DeleteObject(arg0 context.Context, arg1 *s3.DeleteObjectInp } // DeleteObject indicates an expected call of DeleteObject. -func (mr *MockClientMockRecorder) DeleteObject(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteObject(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteObject", reflect.TypeOf((*MockClient)(nil).DeleteObject), varargs...) } // DeleteOpenIDConnectProvider mocks base method. func (m *MockClient) DeleteOpenIDConnectProvider(arg0 context.Context, arg1 *iam.DeleteOpenIDConnectProviderInput, arg2 ...func(*iam.Options)) (*iam.DeleteOpenIDConnectProviderOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -291,16 +297,16 @@ func (m *MockClient) DeleteOpenIDConnectProvider(arg0 context.Context, arg1 *iam } // DeleteOpenIDConnectProvider indicates an expected call of DeleteOpenIDConnectProvider. -func (mr *MockClientMockRecorder) DeleteOpenIDConnectProvider(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteOpenIDConnectProvider(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOpenIDConnectProvider", reflect.TypeOf((*MockClient)(nil).DeleteOpenIDConnectProvider), varargs...) } // DeleteRole mocks base method. func (m *MockClient) DeleteRole(arg0 context.Context, arg1 *iam.DeleteRoleInput, arg2 ...func(*iam.Options)) (*iam.DeleteRoleOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -311,16 +317,16 @@ func (m *MockClient) DeleteRole(arg0 context.Context, arg1 *iam.DeleteRoleInput, } // DeleteRole indicates an expected call of DeleteRole. -func (mr *MockClientMockRecorder) DeleteRole(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteRole(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRole", reflect.TypeOf((*MockClient)(nil).DeleteRole), varargs...) } // DeleteRolePolicy mocks base method. func (m *MockClient) DeleteRolePolicy(arg0 context.Context, arg1 *iam.DeleteRolePolicyInput, arg2 ...func(*iam.Options)) (*iam.DeleteRolePolicyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -331,16 +337,16 @@ func (m *MockClient) DeleteRolePolicy(arg0 context.Context, arg1 *iam.DeleteRole } // DeleteRolePolicy indicates an expected call of DeleteRolePolicy. -func (mr *MockClientMockRecorder) DeleteRolePolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteRolePolicy(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRolePolicy", reflect.TypeOf((*MockClient)(nil).DeleteRolePolicy), varargs...) } // DeleteUser mocks base method. func (m *MockClient) DeleteUser(arg0 context.Context, arg1 *iam.DeleteUserInput, arg2 ...func(*iam.Options)) (*iam.DeleteUserOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -351,16 +357,16 @@ func (m *MockClient) DeleteUser(arg0 context.Context, arg1 *iam.DeleteUserInput, } // DeleteUser indicates an expected call of DeleteUser. -func (mr *MockClientMockRecorder) DeleteUser(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteUser(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUser", reflect.TypeOf((*MockClient)(nil).DeleteUser), varargs...) } // DeleteUserPolicy mocks base method. func (m *MockClient) DeleteUserPolicy(arg0 context.Context, arg1 *iam.DeleteUserPolicyInput, arg2 ...func(*iam.Options)) (*iam.DeleteUserPolicyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -371,16 +377,16 @@ func (m *MockClient) DeleteUserPolicy(arg0 context.Context, arg1 *iam.DeleteUser } // DeleteUserPolicy indicates an expected call of DeleteUserPolicy. -func (mr *MockClientMockRecorder) DeleteUserPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteUserPolicy(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUserPolicy", reflect.TypeOf((*MockClient)(nil).DeleteUserPolicy), varargs...) } // GetBucketTagging mocks base method. func (m *MockClient) GetBucketTagging(arg0 context.Context, arg1 *s3.GetBucketTaggingInput, arg2 ...func(*s3.Options)) (*s3.GetBucketTaggingOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -391,16 +397,16 @@ func (m *MockClient) GetBucketTagging(arg0 context.Context, arg1 *s3.GetBucketTa } // GetBucketTagging indicates an expected call of GetBucketTagging. -func (mr *MockClientMockRecorder) GetBucketTagging(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetBucketTagging(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBucketTagging", reflect.TypeOf((*MockClient)(nil).GetBucketTagging), varargs...) } // GetCloudFrontOriginAccessIdentity mocks base method. func (m *MockClient) GetCloudFrontOriginAccessIdentity(arg0 context.Context, arg1 *cloudfront.GetCloudFrontOriginAccessIdentityInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.GetCloudFrontOriginAccessIdentityOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -411,16 +417,16 @@ func (m *MockClient) GetCloudFrontOriginAccessIdentity(arg0 context.Context, arg } // GetCloudFrontOriginAccessIdentity indicates an expected call of GetCloudFrontOriginAccessIdentity. -func (mr *MockClientMockRecorder) GetCloudFrontOriginAccessIdentity(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetCloudFrontOriginAccessIdentity(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCloudFrontOriginAccessIdentity", reflect.TypeOf((*MockClient)(nil).GetCloudFrontOriginAccessIdentity), varargs...) } // GetDistribution mocks base method. func (m *MockClient) GetDistribution(arg0 context.Context, arg1 *cloudfront.GetDistributionInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.GetDistributionOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -431,16 +437,16 @@ func (m *MockClient) GetDistribution(arg0 context.Context, arg1 *cloudfront.GetD } // GetDistribution indicates an expected call of GetDistribution. -func (mr *MockClientMockRecorder) GetDistribution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetDistribution(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDistribution", reflect.TypeOf((*MockClient)(nil).GetDistribution), varargs...) } // GetObjectTagging mocks base method. func (m *MockClient) GetObjectTagging(arg0 context.Context, arg1 *s3.GetObjectTaggingInput, arg2 ...func(*s3.Options)) (*s3.GetObjectTaggingOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -451,16 +457,16 @@ func (m *MockClient) GetObjectTagging(arg0 context.Context, arg1 *s3.GetObjectTa } // GetObjectTagging indicates an expected call of GetObjectTagging. -func (mr *MockClientMockRecorder) GetObjectTagging(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetObjectTagging(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObjectTagging", reflect.TypeOf((*MockClient)(nil).GetObjectTagging), varargs...) } // GetOpenIDConnectProvider mocks base method. func (m *MockClient) GetOpenIDConnectProvider(arg0 context.Context, arg1 *iam.GetOpenIDConnectProviderInput, arg2 ...func(*iam.Options)) (*iam.GetOpenIDConnectProviderOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -471,16 +477,16 @@ func (m *MockClient) GetOpenIDConnectProvider(arg0 context.Context, arg1 *iam.Ge } // GetOpenIDConnectProvider indicates an expected call of GetOpenIDConnectProvider. -func (mr *MockClientMockRecorder) GetOpenIDConnectProvider(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetOpenIDConnectProvider(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOpenIDConnectProvider", reflect.TypeOf((*MockClient)(nil).GetOpenIDConnectProvider), varargs...) } // GetRole mocks base method. func (m *MockClient) GetRole(arg0 context.Context, arg1 *iam.GetRoleInput, arg2 ...func(*iam.Options)) (*iam.GetRoleOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -491,16 +497,16 @@ func (m *MockClient) GetRole(arg0 context.Context, arg1 *iam.GetRoleInput, arg2 } // GetRole indicates an expected call of GetRole. -func (mr *MockClientMockRecorder) GetRole(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetRole(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRole", reflect.TypeOf((*MockClient)(nil).GetRole), varargs...) } // GetUser mocks base method. func (m *MockClient) GetUser(arg0 context.Context, arg1 *iam.GetUserInput, arg2 ...func(*iam.Options)) (*iam.GetUserOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -511,16 +517,16 @@ func (m *MockClient) GetUser(arg0 context.Context, arg1 *iam.GetUserInput, arg2 } // GetUser indicates an expected call of GetUser. -func (mr *MockClientMockRecorder) GetUser(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetUser(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUser", reflect.TypeOf((*MockClient)(nil).GetUser), varargs...) } // GetUserPolicy mocks base method. func (m *MockClient) GetUserPolicy(arg0 context.Context, arg1 *iam.GetUserPolicyInput, arg2 ...func(*iam.Options)) (*iam.GetUserPolicyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -531,16 +537,16 @@ func (m *MockClient) GetUserPolicy(arg0 context.Context, arg1 *iam.GetUserPolicy } // GetUserPolicy indicates an expected call of GetUserPolicy. -func (mr *MockClientMockRecorder) GetUserPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetUserPolicy(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserPolicy", reflect.TypeOf((*MockClient)(nil).GetUserPolicy), varargs...) } // ListAccessKeys mocks base method. func (m *MockClient) ListAccessKeys(arg0 context.Context, arg1 *iam.ListAccessKeysInput, arg2 ...func(*iam.Options)) (*iam.ListAccessKeysOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -551,16 +557,16 @@ func (m *MockClient) ListAccessKeys(arg0 context.Context, arg1 *iam.ListAccessKe } // ListAccessKeys indicates an expected call of ListAccessKeys. -func (mr *MockClientMockRecorder) ListAccessKeys(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListAccessKeys(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAccessKeys", reflect.TypeOf((*MockClient)(nil).ListAccessKeys), varargs...) } // ListCloudFrontOriginAccessIdentities mocks base method. func (m *MockClient) ListCloudFrontOriginAccessIdentities(arg0 context.Context, arg1 *cloudfront.ListCloudFrontOriginAccessIdentitiesInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.ListCloudFrontOriginAccessIdentitiesOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -571,16 +577,16 @@ func (m *MockClient) ListCloudFrontOriginAccessIdentities(arg0 context.Context, } // ListCloudFrontOriginAccessIdentities indicates an expected call of ListCloudFrontOriginAccessIdentities. -func (mr *MockClientMockRecorder) ListCloudFrontOriginAccessIdentities(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListCloudFrontOriginAccessIdentities(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCloudFrontOriginAccessIdentities", reflect.TypeOf((*MockClient)(nil).ListCloudFrontOriginAccessIdentities), varargs...) } // ListDistributions mocks base method. func (m *MockClient) ListDistributions(arg0 context.Context, arg1 *cloudfront.ListDistributionsInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.ListDistributionsOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -591,16 +597,16 @@ func (m *MockClient) ListDistributions(arg0 context.Context, arg1 *cloudfront.Li } // ListDistributions indicates an expected call of ListDistributions. -func (mr *MockClientMockRecorder) ListDistributions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListDistributions(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDistributions", reflect.TypeOf((*MockClient)(nil).ListDistributions), varargs...) } // ListObjectsV2 mocks base method. func (m *MockClient) ListObjectsV2(arg0 context.Context, arg1 *s3.ListObjectsV2Input, arg2 ...func(*s3.Options)) (*s3.ListObjectsV2Output, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -611,16 +617,16 @@ func (m *MockClient) ListObjectsV2(arg0 context.Context, arg1 *s3.ListObjectsV2I } // ListObjectsV2 indicates an expected call of ListObjectsV2. -func (mr *MockClientMockRecorder) ListObjectsV2(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListObjectsV2(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListObjectsV2", reflect.TypeOf((*MockClient)(nil).ListObjectsV2), varargs...) } // ListOpenIDConnectProviders mocks base method. func (m *MockClient) ListOpenIDConnectProviders(arg0 context.Context, arg1 *iam.ListOpenIDConnectProvidersInput, arg2 ...func(*iam.Options)) (*iam.ListOpenIDConnectProvidersOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -631,16 +637,16 @@ func (m *MockClient) ListOpenIDConnectProviders(arg0 context.Context, arg1 *iam. } // ListOpenIDConnectProviders indicates an expected call of ListOpenIDConnectProviders. -func (mr *MockClientMockRecorder) ListOpenIDConnectProviders(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListOpenIDConnectProviders(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListOpenIDConnectProviders", reflect.TypeOf((*MockClient)(nil).ListOpenIDConnectProviders), varargs...) } // ListRolePolicies mocks base method. func (m *MockClient) ListRolePolicies(arg0 context.Context, arg1 *iam.ListRolePoliciesInput, arg2 ...func(*iam.Options)) (*iam.ListRolePoliciesOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -651,16 +657,16 @@ func (m *MockClient) ListRolePolicies(arg0 context.Context, arg1 *iam.ListRolePo } // ListRolePolicies indicates an expected call of ListRolePolicies. -func (mr *MockClientMockRecorder) ListRolePolicies(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListRolePolicies(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRolePolicies", reflect.TypeOf((*MockClient)(nil).ListRolePolicies), varargs...) } // ListRoles mocks base method. func (m *MockClient) ListRoles(arg0 context.Context, arg1 *iam.ListRolesInput, arg2 ...func(*iam.Options)) (*iam.ListRolesOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -671,16 +677,16 @@ func (m *MockClient) ListRoles(arg0 context.Context, arg1 *iam.ListRolesInput, a } // ListRoles indicates an expected call of ListRoles. -func (mr *MockClientMockRecorder) ListRoles(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListRoles(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRoles", reflect.TypeOf((*MockClient)(nil).ListRoles), varargs...) } // ListTagsForResource mocks base method. func (m *MockClient) ListTagsForResource(arg0 context.Context, arg1 *cloudfront.ListTagsForResourceInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.ListTagsForResourceOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -691,16 +697,16 @@ func (m *MockClient) ListTagsForResource(arg0 context.Context, arg1 *cloudfront. } // ListTagsForResource indicates an expected call of ListTagsForResource. -func (mr *MockClientMockRecorder) ListTagsForResource(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListTagsForResource(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTagsForResource", reflect.TypeOf((*MockClient)(nil).ListTagsForResource), varargs...) } // ListUserPolicies mocks base method. func (m *MockClient) ListUserPolicies(arg0 context.Context, arg1 *iam.ListUserPoliciesInput, arg2 ...func(*iam.Options)) (*iam.ListUserPoliciesOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -711,16 +717,16 @@ func (m *MockClient) ListUserPolicies(arg0 context.Context, arg1 *iam.ListUserPo } // ListUserPolicies indicates an expected call of ListUserPolicies. -func (mr *MockClientMockRecorder) ListUserPolicies(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListUserPolicies(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUserPolicies", reflect.TypeOf((*MockClient)(nil).ListUserPolicies), varargs...) } // PutBucketPolicy mocks base method. func (m *MockClient) PutBucketPolicy(arg0 context.Context, arg1 *s3.PutBucketPolicyInput, arg2 ...func(*s3.Options)) (*s3.PutBucketPolicyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -731,16 +737,16 @@ func (m *MockClient) PutBucketPolicy(arg0 context.Context, arg1 *s3.PutBucketPol } // PutBucketPolicy indicates an expected call of PutBucketPolicy. -func (mr *MockClientMockRecorder) PutBucketPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) PutBucketPolicy(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutBucketPolicy", reflect.TypeOf((*MockClient)(nil).PutBucketPolicy), varargs...) } // PutBucketTagging mocks base method. func (m *MockClient) PutBucketTagging(arg0 context.Context, arg1 *s3.PutBucketTaggingInput, arg2 ...func(*s3.Options)) (*s3.PutBucketTaggingOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -751,16 +757,16 @@ func (m *MockClient) PutBucketTagging(arg0 context.Context, arg1 *s3.PutBucketTa } // PutBucketTagging indicates an expected call of PutBucketTagging. -func (mr *MockClientMockRecorder) PutBucketTagging(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) PutBucketTagging(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutBucketTagging", reflect.TypeOf((*MockClient)(nil).PutBucketTagging), varargs...) } // PutObject mocks base method. func (m *MockClient) PutObject(arg0 context.Context, arg1 *s3.PutObjectInput, arg2 ...func(*s3.Options)) (*s3.PutObjectOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -771,16 +777,16 @@ func (m *MockClient) PutObject(arg0 context.Context, arg1 *s3.PutObjectInput, ar } // PutObject indicates an expected call of PutObject. -func (mr *MockClientMockRecorder) PutObject(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) PutObject(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutObject", reflect.TypeOf((*MockClient)(nil).PutObject), varargs...) } // PutPublicAccessBlock mocks base method. func (m *MockClient) PutPublicAccessBlock(arg0 context.Context, arg1 *s3.PutPublicAccessBlockInput, arg2 ...func(*s3.Options)) (*s3.PutPublicAccessBlockOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -791,16 +797,16 @@ func (m *MockClient) PutPublicAccessBlock(arg0 context.Context, arg1 *s3.PutPubl } // PutPublicAccessBlock indicates an expected call of PutPublicAccessBlock. -func (mr *MockClientMockRecorder) PutPublicAccessBlock(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) PutPublicAccessBlock(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutPublicAccessBlock", reflect.TypeOf((*MockClient)(nil).PutPublicAccessBlock), varargs...) } // PutRolePolicy mocks base method. func (m *MockClient) PutRolePolicy(arg0 context.Context, arg1 *iam.PutRolePolicyInput, arg2 ...func(*iam.Options)) (*iam.PutRolePolicyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -811,16 +817,16 @@ func (m *MockClient) PutRolePolicy(arg0 context.Context, arg1 *iam.PutRolePolicy } // PutRolePolicy indicates an expected call of PutRolePolicy. -func (mr *MockClientMockRecorder) PutRolePolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) PutRolePolicy(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutRolePolicy", reflect.TypeOf((*MockClient)(nil).PutRolePolicy), varargs...) } // PutUserPolicy mocks base method. func (m *MockClient) PutUserPolicy(arg0 context.Context, arg1 *iam.PutUserPolicyInput, arg2 ...func(*iam.Options)) (*iam.PutUserPolicyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -831,16 +837,16 @@ func (m *MockClient) PutUserPolicy(arg0 context.Context, arg1 *iam.PutUserPolicy } // PutUserPolicy indicates an expected call of PutUserPolicy. -func (mr *MockClientMockRecorder) PutUserPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) PutUserPolicy(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutUserPolicy", reflect.TypeOf((*MockClient)(nil).PutUserPolicy), varargs...) } // SimulatePrincipalPolicy mocks base method. func (m *MockClient) SimulatePrincipalPolicy(arg0 context.Context, arg1 *iam.SimulatePrincipalPolicyInput, arg2 ...func(*iam.Options)) (*iam.SimulatePrincipalPolicyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -851,16 +857,16 @@ func (m *MockClient) SimulatePrincipalPolicy(arg0 context.Context, arg1 *iam.Sim } // SimulatePrincipalPolicy indicates an expected call of SimulatePrincipalPolicy. -func (mr *MockClientMockRecorder) SimulatePrincipalPolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) SimulatePrincipalPolicy(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SimulatePrincipalPolicy", reflect.TypeOf((*MockClient)(nil).SimulatePrincipalPolicy), varargs...) } // TagOpenIDConnectProvider mocks base method. func (m *MockClient) TagOpenIDConnectProvider(arg0 context.Context, arg1 *iam.TagOpenIDConnectProviderInput, arg2 ...func(*iam.Options)) (*iam.TagOpenIDConnectProviderOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -871,16 +877,16 @@ func (m *MockClient) TagOpenIDConnectProvider(arg0 context.Context, arg1 *iam.Ta } // TagOpenIDConnectProvider indicates an expected call of TagOpenIDConnectProvider. -func (mr *MockClientMockRecorder) TagOpenIDConnectProvider(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) TagOpenIDConnectProvider(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TagOpenIDConnectProvider", reflect.TypeOf((*MockClient)(nil).TagOpenIDConnectProvider), varargs...) } // TagUser mocks base method. func (m *MockClient) TagUser(arg0 context.Context, arg1 *iam.TagUserInput, arg2 ...func(*iam.Options)) (*iam.TagUserOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -891,16 +897,16 @@ func (m *MockClient) TagUser(arg0 context.Context, arg1 *iam.TagUserInput, arg2 } // TagUser indicates an expected call of TagUser. -func (mr *MockClientMockRecorder) TagUser(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) TagUser(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TagUser", reflect.TypeOf((*MockClient)(nil).TagUser), varargs...) } // UpdateAssumeRolePolicy mocks base method. func (m *MockClient) UpdateAssumeRolePolicy(arg0 context.Context, arg1 *iam.UpdateAssumeRolePolicyInput, arg2 ...func(*iam.Options)) (*iam.UpdateAssumeRolePolicyOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -911,16 +917,16 @@ func (m *MockClient) UpdateAssumeRolePolicy(arg0 context.Context, arg1 *iam.Upda } // UpdateAssumeRolePolicy indicates an expected call of UpdateAssumeRolePolicy. -func (mr *MockClientMockRecorder) UpdateAssumeRolePolicy(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) UpdateAssumeRolePolicy(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAssumeRolePolicy", reflect.TypeOf((*MockClient)(nil).UpdateAssumeRolePolicy), varargs...) } // UpdateDistribution mocks base method. func (m *MockClient) UpdateDistribution(arg0 context.Context, arg1 *cloudfront.UpdateDistributionInput, arg2 ...func(*cloudfront.Options)) (*cloudfront.UpdateDistributionOutput, error) { m.ctrl.T.Helper() - varargs := []interface{}{arg0, arg1} + varargs := []any{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } @@ -931,8 +937,8 @@ func (m *MockClient) UpdateDistribution(arg0 context.Context, arg1 *cloudfront.U } // UpdateDistribution indicates an expected call of UpdateDistribution. -func (mr *MockClientMockRecorder) UpdateDistribution(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) UpdateDistribution(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0, arg1}, arg2...) + varargs := append([]any{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDistribution", reflect.TypeOf((*MockClient)(nil).UpdateDistribution), varargs...) } diff --git a/pkg/azure/actuator_test.go b/pkg/azure/actuator_test.go index ab755690e5..21f0f2564e 100644 --- a/pkg/azure/actuator_test.go +++ b/pkg/azure/actuator_test.go @@ -28,10 +28,10 @@ import ( "github.com/openshift/cloud-credential-operator/pkg/cmd/provisioning" schemeutils "github.com/openshift/cloud-credential-operator/pkg/util" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/microsoftgraph/msgraph-sdk-go/models" diff --git a/pkg/azure/mock/client_generated.go b/pkg/azure/mock/client_generated.go index 8610c8102c..92abdaa215 100644 --- a/pkg/azure/mock/client_generated.go +++ b/pkg/azure/mock/client_generated.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: ./clients.go +// +// Generated by this command: +// +// mockgen -source=./clients.go -destination=./mock/client_generated.go -package=mock +// // Package mock is a generated GoMock package. package mock @@ -15,14 +20,15 @@ import ( armresources "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" armstorage "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" blockblob "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob" - gomock "github.com/golang/mock/gomock" models "github.com/microsoftgraph/msgraph-sdk-go/models" + gomock "go.uber.org/mock/gomock" ) // MockAppClient is a mock of AppClient interface. type MockAppClient struct { ctrl *gomock.Controller recorder *MockAppClientMockRecorder + isgomock struct{} } // MockAppClientMockRecorder is the mock recorder for MockAppClient. @@ -51,7 +57,7 @@ func (m *MockAppClient) Delete(ctx context.Context, applicationObjectID string) } // Delete indicates an expected call of Delete. -func (mr *MockAppClientMockRecorder) Delete(ctx, applicationObjectID interface{}) *gomock.Call { +func (mr *MockAppClientMockRecorder) Delete(ctx, applicationObjectID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAppClient)(nil).Delete), ctx, applicationObjectID) } @@ -66,7 +72,7 @@ func (m *MockAppClient) List(ctx context.Context, filter string) ([]models.Appli } // List indicates an expected call of List. -func (mr *MockAppClientMockRecorder) List(ctx, filter interface{}) *gomock.Call { +func (mr *MockAppClientMockRecorder) List(ctx, filter any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAppClient)(nil).List), ctx, filter) } @@ -75,6 +81,7 @@ func (mr *MockAppClientMockRecorder) List(ctx, filter interface{}) *gomock.Call type MockResourceGroupsClient struct { ctrl *gomock.Controller recorder *MockResourceGroupsClientMockRecorder + isgomock struct{} } // MockResourceGroupsClientMockRecorder is the mock recorder for MockResourceGroupsClient. @@ -104,7 +111,7 @@ func (m *MockResourceGroupsClient) BeginDelete(ctx context.Context, resourceGrou } // BeginDelete indicates an expected call of BeginDelete. -func (mr *MockResourceGroupsClientMockRecorder) BeginDelete(ctx, resourceGroupName, options interface{}) *gomock.Call { +func (mr *MockResourceGroupsClientMockRecorder) BeginDelete(ctx, resourceGroupName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginDelete", reflect.TypeOf((*MockResourceGroupsClient)(nil).BeginDelete), ctx, resourceGroupName, options) } @@ -119,7 +126,7 @@ func (m *MockResourceGroupsClient) CreateOrUpdate(ctx context.Context, resourceG } // CreateOrUpdate indicates an expected call of CreateOrUpdate. -func (mr *MockResourceGroupsClientMockRecorder) CreateOrUpdate(ctx, resourceGroupName, parameters, options interface{}) *gomock.Call { +func (mr *MockResourceGroupsClientMockRecorder) CreateOrUpdate(ctx, resourceGroupName, parameters, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockResourceGroupsClient)(nil).CreateOrUpdate), ctx, resourceGroupName, parameters, options) } @@ -134,7 +141,7 @@ func (m *MockResourceGroupsClient) Get(ctx context.Context, resourceGroupName st } // Get indicates an expected call of Get. -func (mr *MockResourceGroupsClientMockRecorder) Get(ctx, resourceGroupName, options interface{}) *gomock.Call { +func (mr *MockResourceGroupsClientMockRecorder) Get(ctx, resourceGroupName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockResourceGroupsClient)(nil).Get), ctx, resourceGroupName, options) } @@ -143,6 +150,7 @@ func (mr *MockResourceGroupsClientMockRecorder) Get(ctx, resourceGroupName, opti type MockAccountsClient struct { ctrl *gomock.Controller recorder *MockAccountsClientMockRecorder + isgomock struct{} } // MockAccountsClientMockRecorder is the mock recorder for MockAccountsClient. @@ -172,7 +180,7 @@ func (m *MockAccountsClient) BeginCreate(ctx context.Context, resourceGroupName, } // BeginCreate indicates an expected call of BeginCreate. -func (mr *MockAccountsClientMockRecorder) BeginCreate(ctx, resourceGroupName, accountName, parameters, options interface{}) *gomock.Call { +func (mr *MockAccountsClientMockRecorder) BeginCreate(ctx, resourceGroupName, accountName, parameters, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginCreate", reflect.TypeOf((*MockAccountsClient)(nil).BeginCreate), ctx, resourceGroupName, accountName, parameters, options) } @@ -187,7 +195,7 @@ func (m *MockAccountsClient) Delete(ctx context.Context, resourceGroupName, acco } // Delete indicates an expected call of Delete. -func (mr *MockAccountsClientMockRecorder) Delete(ctx, resourceGroupName, accountName, options interface{}) *gomock.Call { +func (mr *MockAccountsClientMockRecorder) Delete(ctx, resourceGroupName, accountName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAccountsClient)(nil).Delete), ctx, resourceGroupName, accountName, options) } @@ -202,7 +210,7 @@ func (m *MockAccountsClient) ListKeys(ctx context.Context, resourceGroupName, ac } // ListKeys indicates an expected call of ListKeys. -func (mr *MockAccountsClientMockRecorder) ListKeys(ctx, resourceGroupName, accountName, options interface{}) *gomock.Call { +func (mr *MockAccountsClientMockRecorder) ListKeys(ctx, resourceGroupName, accountName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListKeys", reflect.TypeOf((*MockAccountsClient)(nil).ListKeys), ctx, resourceGroupName, accountName, options) } @@ -216,7 +224,7 @@ func (m *MockAccountsClient) NewListByResourceGroupPager(resourceGroupName strin } // NewListByResourceGroupPager indicates an expected call of NewListByResourceGroupPager. -func (mr *MockAccountsClientMockRecorder) NewListByResourceGroupPager(resourceGroupName, options interface{}) *gomock.Call { +func (mr *MockAccountsClientMockRecorder) NewListByResourceGroupPager(resourceGroupName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewListByResourceGroupPager", reflect.TypeOf((*MockAccountsClient)(nil).NewListByResourceGroupPager), resourceGroupName, options) } @@ -230,7 +238,7 @@ func (m *MockAccountsClient) NewListPager(options *armstorage.AccountsClientList } // NewListPager indicates an expected call of NewListPager. -func (mr *MockAccountsClientMockRecorder) NewListPager(options interface{}) *gomock.Call { +func (mr *MockAccountsClientMockRecorder) NewListPager(options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewListPager", reflect.TypeOf((*MockAccountsClient)(nil).NewListPager), options) } @@ -245,7 +253,7 @@ func (m *MockAccountsClient) Update(ctx context.Context, resourceGroupName, acco } // Update indicates an expected call of Update. -func (mr *MockAccountsClientMockRecorder) Update(ctx, resourceGroupName, accountName, parameters, options interface{}) *gomock.Call { +func (mr *MockAccountsClientMockRecorder) Update(ctx, resourceGroupName, accountName, parameters, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockAccountsClient)(nil).Update), ctx, resourceGroupName, accountName, parameters, options) } @@ -254,6 +262,7 @@ func (mr *MockAccountsClientMockRecorder) Update(ctx, resourceGroupName, account type MockBlobContainersClient struct { ctrl *gomock.Controller recorder *MockBlobContainersClientMockRecorder + isgomock struct{} } // MockBlobContainersClientMockRecorder is the mock recorder for MockBlobContainersClient. @@ -283,7 +292,7 @@ func (m *MockBlobContainersClient) Create(ctx context.Context, resourceGroupName } // Create indicates an expected call of Create. -func (mr *MockBlobContainersClientMockRecorder) Create(ctx, resourceGroupName, accountName, containerName, blobContainer, options interface{}) *gomock.Call { +func (mr *MockBlobContainersClientMockRecorder) Create(ctx, resourceGroupName, accountName, containerName, blobContainer, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockBlobContainersClient)(nil).Create), ctx, resourceGroupName, accountName, containerName, blobContainer, options) } @@ -298,7 +307,7 @@ func (m *MockBlobContainersClient) Get(ctx context.Context, resourceGroupName, a } // Get indicates an expected call of Get. -func (mr *MockBlobContainersClientMockRecorder) Get(ctx, resourceGroupName, accountName, containerName, options interface{}) *gomock.Call { +func (mr *MockBlobContainersClientMockRecorder) Get(ctx, resourceGroupName, accountName, containerName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockBlobContainersClient)(nil).Get), ctx, resourceGroupName, accountName, containerName, options) } @@ -307,6 +316,7 @@ func (mr *MockBlobContainersClientMockRecorder) Get(ctx, resourceGroupName, acco type MockAZBlobClient struct { ctrl *gomock.Controller recorder *MockAZBlobClientMockRecorder + isgomock struct{} } // MockAZBlobClientMockRecorder is the mock recorder for MockAZBlobClient. @@ -336,7 +346,7 @@ func (m *MockAZBlobClient) UploadBuffer(ctx context.Context, containerName, blob } // UploadBuffer indicates an expected call of UploadBuffer. -func (mr *MockAZBlobClientMockRecorder) UploadBuffer(ctx, containerName, blobName, buffer, o interface{}) *gomock.Call { +func (mr *MockAZBlobClientMockRecorder) UploadBuffer(ctx, containerName, blobName, buffer, o any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UploadBuffer", reflect.TypeOf((*MockAZBlobClient)(nil).UploadBuffer), ctx, containerName, blobName, buffer, o) } @@ -345,6 +355,7 @@ func (mr *MockAZBlobClientMockRecorder) UploadBuffer(ctx, containerName, blobNam type MockUserAssignedIdentitiesClient struct { ctrl *gomock.Controller recorder *MockUserAssignedIdentitiesClientMockRecorder + isgomock struct{} } // MockUserAssignedIdentitiesClientMockRecorder is the mock recorder for MockUserAssignedIdentitiesClient. @@ -374,7 +385,7 @@ func (m *MockUserAssignedIdentitiesClient) CreateOrUpdate(ctx context.Context, r } // CreateOrUpdate indicates an expected call of CreateOrUpdate. -func (mr *MockUserAssignedIdentitiesClientMockRecorder) CreateOrUpdate(ctx, resourceGroupName, resourceName, parameters, options interface{}) *gomock.Call { +func (mr *MockUserAssignedIdentitiesClientMockRecorder) CreateOrUpdate(ctx, resourceGroupName, resourceName, parameters, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockUserAssignedIdentitiesClient)(nil).CreateOrUpdate), ctx, resourceGroupName, resourceName, parameters, options) } @@ -389,7 +400,7 @@ func (m *MockUserAssignedIdentitiesClient) Delete(ctx context.Context, resourceG } // Delete indicates an expected call of Delete. -func (mr *MockUserAssignedIdentitiesClientMockRecorder) Delete(ctx, resourceGroupName, resourceName, options interface{}) *gomock.Call { +func (mr *MockUserAssignedIdentitiesClientMockRecorder) Delete(ctx, resourceGroupName, resourceName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockUserAssignedIdentitiesClient)(nil).Delete), ctx, resourceGroupName, resourceName, options) } @@ -404,7 +415,7 @@ func (m *MockUserAssignedIdentitiesClient) Get(ctx context.Context, resourceGrou } // Get indicates an expected call of Get. -func (mr *MockUserAssignedIdentitiesClientMockRecorder) Get(ctx, resourceGroupName, resourceName, options interface{}) *gomock.Call { +func (mr *MockUserAssignedIdentitiesClientMockRecorder) Get(ctx, resourceGroupName, resourceName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockUserAssignedIdentitiesClient)(nil).Get), ctx, resourceGroupName, resourceName, options) } @@ -418,7 +429,7 @@ func (m *MockUserAssignedIdentitiesClient) NewListByResourceGroupPager(resourceG } // NewListByResourceGroupPager indicates an expected call of NewListByResourceGroupPager. -func (mr *MockUserAssignedIdentitiesClientMockRecorder) NewListByResourceGroupPager(resourceGroupName, options interface{}) *gomock.Call { +func (mr *MockUserAssignedIdentitiesClientMockRecorder) NewListByResourceGroupPager(resourceGroupName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewListByResourceGroupPager", reflect.TypeOf((*MockUserAssignedIdentitiesClient)(nil).NewListByResourceGroupPager), resourceGroupName, options) } @@ -427,6 +438,7 @@ func (mr *MockUserAssignedIdentitiesClientMockRecorder) NewListByResourceGroupPa type MockRoleDefinitionsClient struct { ctrl *gomock.Controller recorder *MockRoleDefinitionsClientMockRecorder + isgomock struct{} } // MockRoleDefinitionsClientMockRecorder is the mock recorder for MockRoleDefinitionsClient. @@ -456,7 +468,7 @@ func (m *MockRoleDefinitionsClient) CreateOrUpdate(ctx context.Context, scope, r } // CreateOrUpdate indicates an expected call of CreateOrUpdate. -func (mr *MockRoleDefinitionsClientMockRecorder) CreateOrUpdate(ctx, scope, roleDefinitionID, roleDefinition, options interface{}) *gomock.Call { +func (mr *MockRoleDefinitionsClientMockRecorder) CreateOrUpdate(ctx, scope, roleDefinitionID, roleDefinition, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockRoleDefinitionsClient)(nil).CreateOrUpdate), ctx, scope, roleDefinitionID, roleDefinition, options) } @@ -471,7 +483,7 @@ func (m *MockRoleDefinitionsClient) Delete(ctx context.Context, scope, roleDefin } // Delete indicates an expected call of Delete. -func (mr *MockRoleDefinitionsClientMockRecorder) Delete(ctx, scope, roleDefinitionID, options interface{}) *gomock.Call { +func (mr *MockRoleDefinitionsClientMockRecorder) Delete(ctx, scope, roleDefinitionID, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockRoleDefinitionsClient)(nil).Delete), ctx, scope, roleDefinitionID, options) } @@ -486,7 +498,7 @@ func (m *MockRoleDefinitionsClient) GetByID(ctx context.Context, roleDefinitionI } // GetByID indicates an expected call of GetByID. -func (mr *MockRoleDefinitionsClientMockRecorder) GetByID(ctx, roleDefinitionID, options interface{}) *gomock.Call { +func (mr *MockRoleDefinitionsClientMockRecorder) GetByID(ctx, roleDefinitionID, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetByID", reflect.TypeOf((*MockRoleDefinitionsClient)(nil).GetByID), ctx, roleDefinitionID, options) } @@ -500,7 +512,7 @@ func (m *MockRoleDefinitionsClient) NewListPager(scope string, options *armautho } // NewListPager indicates an expected call of NewListPager. -func (mr *MockRoleDefinitionsClientMockRecorder) NewListPager(scope, options interface{}) *gomock.Call { +func (mr *MockRoleDefinitionsClientMockRecorder) NewListPager(scope, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewListPager", reflect.TypeOf((*MockRoleDefinitionsClient)(nil).NewListPager), scope, options) } @@ -509,6 +521,7 @@ func (mr *MockRoleDefinitionsClientMockRecorder) NewListPager(scope, options int type MockRoleAssignmentsClient struct { ctrl *gomock.Controller recorder *MockRoleAssignmentsClientMockRecorder + isgomock struct{} } // MockRoleAssignmentsClientMockRecorder is the mock recorder for MockRoleAssignmentsClient. @@ -538,7 +551,7 @@ func (m *MockRoleAssignmentsClient) Create(ctx context.Context, scope, roleAssig } // Create indicates an expected call of Create. -func (mr *MockRoleAssignmentsClientMockRecorder) Create(ctx, scope, roleAssignmentName, parameters, options interface{}) *gomock.Call { +func (mr *MockRoleAssignmentsClientMockRecorder) Create(ctx, scope, roleAssignmentName, parameters, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockRoleAssignmentsClient)(nil).Create), ctx, scope, roleAssignmentName, parameters, options) } @@ -553,7 +566,7 @@ func (m *MockRoleAssignmentsClient) Delete(ctx context.Context, scope, roleAssig } // Delete indicates an expected call of Delete. -func (mr *MockRoleAssignmentsClientMockRecorder) Delete(ctx, scope, roleAssignmentName, options interface{}) *gomock.Call { +func (mr *MockRoleAssignmentsClientMockRecorder) Delete(ctx, scope, roleAssignmentName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockRoleAssignmentsClient)(nil).Delete), ctx, scope, roleAssignmentName, options) } @@ -567,7 +580,7 @@ func (m *MockRoleAssignmentsClient) NewListForScopePager(scope string, options * } // NewListForScopePager indicates an expected call of NewListForScopePager. -func (mr *MockRoleAssignmentsClientMockRecorder) NewListForScopePager(scope, options interface{}) *gomock.Call { +func (mr *MockRoleAssignmentsClientMockRecorder) NewListForScopePager(scope, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewListForScopePager", reflect.TypeOf((*MockRoleAssignmentsClient)(nil).NewListForScopePager), scope, options) } @@ -576,6 +589,7 @@ func (mr *MockRoleAssignmentsClientMockRecorder) NewListForScopePager(scope, opt type MockFederatedIdentityCredentialsClient struct { ctrl *gomock.Controller recorder *MockFederatedIdentityCredentialsClientMockRecorder + isgomock struct{} } // MockFederatedIdentityCredentialsClientMockRecorder is the mock recorder for MockFederatedIdentityCredentialsClient. @@ -605,7 +619,7 @@ func (m *MockFederatedIdentityCredentialsClient) CreateOrUpdate(ctx context.Cont } // CreateOrUpdate indicates an expected call of CreateOrUpdate. -func (mr *MockFederatedIdentityCredentialsClientMockRecorder) CreateOrUpdate(ctx, resourceGroupName, resourceName, federatedIdentityCredentialResourceName, parameters, options interface{}) *gomock.Call { +func (mr *MockFederatedIdentityCredentialsClientMockRecorder) CreateOrUpdate(ctx, resourceGroupName, resourceName, federatedIdentityCredentialResourceName, parameters, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockFederatedIdentityCredentialsClient)(nil).CreateOrUpdate), ctx, resourceGroupName, resourceName, federatedIdentityCredentialResourceName, parameters, options) } @@ -620,7 +634,7 @@ func (m *MockFederatedIdentityCredentialsClient) Get(ctx context.Context, resour } // Get indicates an expected call of Get. -func (mr *MockFederatedIdentityCredentialsClientMockRecorder) Get(ctx, resourceGroupName, resourceName, federatedIdentityCredentialResourceName, options interface{}) *gomock.Call { +func (mr *MockFederatedIdentityCredentialsClientMockRecorder) Get(ctx, resourceGroupName, resourceName, federatedIdentityCredentialResourceName, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockFederatedIdentityCredentialsClient)(nil).Get), ctx, resourceGroupName, resourceName, federatedIdentityCredentialResourceName, options) } @@ -629,6 +643,7 @@ func (mr *MockFederatedIdentityCredentialsClientMockRecorder) Get(ctx, resourceG type MockMockablePoller[T any] struct { ctrl *gomock.Controller recorder *MockMockablePollerMockRecorder[T] + isgomock struct{} } // MockMockablePollerMockRecorder is the mock recorder for MockMockablePoller. @@ -672,7 +687,7 @@ func (m *MockMockablePoller[T]) Poll(ctx context.Context) (*http.Response, error } // Poll indicates an expected call of Poll. -func (mr *MockMockablePollerMockRecorder[T]) Poll(ctx interface{}) *gomock.Call { +func (mr *MockMockablePollerMockRecorder[T]) Poll(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Poll", reflect.TypeOf((*MockMockablePoller[T])(nil).Poll), ctx) } @@ -687,7 +702,7 @@ func (m *MockMockablePoller[T]) PollUntilDone(ctx context.Context, options *runt } // PollUntilDone indicates an expected call of PollUntilDone. -func (mr *MockMockablePollerMockRecorder[T]) PollUntilDone(ctx, options interface{}) *gomock.Call { +func (mr *MockMockablePollerMockRecorder[T]) PollUntilDone(ctx, options any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PollUntilDone", reflect.TypeOf((*MockMockablePoller[T])(nil).PollUntilDone), ctx, options) } @@ -702,7 +717,7 @@ func (m *MockMockablePoller[T]) Result(ctx context.Context) (T, error) { } // Result indicates an expected call of Result. -func (mr *MockMockablePollerMockRecorder[T]) Result(ctx interface{}) *gomock.Call { +func (mr *MockMockablePollerMockRecorder[T]) Result(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Result", reflect.TypeOf((*MockMockablePoller[T])(nil).Result), ctx) } diff --git a/pkg/cmd/provisioning/aws/create-iam-roles_test.go b/pkg/cmd/provisioning/aws/create-iam-roles_test.go index 13c1faa653..e1990bce8f 100644 --- a/pkg/cmd/provisioning/aws/create-iam-roles_test.go +++ b/pkg/cmd/provisioning/aws/create-iam-roles_test.go @@ -6,9 +6,9 @@ import ( "path/filepath" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" awssdk "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/iam" diff --git a/pkg/cmd/provisioning/aws/create_identity_provider_test.go b/pkg/cmd/provisioning/aws/create_identity_provider_test.go index e8d2594969..bc2bb89808 100644 --- a/pkg/cmd/provisioning/aws/create_identity_provider_test.go +++ b/pkg/cmd/provisioning/aws/create_identity_provider_test.go @@ -9,9 +9,9 @@ import ( "path/filepath" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" awssdk "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudfront" diff --git a/pkg/cmd/provisioning/azure/create_managed_identities_test.go b/pkg/cmd/provisioning/azure/create_managed_identities_test.go index ec063f2fe0..feebd68f8a 100644 --- a/pkg/cmd/provisioning/azure/create_managed_identities_test.go +++ b/pkg/cmd/provisioning/azure/create_managed_identities_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" ) var ( diff --git a/pkg/cmd/provisioning/azure/create_oidc_issuer_test.go b/pkg/cmd/provisioning/azure/create_oidc_issuer_test.go index 29cd5b2580..d18fb5f507 100644 --- a/pkg/cmd/provisioning/azure/create_oidc_issuer_test.go +++ b/pkg/cmd/provisioning/azure/create_oidc_issuer_test.go @@ -14,11 +14,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob" - "github.com/golang/mock/gomock" azureclients "github.com/openshift/cloud-credential-operator/pkg/azure" mockazure "github.com/openshift/cloud-credential-operator/pkg/azure/mock" "github.com/openshift/cloud-credential-operator/pkg/cmd/provisioning" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) var ( diff --git a/pkg/cmd/provisioning/gcp/create_service_accounts_test.go b/pkg/cmd/provisioning/gcp/create_service_accounts_test.go index f8106a04e9..eb344cf85d 100644 --- a/pkg/cmd/provisioning/gcp/create_service_accounts_test.go +++ b/pkg/cmd/provisioning/gcp/create_service_accounts_test.go @@ -7,9 +7,9 @@ import ( "path/filepath" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "google.golang.org/api/cloudresourcemanager/v1" "google.golang.org/api/iam/v1" iamadminpb "google.golang.org/genproto/googleapis/iam/admin/v1" diff --git a/pkg/cmd/provisioning/gcp/create_workload_identity_pool_test.go b/pkg/cmd/provisioning/gcp/create_workload_identity_pool_test.go index de19bf5450..faf0e86582 100644 --- a/pkg/cmd/provisioning/gcp/create_workload_identity_pool_test.go +++ b/pkg/cmd/provisioning/gcp/create_workload_identity_pool_test.go @@ -5,9 +5,9 @@ import ( "os" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "google.golang.org/api/googleapi" "google.golang.org/api/iam/v1" diff --git a/pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go b/pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go index c57443fe8d..32a1717a30 100644 --- a/pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go +++ b/pkg/cmd/provisioning/gcp/create_workload_identity_provider_test.go @@ -12,9 +12,9 @@ import ( iamCloud "cloud.google.com/go/iam" "cloud.google.com/go/storage" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "google.golang.org/api/googleapi" "google.golang.org/api/iam/v1" pb "google.golang.org/genproto/googleapis/iam/v1" diff --git a/pkg/cmd/provisioning/ibmcloud/create_service_id_test.go b/pkg/cmd/provisioning/ibmcloud/create_service_id_test.go index a258e2f676..2f6a0ec837 100644 --- a/pkg/cmd/provisioning/ibmcloud/create_service_id_test.go +++ b/pkg/cmd/provisioning/ibmcloud/create_service_id_test.go @@ -7,11 +7,11 @@ import ( "strconv" "testing" - "github.com/golang/mock/gomock" "github.com/google/uuid" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/platform-services-go-sdk/iamidentityv1" diff --git a/pkg/cmd/provisioning/ibmcloud/delete_service_id_test.go b/pkg/cmd/provisioning/ibmcloud/delete_service_id_test.go index d999c914d3..28b0dcd29b 100644 --- a/pkg/cmd/provisioning/ibmcloud/delete_service_id_test.go +++ b/pkg/cmd/provisioning/ibmcloud/delete_service_id_test.go @@ -5,11 +5,11 @@ import ( "os" "testing" - "github.com/golang/mock/gomock" "github.com/google/uuid" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/platform-services-go-sdk/iamidentityv1" diff --git a/pkg/cmd/provisioning/ibmcloud/refresh-keys_test.go b/pkg/cmd/provisioning/ibmcloud/refresh-keys_test.go index 8cbe36fb98..8f57b06b51 100644 --- a/pkg/cmd/provisioning/ibmcloud/refresh-keys_test.go +++ b/pkg/cmd/provisioning/ibmcloud/refresh-keys_test.go @@ -5,9 +5,9 @@ import ( "os" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/gcp/mock/client_generated.go b/pkg/gcp/mock/client_generated.go index bf86fb4e1a..8cc3510efd 100644 --- a/pkg/gcp/mock/client_generated.go +++ b/pkg/gcp/mock/client_generated.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: ./client.go +// +// Generated by this command: +// +// mockgen -source=./client.go -destination=./mock/client_generated.go -package=mock +// // Package mock is a generated GoMock package. package mock @@ -10,7 +15,7 @@ import ( iam "cloud.google.com/go/iam" storage "cloud.google.com/go/storage" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v1" iam0 "google.golang.org/api/iam/v1" admin "google.golang.org/genproto/googleapis/iam/admin/v1" @@ -20,6 +25,7 @@ import ( type MockClient struct { ctrl *gomock.Controller recorder *MockClientMockRecorder + isgomock struct{} } // MockClientMockRecorder is the mock recorder for MockClient. @@ -48,7 +54,7 @@ func (m *MockClient) CreateBucket(arg0 context.Context, arg1, arg2 string, arg3 } // CreateBucket indicates an expected call of CreateBucket. -func (mr *MockClientMockRecorder) CreateBucket(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateBucket(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBucket", reflect.TypeOf((*MockClient)(nil).CreateBucket), arg0, arg1, arg2, arg3) } @@ -63,7 +69,7 @@ func (m *MockClient) CreateRole(arg0 context.Context, arg1 *admin.CreateRoleRequ } // CreateRole indicates an expected call of CreateRole. -func (mr *MockClientMockRecorder) CreateRole(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateRole(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRole", reflect.TypeOf((*MockClient)(nil).CreateRole), arg0, arg1) } @@ -78,7 +84,7 @@ func (m *MockClient) CreateServiceAccount(arg0 context.Context, arg1 *admin.Crea } // CreateServiceAccount indicates an expected call of CreateServiceAccount. -func (mr *MockClientMockRecorder) CreateServiceAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateServiceAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateServiceAccount", reflect.TypeOf((*MockClient)(nil).CreateServiceAccount), arg0, arg1) } @@ -93,7 +99,7 @@ func (m *MockClient) CreateServiceAccountKey(arg0 context.Context, arg1 *admin.C } // CreateServiceAccountKey indicates an expected call of CreateServiceAccountKey. -func (mr *MockClientMockRecorder) CreateServiceAccountKey(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateServiceAccountKey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateServiceAccountKey", reflect.TypeOf((*MockClient)(nil).CreateServiceAccountKey), arg0, arg1) } @@ -108,7 +114,7 @@ func (m *MockClient) CreateWorkloadIdentityPool(arg0 context.Context, arg1, arg2 } // CreateWorkloadIdentityPool indicates an expected call of CreateWorkloadIdentityPool. -func (mr *MockClientMockRecorder) CreateWorkloadIdentityPool(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateWorkloadIdentityPool(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkloadIdentityPool", reflect.TypeOf((*MockClient)(nil).CreateWorkloadIdentityPool), arg0, arg1, arg2, arg3) } @@ -123,7 +129,7 @@ func (m *MockClient) CreateWorkloadIdentityProvider(arg0 context.Context, arg1, } // CreateWorkloadIdentityProvider indicates an expected call of CreateWorkloadIdentityProvider. -func (mr *MockClientMockRecorder) CreateWorkloadIdentityProvider(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateWorkloadIdentityProvider(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkloadIdentityProvider", reflect.TypeOf((*MockClient)(nil).CreateWorkloadIdentityProvider), arg0, arg1, arg2, arg3) } @@ -137,7 +143,7 @@ func (m *MockClient) DeleteBucket(arg0 context.Context, arg1 string) error { } // DeleteBucket indicates an expected call of DeleteBucket. -func (mr *MockClientMockRecorder) DeleteBucket(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteBucket(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteBucket", reflect.TypeOf((*MockClient)(nil).DeleteBucket), arg0, arg1) } @@ -151,7 +157,7 @@ func (m *MockClient) DeleteObject(arg0 context.Context, arg1, arg2 string) error } // DeleteObject indicates an expected call of DeleteObject. -func (mr *MockClientMockRecorder) DeleteObject(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteObject(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteObject", reflect.TypeOf((*MockClient)(nil).DeleteObject), arg0, arg1, arg2) } @@ -166,7 +172,7 @@ func (m *MockClient) DeleteRole(arg0 context.Context, arg1 *admin.DeleteRoleRequ } // DeleteRole indicates an expected call of DeleteRole. -func (mr *MockClientMockRecorder) DeleteRole(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteRole(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRole", reflect.TypeOf((*MockClient)(nil).DeleteRole), arg0, arg1) } @@ -180,7 +186,7 @@ func (m *MockClient) DeleteServiceAccount(arg0 context.Context, arg1 *admin.Dele } // DeleteServiceAccount indicates an expected call of DeleteServiceAccount. -func (mr *MockClientMockRecorder) DeleteServiceAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteServiceAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteServiceAccount", reflect.TypeOf((*MockClient)(nil).DeleteServiceAccount), arg0, arg1) } @@ -194,7 +200,7 @@ func (m *MockClient) DeleteServiceAccountKey(arg0 context.Context, arg1 *admin.D } // DeleteServiceAccountKey indicates an expected call of DeleteServiceAccountKey. -func (mr *MockClientMockRecorder) DeleteServiceAccountKey(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteServiceAccountKey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteServiceAccountKey", reflect.TypeOf((*MockClient)(nil).DeleteServiceAccountKey), arg0, arg1) } @@ -209,7 +215,7 @@ func (m *MockClient) DeleteWorkloadIdentityPool(arg0 context.Context, arg1 strin } // DeleteWorkloadIdentityPool indicates an expected call of DeleteWorkloadIdentityPool. -func (mr *MockClientMockRecorder) DeleteWorkloadIdentityPool(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteWorkloadIdentityPool(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkloadIdentityPool", reflect.TypeOf((*MockClient)(nil).DeleteWorkloadIdentityPool), arg0, arg1) } @@ -224,7 +230,7 @@ func (m *MockClient) GetBucketAttrs(arg0 context.Context, arg1 string) (*storage } // GetBucketAttrs indicates an expected call of GetBucketAttrs. -func (mr *MockClientMockRecorder) GetBucketAttrs(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetBucketAttrs(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBucketAttrs", reflect.TypeOf((*MockClient)(nil).GetBucketAttrs), arg0, arg1) } @@ -239,7 +245,7 @@ func (m *MockClient) GetBucketPolicy(arg0 context.Context, arg1 string) (*iam.Po } // GetBucketPolicy indicates an expected call of GetBucketPolicy. -func (mr *MockClientMockRecorder) GetBucketPolicy(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetBucketPolicy(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBucketPolicy", reflect.TypeOf((*MockClient)(nil).GetBucketPolicy), arg0, arg1) } @@ -254,7 +260,7 @@ func (m *MockClient) GetProject(ctx context.Context, projectName string) (*cloud } // GetProject indicates an expected call of GetProject. -func (mr *MockClientMockRecorder) GetProject(ctx, projectName interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetProject(ctx, projectName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProject", reflect.TypeOf((*MockClient)(nil).GetProject), ctx, projectName) } @@ -269,7 +275,7 @@ func (m *MockClient) GetProjectIamPolicy(arg0 string, arg1 *cloudresourcemanager } // GetProjectIamPolicy indicates an expected call of GetProjectIamPolicy. -func (mr *MockClientMockRecorder) GetProjectIamPolicy(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetProjectIamPolicy(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProjectIamPolicy", reflect.TypeOf((*MockClient)(nil).GetProjectIamPolicy), arg0, arg1) } @@ -298,7 +304,7 @@ func (m *MockClient) GetRole(arg0 context.Context, arg1 *admin.GetRoleRequest) ( } // GetRole indicates an expected call of GetRole. -func (mr *MockClientMockRecorder) GetRole(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetRole(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRole", reflect.TypeOf((*MockClient)(nil).GetRole), arg0, arg1) } @@ -313,7 +319,7 @@ func (m *MockClient) GetServiceAccount(arg0 context.Context, arg1 *admin.GetServ } // GetServiceAccount indicates an expected call of GetServiceAccount. -func (mr *MockClientMockRecorder) GetServiceAccount(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetServiceAccount(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetServiceAccount", reflect.TypeOf((*MockClient)(nil).GetServiceAccount), arg0, arg1) } @@ -328,7 +334,7 @@ func (m *MockClient) GetServiceAccountIamPolicy(arg0 string) (*iam0.Policy, erro } // GetServiceAccountIamPolicy indicates an expected call of GetServiceAccountIamPolicy. -func (mr *MockClientMockRecorder) GetServiceAccountIamPolicy(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetServiceAccountIamPolicy(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetServiceAccountIamPolicy", reflect.TypeOf((*MockClient)(nil).GetServiceAccountIamPolicy), arg0) } @@ -343,7 +349,7 @@ func (m *MockClient) GetWorkloadIdentityPool(arg0 context.Context, arg1 string) } // GetWorkloadIdentityPool indicates an expected call of GetWorkloadIdentityPool. -func (mr *MockClientMockRecorder) GetWorkloadIdentityPool(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetWorkloadIdentityPool(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkloadIdentityPool", reflect.TypeOf((*MockClient)(nil).GetWorkloadIdentityPool), arg0, arg1) } @@ -358,7 +364,7 @@ func (m *MockClient) GetWorkloadIdentityProvider(arg0 context.Context, arg1 stri } // GetWorkloadIdentityProvider indicates an expected call of GetWorkloadIdentityProvider. -func (mr *MockClientMockRecorder) GetWorkloadIdentityProvider(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetWorkloadIdentityProvider(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkloadIdentityProvider", reflect.TypeOf((*MockClient)(nil).GetWorkloadIdentityProvider), arg0, arg1) } @@ -373,7 +379,7 @@ func (m *MockClient) ListObjects(arg0 context.Context, arg1 string) ([]*storage. } // ListObjects indicates an expected call of ListObjects. -func (mr *MockClientMockRecorder) ListObjects(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListObjects(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListObjects", reflect.TypeOf((*MockClient)(nil).ListObjects), arg0, arg1) } @@ -388,7 +394,7 @@ func (m *MockClient) ListRoles(arg0 context.Context, arg1 *admin.ListRolesReques } // ListRoles indicates an expected call of ListRoles. -func (mr *MockClientMockRecorder) ListRoles(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListRoles(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRoles", reflect.TypeOf((*MockClient)(nil).ListRoles), arg0, arg1) } @@ -403,7 +409,7 @@ func (m *MockClient) ListServiceAccountKeys(arg0 context.Context, arg1 *admin.Li } // ListServiceAccountKeys indicates an expected call of ListServiceAccountKeys. -func (mr *MockClientMockRecorder) ListServiceAccountKeys(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListServiceAccountKeys(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListServiceAccountKeys", reflect.TypeOf((*MockClient)(nil).ListServiceAccountKeys), arg0, arg1) } @@ -418,7 +424,7 @@ func (m *MockClient) ListServiceAccounts(arg0 context.Context, arg1 *admin.ListS } // ListServiceAccounts indicates an expected call of ListServiceAccounts. -func (mr *MockClientMockRecorder) ListServiceAccounts(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListServiceAccounts(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListServiceAccounts", reflect.TypeOf((*MockClient)(nil).ListServiceAccounts), arg0, arg1) } @@ -447,7 +453,7 @@ func (m *MockClient) PutObject(arg0 context.Context, arg1, arg2 string, arg3 []b } // PutObject indicates an expected call of PutObject. -func (mr *MockClientMockRecorder) PutObject(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) PutObject(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutObject", reflect.TypeOf((*MockClient)(nil).PutObject), arg0, arg1, arg2, arg3) } @@ -462,7 +468,7 @@ func (m *MockClient) QueryTestablePermissions(arg0 context.Context, arg1 *admin. } // QueryTestablePermissions indicates an expected call of QueryTestablePermissions. -func (mr *MockClientMockRecorder) QueryTestablePermissions(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) QueryTestablePermissions(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryTestablePermissions", reflect.TypeOf((*MockClient)(nil).QueryTestablePermissions), arg0, arg1) } @@ -476,7 +482,7 @@ func (m *MockClient) SetBucketPolicy(arg0 context.Context, arg1 string, arg2 *ia } // SetBucketPolicy indicates an expected call of SetBucketPolicy. -func (mr *MockClientMockRecorder) SetBucketPolicy(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) SetBucketPolicy(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetBucketPolicy", reflect.TypeOf((*MockClient)(nil).SetBucketPolicy), arg0, arg1, arg2) } @@ -491,7 +497,7 @@ func (m *MockClient) SetProjectIamPolicy(arg0 string, arg1 *cloudresourcemanager } // SetProjectIamPolicy indicates an expected call of SetProjectIamPolicy. -func (mr *MockClientMockRecorder) SetProjectIamPolicy(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) SetProjectIamPolicy(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetProjectIamPolicy", reflect.TypeOf((*MockClient)(nil).SetProjectIamPolicy), arg0, arg1) } @@ -506,7 +512,7 @@ func (m *MockClient) SetServiceAccountIamPolicy(arg0 string, arg1 *iam0.SetIamPo } // SetServiceAccountIamPolicy indicates an expected call of SetServiceAccountIamPolicy. -func (mr *MockClientMockRecorder) SetServiceAccountIamPolicy(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) SetServiceAccountIamPolicy(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetServiceAccountIamPolicy", reflect.TypeOf((*MockClient)(nil).SetServiceAccountIamPolicy), arg0, arg1) } @@ -521,7 +527,7 @@ func (m *MockClient) TestIamPermissions(arg0 string, arg1 *cloudresourcemanager. } // TestIamPermissions indicates an expected call of TestIamPermissions. -func (mr *MockClientMockRecorder) TestIamPermissions(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) TestIamPermissions(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TestIamPermissions", reflect.TypeOf((*MockClient)(nil).TestIamPermissions), arg0, arg1) } @@ -536,7 +542,7 @@ func (m *MockClient) UndeleteRole(arg0 context.Context, arg1 *admin.UndeleteRole } // UndeleteRole indicates an expected call of UndeleteRole. -func (mr *MockClientMockRecorder) UndeleteRole(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) UndeleteRole(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UndeleteRole", reflect.TypeOf((*MockClient)(nil).UndeleteRole), arg0, arg1) } @@ -551,7 +557,7 @@ func (m *MockClient) UndeleteWorkloadIdentityPool(arg0 context.Context, arg1 str } // UndeleteWorkloadIdentityPool indicates an expected call of UndeleteWorkloadIdentityPool. -func (mr *MockClientMockRecorder) UndeleteWorkloadIdentityPool(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) UndeleteWorkloadIdentityPool(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UndeleteWorkloadIdentityPool", reflect.TypeOf((*MockClient)(nil).UndeleteWorkloadIdentityPool), arg0, arg1, arg2) } @@ -566,7 +572,7 @@ func (m *MockClient) UpdateRole(arg0 context.Context, arg1 *admin.UpdateRoleRequ } // UpdateRole indicates an expected call of UpdateRole. -func (mr *MockClientMockRecorder) UpdateRole(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) UpdateRole(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRole", reflect.TypeOf((*MockClient)(nil).UpdateRole), arg0, arg1) } diff --git a/pkg/ibmcloud/mock/client_generated.go b/pkg/ibmcloud/mock/client_generated.go index 96be955fe7..20c02a0edb 100644 --- a/pkg/ibmcloud/mock/client_generated.go +++ b/pkg/ibmcloud/mock/client_generated.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: ./client.go +// +// Generated by this command: +// +// mockgen -source=./client.go -destination=./mock/client_generated.go -package=mock +// // Package mock is a generated GoMock package. package mock @@ -11,13 +16,14 @@ import ( iamidentityv1 "github.com/IBM/platform-services-go-sdk/iamidentityv1" iampolicymanagementv1 "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" resourcemanagerv2 "github.com/IBM/platform-services-go-sdk/resourcemanagerv2" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockClient is a mock of Client interface. type MockClient struct { ctrl *gomock.Controller recorder *MockClientMockRecorder + isgomock struct{} } // MockClientMockRecorder is the mock recorder for MockClient. @@ -48,7 +54,7 @@ func (m *MockClient) CreateAPIKey(arg0 *iamidentityv1.CreateAPIKeyOptions) (*iam } // CreateAPIKey indicates an expected call of CreateAPIKey. -func (mr *MockClientMockRecorder) CreateAPIKey(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateAPIKey(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAPIKey", reflect.TypeOf((*MockClient)(nil).CreateAPIKey), arg0) } @@ -64,7 +70,7 @@ func (m *MockClient) CreatePolicy(arg0 *iampolicymanagementv1.CreatePolicyOption } // CreatePolicy indicates an expected call of CreatePolicy. -func (mr *MockClientMockRecorder) CreatePolicy(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreatePolicy(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePolicy", reflect.TypeOf((*MockClient)(nil).CreatePolicy), arg0) } @@ -80,7 +86,7 @@ func (m *MockClient) CreateServiceID(arg0 *iamidentityv1.CreateServiceIDOptions) } // CreateServiceID indicates an expected call of CreateServiceID. -func (mr *MockClientMockRecorder) CreateServiceID(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) CreateServiceID(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateServiceID", reflect.TypeOf((*MockClient)(nil).CreateServiceID), arg0) } @@ -95,7 +101,7 @@ func (m *MockClient) DeleteAPIKey(arg0 *iamidentityv1.DeleteAPIKeyOptions) (*cor } // DeleteAPIKey indicates an expected call of DeleteAPIKey. -func (mr *MockClientMockRecorder) DeleteAPIKey(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteAPIKey(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAPIKey", reflect.TypeOf((*MockClient)(nil).DeleteAPIKey), arg0) } @@ -110,7 +116,7 @@ func (m *MockClient) DeleteServiceID(arg0 *iamidentityv1.DeleteServiceIDOptions) } // DeleteServiceID indicates an expected call of DeleteServiceID. -func (mr *MockClientMockRecorder) DeleteServiceID(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) DeleteServiceID(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteServiceID", reflect.TypeOf((*MockClient)(nil).DeleteServiceID), arg0) } @@ -126,7 +132,7 @@ func (m *MockClient) GetAPIKeysDetails(arg0 *iamidentityv1.GetAPIKeysDetailsOpti } // GetAPIKeysDetails indicates an expected call of GetAPIKeysDetails. -func (mr *MockClientMockRecorder) GetAPIKeysDetails(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) GetAPIKeysDetails(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAPIKeysDetails", reflect.TypeOf((*MockClient)(nil).GetAPIKeysDetails), arg0) } @@ -142,7 +148,7 @@ func (m *MockClient) ListAPIKeys(arg0 *iamidentityv1.ListAPIKeysOptions) (*iamid } // ListAPIKeys indicates an expected call of ListAPIKeys. -func (mr *MockClientMockRecorder) ListAPIKeys(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListAPIKeys(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAPIKeys", reflect.TypeOf((*MockClient)(nil).ListAPIKeys), arg0) } @@ -158,7 +164,7 @@ func (m *MockClient) ListResourceGroups(arg0 *resourcemanagerv2.ListResourceGrou } // ListResourceGroups indicates an expected call of ListResourceGroups. -func (mr *MockClientMockRecorder) ListResourceGroups(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListResourceGroups(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourceGroups", reflect.TypeOf((*MockClient)(nil).ListResourceGroups), arg0) } @@ -174,7 +180,7 @@ func (m *MockClient) ListServiceID(arg0 *iamidentityv1.ListServiceIdsOptions) (* } // ListServiceID indicates an expected call of ListServiceID. -func (mr *MockClientMockRecorder) ListServiceID(arg0 interface{}) *gomock.Call { +func (mr *MockClientMockRecorder) ListServiceID(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListServiceID", reflect.TypeOf((*MockClient)(nil).ListServiceID), arg0) } diff --git a/pkg/operator/cleanup/cleanup_controller_test.go b/pkg/operator/cleanup/cleanup_controller_test.go index 0838b6cde6..11cfbcf044 100644 --- a/pkg/operator/cleanup/cleanup_controller_test.go +++ b/pkg/operator/cleanup/cleanup_controller_test.go @@ -5,9 +5,9 @@ import ( "fmt" "testing" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/operator/credentialsrequest/credentialsrequest_controller_azure_test.go b/pkg/operator/credentialsrequest/credentialsrequest_controller_azure_test.go index ef98fc1015..c9f22ad781 100644 --- a/pkg/operator/credentialsrequest/credentialsrequest_controller_azure_test.go +++ b/pkg/operator/credentialsrequest/credentialsrequest_controller_azure_test.go @@ -21,10 +21,10 @@ import ( "fmt" "testing" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/microsoftgraph/msgraph-sdk-go/models" diff --git a/pkg/operator/credentialsrequest/credentialsrequest_controller_gcp_test.go b/pkg/operator/credentialsrequest/credentialsrequest_controller_gcp_test.go index 13144157bb..9026a77ddc 100644 --- a/pkg/operator/credentialsrequest/credentialsrequest_controller_gcp_test.go +++ b/pkg/operator/credentialsrequest/credentialsrequest_controller_gcp_test.go @@ -22,10 +22,10 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "google.golang.org/api/cloudresourcemanager/v1" iamadminpb "google.golang.org/genproto/googleapis/iam/admin/v1" diff --git a/pkg/operator/credentialsrequest/credentialsrequest_controller_test.go b/pkg/operator/credentialsrequest/credentialsrequest_controller_test.go index 09953918ea..442597cb79 100644 --- a/pkg/operator/credentialsrequest/credentialsrequest_controller_test.go +++ b/pkg/operator/credentialsrequest/credentialsrequest_controller_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" awssdk "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/iam" diff --git a/pkg/operator/credentialsrequest/credentialsrequest_controller_vsphere_test.go b/pkg/operator/credentialsrequest/credentialsrequest_controller_vsphere_test.go index 6dc919bf02..bad8a8012f 100644 --- a/pkg/operator/credentialsrequest/credentialsrequest_controller_vsphere_test.go +++ b/pkg/operator/credentialsrequest/credentialsrequest_controller_vsphere_test.go @@ -20,10 +20,10 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/operator/credentialsrequest/status_test.go b/pkg/operator/credentialsrequest/status_test.go index 41628ddfb5..59e67881b4 100644 --- a/pkg/operator/credentialsrequest/status_test.go +++ b/pkg/operator/credentialsrequest/status_test.go @@ -19,9 +19,9 @@ package credentialsrequest import ( "testing" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/operator/podidentity/podidentitywebhook_controller_test.go b/pkg/operator/podidentity/podidentitywebhook_controller_test.go index fb1e91b86b..ed2751f52a 100644 --- a/pkg/operator/podidentity/podidentitywebhook_controller_test.go +++ b/pkg/operator/podidentity/podidentitywebhook_controller_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/golang/mock/gomock" + "go.uber.org/mock/gomock" admissionv1 "k8s.io/api/admissionregistration/v1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/operator/secretannotator/aws/reconciler_test.go b/pkg/operator/secretannotator/aws/reconciler_test.go index 09e9fa7525..d5749f7e7e 100644 --- a/pkg/operator/secretannotator/aws/reconciler_test.go +++ b/pkg/operator/secretannotator/aws/reconciler_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/operator/secretannotator/azure/mock/adal_generated.go b/pkg/operator/secretannotator/azure/mock/adal_generated.go index 5339a16d9d..c90a638880 100644 --- a/pkg/operator/secretannotator/azure/mock/adal_generated.go +++ b/pkg/operator/secretannotator/azure/mock/adal_generated.go @@ -8,7 +8,7 @@ import ( reflect "reflect" adal "github.com/Azure/go-autorest/autorest/adal" - gomock "github.com/golang/mock/gomock" + gomock "go.uber.org/mock/gomock" ) // MockAdalService is a mock of AdalService interface. diff --git a/pkg/operator/secretannotator/gcp/reconciler_test.go b/pkg/operator/secretannotator/gcp/reconciler_test.go index 9b594ca457..2d5cf32dcc 100644 --- a/pkg/operator/secretannotator/gcp/reconciler_test.go +++ b/pkg/operator/secretannotator/gcp/reconciler_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/operator/secretannotator/vsphere/reconciler_test.go b/pkg/operator/secretannotator/vsphere/reconciler_test.go index cd0d052488..735290214a 100644 --- a/pkg/operator/secretannotator/vsphere/reconciler_test.go +++ b/pkg/operator/secretannotator/vsphere/reconciler_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/operator/utils/gcp/utils_test.go b/pkg/operator/utils/gcp/utils_test.go index d870df552f..3cc8e350f5 100644 --- a/pkg/operator/utils/gcp/utils_test.go +++ b/pkg/operator/utils/gcp/utils_test.go @@ -21,10 +21,10 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "google.golang.org/api/cloudresourcemanager/v1" @@ -133,7 +133,7 @@ func TestCheckPermissionsAgainstPermissionListChunking(t *testing.T) { testablePerms.lastUpdated = time.Now() testablePerms.permSet = sets.NewString(permissionsList...) - mockCallList := []*gomock.Call{} + mockCallList := []any{} for _, chunk := range test.chunks { permRequest := &cloudresourcemanager.TestIamPermissionsRequest{ diff --git a/vendor/github.com/golang/mock/CONTRIBUTORS b/vendor/github.com/golang/mock/CONTRIBUTORS deleted file mode 100644 index def849cab1..0000000000 --- a/vendor/github.com/golang/mock/CONTRIBUTORS +++ /dev/null @@ -1,37 +0,0 @@ -# This is the official list of people who can contribute (and typically -# have contributed) code to the gomock repository. -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, Google employees are listed here -# but not in AUTHORS, because Google holds the copyright. -# -# The submission process automatically checks to make sure -# that people submitting code are listed in this file (by email address). -# -# Names should be added to this file only after verifying that -# the individual or the individual's organization has agreed to -# the appropriate Contributor License Agreement, found here: -# -# http://code.google.com/legal/individual-cla-v1.0.html -# http://code.google.com/legal/corporate-cla-v1.0.html -# -# The agreement for individuals can be filled out on the web. -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file, depending on whether the -# individual or corporate CLA was used. - -# Names should be added to this file like so: -# Name -# -# An entry with two email addresses specifies that the -# first address should be used in the submit logs and -# that the second address should be recognized as the -# same person when interacting with Rietveld. - -# Please keep the list sorted. - -Aaron Jacobs -Alex Reece -David Symonds -Ryan Barrett diff --git a/vendor/github.com/golang/mock/AUTHORS b/vendor/go.uber.org/mock/AUTHORS similarity index 100% rename from vendor/github.com/golang/mock/AUTHORS rename to vendor/go.uber.org/mock/AUTHORS diff --git a/vendor/github.com/golang/mock/LICENSE b/vendor/go.uber.org/mock/LICENSE similarity index 100% rename from vendor/github.com/golang/mock/LICENSE rename to vendor/go.uber.org/mock/LICENSE diff --git a/vendor/github.com/golang/mock/gomock/call.go b/vendor/go.uber.org/mock/gomock/call.go similarity index 86% rename from vendor/github.com/golang/mock/gomock/call.go rename to vendor/go.uber.org/mock/gomock/call.go index 98881596d1..e1fe222afc 100644 --- a/vendor/github.com/golang/mock/gomock/call.go +++ b/vendor/go.uber.org/mock/gomock/call.go @@ -25,7 +25,7 @@ import ( type Call struct { t TestHelper // for triggering test failures on invalid call setup - receiver interface{} // the receiver of the method call + receiver any // the receiver of the method call method string // the name of the method methodType reflect.Type // the type of the method args []Matcher // the args @@ -41,12 +41,12 @@ type Call struct { // actions are called when this Call is called. Each action gets the args and // can set the return values by returning a non-nil slice. Actions run in the // order they are created. - actions []func([]interface{}) []interface{} + actions []func([]any) []any } // newCall creates a *Call. It requires the method type in order to support // unexported methods. -func newCall(t TestHelper, receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { +func newCall(t TestHelper, receiver any, method string, methodType reflect.Type, args ...any) *Call { t.Helper() // TODO: check arity, types. @@ -67,16 +67,18 @@ func newCall(t TestHelper, receiver interface{}, method string, methodType refle // and this line changes, i.e. this code is wrapped in another anonymous function. // 0 is us, 1 is RecordCallWithMethodType(), 2 is the generated recorder, and 3 is the user's test. origin := callerInfo(3) - actions := []func([]interface{}) []interface{}{func([]interface{}) []interface{} { + actions := []func([]any) []any{func([]any) []any { // Synthesize the zero value for each of the return args' types. - rets := make([]interface{}, methodType.NumOut()) + rets := make([]any, methodType.NumOut()) for i := 0; i < methodType.NumOut(); i++ { rets[i] = reflect.Zero(methodType.Out(i)).Interface() } return rets }} - return &Call{t: t, receiver: receiver, method: method, methodType: methodType, - args: mArgs, origin: origin, minCalls: 1, maxCalls: 1, actions: actions} + return &Call{ + t: t, receiver: receiver, method: method, methodType: methodType, + args: mArgs, origin: origin, minCalls: 1, maxCalls: 1, actions: actions, + } } // AnyTimes allows the expectation to be called 0 or more times @@ -107,13 +109,13 @@ func (c *Call) MaxTimes(n int) *Call { // DoAndReturn declares the action to run when the call is matched. // The return values from this function are returned by the mocked function. -// It takes an interface{} argument to support n-arity functions. +// It takes an any argument to support n-arity functions. // The anonymous function must match the function signature mocked method. -func (c *Call) DoAndReturn(f interface{}) *Call { +func (c *Call) DoAndReturn(f any) *Call { // TODO: Check arity and types here, rather than dying badly elsewhere. v := reflect.ValueOf(f) - c.addAction(func(args []interface{}) []interface{} { + c.addAction(func(args []any) []any { c.t.Helper() ft := v.Type() if c.methodType.NumIn() != ft.NumIn() { @@ -136,7 +138,7 @@ func (c *Call) DoAndReturn(f interface{}) *Call { } } vRets := v.Call(vArgs) - rets := make([]interface{}, len(vRets)) + rets := make([]any, len(vRets)) for i, ret := range vRets { rets[i] = ret.Interface() } @@ -148,13 +150,13 @@ func (c *Call) DoAndReturn(f interface{}) *Call { // Do declares the action to run when the call is matched. The function's // return values are ignored to retain backward compatibility. To use the // return values call DoAndReturn. -// It takes an interface{} argument to support n-arity functions. +// It takes an any argument to support n-arity functions. // The anonymous function must match the function signature mocked method. -func (c *Call) Do(f interface{}) *Call { +func (c *Call) Do(f any) *Call { // TODO: Check arity and types here, rather than dying badly elsewhere. v := reflect.ValueOf(f) - c.addAction(func(args []interface{}) []interface{} { + c.addAction(func(args []any) []any { c.t.Helper() ft := v.Type() if c.methodType.NumIn() != ft.NumIn() { @@ -183,7 +185,7 @@ func (c *Call) Do(f interface{}) *Call { } // Return declares the values to be returned by the mocked function call. -func (c *Call) Return(rets ...interface{}) *Call { +func (c *Call) Return(rets ...any) *Call { c.t.Helper() mt := c.methodType @@ -215,7 +217,7 @@ func (c *Call) Return(rets ...interface{}) *Call { } } - c.addAction(func([]interface{}) []interface{} { + c.addAction(func([]any) []any { return rets }) @@ -231,7 +233,7 @@ func (c *Call) Times(n int) *Call { // SetArg declares an action that will set the nth argument's value, // indirected through a pointer. Or, in the case of a slice and map, SetArg // will copy value's elements/key-value pairs into the nth argument. -func (c *Call) SetArg(n int, value interface{}) *Call { +func (c *Call) SetArg(n int, value any) *Call { c.t.Helper() mt := c.methodType @@ -251,18 +253,14 @@ func (c *Call) SetArg(n int, value interface{}) *Call { c.t.Fatalf("SetArg(%d, ...) argument is a %v, not assignable to %v [%s]", n, vt, dt, c.origin) } - case reflect.Interface: - // nothing to do - case reflect.Slice: - // nothing to do - case reflect.Map: + case reflect.Interface, reflect.Slice, reflect.Map: // nothing to do default: c.t.Fatalf("SetArg(%d, ...) referring to argument of non-pointer non-interface non-slice non-map type %v [%s]", n, at, c.origin) } - c.addAction(func(args []interface{}) []interface{} { + c.addAction(func(args []any) []any { v := reflect.ValueOf(value) switch reflect.TypeOf(args[n]).Kind() { case reflect.Slice: @@ -323,7 +321,7 @@ func (c *Call) String() string { // Tests if the given call matches the expected call. // If yes, returns nil. If no, returns error with message explaining why it does not match. -func (c *Call) matches(args []interface{}) error { +func (c *Call) matches(args []any) error { if !c.methodType.IsVariadic() { if len(args) != len(c.args) { return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d", @@ -429,26 +427,63 @@ func (c *Call) dropPrereqs() (preReqs []*Call) { return } -func (c *Call) call() []func([]interface{}) []interface{} { +func (c *Call) call() []func([]any) []any { c.numCalls++ return c.actions } // InOrder declares that the given calls should occur in order. -func InOrder(calls ...*Call) { +// It panics if the type of any of the arguments isn't *Call or a generated +// mock with an embedded *Call. +func InOrder(args ...any) { + calls := make([]*Call, 0, len(args)) + for i := 0; i < len(args); i++ { + if call := getCall(args[i]); call != nil { + calls = append(calls, call) + continue + } + panic(fmt.Sprintf( + "invalid argument at position %d of type %T, InOrder expects *gomock.Call or generated mock types with an embedded *gomock.Call", + i, + args[i], + )) + } for i := 1; i < len(calls); i++ { calls[i].After(calls[i-1]) } } -func setSlice(arg interface{}, v reflect.Value) { +// getCall checks if the parameter is a *Call or a generated struct +// that wraps a *Call and returns the *Call pointer - if neither, it returns nil. +func getCall(arg any) *Call { + if call, ok := arg.(*Call); ok { + return call + } + t := reflect.ValueOf(arg) + if t.Kind() != reflect.Ptr && t.Kind() != reflect.Interface { + return nil + } + t = t.Elem() + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if !f.CanInterface() { + continue + } + if call, ok := f.Interface().(*Call); ok { + return call + } + } + return nil +} + +func setSlice(arg any, v reflect.Value) { va := reflect.ValueOf(arg) for i := 0; i < v.Len(); i++ { va.Index(i).Set(v.Index(i)) } } -func setMap(arg interface{}, v reflect.Value) { +func setMap(arg any, v reflect.Value) { va := reflect.ValueOf(arg) for _, e := range va.MapKeys() { va.SetMapIndex(e, reflect.Value{}) @@ -458,11 +493,11 @@ func setMap(arg interface{}, v reflect.Value) { } } -func (c *Call) addAction(action func([]interface{}) []interface{}) { +func (c *Call) addAction(action func([]any) []any) { c.actions = append(c.actions, action) } -func formatGottenArg(m Matcher, arg interface{}) string { +func formatGottenArg(m Matcher, arg any) string { got := fmt.Sprintf("%v (%T)", arg, arg) if gs, ok := m.(GotFormatter); ok { got = gs.Got(arg) diff --git a/vendor/github.com/golang/mock/gomock/callset.go b/vendor/go.uber.org/mock/gomock/callset.go similarity index 70% rename from vendor/github.com/golang/mock/gomock/callset.go rename to vendor/go.uber.org/mock/gomock/callset.go index 49dba787a4..f5cc592d6f 100644 --- a/vendor/github.com/golang/mock/gomock/callset.go +++ b/vendor/go.uber.org/mock/gomock/callset.go @@ -18,40 +18,69 @@ import ( "bytes" "errors" "fmt" + "sync" ) // callSet represents a set of expected calls, indexed by receiver and method // name. type callSet struct { // Calls that are still expected. - expected map[callSetKey][]*Call + expected map[callSetKey][]*Call + expectedMu *sync.Mutex // Calls that have been exhausted. exhausted map[callSetKey][]*Call + // when set to true, existing call expectations are overridden when new call expectations are made + allowOverride bool } // callSetKey is the key in the maps in callSet type callSetKey struct { - receiver interface{} + receiver any fname string } func newCallSet() *callSet { - return &callSet{make(map[callSetKey][]*Call), make(map[callSetKey][]*Call)} + return &callSet{ + expected: make(map[callSetKey][]*Call), + expectedMu: &sync.Mutex{}, + exhausted: make(map[callSetKey][]*Call), + } +} + +func newOverridableCallSet() *callSet { + return &callSet{ + expected: make(map[callSetKey][]*Call), + expectedMu: &sync.Mutex{}, + exhausted: make(map[callSetKey][]*Call), + allowOverride: true, + } } // Add adds a new expected call. func (cs callSet) Add(call *Call) { key := callSetKey{call.receiver, call.method} + + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + m := cs.expected if call.exhausted() { m = cs.exhausted } + if cs.allowOverride { + m[key] = make([]*Call, 0) + } + m[key] = append(m[key], call) } // Remove removes an expected call. func (cs callSet) Remove(call *Call) { key := callSetKey{call.receiver, call.method} + + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + calls := cs.expected[key] for i, c := range calls { if c == call { @@ -64,9 +93,12 @@ func (cs callSet) Remove(call *Call) { } // FindMatch searches for a matching call. Returns error with explanation message if no call matched. -func (cs callSet) FindMatch(receiver interface{}, method string, args []interface{}) (*Call, error) { +func (cs callSet) FindMatch(receiver any, method string, args []any) (*Call, error) { key := callSetKey{receiver, method} + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + // Search through the expected calls. expected := cs.expected[key] var callsErrors bytes.Buffer @@ -101,6 +133,9 @@ func (cs callSet) FindMatch(receiver interface{}, method string, args []interfac // Failures returns the calls that are not satisfied. func (cs callSet) Failures() []*Call { + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + failures := make([]*Call, 0, len(cs.expected)) for _, calls := range cs.expected { for _, call := range calls { @@ -111,3 +146,19 @@ func (cs callSet) Failures() []*Call { } return failures } + +// Satisfied returns true in case all expected calls in this callSet are satisfied. +func (cs callSet) Satisfied() bool { + cs.expectedMu.Lock() + defer cs.expectedMu.Unlock() + + for _, calls := range cs.expected { + for _, call := range calls { + if !call.satisfied() { + return false + } + } + } + + return true +} diff --git a/vendor/github.com/golang/mock/gomock/controller.go b/vendor/go.uber.org/mock/gomock/controller.go similarity index 70% rename from vendor/github.com/golang/mock/gomock/controller.go rename to vendor/go.uber.org/mock/gomock/controller.go index 5e2def135b..674c3298c4 100644 --- a/vendor/github.com/golang/mock/gomock/controller.go +++ b/vendor/go.uber.org/mock/gomock/controller.go @@ -25,8 +25,8 @@ import ( // A TestReporter is something that can be used to report test failures. It // is satisfied by the standard library's *testing.T. type TestReporter interface { - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) + Errorf(format string, args ...any) + Fatalf(format string, args ...any) } // TestHelper is a TestReporter that has the Helper method. It is satisfied @@ -48,27 +48,23 @@ type cleanuper interface { // A Controller represents the top-level control of a mock ecosystem. It // defines the scope and lifetime of mock objects, as well as their // expectations. It is safe to call Controller's methods from multiple -// goroutines. Each test should create a new Controller and invoke Finish via -// defer. +// goroutines. Each test should create a new Controller. // -// func TestFoo(t *testing.T) { -// ctrl := gomock.NewController(t) -// defer ctrl.Finish() -// // .. -// } +// func TestFoo(t *testing.T) { +// ctrl := gomock.NewController(t) +// // .. +// } // -// func TestBar(t *testing.T) { -// t.Run("Sub-Test-1", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// t.Run("Sub-Test-2", st) { -// ctrl := gomock.NewController(st) -// defer ctrl.Finish() -// // .. -// }) -// }) +// func TestBar(t *testing.T) { +// t.Run("Sub-Test-1", st) { +// ctrl := gomock.NewController(st) +// // .. +// }) +// t.Run("Sub-Test-2", st) { +// ctrl := gomock.NewController(st) +// // .. +// }) +// }) type Controller struct { // T should only be called within a generated mock. It is not intended to // be used in user code and may be changed in future versions. T is the @@ -81,12 +77,11 @@ type Controller struct { finished bool } -// NewController returns a new Controller. It is the preferred way to create a -// Controller. +// NewController returns a new Controller. It is the preferred way to create a Controller. // -// New in go1.14+, if you are passing a *testing.T into this function you no -// longer need to call ctrl.Finish() in your test methods. -func NewController(t TestReporter) *Controller { +// Passing [*testing.T] registers cleanup function to automatically call [Controller.Finish] +// when the test and all its subtests complete. +func NewController(t TestReporter, opts ...ControllerOption) *Controller { h, ok := t.(TestHelper) if !ok { h = &nopTestHelper{t} @@ -95,6 +90,9 @@ func NewController(t TestReporter) *Controller { T: h, expectedCalls: newCallSet(), } + for _, opt := range opts { + opt.apply(ctrl) + } if c, ok := isCleanuper(ctrl.T); ok { c.Cleanup(func() { ctrl.T.Helper() @@ -105,15 +103,33 @@ func NewController(t TestReporter) *Controller { return ctrl } +// ControllerOption configures how a Controller should behave. +type ControllerOption interface { + apply(*Controller) +} + +type overridableExpectationsOption struct{} + +// WithOverridableExpectations allows for overridable call expectations +// i.e., subsequent call expectations override existing call expectations +func WithOverridableExpectations() overridableExpectationsOption { + return overridableExpectationsOption{} +} + +func (o overridableExpectationsOption) apply(ctrl *Controller) { + ctrl.expectedCalls = newOverridableCallSet() +} + type cancelReporter struct { t TestHelper cancel func() } -func (r *cancelReporter) Errorf(format string, args ...interface{}) { +func (r *cancelReporter) Errorf(format string, args ...any) { r.t.Errorf(format, args...) } -func (r *cancelReporter) Fatalf(format string, args ...interface{}) { + +func (r *cancelReporter) Fatalf(format string, args ...any) { defer r.cancel() r.t.Fatalf(format, args...) } @@ -138,17 +154,18 @@ type nopTestHelper struct { t TestReporter } -func (h *nopTestHelper) Errorf(format string, args ...interface{}) { +func (h *nopTestHelper) Errorf(format string, args ...any) { h.t.Errorf(format, args...) } -func (h *nopTestHelper) Fatalf(format string, args ...interface{}) { + +func (h *nopTestHelper) Fatalf(format string, args ...any) { h.t.Fatalf(format, args...) } func (h nopTestHelper) Helper() {} // RecordCall is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ...interface{}) *Call { +func (ctrl *Controller) RecordCall(receiver any, method string, args ...any) *Call { ctrl.T.Helper() recv := reflect.ValueOf(receiver) @@ -162,7 +179,7 @@ func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ... } // RecordCallWithMethodType is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { +func (ctrl *Controller) RecordCallWithMethodType(receiver any, method string, methodType reflect.Type, args ...any) *Call { ctrl.T.Helper() call := newCall(ctrl.T, receiver, method, methodType, args...) @@ -175,11 +192,11 @@ func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method st } // Call is called by a mock. It should not be called by user code. -func (ctrl *Controller) Call(receiver interface{}, method string, args ...interface{}) []interface{} { +func (ctrl *Controller) Call(receiver any, method string, args ...any) []any { ctrl.T.Helper() // Nest this code so we can use defer to make sure the lock is released. - actions := func() []func([]interface{}) []interface{} { + actions := func() []func([]any) []any { ctrl.T.Helper() ctrl.mu.Lock() defer ctrl.mu.Unlock() @@ -190,12 +207,16 @@ func (ctrl *Controller) Call(receiver interface{}, method string, args ...interf // and this line changes, i.e. this code is wrapped in another anonymous function. // 0 is us, 1 is controller.Call(), 2 is the generated mock, and 3 is the user's test. origin := callerInfo(3) - ctrl.T.Fatalf("Unexpected call to %T.%v(%v) at %s because: %s", receiver, method, args, origin, err) + stringArgs := make([]string, len(args)) + for i, arg := range args { + stringArgs[i] = getString(arg) + } + ctrl.T.Fatalf("Unexpected call to %T.%v(%v) at %s because: %s", receiver, method, stringArgs, origin, err) } // Two things happen here: - // * the matching call no longer needs to check prerequite calls, - // * and the prerequite calls are no longer expected, so remove them. + // * the matching call no longer needs to check prerequisite calls, + // * and the prerequisite calls are no longer expected, so remove them. preReqCalls := expected.dropPrereqs() for _, preReqCall := range preReqCalls { ctrl.expectedCalls.Remove(preReqCall) @@ -208,7 +229,7 @@ func (ctrl *Controller) Call(receiver interface{}, method string, args ...interf return actions }() - var rets []interface{} + var rets []any for _, action := range actions { if r := action(args); r != nil { rets = r @@ -218,12 +239,11 @@ func (ctrl *Controller) Call(receiver interface{}, method string, args ...interf return rets } -// Finish checks to see if all the methods that were expected to be called -// were called. It should be invoked for each Controller. It is not idempotent -// and therefore can only be invoked once. +// Finish checks to see if all the methods that were expected to be called were called. +// It is not idempotent and therefore can only be invoked once. // -// New in go1.14+, if you are passing a *testing.T into NewController function you no -// longer need to call ctrl.Finish() in your test methods. +// Note: If you pass a *testing.T into [NewController], you no longer +// need to call ctrl.Finish() in your test methods. func (ctrl *Controller) Finish() { // If we're currently panicking, probably because this is a deferred call. // This must be recovered in the deferred function. @@ -231,7 +251,15 @@ func (ctrl *Controller) Finish() { ctrl.finish(false, err) } -func (ctrl *Controller) finish(cleanup bool, panicErr interface{}) { +// Satisfied returns whether all expected calls bound to this Controller have been satisfied. +// Calling Finish is then guaranteed to not fail due to missing calls. +func (ctrl *Controller) Satisfied() bool { + ctrl.mu.Lock() + defer ctrl.mu.Unlock() + return ctrl.expectedCalls.Satisfied() +} + +func (ctrl *Controller) finish(cleanup bool, panicErr any) { ctrl.T.Helper() ctrl.mu.Lock() diff --git a/vendor/github.com/golang/mock/gomock/doc.go b/vendor/go.uber.org/mock/gomock/doc.go similarity index 63% rename from vendor/github.com/golang/mock/gomock/doc.go rename to vendor/go.uber.org/mock/gomock/doc.go index 1706b50485..696dda3882 100644 --- a/vendor/github.com/golang/mock/gomock/doc.go +++ b/vendor/go.uber.org/mock/gomock/doc.go @@ -15,18 +15,19 @@ // Package gomock is a mock framework for Go. // // Standard usage: -// (1) Define an interface that you wish to mock. -// type MyInterface interface { -// SomeMethod(x int64, y string) -// } -// (2) Use mockgen to generate a mock from the interface. -// (3) Use the mock in a test: -// func TestMyThing(t *testing.T) { -// mockCtrl := gomock.NewController(t)// -// mockObj := something.NewMockMyInterface(mockCtrl) -// mockObj.EXPECT().SomeMethod(4, "blah") -// // pass mockObj to a real object and play with it. -// } +// +// (1) Define an interface that you wish to mock. +// type MyInterface interface { +// SomeMethod(x int64, y string) +// } +// (2) Use mockgen to generate a mock from the interface. +// (3) Use the mock in a test: +// func TestMyThing(t *testing.T) { +// mockCtrl := gomock.NewController(t) +// mockObj := something.NewMockMyInterface(mockCtrl) +// mockObj.EXPECT().SomeMethod(4, "blah") +// // pass mockObj to a real object and play with it. +// } // // By default, expected calls are not enforced to run in any particular order. // Call order dependency can be enforced by use of InOrder and/or Call.After. @@ -37,17 +38,17 @@ // // Example of using Call.After to chain expected call order: // -// firstCall := mockObj.EXPECT().SomeMethod(1, "first") -// secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall) -// mockObj.EXPECT().SomeMethod(3, "third").After(secondCall) +// firstCall := mockObj.EXPECT().SomeMethod(1, "first") +// secondCall := mockObj.EXPECT().SomeMethod(2, "second").After(firstCall) +// mockObj.EXPECT().SomeMethod(3, "third").After(secondCall) // // Example of using InOrder to declare expected call order: // -// gomock.InOrder( -// mockObj.EXPECT().SomeMethod(1, "first"), -// mockObj.EXPECT().SomeMethod(2, "second"), -// mockObj.EXPECT().SomeMethod(3, "third"), -// ) +// gomock.InOrder( +// mockObj.EXPECT().SomeMethod(1, "first"), +// mockObj.EXPECT().SomeMethod(2, "second"), +// mockObj.EXPECT().SomeMethod(3, "third"), +// ) // // The standard TestReporter most users will pass to `NewController` is a // `*testing.T` from the context of the test. Note that this will use the diff --git a/vendor/github.com/golang/mock/gomock/matchers.go b/vendor/go.uber.org/mock/gomock/matchers.go similarity index 62% rename from vendor/github.com/golang/mock/gomock/matchers.go rename to vendor/go.uber.org/mock/gomock/matchers.go index 2822fb2c8c..d52495f39e 100644 --- a/vendor/github.com/golang/mock/gomock/matchers.go +++ b/vendor/go.uber.org/mock/gomock/matchers.go @@ -17,6 +17,7 @@ package gomock import ( "fmt" "reflect" + "regexp" "strings" ) @@ -24,7 +25,7 @@ import ( // It is used to represent the valid or expected arguments to a mocked method. type Matcher interface { // Matches returns whether x is a match. - Matches(x interface{}) bool + Matches(x any) bool // String describes what the matcher matches. String() string @@ -35,7 +36,7 @@ type Matcher interface { // printing . func WantFormatter(s fmt.Stringer, m Matcher) Matcher { type matcher interface { - Matches(x interface{}) bool + Matches(x any) bool } return struct { @@ -63,16 +64,16 @@ func (f StringerFunc) String() string { type GotFormatter interface { // Got is invoked with the received value. The result is used when // printing the failure message. - Got(got interface{}) string + Got(got any) string } // GotFormatterFunc type is an adapter to allow the use of ordinary // functions as a GotFormatter. If f is a function with the appropriate // signature, GotFormatterFunc(f) is a GotFormatter that calls f. -type GotFormatterFunc func(got interface{}) string +type GotFormatterFunc func(got any) string // Got implements GotFormatter. -func (f GotFormatterFunc) Got(got interface{}) string { +func (f GotFormatterFunc) Got(got any) string { return f(got) } @@ -89,7 +90,7 @@ func GotFormatterAdapter(s GotFormatter, m Matcher) Matcher { type anyMatcher struct{} -func (anyMatcher) Matches(interface{}) bool { +func (anyMatcher) Matches(any) bool { return true } @@ -97,11 +98,27 @@ func (anyMatcher) String() string { return "is anything" } +type condMatcher[T any] struct { + fn func(x T) bool +} + +func (c condMatcher[T]) Matches(x any) bool { + typed, ok := x.(T) + if !ok { + return false + } + return c.fn(typed) +} + +func (c condMatcher[T]) String() string { + return "adheres to a custom condition" +} + type eqMatcher struct { - x interface{} + x any } -func (e eqMatcher) Matches(x interface{}) bool { +func (e eqMatcher) Matches(x any) bool { // In case, some value is nil if e.x == nil || x == nil { return reflect.DeepEqual(e.x, x) @@ -120,12 +137,12 @@ func (e eqMatcher) Matches(x interface{}) bool { } func (e eqMatcher) String() string { - return fmt.Sprintf("is equal to %v (%T)", e.x, e.x) + return fmt.Sprintf("is equal to %s (%T)", getString(e.x), e.x) } type nilMatcher struct{} -func (nilMatcher) Matches(x interface{}) bool { +func (nilMatcher) Matches(x any) bool { if x == nil { return true } @@ -148,7 +165,7 @@ type notMatcher struct { m Matcher } -func (n notMatcher) Matches(x interface{}) bool { +func (n notMatcher) Matches(x any) bool { return !n.m.Matches(x) } @@ -156,11 +173,30 @@ func (n notMatcher) String() string { return "not(" + n.m.String() + ")" } +type regexMatcher struct { + regex *regexp.Regexp +} + +func (m regexMatcher) Matches(x any) bool { + switch t := x.(type) { + case string: + return m.regex.MatchString(t) + case []byte: + return m.regex.Match(t) + default: + return false + } +} + +func (m regexMatcher) String() string { + return "matches regex " + m.regex.String() +} + type assignableToTypeOfMatcher struct { targetType reflect.Type } -func (m assignableToTypeOfMatcher) Matches(x interface{}) bool { +func (m assignableToTypeOfMatcher) Matches(x any) bool { return reflect.TypeOf(x).AssignableTo(m.targetType) } @@ -168,11 +204,32 @@ func (m assignableToTypeOfMatcher) String() string { return "is assignable to " + m.targetType.Name() } +type anyOfMatcher struct { + matchers []Matcher +} + +func (am anyOfMatcher) Matches(x any) bool { + for _, m := range am.matchers { + if m.Matches(x) { + return true + } + } + return false +} + +func (am anyOfMatcher) String() string { + ss := make([]string, 0, len(am.matchers)) + for _, matcher := range am.matchers { + ss = append(ss, matcher.String()) + } + return strings.Join(ss, " | ") +} + type allMatcher struct { matchers []Matcher } -func (am allMatcher) Matches(x interface{}) bool { +func (am allMatcher) Matches(x any) bool { for _, m := range am.matchers { if !m.Matches(x) { return false @@ -193,7 +250,7 @@ type lenMatcher struct { i int } -func (m lenMatcher) Matches(x interface{}) bool { +func (m lenMatcher) Matches(x any) bool { v := reflect.ValueOf(x) switch v.Kind() { case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String: @@ -208,10 +265,10 @@ func (m lenMatcher) String() string { } type inAnyOrderMatcher struct { - x interface{} + x any } -func (m inAnyOrderMatcher) Matches(x interface{}) bool { +func (m inAnyOrderMatcher) Matches(x any) bool { given, ok := m.prepareValue(x) if !ok { return false @@ -257,7 +314,7 @@ func (m inAnyOrderMatcher) Matches(x interface{}) bool { return extraInGiven == 0 && missingFromWanted == 0 } -func (m inAnyOrderMatcher) prepareValue(x interface{}) (reflect.Value, bool) { +func (m inAnyOrderMatcher) prepareValue(x any) (reflect.Value, bool) { xValue := reflect.ValueOf(x) switch xValue.Kind() { case reflect.Slice, reflect.Array: @@ -280,12 +337,45 @@ func All(ms ...Matcher) Matcher { return allMatcher{ms} } // Any returns a matcher that always matches. func Any() Matcher { return anyMatcher{} } +// Cond returns a matcher that matches when the given function returns true +// after passing it the parameter to the mock function. +// This is particularly useful in case you want to match over a field of a custom struct, or dynamic logic. +// +// Example usage: +// +// Cond(func(x int){return x == 1}).Matches(1) // returns true +// Cond(func(x int){return x == 2}).Matches(1) // returns false +func Cond[T any](fn func(x T) bool) Matcher { return condMatcher[T]{fn} } + +// AnyOf returns a composite Matcher that returns true if at least one of the +// matchers returns true. +// +// Example usage: +// +// AnyOf(1, 2, 3).Matches(2) // returns true +// AnyOf(1, 2, 3).Matches(10) // returns false +// AnyOf(Nil(), Len(2)).Matches(nil) // returns true +// AnyOf(Nil(), Len(2)).Matches("hi") // returns true +// AnyOf(Nil(), Len(2)).Matches("hello") // returns false +func AnyOf(xs ...any) Matcher { + ms := make([]Matcher, 0, len(xs)) + for _, x := range xs { + if m, ok := x.(Matcher); ok { + ms = append(ms, m) + } else { + ms = append(ms, Eq(x)) + } + } + return anyOfMatcher{ms} +} + // Eq returns a matcher that matches on equality. // // Example usage: -// Eq(5).Matches(5) // returns true -// Eq(5).Matches(4) // returns false -func Eq(x interface{}) Matcher { return eqMatcher{x} } +// +// Eq(5).Matches(5) // returns true +// Eq(5).Matches(4) // returns false +func Eq(x any) Matcher { return eqMatcher{x} } // Len returns a matcher that matches on length. This matcher returns false if // is compared to a type that is not an array, chan, map, slice, or string. @@ -296,35 +386,50 @@ func Len(i int) Matcher { // Nil returns a matcher that matches if the received value is nil. // // Example usage: -// var x *bytes.Buffer -// Nil().Matches(x) // returns true -// x = &bytes.Buffer{} -// Nil().Matches(x) // returns false +// +// var x *bytes.Buffer +// Nil().Matches(x) // returns true +// x = &bytes.Buffer{} +// Nil().Matches(x) // returns false func Nil() Matcher { return nilMatcher{} } // Not reverses the results of its given child matcher. // // Example usage: -// Not(Eq(5)).Matches(4) // returns true -// Not(Eq(5)).Matches(5) // returns false -func Not(x interface{}) Matcher { +// +// Not(Eq(5)).Matches(4) // returns true +// Not(Eq(5)).Matches(5) // returns false +func Not(x any) Matcher { if m, ok := x.(Matcher); ok { return notMatcher{m} } return notMatcher{Eq(x)} } +// Regex checks whether parameter matches the associated regex. +// +// Example usage: +// +// Regex("[0-9]{2}:[0-9]{2}").Matches("23:02") // returns true +// Regex("[0-9]{2}:[0-9]{2}").Matches([]byte{'2', '3', ':', '0', '2'}) // returns true +// Regex("[0-9]{2}:[0-9]{2}").Matches("hello world") // returns false +// Regex("[0-9]{2}").Matches(21) // returns false as it's not a valid type +func Regex(regexStr string) Matcher { + return regexMatcher{regex: regexp.MustCompile(regexStr)} +} + // AssignableToTypeOf is a Matcher that matches if the parameter to the mock // function is assignable to the type of the parameter to this function. // // Example usage: -// var s fmt.Stringer = &bytes.Buffer{} -// AssignableToTypeOf(s).Matches(time.Second) // returns true -// AssignableToTypeOf(s).Matches(99) // returns false // -// var ctx = reflect.TypeOf((*context.Context)(nil)).Elem() -// AssignableToTypeOf(ctx).Matches(context.Background()) // returns true -func AssignableToTypeOf(x interface{}) Matcher { +// var s fmt.Stringer = &bytes.Buffer{} +// AssignableToTypeOf(s).Matches(time.Second) // returns true +// AssignableToTypeOf(s).Matches(99) // returns false +// +// var ctx = reflect.TypeOf((*context.Context)(nil)).Elem() +// AssignableToTypeOf(ctx).Matches(context.Background()) // returns true +func AssignableToTypeOf(x any) Matcher { if xt, ok := x.(reflect.Type); ok { return assignableToTypeOfMatcher{xt} } @@ -334,8 +439,9 @@ func AssignableToTypeOf(x interface{}) Matcher { // InAnyOrder is a Matcher that returns true for collections of the same elements ignoring the order. // // Example usage: -// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 3, 2}) // returns true -// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 2}) // returns false -func InAnyOrder(x interface{}) Matcher { +// +// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 3, 2}) // returns true +// InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 2}) // returns false +func InAnyOrder(x any) Matcher { return inAnyOrderMatcher{x} } diff --git a/vendor/go.uber.org/mock/gomock/string.go b/vendor/go.uber.org/mock/gomock/string.go new file mode 100644 index 0000000000..ec4ca7e4d3 --- /dev/null +++ b/vendor/go.uber.org/mock/gomock/string.go @@ -0,0 +1,36 @@ +package gomock + +import ( + "fmt" + "reflect" +) + +// getString is a safe way to convert a value to a string for printing results +// If the value is a a mock, getString avoids calling the mocked String() method, +// which avoids potential deadlocks +func getString(x any) string { + if isGeneratedMock(x) { + return fmt.Sprintf("%T", x) + } + if s, ok := x.(fmt.Stringer); ok { + return s.String() + } + return fmt.Sprintf("%v", x) +} + +// isGeneratedMock checks if the given type has a "isgomock" field, +// indicating it is a generated mock. +func isGeneratedMock(x any) bool { + typ := reflect.TypeOf(x) + if typ == nil { + return false + } + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + if typ.Kind() != reflect.Struct { + return false + } + _, isgomock := typ.FieldByName("isgomock") + return isgomock +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 6df0486355..c04107f672 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -532,9 +532,6 @@ github.com/golang-jwt/jwt/v5 github.com/golang/glog github.com/golang/glog/internal/logsink github.com/golang/glog/internal/stackdump -# github.com/golang/mock v1.7.0-rc.1 -## explicit; go 1.15 -github.com/golang/mock/gomock # github.com/google/btree v1.1.3 ## explicit; go 1.18 github.com/google/btree @@ -1155,6 +1152,9 @@ go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded go.opentelemetry.io/otel/trace/internal/telemetry go.opentelemetry.io/otel/trace/noop +# go.uber.org/mock v0.6.0 +## explicit; go 1.23.0 +go.uber.org/mock/gomock # go.yaml.in/yaml/v2 v2.4.3 ## explicit; go 1.15 go.yaml.in/yaml/v2