diff --git a/pkg/util/azureclient/azuresdk/armcosmos/generate.go b/pkg/util/azureclient/azuresdk/armcosmos/generate.go new file mode 100644 index 00000000000..1c56a485c21 --- /dev/null +++ b/pkg/util/azureclient/azuresdk/armcosmos/generate.go @@ -0,0 +1,8 @@ +package armcosmos + +// Copyright (c) Microsoft Corporation. +// Licensed under the Apache License 2.0. + +//go:generate rm -rf ../../../../../pkg/util/mocks/azureclient/azuresdk/$GOPACKAGE +//go:generate mockgen -destination=../../../mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/$GOPACKAGE DatabaseAccountsClient +//go:generate goimports -local=github.com/Azure/ARO-RP -e -w ../../../mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go diff --git a/pkg/util/azureclient/azuresdk/armnetwork/generate.go b/pkg/util/azureclient/azuresdk/armnetwork/generate.go index 186b52a70a6..48215a47500 100644 --- a/pkg/util/azureclient/azuresdk/armnetwork/generate.go +++ b/pkg/util/azureclient/azuresdk/armnetwork/generate.go @@ -4,5 +4,5 @@ package armnetwork // Licensed under the Apache License 2.0. //go:generate rm -rf ../../../../util/mocks/$GOPACKAGE -//go:generate mockgen -destination=../../../../util/mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/$GOPACKAGE InterfacesClient,LoadBalancersClient,LoadBalancerBackendAddressPoolsClient,PrivateEndpointsClient,PrivateLinkServicesClient,PublicIPAddressesClient,SecurityGroupsClient +//go:generate mockgen -destination=../../../../util/mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/$GOPACKAGE InterfacesClient,LoadBalancersClient,LoadBalancerBackendAddressPoolsClient,PrivateEndpointsClient,PrivateLinkServicesClient,PublicIPAddressesClient,SecurityGroupsClient,SubnetsClient //go:generate goimports -local=github.com/Azure/ARO-RP -e -w ../../../../util/mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go diff --git a/pkg/util/mocks/azureclient/azuresdk/armcosmos/databaseaccounts.go b/pkg/util/mocks/azureclient/azuresdk/armcosmos/armcosmos.go similarity index 68% rename from pkg/util/mocks/azureclient/azuresdk/armcosmos/databaseaccounts.go rename to pkg/util/mocks/azureclient/azuresdk/armcosmos/armcosmos.go index 98012ef2b19..8cf025a5a8e 100644 --- a/pkg/util/mocks/azureclient/azuresdk/armcosmos/databaseaccounts.go +++ b/pkg/util/mocks/azureclient/azuresdk/armcosmos/armcosmos.go @@ -1,5 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: pkg/util/azureclient/azuresdk/armcosmos/databaseaccounts.go +// Source: github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/armcosmos (interfaces: DatabaseAccountsClient) +// +// Generated by this command: +// +// mockgen -destination=../../../mocks/azureclient/azuresdk/armcosmos/armcosmos.go github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/armcosmos DatabaseAccountsClient +// // Package mock_armcosmos is a generated GoMock package. package mock_armcosmos @@ -36,16 +41,16 @@ func (m *MockDatabaseAccountsClient) EXPECT() *MockDatabaseAccountsClientMockRec } // ListKeys mocks base method. -func (m *MockDatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroupName, accountName string, options *armcosmos.DatabaseAccountsClientListKeysOptions) (armcosmos.DatabaseAccountsClientListKeysResponse, error) { +func (m *MockDatabaseAccountsClient) ListKeys(arg0 context.Context, arg1, arg2 string, arg3 *armcosmos.DatabaseAccountsClientListKeysOptions) (armcosmos.DatabaseAccountsClientListKeysResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListKeys", ctx, resourceGroupName, accountName, options) + ret := m.ctrl.Call(m, "ListKeys", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(armcosmos.DatabaseAccountsClientListKeysResponse) ret1, _ := ret[1].(error) return ret0, ret1 } // ListKeys indicates an expected call of ListKeys. -func (mr *MockDatabaseAccountsClientMockRecorder) ListKeys(ctx, resourceGroupName, accountName, options interface{}) *gomock.Call { +func (mr *MockDatabaseAccountsClientMockRecorder) ListKeys(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListKeys", reflect.TypeOf((*MockDatabaseAccountsClient)(nil).ListKeys), ctx, resourceGroupName, accountName, options) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListKeys", reflect.TypeOf((*MockDatabaseAccountsClient)(nil).ListKeys), arg0, arg1, arg2, arg3) } diff --git a/pkg/util/mocks/azureclient/azuresdk/armnetwork/armnetwork.go b/pkg/util/mocks/azureclient/azuresdk/armnetwork/armnetwork.go index 19c6bda8a36..9ab17f4a9fa 100644 --- a/pkg/util/mocks/azureclient/azuresdk/armnetwork/armnetwork.go +++ b/pkg/util/mocks/azureclient/azuresdk/armnetwork/armnetwork.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/armnetwork (interfaces: InterfacesClient,LoadBalancersClient,LoadBalancerBackendAddressPoolsClient,PrivateEndpointsClient,PrivateLinkServicesClient,PublicIPAddressesClient,SecurityGroupsClient) +// Source: github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/armnetwork (interfaces: InterfacesClient,LoadBalancersClient,LoadBalancerBackendAddressPoolsClient,PrivateEndpointsClient,PrivateLinkServicesClient,PublicIPAddressesClient,SecurityGroupsClient,SubnetsClient) // // Generated by this command: // -// mockgen -destination=../../../../util/mocks/azureclient/azuresdk/armnetwork/armnetwork.go github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/armnetwork InterfacesClient,LoadBalancersClient,LoadBalancerBackendAddressPoolsClient,PrivateEndpointsClient,PrivateLinkServicesClient,PublicIPAddressesClient,SecurityGroupsClient +// mockgen -destination=../../../../util/mocks/azureclient/azuresdk/armnetwork/armnetwork.go github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/armnetwork InterfacesClient,LoadBalancersClient,LoadBalancerBackendAddressPoolsClient,PrivateEndpointsClient,PrivateLinkServicesClient,PublicIPAddressesClient,SecurityGroupsClient,SubnetsClient // // Package mock_armnetwork is a generated GoMock package. @@ -482,3 +482,41 @@ func (mr *MockSecurityGroupsClientMockRecorder) List(arg0, arg1, arg2 any) *gomo mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockSecurityGroupsClient)(nil).List), arg0, arg1, arg2) } + +// MockSubnetsClient is a mock of SubnetsClient interface. +type MockSubnetsClient struct { + ctrl *gomock.Controller + recorder *MockSubnetsClientMockRecorder +} + +// MockSubnetsClientMockRecorder is the mock recorder for MockSubnetsClient. +type MockSubnetsClientMockRecorder struct { + mock *MockSubnetsClient +} + +// NewMockSubnetsClient creates a new mock instance. +func NewMockSubnetsClient(ctrl *gomock.Controller) *MockSubnetsClient { + mock := &MockSubnetsClient{ctrl: ctrl} + mock.recorder = &MockSubnetsClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSubnetsClient) EXPECT() *MockSubnetsClientMockRecorder { + return m.recorder +} + +// Get mocks base method. +func (m *MockSubnetsClient) Get(arg0 context.Context, arg1, arg2, arg3 string, arg4 *armnetwork.SubnetsClientGetOptions) (armnetwork.SubnetsClientGetResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2, arg3, arg4) + ret0, _ := ret[0].(armnetwork.SubnetsClientGetResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Get indicates an expected call of Get. +func (mr *MockSubnetsClientMockRecorder) Get(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockSubnetsClient)(nil).Get), arg0, arg1, arg2, arg3, arg4) +} diff --git a/pkg/util/mocks/azureclient/azuresdk/armnetwork/subnets.go b/pkg/util/mocks/azureclient/azuresdk/armnetwork/subnets.go deleted file mode 100644 index 2a8dfccbf88..00000000000 --- a/pkg/util/mocks/azureclient/azuresdk/armnetwork/subnets.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: pkg/util/azureclient/azuresdk/armnetwork/subnets.go - -// Package mock_armnetwork is a generated GoMock package. -package mock_armnetwork - -import ( - context "context" - reflect "reflect" - - armnetwork "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2" - gomock "go.uber.org/mock/gomock" -) - -// MockSubnetsClient is a mock of SubnetsClient interface. -type MockSubnetsClient struct { - ctrl *gomock.Controller - recorder *MockSubnetsClientMockRecorder -} - -// MockSubnetsClientMockRecorder is the mock recorder for MockSubnetsClient. -type MockSubnetsClientMockRecorder struct { - mock *MockSubnetsClient -} - -// NewMockSubnetsClient creates a new mock instance. -func NewMockSubnetsClient(ctrl *gomock.Controller) *MockSubnetsClient { - mock := &MockSubnetsClient{ctrl: ctrl} - mock.recorder = &MockSubnetsClientMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockSubnetsClient) EXPECT() *MockSubnetsClientMockRecorder { - return m.recorder -} - -// Get mocks base method. -func (m *MockSubnetsClient) Get(ctx context.Context, resourceGroupName, virtualNetworkName, subnetName string, options *armnetwork.SubnetsClientGetOptions) (armnetwork.SubnetsClientGetResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", ctx, resourceGroupName, virtualNetworkName, subnetName, options) - ret0, _ := ret[0].(armnetwork.SubnetsClientGetResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Get indicates an expected call of Get. -func (mr *MockSubnetsClientMockRecorder) Get(ctx, resourceGroupName, virtualNetworkName, subnetName, options interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockSubnetsClient)(nil).Get), ctx, resourceGroupName, virtualNetworkName, subnetName, options) -}