From 2f0311394506c6cc594e52c141c346b3abb4d116 Mon Sep 17 00:00:00 2001 From: Nick Beenham <1985327+superbeeny@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:47:57 -0400 Subject: [PATCH] fixes #7592 - adding typed to mockgen (#7647) # Description Fixes issue #7592 - adding types to generated mocks ## Type of change - This pull request fixes a bug in Radius and has an approved issue #7592 . Fixes: #7592 --------- Signed-off-by: Nick Beenham <1985327+superbeeny@users.noreply.github.com> Co-authored-by: Karishma Chawla --- .../statusmanager/mock_statusmanager.go | 114 +++- .../statusmanager/statusmanager.go | 2 +- pkg/cli/aws/client.go | 2 +- pkg/cli/aws/client_mock.go | 58 +- pkg/cli/azure/client.go | 2 +- pkg/cli/azure/client_mock.go | 142 +++- pkg/cli/bicep/mock_bicep.go | 30 +- pkg/cli/bicep/types.go | 2 +- pkg/cli/clients/clients.go | 4 +- pkg/cli/clients/mock_applicationsclient.go | 646 ++++++++++++++++-- pkg/cli/clients/mock_diagnosticsclient.go | 86 ++- pkg/cli/cmd/env/namespace/mock_namespace.go | 30 +- pkg/cli/cmd/env/namespace/namespace.go | 2 +- pkg/cli/cmd/radinit/mock_devrecipeclient.go | 30 +- pkg/cli/cmd/radinit/recipe.go | 2 +- .../credential/aws_credential_management.go | 2 +- .../credential/azure_credential_management.go | 2 +- pkg/cli/credential/credential_management.go | 2 +- .../mock_aws_credential_management.go | 114 +++- .../mock_azure_credential_management.go | 114 +++- .../mock_credentialmanagementclient.go | 142 +++- pkg/cli/deploy/mock_deploy.go | 30 +- pkg/cli/deploy/types.go | 2 +- pkg/cli/framework/config.go | 2 +- pkg/cli/framework/mock_config.go | 114 +++- pkg/cli/helm/cluster.go | 2 +- pkg/cli/helm/mock_cluster.go | 86 ++- pkg/cli/kubernetes/kubernetes.go | 2 +- .../kubernetes/logstream/mock_logstream.go | 30 +- pkg/cli/kubernetes/logstream/types.go | 2 +- pkg/cli/kubernetes/mock_kubernetes.go | 30 +- .../portforward/mock_portforward.go | 30 +- pkg/cli/kubernetes/portforward/types.go | 2 +- pkg/cli/prompt/mock_prompter.go | 86 ++- pkg/cli/prompt/prompt.go | 2 +- .../backend/deployment/deploymentprocessor.go | 2 +- .../deployment/mock_deploymentprocessor.go | 114 +++- pkg/corerp/handlers/mock_resource_handler.go | 58 +- pkg/corerp/handlers/resource_handler.go | 2 +- pkg/corerp/renderers/mock_renderer.go | 58 +- pkg/corerp/renderers/types.go | 2 +- .../processors/mock_resourceclient.go | 30 +- pkg/portableresources/processors/types.go | 2 +- pkg/recipes/configloader/environment.go | 2 +- .../configloader/mock_config_loader.go | 58 +- .../configloader/mock_secret_loader.go | 30 +- pkg/recipes/configloader/types.go | 2 +- pkg/recipes/driver/mock_driver.go | 86 ++- .../driver/mock_driver_with_secrets.go | 114 +++- pkg/recipes/driver/types.go | 4 +- pkg/recipes/engine/mock_engine.go | 86 ++- pkg/recipes/engine/types.go | 2 +- .../terraform/config/backends/mock_backend.go | 58 +- .../terraform/config/backends/types.go | 2 +- .../config/providers/mock_provider.go | 30 +- .../terraform/config/providers/types.go | 2 +- pkg/recipes/terraform/mock_executor.go | 86 ++- pkg/recipes/terraform/types.go | 2 +- pkg/ucp/aws/cloudcontrolclient.go | 2 +- pkg/ucp/aws/cloudformationclient.go | 2 +- pkg/ucp/aws/mock_awscloudcontrolclient.go | 226 +++++- pkg/ucp/aws/mock_awscloudformationclient.go | 30 +- .../dataprovider/mock_datastorage_provider.go | 30 +- pkg/ucp/dataprovider/types.go | 2 +- pkg/ucp/queue/client/client.go | 2 +- pkg/ucp/queue/client/client_test.go | 2 +- pkg/ucp/queue/client/mock_client.go | 114 +++- pkg/ucp/secret/client.go | 2 +- pkg/ucp/secret/mock_client.go | 86 ++- pkg/ucp/store/client.go | 2 +- pkg/ucp/store/mock_storageClient.go | 114 +++- 71 files changed, 3089 insertions(+), 305 deletions(-) diff --git a/pkg/armrpc/asyncoperation/statusmanager/mock_statusmanager.go b/pkg/armrpc/asyncoperation/statusmanager/mock_statusmanager.go index be84b317a79..3b15f2da0d3 100644 --- a/pkg/armrpc/asyncoperation/statusmanager/mock_statusmanager.go +++ b/pkg/armrpc/asyncoperation/statusmanager/mock_statusmanager.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_statusmanager.go -package=statusmanager -self_package github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager StatusManager +// mockgen -typed -destination=./mock_statusmanager.go -package=statusmanager -self_package github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager StatusManager // // Package statusmanager is a generated GoMock package. @@ -52,9 +52,33 @@ func (m *MockStatusManager) Delete(arg0 context.Context, arg1 resources.ID, arg2 } // Delete indicates an expected call of Delete. -func (mr *MockStatusManagerMockRecorder) Delete(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockStatusManagerMockRecorder) Delete(arg0, arg1, arg2 any) *MockStatusManagerDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockStatusManager)(nil).Delete), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockStatusManager)(nil).Delete), arg0, arg1, arg2) + return &MockStatusManagerDeleteCall{Call: call} +} + +// MockStatusManagerDeleteCall wrap *gomock.Call +type MockStatusManagerDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStatusManagerDeleteCall) Return(arg0 error) *MockStatusManagerDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStatusManagerDeleteCall) Do(f func(context.Context, resources.ID, uuid.UUID) error) *MockStatusManagerDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStatusManagerDeleteCall) DoAndReturn(f func(context.Context, resources.ID, uuid.UUID) error) *MockStatusManagerDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Get mocks base method. @@ -67,9 +91,33 @@ func (m *MockStatusManager) Get(arg0 context.Context, arg1 resources.ID, arg2 uu } // Get indicates an expected call of Get. -func (mr *MockStatusManagerMockRecorder) Get(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockStatusManagerMockRecorder) Get(arg0, arg1, arg2 any) *MockStatusManagerGetCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockStatusManager)(nil).Get), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockStatusManager)(nil).Get), arg0, arg1, arg2) + return &MockStatusManagerGetCall{Call: call} +} + +// MockStatusManagerGetCall wrap *gomock.Call +type MockStatusManagerGetCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStatusManagerGetCall) Return(arg0 *Status, arg1 error) *MockStatusManagerGetCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStatusManagerGetCall) Do(f func(context.Context, resources.ID, uuid.UUID) (*Status, error)) *MockStatusManagerGetCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStatusManagerGetCall) DoAndReturn(f func(context.Context, resources.ID, uuid.UUID) (*Status, error)) *MockStatusManagerGetCall { + c.Call = c.Call.DoAndReturn(f) + return c } // QueueAsyncOperation mocks base method. @@ -81,9 +129,33 @@ func (m *MockStatusManager) QueueAsyncOperation(arg0 context.Context, arg1 *v1.A } // QueueAsyncOperation indicates an expected call of QueueAsyncOperation. -func (mr *MockStatusManagerMockRecorder) QueueAsyncOperation(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockStatusManagerMockRecorder) QueueAsyncOperation(arg0, arg1, arg2 any) *MockStatusManagerQueueAsyncOperationCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueueAsyncOperation", reflect.TypeOf((*MockStatusManager)(nil).QueueAsyncOperation), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueueAsyncOperation", reflect.TypeOf((*MockStatusManager)(nil).QueueAsyncOperation), arg0, arg1, arg2) + return &MockStatusManagerQueueAsyncOperationCall{Call: call} +} + +// MockStatusManagerQueueAsyncOperationCall wrap *gomock.Call +type MockStatusManagerQueueAsyncOperationCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStatusManagerQueueAsyncOperationCall) Return(arg0 error) *MockStatusManagerQueueAsyncOperationCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStatusManagerQueueAsyncOperationCall) Do(f func(context.Context, *v1.ARMRequestContext, QueueOperationOptions) error) *MockStatusManagerQueueAsyncOperationCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStatusManagerQueueAsyncOperationCall) DoAndReturn(f func(context.Context, *v1.ARMRequestContext, QueueOperationOptions) error) *MockStatusManagerQueueAsyncOperationCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Update mocks base method. @@ -95,7 +167,31 @@ func (m *MockStatusManager) Update(arg0 context.Context, arg1 resources.ID, arg2 } // Update indicates an expected call of Update. -func (mr *MockStatusManagerMockRecorder) Update(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { +func (mr *MockStatusManagerMockRecorder) Update(arg0, arg1, arg2, arg3, arg4, arg5 any) *MockStatusManagerUpdateCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockStatusManager)(nil).Update), arg0, arg1, arg2, arg3, arg4, arg5) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockStatusManager)(nil).Update), arg0, arg1, arg2, arg3, arg4, arg5) + return &MockStatusManagerUpdateCall{Call: call} +} + +// MockStatusManagerUpdateCall wrap *gomock.Call +type MockStatusManagerUpdateCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStatusManagerUpdateCall) Return(arg0 error) *MockStatusManagerUpdateCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStatusManagerUpdateCall) Do(f func(context.Context, resources.ID, uuid.UUID, v1.ProvisioningState, *time.Time, *v1.ErrorDetails) error) *MockStatusManagerUpdateCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStatusManagerUpdateCall) DoAndReturn(f func(context.Context, resources.ID, uuid.UUID, v1.ProvisioningState, *time.Time, *v1.ErrorDetails) error) *MockStatusManagerUpdateCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go b/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go index a51525c2cac..7b51764390a 100644 --- a/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go +++ b/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go @@ -50,7 +50,7 @@ type QueueOperationOptions struct { RetryAfter time.Duration } -//go:generate mockgen -destination=./mock_statusmanager.go -package=statusmanager -self_package github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager StatusManager +//go:generate mockgen -typed -destination=./mock_statusmanager.go -package=statusmanager -self_package github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager StatusManager // StatusManager is an interface to manage async operation status. type StatusManager interface { diff --git a/pkg/cli/aws/client.go b/pkg/cli/aws/client.go index fdf0f7f717d..b28389459b6 100644 --- a/pkg/cli/aws/client.go +++ b/pkg/cli/aws/client.go @@ -23,7 +23,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/sts" ) -//go:generate mockgen -destination=./client_mock.go -package=aws -self_package github.com/radius-project/radius/pkg/cli/aws github.com/radius-project/radius/pkg/cli/aws Client +//go:generate mockgen -typed -destination=./client_mock.go -package=aws -self_package github.com/radius-project/radius/pkg/cli/aws github.com/radius-project/radius/pkg/cli/aws Client // Client is an interface that abstracts `rad init`'s interactions with AWS. This is for testing purposes. This is only exported because mockgen requires it. type Client interface { diff --git a/pkg/cli/aws/client_mock.go b/pkg/cli/aws/client_mock.go index c35bd612368..13391cd4c87 100644 --- a/pkg/cli/aws/client_mock.go +++ b/pkg/cli/aws/client_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./client_mock.go -package=aws -self_package github.com/radius-project/radius/pkg/cli/aws github.com/radius-project/radius/pkg/cli/aws Client +// mockgen -typed -destination=./client_mock.go -package=aws -self_package github.com/radius-project/radius/pkg/cli/aws github.com/radius-project/radius/pkg/cli/aws Client // // Package aws is a generated GoMock package. @@ -51,9 +51,33 @@ func (m *MockClient) GetCallerIdentity(arg0 context.Context, arg1, arg2, arg3 st } // GetCallerIdentity indicates an expected call of GetCallerIdentity. -func (mr *MockClientMockRecorder) GetCallerIdentity(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockClientMockRecorder) GetCallerIdentity(arg0, arg1, arg2, arg3 any) *MockClientGetCallerIdentityCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCallerIdentity", reflect.TypeOf((*MockClient)(nil).GetCallerIdentity), arg0, arg1, arg2, arg3) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCallerIdentity", reflect.TypeOf((*MockClient)(nil).GetCallerIdentity), arg0, arg1, arg2, arg3) + return &MockClientGetCallerIdentityCall{Call: call} +} + +// MockClientGetCallerIdentityCall wrap *gomock.Call +type MockClientGetCallerIdentityCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientGetCallerIdentityCall) Return(arg0 *sts.GetCallerIdentityOutput, arg1 error) *MockClientGetCallerIdentityCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientGetCallerIdentityCall) Do(f func(context.Context, string, string, string) (*sts.GetCallerIdentityOutput, error)) *MockClientGetCallerIdentityCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientGetCallerIdentityCall) DoAndReturn(f func(context.Context, string, string, string) (*sts.GetCallerIdentityOutput, error)) *MockClientGetCallerIdentityCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListRegions mocks base method. @@ -66,7 +90,31 @@ func (m *MockClient) ListRegions(arg0 context.Context, arg1, arg2, arg3 string) } // ListRegions indicates an expected call of ListRegions. -func (mr *MockClientMockRecorder) ListRegions(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockClientMockRecorder) ListRegions(arg0, arg1, arg2, arg3 any) *MockClientListRegionsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRegions", reflect.TypeOf((*MockClient)(nil).ListRegions), arg0, arg1, arg2, arg3) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRegions", reflect.TypeOf((*MockClient)(nil).ListRegions), arg0, arg1, arg2, arg3) + return &MockClientListRegionsCall{Call: call} +} + +// MockClientListRegionsCall wrap *gomock.Call +type MockClientListRegionsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientListRegionsCall) Return(arg0 *ec2.DescribeRegionsOutput, arg1 error) *MockClientListRegionsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientListRegionsCall) Do(f func(context.Context, string, string, string) (*ec2.DescribeRegionsOutput, error)) *MockClientListRegionsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientListRegionsCall) DoAndReturn(f func(context.Context, string, string, string) (*ec2.DescribeRegionsOutput, error)) *MockClientListRegionsCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/azure/client.go b/pkg/cli/azure/client.go index 41e90813ab3..6b3f81f3071 100644 --- a/pkg/cli/azure/client.go +++ b/pkg/cli/azure/client.go @@ -25,7 +25,7 @@ import ( "github.com/radius-project/radius/pkg/azure/armauth" ) -//go:generate mockgen -destination=./client_mock.go -package=azure -self_package github.com/radius-project/radius/pkg/cli/azure github.com/radius-project/radius/pkg/cli/azure Client +//go:generate mockgen -typed -destination=./client_mock.go -package=azure -self_package github.com/radius-project/radius/pkg/cli/azure github.com/radius-project/radius/pkg/cli/azure Client // Client is an interface that abstracts `rad init`'s interactions with Azure. This is for testing purposes. type Client interface { diff --git a/pkg/cli/azure/client_mock.go b/pkg/cli/azure/client_mock.go index 217aaed9c3e..5a4d01cc792 100644 --- a/pkg/cli/azure/client_mock.go +++ b/pkg/cli/azure/client_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./client_mock.go -package=azure -self_package github.com/radius-project/radius/pkg/cli/azure github.com/radius-project/radius/pkg/cli/azure Client +// mockgen -typed -destination=./client_mock.go -package=azure -self_package github.com/radius-project/radius/pkg/cli/azure github.com/radius-project/radius/pkg/cli/azure Client // // Package azure is a generated GoMock package. @@ -51,9 +51,33 @@ func (m *MockClient) CheckResourceGroupExistence(arg0 context.Context, arg1, arg } // CheckResourceGroupExistence indicates an expected call of CheckResourceGroupExistence. -func (mr *MockClientMockRecorder) CheckResourceGroupExistence(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockClientMockRecorder) CheckResourceGroupExistence(arg0, arg1, arg2 any) *MockClientCheckResourceGroupExistenceCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckResourceGroupExistence", reflect.TypeOf((*MockClient)(nil).CheckResourceGroupExistence), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckResourceGroupExistence", reflect.TypeOf((*MockClient)(nil).CheckResourceGroupExistence), arg0, arg1, arg2) + return &MockClientCheckResourceGroupExistenceCall{Call: call} +} + +// MockClientCheckResourceGroupExistenceCall wrap *gomock.Call +type MockClientCheckResourceGroupExistenceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientCheckResourceGroupExistenceCall) Return(arg0 bool, arg1 error) *MockClientCheckResourceGroupExistenceCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientCheckResourceGroupExistenceCall) Do(f func(context.Context, string, string) (bool, error)) *MockClientCheckResourceGroupExistenceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientCheckResourceGroupExistenceCall) DoAndReturn(f func(context.Context, string, string) (bool, error)) *MockClientCheckResourceGroupExistenceCall { + c.Call = c.Call.DoAndReturn(f) + return c } // CreateOrUpdateResourceGroup mocks base method. @@ -65,9 +89,33 @@ func (m *MockClient) CreateOrUpdateResourceGroup(arg0 context.Context, arg1, arg } // CreateOrUpdateResourceGroup indicates an expected call of CreateOrUpdateResourceGroup. -func (mr *MockClientMockRecorder) CreateOrUpdateResourceGroup(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockClientMockRecorder) CreateOrUpdateResourceGroup(arg0, arg1, arg2, arg3 any) *MockClientCreateOrUpdateResourceGroupCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateResourceGroup", reflect.TypeOf((*MockClient)(nil).CreateOrUpdateResourceGroup), arg0, arg1, arg2, arg3) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateResourceGroup", reflect.TypeOf((*MockClient)(nil).CreateOrUpdateResourceGroup), arg0, arg1, arg2, arg3) + return &MockClientCreateOrUpdateResourceGroupCall{Call: call} +} + +// MockClientCreateOrUpdateResourceGroupCall wrap *gomock.Call +type MockClientCreateOrUpdateResourceGroupCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientCreateOrUpdateResourceGroupCall) Return(arg0 error) *MockClientCreateOrUpdateResourceGroupCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientCreateOrUpdateResourceGroupCall) Do(f func(context.Context, string, string, string) error) *MockClientCreateOrUpdateResourceGroupCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientCreateOrUpdateResourceGroupCall) DoAndReturn(f func(context.Context, string, string, string) error) *MockClientCreateOrUpdateResourceGroupCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Locations mocks base method. @@ -80,9 +128,33 @@ func (m *MockClient) Locations(arg0 context.Context, arg1 string) ([]armsubscrip } // Locations indicates an expected call of Locations. -func (mr *MockClientMockRecorder) Locations(arg0, arg1 any) *gomock.Call { +func (mr *MockClientMockRecorder) Locations(arg0, arg1 any) *MockClientLocationsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Locations", reflect.TypeOf((*MockClient)(nil).Locations), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Locations", reflect.TypeOf((*MockClient)(nil).Locations), arg0, arg1) + return &MockClientLocationsCall{Call: call} +} + +// MockClientLocationsCall wrap *gomock.Call +type MockClientLocationsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientLocationsCall) Return(arg0 []armsubscriptions.Location, arg1 error) *MockClientLocationsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientLocationsCall) Do(f func(context.Context, string) ([]armsubscriptions.Location, error)) *MockClientLocationsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientLocationsCall) DoAndReturn(f func(context.Context, string) ([]armsubscriptions.Location, error)) *MockClientLocationsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ResourceGroups mocks base method. @@ -95,9 +167,33 @@ func (m *MockClient) ResourceGroups(arg0 context.Context, arg1 string) ([]armres } // ResourceGroups indicates an expected call of ResourceGroups. -func (mr *MockClientMockRecorder) ResourceGroups(arg0, arg1 any) *gomock.Call { +func (mr *MockClientMockRecorder) ResourceGroups(arg0, arg1 any) *MockClientResourceGroupsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResourceGroups", reflect.TypeOf((*MockClient)(nil).ResourceGroups), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResourceGroups", reflect.TypeOf((*MockClient)(nil).ResourceGroups), arg0, arg1) + return &MockClientResourceGroupsCall{Call: call} +} + +// MockClientResourceGroupsCall wrap *gomock.Call +type MockClientResourceGroupsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientResourceGroupsCall) Return(arg0 []armresources.ResourceGroup, arg1 error) *MockClientResourceGroupsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientResourceGroupsCall) Do(f func(context.Context, string) ([]armresources.ResourceGroup, error)) *MockClientResourceGroupsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientResourceGroupsCall) DoAndReturn(f func(context.Context, string) ([]armresources.ResourceGroup, error)) *MockClientResourceGroupsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Subscriptions mocks base method. @@ -110,7 +206,31 @@ func (m *MockClient) Subscriptions(arg0 context.Context) (*SubscriptionResult, e } // Subscriptions indicates an expected call of Subscriptions. -func (mr *MockClientMockRecorder) Subscriptions(arg0 any) *gomock.Call { +func (mr *MockClientMockRecorder) Subscriptions(arg0 any) *MockClientSubscriptionsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscriptions", reflect.TypeOf((*MockClient)(nil).Subscriptions), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscriptions", reflect.TypeOf((*MockClient)(nil).Subscriptions), arg0) + return &MockClientSubscriptionsCall{Call: call} +} + +// MockClientSubscriptionsCall wrap *gomock.Call +type MockClientSubscriptionsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientSubscriptionsCall) Return(arg0 *SubscriptionResult, arg1 error) *MockClientSubscriptionsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientSubscriptionsCall) Do(f func(context.Context) (*SubscriptionResult, error)) *MockClientSubscriptionsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientSubscriptionsCall) DoAndReturn(f func(context.Context) (*SubscriptionResult, error)) *MockClientSubscriptionsCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/bicep/mock_bicep.go b/pkg/cli/bicep/mock_bicep.go index 4649496d585..ed13e3db256 100644 --- a/pkg/cli/bicep/mock_bicep.go +++ b/pkg/cli/bicep/mock_bicep.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_bicep.go -package=bicep -self_package github.com/radius-project/radius/pkg/cli/bicep github.com/radius-project/radius/pkg/cli/bicep Interface +// mockgen -typed -destination=./mock_bicep.go -package=bicep -self_package github.com/radius-project/radius/pkg/cli/bicep github.com/radius-project/radius/pkg/cli/bicep Interface // // Package bicep is a generated GoMock package. @@ -48,7 +48,31 @@ func (m *MockInterface) PrepareTemplate(arg0 string) (map[string]any, error) { } // PrepareTemplate indicates an expected call of PrepareTemplate. -func (mr *MockInterfaceMockRecorder) PrepareTemplate(arg0 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) PrepareTemplate(arg0 any) *MockInterfacePrepareTemplateCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrepareTemplate", reflect.TypeOf((*MockInterface)(nil).PrepareTemplate), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrepareTemplate", reflect.TypeOf((*MockInterface)(nil).PrepareTemplate), arg0) + return &MockInterfacePrepareTemplateCall{Call: call} +} + +// MockInterfacePrepareTemplateCall wrap *gomock.Call +type MockInterfacePrepareTemplateCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfacePrepareTemplateCall) Return(arg0 map[string]any, arg1 error) *MockInterfacePrepareTemplateCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfacePrepareTemplateCall) Do(f func(string) (map[string]any, error)) *MockInterfacePrepareTemplateCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfacePrepareTemplateCall) DoAndReturn(f func(string) (map[string]any, error)) *MockInterfacePrepareTemplateCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/bicep/types.go b/pkg/cli/bicep/types.go index 2fb667f1e76..6c11156a7b1 100644 --- a/pkg/cli/bicep/types.go +++ b/pkg/cli/bicep/types.go @@ -34,7 +34,7 @@ type Interface interface { var _ Interface = (*Impl)(nil) -//go:generate mockgen -destination=./mock_bicep.go -package=bicep -self_package github.com/radius-project/radius/pkg/cli/bicep github.com/radius-project/radius/pkg/cli/bicep Interface +//go:generate mockgen -typed -destination=./mock_bicep.go -package=bicep -self_package github.com/radius-project/radius/pkg/cli/bicep github.com/radius-project/radius/pkg/cli/bicep Interface // Impl is the implementation of Interface. type Impl struct { diff --git a/pkg/cli/clients/clients.go b/pkg/cli/clients/clients.go index 21aeaab8478..281f286c821 100644 --- a/pkg/cli/clients/clients.go +++ b/pkg/cli/clients/clients.go @@ -88,7 +88,7 @@ type DeploymentClient interface { Deploy(ctx context.Context, options DeploymentOptions) (DeploymentResult, error) } -//go:generate mockgen -destination=./mock_diagnosticsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients DiagnosticsClient +//go:generate mockgen -typed -destination=./mock_diagnosticsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients DiagnosticsClient // DiagnosticsClient is used to interface with diagnostics features like logs and port-forwards. type DiagnosticsClient interface { @@ -133,7 +133,7 @@ type LogStream struct { Stream io.ReadCloser } -//go:generate mockgen -destination=./mock_applicationsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients ApplicationsManagementClient +//go:generate mockgen -typed -destination=./mock_applicationsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients ApplicationsManagementClient // ApplicationsManagementClient is used to interface with management features like listing resources by app, show details of a resource. type ApplicationsManagementClient interface { diff --git a/pkg/cli/clients/mock_applicationsclient.go b/pkg/cli/clients/mock_applicationsclient.go index 3a6940697a3..26832d9a6a9 100644 --- a/pkg/cli/clients/mock_applicationsclient.go +++ b/pkg/cli/clients/mock_applicationsclient.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_applicationsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients ApplicationsManagementClient +// mockgen -typed -destination=./mock_applicationsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients ApplicationsManagementClient // // Package clients is a generated GoMock package. @@ -51,9 +51,33 @@ func (m *MockApplicationsManagementClient) CreateApplicationIfNotFound(arg0 cont } // CreateApplicationIfNotFound indicates an expected call of CreateApplicationIfNotFound. -func (mr *MockApplicationsManagementClientMockRecorder) CreateApplicationIfNotFound(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) CreateApplicationIfNotFound(arg0, arg1, arg2 any) *MockApplicationsManagementClientCreateApplicationIfNotFoundCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateApplicationIfNotFound", reflect.TypeOf((*MockApplicationsManagementClient)(nil).CreateApplicationIfNotFound), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateApplicationIfNotFound", reflect.TypeOf((*MockApplicationsManagementClient)(nil).CreateApplicationIfNotFound), arg0, arg1, arg2) + return &MockApplicationsManagementClientCreateApplicationIfNotFoundCall{Call: call} +} + +// MockApplicationsManagementClientCreateApplicationIfNotFoundCall wrap *gomock.Call +type MockApplicationsManagementClientCreateApplicationIfNotFoundCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientCreateApplicationIfNotFoundCall) Return(arg0 error) *MockApplicationsManagementClientCreateApplicationIfNotFoundCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientCreateApplicationIfNotFoundCall) Do(f func(context.Context, string, *v20231001preview.ApplicationResource) error) *MockApplicationsManagementClientCreateApplicationIfNotFoundCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientCreateApplicationIfNotFoundCall) DoAndReturn(f func(context.Context, string, *v20231001preview.ApplicationResource) error) *MockApplicationsManagementClientCreateApplicationIfNotFoundCall { + c.Call = c.Call.DoAndReturn(f) + return c } // CreateOrUpdateApplication mocks base method. @@ -65,9 +89,33 @@ func (m *MockApplicationsManagementClient) CreateOrUpdateApplication(arg0 contex } // CreateOrUpdateApplication indicates an expected call of CreateOrUpdateApplication. -func (mr *MockApplicationsManagementClientMockRecorder) CreateOrUpdateApplication(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) CreateOrUpdateApplication(arg0, arg1, arg2 any) *MockApplicationsManagementClientCreateOrUpdateApplicationCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).CreateOrUpdateApplication), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).CreateOrUpdateApplication), arg0, arg1, arg2) + return &MockApplicationsManagementClientCreateOrUpdateApplicationCall{Call: call} +} + +// MockApplicationsManagementClientCreateOrUpdateApplicationCall wrap *gomock.Call +type MockApplicationsManagementClientCreateOrUpdateApplicationCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientCreateOrUpdateApplicationCall) Return(arg0 error) *MockApplicationsManagementClientCreateOrUpdateApplicationCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientCreateOrUpdateApplicationCall) Do(f func(context.Context, string, *v20231001preview.ApplicationResource) error) *MockApplicationsManagementClientCreateOrUpdateApplicationCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientCreateOrUpdateApplicationCall) DoAndReturn(f func(context.Context, string, *v20231001preview.ApplicationResource) error) *MockApplicationsManagementClientCreateOrUpdateApplicationCall { + c.Call = c.Call.DoAndReturn(f) + return c } // CreateOrUpdateEnvironment mocks base method. @@ -79,9 +127,33 @@ func (m *MockApplicationsManagementClient) CreateOrUpdateEnvironment(arg0 contex } // CreateOrUpdateEnvironment indicates an expected call of CreateOrUpdateEnvironment. -func (mr *MockApplicationsManagementClientMockRecorder) CreateOrUpdateEnvironment(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) CreateOrUpdateEnvironment(arg0, arg1, arg2 any) *MockApplicationsManagementClientCreateOrUpdateEnvironmentCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).CreateOrUpdateEnvironment), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).CreateOrUpdateEnvironment), arg0, arg1, arg2) + return &MockApplicationsManagementClientCreateOrUpdateEnvironmentCall{Call: call} +} + +// MockApplicationsManagementClientCreateOrUpdateEnvironmentCall wrap *gomock.Call +type MockApplicationsManagementClientCreateOrUpdateEnvironmentCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientCreateOrUpdateEnvironmentCall) Return(arg0 error) *MockApplicationsManagementClientCreateOrUpdateEnvironmentCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientCreateOrUpdateEnvironmentCall) Do(f func(context.Context, string, *v20231001preview.EnvironmentResource) error) *MockApplicationsManagementClientCreateOrUpdateEnvironmentCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientCreateOrUpdateEnvironmentCall) DoAndReturn(f func(context.Context, string, *v20231001preview.EnvironmentResource) error) *MockApplicationsManagementClientCreateOrUpdateEnvironmentCall { + c.Call = c.Call.DoAndReturn(f) + return c } // CreateOrUpdateResourceGroup mocks base method. @@ -93,9 +165,33 @@ func (m *MockApplicationsManagementClient) CreateOrUpdateResourceGroup(arg0 cont } // CreateOrUpdateResourceGroup indicates an expected call of CreateOrUpdateResourceGroup. -func (mr *MockApplicationsManagementClientMockRecorder) CreateOrUpdateResourceGroup(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) CreateOrUpdateResourceGroup(arg0, arg1, arg2, arg3 any) *MockApplicationsManagementClientCreateOrUpdateResourceGroupCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateResourceGroup", reflect.TypeOf((*MockApplicationsManagementClient)(nil).CreateOrUpdateResourceGroup), arg0, arg1, arg2, arg3) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateResourceGroup", reflect.TypeOf((*MockApplicationsManagementClient)(nil).CreateOrUpdateResourceGroup), arg0, arg1, arg2, arg3) + return &MockApplicationsManagementClientCreateOrUpdateResourceGroupCall{Call: call} +} + +// MockApplicationsManagementClientCreateOrUpdateResourceGroupCall wrap *gomock.Call +type MockApplicationsManagementClientCreateOrUpdateResourceGroupCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientCreateOrUpdateResourceGroupCall) Return(arg0 error) *MockApplicationsManagementClientCreateOrUpdateResourceGroupCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientCreateOrUpdateResourceGroupCall) Do(f func(context.Context, string, string, *v20231001preview0.ResourceGroupResource) error) *MockApplicationsManagementClientCreateOrUpdateResourceGroupCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientCreateOrUpdateResourceGroupCall) DoAndReturn(f func(context.Context, string, string, *v20231001preview0.ResourceGroupResource) error) *MockApplicationsManagementClientCreateOrUpdateResourceGroupCall { + c.Call = c.Call.DoAndReturn(f) + return c } // DeleteApplication mocks base method. @@ -108,9 +204,33 @@ func (m *MockApplicationsManagementClient) DeleteApplication(arg0 context.Contex } // DeleteApplication indicates an expected call of DeleteApplication. -func (mr *MockApplicationsManagementClientMockRecorder) DeleteApplication(arg0, arg1 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) DeleteApplication(arg0, arg1 any) *MockApplicationsManagementClientDeleteApplicationCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).DeleteApplication), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).DeleteApplication), arg0, arg1) + return &MockApplicationsManagementClientDeleteApplicationCall{Call: call} +} + +// MockApplicationsManagementClientDeleteApplicationCall wrap *gomock.Call +type MockApplicationsManagementClientDeleteApplicationCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientDeleteApplicationCall) Return(arg0 bool, arg1 error) *MockApplicationsManagementClientDeleteApplicationCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientDeleteApplicationCall) Do(f func(context.Context, string) (bool, error)) *MockApplicationsManagementClientDeleteApplicationCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientDeleteApplicationCall) DoAndReturn(f func(context.Context, string) (bool, error)) *MockApplicationsManagementClientDeleteApplicationCall { + c.Call = c.Call.DoAndReturn(f) + return c } // DeleteEnvironment mocks base method. @@ -123,9 +243,33 @@ func (m *MockApplicationsManagementClient) DeleteEnvironment(arg0 context.Contex } // DeleteEnvironment indicates an expected call of DeleteEnvironment. -func (mr *MockApplicationsManagementClientMockRecorder) DeleteEnvironment(arg0, arg1 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) DeleteEnvironment(arg0, arg1 any) *MockApplicationsManagementClientDeleteEnvironmentCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).DeleteEnvironment), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).DeleteEnvironment), arg0, arg1) + return &MockApplicationsManagementClientDeleteEnvironmentCall{Call: call} +} + +// MockApplicationsManagementClientDeleteEnvironmentCall wrap *gomock.Call +type MockApplicationsManagementClientDeleteEnvironmentCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientDeleteEnvironmentCall) Return(arg0 bool, arg1 error) *MockApplicationsManagementClientDeleteEnvironmentCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientDeleteEnvironmentCall) Do(f func(context.Context, string) (bool, error)) *MockApplicationsManagementClientDeleteEnvironmentCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientDeleteEnvironmentCall) DoAndReturn(f func(context.Context, string) (bool, error)) *MockApplicationsManagementClientDeleteEnvironmentCall { + c.Call = c.Call.DoAndReturn(f) + return c } // DeleteResource mocks base method. @@ -138,9 +282,33 @@ func (m *MockApplicationsManagementClient) DeleteResource(arg0 context.Context, } // DeleteResource indicates an expected call of DeleteResource. -func (mr *MockApplicationsManagementClientMockRecorder) DeleteResource(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) DeleteResource(arg0, arg1, arg2 any) *MockApplicationsManagementClientDeleteResourceCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteResource", reflect.TypeOf((*MockApplicationsManagementClient)(nil).DeleteResource), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteResource", reflect.TypeOf((*MockApplicationsManagementClient)(nil).DeleteResource), arg0, arg1, arg2) + return &MockApplicationsManagementClientDeleteResourceCall{Call: call} +} + +// MockApplicationsManagementClientDeleteResourceCall wrap *gomock.Call +type MockApplicationsManagementClientDeleteResourceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientDeleteResourceCall) Return(arg0 bool, arg1 error) *MockApplicationsManagementClientDeleteResourceCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientDeleteResourceCall) Do(f func(context.Context, string, string) (bool, error)) *MockApplicationsManagementClientDeleteResourceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientDeleteResourceCall) DoAndReturn(f func(context.Context, string, string) (bool, error)) *MockApplicationsManagementClientDeleteResourceCall { + c.Call = c.Call.DoAndReturn(f) + return c } // DeleteResourceGroup mocks base method. @@ -153,9 +321,33 @@ func (m *MockApplicationsManagementClient) DeleteResourceGroup(arg0 context.Cont } // DeleteResourceGroup indicates an expected call of DeleteResourceGroup. -func (mr *MockApplicationsManagementClientMockRecorder) DeleteResourceGroup(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) DeleteResourceGroup(arg0, arg1, arg2 any) *MockApplicationsManagementClientDeleteResourceGroupCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteResourceGroup", reflect.TypeOf((*MockApplicationsManagementClient)(nil).DeleteResourceGroup), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteResourceGroup", reflect.TypeOf((*MockApplicationsManagementClient)(nil).DeleteResourceGroup), arg0, arg1, arg2) + return &MockApplicationsManagementClientDeleteResourceGroupCall{Call: call} +} + +// MockApplicationsManagementClientDeleteResourceGroupCall wrap *gomock.Call +type MockApplicationsManagementClientDeleteResourceGroupCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientDeleteResourceGroupCall) Return(arg0 bool, arg1 error) *MockApplicationsManagementClientDeleteResourceGroupCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientDeleteResourceGroupCall) Do(f func(context.Context, string, string) (bool, error)) *MockApplicationsManagementClientDeleteResourceGroupCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientDeleteResourceGroupCall) DoAndReturn(f func(context.Context, string, string) (bool, error)) *MockApplicationsManagementClientDeleteResourceGroupCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetApplication mocks base method. @@ -168,9 +360,33 @@ func (m *MockApplicationsManagementClient) GetApplication(arg0 context.Context, } // GetApplication indicates an expected call of GetApplication. -func (mr *MockApplicationsManagementClientMockRecorder) GetApplication(arg0, arg1 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) GetApplication(arg0, arg1 any) *MockApplicationsManagementClientGetApplicationCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetApplication), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetApplication), arg0, arg1) + return &MockApplicationsManagementClientGetApplicationCall{Call: call} +} + +// MockApplicationsManagementClientGetApplicationCall wrap *gomock.Call +type MockApplicationsManagementClientGetApplicationCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientGetApplicationCall) Return(arg0 v20231001preview.ApplicationResource, arg1 error) *MockApplicationsManagementClientGetApplicationCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientGetApplicationCall) Do(f func(context.Context, string) (v20231001preview.ApplicationResource, error)) *MockApplicationsManagementClientGetApplicationCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientGetApplicationCall) DoAndReturn(f func(context.Context, string) (v20231001preview.ApplicationResource, error)) *MockApplicationsManagementClientGetApplicationCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetApplicationGraph mocks base method. @@ -183,9 +399,33 @@ func (m *MockApplicationsManagementClient) GetApplicationGraph(arg0 context.Cont } // GetApplicationGraph indicates an expected call of GetApplicationGraph. -func (mr *MockApplicationsManagementClientMockRecorder) GetApplicationGraph(arg0, arg1 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) GetApplicationGraph(arg0, arg1 any) *MockApplicationsManagementClientGetApplicationGraphCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplicationGraph", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetApplicationGraph), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplicationGraph", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetApplicationGraph), arg0, arg1) + return &MockApplicationsManagementClientGetApplicationGraphCall{Call: call} +} + +// MockApplicationsManagementClientGetApplicationGraphCall wrap *gomock.Call +type MockApplicationsManagementClientGetApplicationGraphCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientGetApplicationGraphCall) Return(arg0 v20231001preview.ApplicationGraphResponse, arg1 error) *MockApplicationsManagementClientGetApplicationGraphCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientGetApplicationGraphCall) Do(f func(context.Context, string) (v20231001preview.ApplicationGraphResponse, error)) *MockApplicationsManagementClientGetApplicationGraphCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientGetApplicationGraphCall) DoAndReturn(f func(context.Context, string) (v20231001preview.ApplicationGraphResponse, error)) *MockApplicationsManagementClientGetApplicationGraphCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetEnvironment mocks base method. @@ -198,9 +438,33 @@ func (m *MockApplicationsManagementClient) GetEnvironment(arg0 context.Context, } // GetEnvironment indicates an expected call of GetEnvironment. -func (mr *MockApplicationsManagementClientMockRecorder) GetEnvironment(arg0, arg1 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) GetEnvironment(arg0, arg1 any) *MockApplicationsManagementClientGetEnvironmentCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetEnvironment), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetEnvironment), arg0, arg1) + return &MockApplicationsManagementClientGetEnvironmentCall{Call: call} +} + +// MockApplicationsManagementClientGetEnvironmentCall wrap *gomock.Call +type MockApplicationsManagementClientGetEnvironmentCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientGetEnvironmentCall) Return(arg0 v20231001preview.EnvironmentResource, arg1 error) *MockApplicationsManagementClientGetEnvironmentCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientGetEnvironmentCall) Do(f func(context.Context, string) (v20231001preview.EnvironmentResource, error)) *MockApplicationsManagementClientGetEnvironmentCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientGetEnvironmentCall) DoAndReturn(f func(context.Context, string) (v20231001preview.EnvironmentResource, error)) *MockApplicationsManagementClientGetEnvironmentCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetRecipeMetadata mocks base method. @@ -213,9 +477,33 @@ func (m *MockApplicationsManagementClient) GetRecipeMetadata(arg0 context.Contex } // GetRecipeMetadata indicates an expected call of GetRecipeMetadata. -func (mr *MockApplicationsManagementClientMockRecorder) GetRecipeMetadata(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) GetRecipeMetadata(arg0, arg1, arg2 any) *MockApplicationsManagementClientGetRecipeMetadataCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetRecipeMetadata), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetRecipeMetadata), arg0, arg1, arg2) + return &MockApplicationsManagementClientGetRecipeMetadataCall{Call: call} +} + +// MockApplicationsManagementClientGetRecipeMetadataCall wrap *gomock.Call +type MockApplicationsManagementClientGetRecipeMetadataCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientGetRecipeMetadataCall) Return(arg0 v20231001preview.RecipeGetMetadataResponse, arg1 error) *MockApplicationsManagementClientGetRecipeMetadataCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientGetRecipeMetadataCall) Do(f func(context.Context, string, v20231001preview.RecipeGetMetadata) (v20231001preview.RecipeGetMetadataResponse, error)) *MockApplicationsManagementClientGetRecipeMetadataCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientGetRecipeMetadataCall) DoAndReturn(f func(context.Context, string, v20231001preview.RecipeGetMetadata) (v20231001preview.RecipeGetMetadataResponse, error)) *MockApplicationsManagementClientGetRecipeMetadataCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetResource mocks base method. @@ -228,9 +516,33 @@ func (m *MockApplicationsManagementClient) GetResource(arg0 context.Context, arg } // GetResource indicates an expected call of GetResource. -func (mr *MockApplicationsManagementClientMockRecorder) GetResource(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) GetResource(arg0, arg1, arg2 any) *MockApplicationsManagementClientGetResourceCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResource", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetResource), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResource", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetResource), arg0, arg1, arg2) + return &MockApplicationsManagementClientGetResourceCall{Call: call} +} + +// MockApplicationsManagementClientGetResourceCall wrap *gomock.Call +type MockApplicationsManagementClientGetResourceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientGetResourceCall) Return(arg0 generated.GenericResource, arg1 error) *MockApplicationsManagementClientGetResourceCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientGetResourceCall) Do(f func(context.Context, string, string) (generated.GenericResource, error)) *MockApplicationsManagementClientGetResourceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientGetResourceCall) DoAndReturn(f func(context.Context, string, string) (generated.GenericResource, error)) *MockApplicationsManagementClientGetResourceCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetResourceGroup mocks base method. @@ -243,9 +555,33 @@ func (m *MockApplicationsManagementClient) GetResourceGroup(arg0 context.Context } // GetResourceGroup indicates an expected call of GetResourceGroup. -func (mr *MockApplicationsManagementClientMockRecorder) GetResourceGroup(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) GetResourceGroup(arg0, arg1, arg2 any) *MockApplicationsManagementClientGetResourceGroupCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResourceGroup", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetResourceGroup), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResourceGroup", reflect.TypeOf((*MockApplicationsManagementClient)(nil).GetResourceGroup), arg0, arg1, arg2) + return &MockApplicationsManagementClientGetResourceGroupCall{Call: call} +} + +// MockApplicationsManagementClientGetResourceGroupCall wrap *gomock.Call +type MockApplicationsManagementClientGetResourceGroupCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientGetResourceGroupCall) Return(arg0 v20231001preview0.ResourceGroupResource, arg1 error) *MockApplicationsManagementClientGetResourceGroupCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientGetResourceGroupCall) Do(f func(context.Context, string, string) (v20231001preview0.ResourceGroupResource, error)) *MockApplicationsManagementClientGetResourceGroupCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientGetResourceGroupCall) DoAndReturn(f func(context.Context, string, string) (v20231001preview0.ResourceGroupResource, error)) *MockApplicationsManagementClientGetResourceGroupCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListApplications mocks base method. @@ -258,9 +594,33 @@ func (m *MockApplicationsManagementClient) ListApplications(arg0 context.Context } // ListApplications indicates an expected call of ListApplications. -func (mr *MockApplicationsManagementClientMockRecorder) ListApplications(arg0 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) ListApplications(arg0 any) *MockApplicationsManagementClientListApplicationsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListApplications", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListApplications), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListApplications", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListApplications), arg0) + return &MockApplicationsManagementClientListApplicationsCall{Call: call} +} + +// MockApplicationsManagementClientListApplicationsCall wrap *gomock.Call +type MockApplicationsManagementClientListApplicationsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientListApplicationsCall) Return(arg0 []v20231001preview.ApplicationResource, arg1 error) *MockApplicationsManagementClientListApplicationsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientListApplicationsCall) Do(f func(context.Context) ([]v20231001preview.ApplicationResource, error)) *MockApplicationsManagementClientListApplicationsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientListApplicationsCall) DoAndReturn(f func(context.Context) ([]v20231001preview.ApplicationResource, error)) *MockApplicationsManagementClientListApplicationsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListEnvironments mocks base method. @@ -273,9 +633,33 @@ func (m *MockApplicationsManagementClient) ListEnvironments(arg0 context.Context } // ListEnvironments indicates an expected call of ListEnvironments. -func (mr *MockApplicationsManagementClientMockRecorder) ListEnvironments(arg0 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) ListEnvironments(arg0 any) *MockApplicationsManagementClientListEnvironmentsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListEnvironments", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListEnvironments), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListEnvironments", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListEnvironments), arg0) + return &MockApplicationsManagementClientListEnvironmentsCall{Call: call} +} + +// MockApplicationsManagementClientListEnvironmentsCall wrap *gomock.Call +type MockApplicationsManagementClientListEnvironmentsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientListEnvironmentsCall) Return(arg0 []v20231001preview.EnvironmentResource, arg1 error) *MockApplicationsManagementClientListEnvironmentsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientListEnvironmentsCall) Do(f func(context.Context) ([]v20231001preview.EnvironmentResource, error)) *MockApplicationsManagementClientListEnvironmentsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientListEnvironmentsCall) DoAndReturn(f func(context.Context) ([]v20231001preview.EnvironmentResource, error)) *MockApplicationsManagementClientListEnvironmentsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListEnvironmentsAll mocks base method. @@ -288,9 +672,33 @@ func (m *MockApplicationsManagementClient) ListEnvironmentsAll(arg0 context.Cont } // ListEnvironmentsAll indicates an expected call of ListEnvironmentsAll. -func (mr *MockApplicationsManagementClientMockRecorder) ListEnvironmentsAll(arg0 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) ListEnvironmentsAll(arg0 any) *MockApplicationsManagementClientListEnvironmentsAllCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListEnvironmentsAll", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListEnvironmentsAll), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListEnvironmentsAll", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListEnvironmentsAll), arg0) + return &MockApplicationsManagementClientListEnvironmentsAllCall{Call: call} +} + +// MockApplicationsManagementClientListEnvironmentsAllCall wrap *gomock.Call +type MockApplicationsManagementClientListEnvironmentsAllCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientListEnvironmentsAllCall) Return(arg0 []v20231001preview.EnvironmentResource, arg1 error) *MockApplicationsManagementClientListEnvironmentsAllCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientListEnvironmentsAllCall) Do(f func(context.Context) ([]v20231001preview.EnvironmentResource, error)) *MockApplicationsManagementClientListEnvironmentsAllCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientListEnvironmentsAllCall) DoAndReturn(f func(context.Context) ([]v20231001preview.EnvironmentResource, error)) *MockApplicationsManagementClientListEnvironmentsAllCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListResourceGroups mocks base method. @@ -303,9 +711,33 @@ func (m *MockApplicationsManagementClient) ListResourceGroups(arg0 context.Conte } // ListResourceGroups indicates an expected call of ListResourceGroups. -func (mr *MockApplicationsManagementClientMockRecorder) ListResourceGroups(arg0, arg1 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) ListResourceGroups(arg0, arg1 any) *MockApplicationsManagementClientListResourceGroupsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourceGroups", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourceGroups), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourceGroups", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourceGroups), arg0, arg1) + return &MockApplicationsManagementClientListResourceGroupsCall{Call: call} +} + +// MockApplicationsManagementClientListResourceGroupsCall wrap *gomock.Call +type MockApplicationsManagementClientListResourceGroupsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientListResourceGroupsCall) Return(arg0 []v20231001preview0.ResourceGroupResource, arg1 error) *MockApplicationsManagementClientListResourceGroupsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientListResourceGroupsCall) Do(f func(context.Context, string) ([]v20231001preview0.ResourceGroupResource, error)) *MockApplicationsManagementClientListResourceGroupsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientListResourceGroupsCall) DoAndReturn(f func(context.Context, string) ([]v20231001preview0.ResourceGroupResource, error)) *MockApplicationsManagementClientListResourceGroupsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListResourcesInApplication mocks base method. @@ -318,9 +750,33 @@ func (m *MockApplicationsManagementClient) ListResourcesInApplication(arg0 conte } // ListResourcesInApplication indicates an expected call of ListResourcesInApplication. -func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesInApplication(arg0, arg1 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesInApplication(arg0, arg1 any) *MockApplicationsManagementClientListResourcesInApplicationCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesInApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesInApplication), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesInApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesInApplication), arg0, arg1) + return &MockApplicationsManagementClientListResourcesInApplicationCall{Call: call} +} + +// MockApplicationsManagementClientListResourcesInApplicationCall wrap *gomock.Call +type MockApplicationsManagementClientListResourcesInApplicationCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientListResourcesInApplicationCall) Return(arg0 []generated.GenericResource, arg1 error) *MockApplicationsManagementClientListResourcesInApplicationCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientListResourcesInApplicationCall) Do(f func(context.Context, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesInApplicationCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientListResourcesInApplicationCall) DoAndReturn(f func(context.Context, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesInApplicationCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListResourcesInEnvironment mocks base method. @@ -333,9 +789,33 @@ func (m *MockApplicationsManagementClient) ListResourcesInEnvironment(arg0 conte } // ListResourcesInEnvironment indicates an expected call of ListResourcesInEnvironment. -func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesInEnvironment(arg0, arg1 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesInEnvironment(arg0, arg1 any) *MockApplicationsManagementClientListResourcesInEnvironmentCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesInEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesInEnvironment), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesInEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesInEnvironment), arg0, arg1) + return &MockApplicationsManagementClientListResourcesInEnvironmentCall{Call: call} +} + +// MockApplicationsManagementClientListResourcesInEnvironmentCall wrap *gomock.Call +type MockApplicationsManagementClientListResourcesInEnvironmentCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientListResourcesInEnvironmentCall) Return(arg0 []generated.GenericResource, arg1 error) *MockApplicationsManagementClientListResourcesInEnvironmentCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientListResourcesInEnvironmentCall) Do(f func(context.Context, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesInEnvironmentCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientListResourcesInEnvironmentCall) DoAndReturn(f func(context.Context, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesInEnvironmentCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListResourcesOfType mocks base method. @@ -348,9 +828,33 @@ func (m *MockApplicationsManagementClient) ListResourcesOfType(arg0 context.Cont } // ListResourcesOfType indicates an expected call of ListResourcesOfType. -func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesOfType(arg0, arg1 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesOfType(arg0, arg1 any) *MockApplicationsManagementClientListResourcesOfTypeCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesOfType", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesOfType), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesOfType", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesOfType), arg0, arg1) + return &MockApplicationsManagementClientListResourcesOfTypeCall{Call: call} +} + +// MockApplicationsManagementClientListResourcesOfTypeCall wrap *gomock.Call +type MockApplicationsManagementClientListResourcesOfTypeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientListResourcesOfTypeCall) Return(arg0 []generated.GenericResource, arg1 error) *MockApplicationsManagementClientListResourcesOfTypeCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientListResourcesOfTypeCall) Do(f func(context.Context, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesOfTypeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientListResourcesOfTypeCall) DoAndReturn(f func(context.Context, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesOfTypeCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListResourcesOfTypeInApplication mocks base method. @@ -363,9 +867,33 @@ func (m *MockApplicationsManagementClient) ListResourcesOfTypeInApplication(arg0 } // ListResourcesOfTypeInApplication indicates an expected call of ListResourcesOfTypeInApplication. -func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesOfTypeInApplication(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesOfTypeInApplication(arg0, arg1, arg2 any) *MockApplicationsManagementClientListResourcesOfTypeInApplicationCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesOfTypeInApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesOfTypeInApplication), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesOfTypeInApplication", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesOfTypeInApplication), arg0, arg1, arg2) + return &MockApplicationsManagementClientListResourcesOfTypeInApplicationCall{Call: call} +} + +// MockApplicationsManagementClientListResourcesOfTypeInApplicationCall wrap *gomock.Call +type MockApplicationsManagementClientListResourcesOfTypeInApplicationCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientListResourcesOfTypeInApplicationCall) Return(arg0 []generated.GenericResource, arg1 error) *MockApplicationsManagementClientListResourcesOfTypeInApplicationCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientListResourcesOfTypeInApplicationCall) Do(f func(context.Context, string, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesOfTypeInApplicationCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientListResourcesOfTypeInApplicationCall) DoAndReturn(f func(context.Context, string, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesOfTypeInApplicationCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListResourcesOfTypeInEnvironment mocks base method. @@ -378,7 +906,31 @@ func (m *MockApplicationsManagementClient) ListResourcesOfTypeInEnvironment(arg0 } // ListResourcesOfTypeInEnvironment indicates an expected call of ListResourcesOfTypeInEnvironment. -func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesOfTypeInEnvironment(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockApplicationsManagementClientMockRecorder) ListResourcesOfTypeInEnvironment(arg0, arg1, arg2 any) *MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesOfTypeInEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesOfTypeInEnvironment), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourcesOfTypeInEnvironment", reflect.TypeOf((*MockApplicationsManagementClient)(nil).ListResourcesOfTypeInEnvironment), arg0, arg1, arg2) + return &MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall{Call: call} +} + +// MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall wrap *gomock.Call +type MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall) Return(arg0 []generated.GenericResource, arg1 error) *MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall) Do(f func(context.Context, string, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall) DoAndReturn(f func(context.Context, string, string) ([]generated.GenericResource, error)) *MockApplicationsManagementClientListResourcesOfTypeInEnvironmentCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/clients/mock_diagnosticsclient.go b/pkg/cli/clients/mock_diagnosticsclient.go index 2ea18565db0..ba7e051d575 100644 --- a/pkg/cli/clients/mock_diagnosticsclient.go +++ b/pkg/cli/clients/mock_diagnosticsclient.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_diagnosticsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients DiagnosticsClient +// mockgen -typed -destination=./mock_diagnosticsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients DiagnosticsClient // // Package clients is a generated GoMock package. @@ -52,9 +52,33 @@ func (m *MockDiagnosticsClient) Expose(arg0 context.Context, arg1 ExposeOptions) } // Expose indicates an expected call of Expose. -func (mr *MockDiagnosticsClientMockRecorder) Expose(arg0, arg1 any) *gomock.Call { +func (mr *MockDiagnosticsClientMockRecorder) Expose(arg0, arg1 any) *MockDiagnosticsClientExposeCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Expose", reflect.TypeOf((*MockDiagnosticsClient)(nil).Expose), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Expose", reflect.TypeOf((*MockDiagnosticsClient)(nil).Expose), arg0, arg1) + return &MockDiagnosticsClientExposeCall{Call: call} +} + +// MockDiagnosticsClientExposeCall wrap *gomock.Call +type MockDiagnosticsClientExposeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDiagnosticsClientExposeCall) Return(arg0 chan error, arg1 chan struct{}, arg2 chan os.Signal, arg3 error) *MockDiagnosticsClientExposeCall { + c.Call = c.Call.Return(arg0, arg1, arg2, arg3) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDiagnosticsClientExposeCall) Do(f func(context.Context, ExposeOptions) (chan error, chan struct{}, chan os.Signal, error)) *MockDiagnosticsClientExposeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDiagnosticsClientExposeCall) DoAndReturn(f func(context.Context, ExposeOptions) (chan error, chan struct{}, chan os.Signal, error)) *MockDiagnosticsClientExposeCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetPublicEndpoint mocks base method. @@ -67,9 +91,33 @@ func (m *MockDiagnosticsClient) GetPublicEndpoint(arg0 context.Context, arg1 End } // GetPublicEndpoint indicates an expected call of GetPublicEndpoint. -func (mr *MockDiagnosticsClientMockRecorder) GetPublicEndpoint(arg0, arg1 any) *gomock.Call { +func (mr *MockDiagnosticsClientMockRecorder) GetPublicEndpoint(arg0, arg1 any) *MockDiagnosticsClientGetPublicEndpointCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPublicEndpoint", reflect.TypeOf((*MockDiagnosticsClient)(nil).GetPublicEndpoint), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPublicEndpoint", reflect.TypeOf((*MockDiagnosticsClient)(nil).GetPublicEndpoint), arg0, arg1) + return &MockDiagnosticsClientGetPublicEndpointCall{Call: call} +} + +// MockDiagnosticsClientGetPublicEndpointCall wrap *gomock.Call +type MockDiagnosticsClientGetPublicEndpointCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDiagnosticsClientGetPublicEndpointCall) Return(arg0 *string, arg1 error) *MockDiagnosticsClientGetPublicEndpointCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDiagnosticsClientGetPublicEndpointCall) Do(f func(context.Context, EndpointOptions) (*string, error)) *MockDiagnosticsClientGetPublicEndpointCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDiagnosticsClientGetPublicEndpointCall) DoAndReturn(f func(context.Context, EndpointOptions) (*string, error)) *MockDiagnosticsClientGetPublicEndpointCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Logs mocks base method. @@ -82,7 +130,31 @@ func (m *MockDiagnosticsClient) Logs(arg0 context.Context, arg1 LogsOptions) ([] } // Logs indicates an expected call of Logs. -func (mr *MockDiagnosticsClientMockRecorder) Logs(arg0, arg1 any) *gomock.Call { +func (mr *MockDiagnosticsClientMockRecorder) Logs(arg0, arg1 any) *MockDiagnosticsClientLogsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Logs", reflect.TypeOf((*MockDiagnosticsClient)(nil).Logs), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Logs", reflect.TypeOf((*MockDiagnosticsClient)(nil).Logs), arg0, arg1) + return &MockDiagnosticsClientLogsCall{Call: call} +} + +// MockDiagnosticsClientLogsCall wrap *gomock.Call +type MockDiagnosticsClientLogsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDiagnosticsClientLogsCall) Return(arg0 []LogStream, arg1 error) *MockDiagnosticsClientLogsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDiagnosticsClientLogsCall) Do(f func(context.Context, LogsOptions) ([]LogStream, error)) *MockDiagnosticsClientLogsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDiagnosticsClientLogsCall) DoAndReturn(f func(context.Context, LogsOptions) ([]LogStream, error)) *MockDiagnosticsClientLogsCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/cmd/env/namespace/mock_namespace.go b/pkg/cli/cmd/env/namespace/mock_namespace.go index 948ff8cad6c..dc78230b9e2 100644 --- a/pkg/cli/cmd/env/namespace/mock_namespace.go +++ b/pkg/cli/cmd/env/namespace/mock_namespace.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_namespace.go -package=namespace -self_package github.com/radius-project/radius/pkg/cli/cmd/env/namespace github.com/radius-project/radius/pkg/cli/cmd/env/namespace Interface +// mockgen -typed -destination=./mock_namespace.go -package=namespace -self_package github.com/radius-project/radius/pkg/cli/cmd/env/namespace github.com/radius-project/radius/pkg/cli/cmd/env/namespace Interface // // Package namespace is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockInterface) ValidateNamespace(arg0 context.Context, arg1 string, arg } // ValidateNamespace indicates an expected call of ValidateNamespace. -func (mr *MockInterfaceMockRecorder) ValidateNamespace(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) ValidateNamespace(arg0, arg1, arg2 any) *MockInterfaceValidateNamespaceCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateNamespace", reflect.TypeOf((*MockInterface)(nil).ValidateNamespace), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateNamespace", reflect.TypeOf((*MockInterface)(nil).ValidateNamespace), arg0, arg1, arg2) + return &MockInterfaceValidateNamespaceCall{Call: call} +} + +// MockInterfaceValidateNamespaceCall wrap *gomock.Call +type MockInterfaceValidateNamespaceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceValidateNamespaceCall) Return(arg0 error) *MockInterfaceValidateNamespaceCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceValidateNamespaceCall) Do(f func(context.Context, string, workspaces.Workspace) error) *MockInterfaceValidateNamespaceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceValidateNamespaceCall) DoAndReturn(f func(context.Context, string, workspaces.Workspace) error) *MockInterfaceValidateNamespaceCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/cmd/env/namespace/namespace.go b/pkg/cli/cmd/env/namespace/namespace.go index 5fb35e43e66..4c9e908d94d 100644 --- a/pkg/cli/cmd/env/namespace/namespace.go +++ b/pkg/cli/cmd/env/namespace/namespace.go @@ -24,7 +24,7 @@ import ( "github.com/radius-project/radius/pkg/cli/workspaces" ) -//go:generate mockgen -destination=./mock_namespace.go -package=namespace -self_package github.com/radius-project/radius/pkg/cli/cmd/env/namespace github.com/radius-project/radius/pkg/cli/cmd/env/namespace Interface +//go:generate mockgen -typed -destination=./mock_namespace.go -package=namespace -self_package github.com/radius-project/radius/pkg/cli/cmd/env/namespace github.com/radius-project/radius/pkg/cli/cmd/env/namespace Interface type Interface interface { ValidateNamespace(ctx context.Context, namespace string, workspace workspaces.Workspace) error } diff --git a/pkg/cli/cmd/radinit/mock_devrecipeclient.go b/pkg/cli/cmd/radinit/mock_devrecipeclient.go index 94b1f177dd8..3ed7ceae95c 100644 --- a/pkg/cli/cmd/radinit/mock_devrecipeclient.go +++ b/pkg/cli/cmd/radinit/mock_devrecipeclient.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_devrecipeclient.go -package=radinit -self_package github.com/radius-project/radius/pkg/cli/cmd/radinit github.com/radius-project/radius/pkg/cli/cmd/radinit DevRecipeClient +// mockgen -typed -destination=./mock_devrecipeclient.go -package=radinit -self_package github.com/radius-project/radius/pkg/cli/cmd/radinit github.com/radius-project/radius/pkg/cli/cmd/radinit DevRecipeClient // // Package radinit is a generated GoMock package. @@ -50,7 +50,31 @@ func (m *MockDevRecipeClient) GetDevRecipes(arg0 context.Context) (map[string]ma } // GetDevRecipes indicates an expected call of GetDevRecipes. -func (mr *MockDevRecipeClientMockRecorder) GetDevRecipes(arg0 any) *gomock.Call { +func (mr *MockDevRecipeClientMockRecorder) GetDevRecipes(arg0 any) *MockDevRecipeClientGetDevRecipesCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDevRecipes", reflect.TypeOf((*MockDevRecipeClient)(nil).GetDevRecipes), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDevRecipes", reflect.TypeOf((*MockDevRecipeClient)(nil).GetDevRecipes), arg0) + return &MockDevRecipeClientGetDevRecipesCall{Call: call} +} + +// MockDevRecipeClientGetDevRecipesCall wrap *gomock.Call +type MockDevRecipeClientGetDevRecipesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDevRecipeClientGetDevRecipesCall) Return(arg0 map[string]map[string]v20231001preview.RecipePropertiesClassification, arg1 error) *MockDevRecipeClientGetDevRecipesCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDevRecipeClientGetDevRecipesCall) Do(f func(context.Context) (map[string]map[string]v20231001preview.RecipePropertiesClassification, error)) *MockDevRecipeClientGetDevRecipesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDevRecipeClientGetDevRecipesCall) DoAndReturn(f func(context.Context) (map[string]map[string]v20231001preview.RecipePropertiesClassification, error)) *MockDevRecipeClientGetDevRecipesCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/cmd/radinit/recipe.go b/pkg/cli/cmd/radinit/recipe.go index cb389c035e4..fda9b3207ac 100644 --- a/pkg/cli/cmd/radinit/recipe.go +++ b/pkg/cli/cmd/radinit/recipe.go @@ -94,7 +94,7 @@ func AvailableDevRecipes() []DevRecipe { } } -//go:generate mockgen -destination=./mock_devrecipeclient.go -package=radinit -self_package github.com/radius-project/radius/pkg/cli/cmd/radinit github.com/radius-project/radius/pkg/cli/cmd/radinit DevRecipeClient +//go:generate mockgen -typed -destination=./mock_devrecipeclient.go -package=radinit -self_package github.com/radius-project/radius/pkg/cli/cmd/radinit github.com/radius-project/radius/pkg/cli/cmd/radinit DevRecipeClient type DevRecipeClient interface { GetDevRecipes(ctx context.Context) (map[string]map[string]corerp.RecipePropertiesClassification, error) } diff --git a/pkg/cli/credential/aws_credential_management.go b/pkg/cli/credential/aws_credential_management.go index 9ac48354b15..6926e34c16b 100644 --- a/pkg/cli/credential/aws_credential_management.go +++ b/pkg/cli/credential/aws_credential_management.go @@ -26,7 +26,7 @@ import ( ucp "github.com/radius-project/radius/pkg/ucp/api/v20231001preview" ) -//go:generate mockgen -destination=./mock_aws_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AWSCredentialManagementClientInterface +//go:generate mockgen -typed -destination=./mock_aws_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AWSCredentialManagementClientInterface // AWSCredentialManagementClient is used to interface with cloud provider configuration and credentials. type AWSCredentialManagementClient struct { diff --git a/pkg/cli/credential/azure_credential_management.go b/pkg/cli/credential/azure_credential_management.go index 0a31d79e3f8..4070a41a151 100644 --- a/pkg/cli/credential/azure_credential_management.go +++ b/pkg/cli/credential/azure_credential_management.go @@ -26,7 +26,7 @@ import ( ucp "github.com/radius-project/radius/pkg/ucp/api/v20231001preview" ) -//go:generate mockgen -destination=./mock_azure_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AzureCredentialManagementClientInterface +//go:generate mockgen -typed -destination=./mock_azure_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AzureCredentialManagementClientInterface // AzureCredentialManagementClient is used to interface with cloud provider configuration and credentials. type AzureCredentialManagementClient struct { diff --git a/pkg/cli/credential/credential_management.go b/pkg/cli/credential/credential_management.go index 66d03ff08f6..41b602fe357 100644 --- a/pkg/cli/credential/credential_management.go +++ b/pkg/cli/credential/credential_management.go @@ -29,7 +29,7 @@ const ( AWSPlaneType = "aws" ) -//go:generate mockgen -destination=./mock_credentialmanagementclient.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential CredentialManagementClient +//go:generate mockgen -typed -destination=./mock_credentialmanagementclient.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential CredentialManagementClient // CredentialManagementClient is used to interface with cloud provider configuration and credentials. type CredentialManagementClient interface { diff --git a/pkg/cli/credential/mock_aws_credential_management.go b/pkg/cli/credential/mock_aws_credential_management.go index b9944a66a7d..99c6b463f67 100644 --- a/pkg/cli/credential/mock_aws_credential_management.go +++ b/pkg/cli/credential/mock_aws_credential_management.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_aws_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AWSCredentialManagementClientInterface +// mockgen -typed -destination=./mock_aws_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AWSCredentialManagementClientInterface // // Package credential is a generated GoMock package. @@ -50,9 +50,33 @@ func (m *MockAWSCredentialManagementClientInterface) Delete(arg0 context.Context } // Delete indicates an expected call of Delete. -func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Delete(arg0, arg1 any) *MockAWSCredentialManagementClientInterfaceDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAWSCredentialManagementClientInterface)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAWSCredentialManagementClientInterface)(nil).Delete), arg0, arg1) + return &MockAWSCredentialManagementClientInterfaceDeleteCall{Call: call} +} + +// MockAWSCredentialManagementClientInterfaceDeleteCall wrap *gomock.Call +type MockAWSCredentialManagementClientInterfaceDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCredentialManagementClientInterfaceDeleteCall) Return(arg0 bool, arg1 error) *MockAWSCredentialManagementClientInterfaceDeleteCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCredentialManagementClientInterfaceDeleteCall) Do(f func(context.Context, string) (bool, error)) *MockAWSCredentialManagementClientInterfaceDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCredentialManagementClientInterfaceDeleteCall) DoAndReturn(f func(context.Context, string) (bool, error)) *MockAWSCredentialManagementClientInterfaceDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Get mocks base method. @@ -65,9 +89,33 @@ func (m *MockAWSCredentialManagementClientInterface) Get(arg0 context.Context, a } // Get indicates an expected call of Get. -func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Get(arg0, arg1 any) *gomock.Call { +func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Get(arg0, arg1 any) *MockAWSCredentialManagementClientInterfaceGetCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockAWSCredentialManagementClientInterface)(nil).Get), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockAWSCredentialManagementClientInterface)(nil).Get), arg0, arg1) + return &MockAWSCredentialManagementClientInterfaceGetCall{Call: call} +} + +// MockAWSCredentialManagementClientInterfaceGetCall wrap *gomock.Call +type MockAWSCredentialManagementClientInterfaceGetCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCredentialManagementClientInterfaceGetCall) Return(arg0 ProviderCredentialConfiguration, arg1 error) *MockAWSCredentialManagementClientInterfaceGetCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCredentialManagementClientInterfaceGetCall) Do(f func(context.Context, string) (ProviderCredentialConfiguration, error)) *MockAWSCredentialManagementClientInterfaceGetCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCredentialManagementClientInterfaceGetCall) DoAndReturn(f func(context.Context, string) (ProviderCredentialConfiguration, error)) *MockAWSCredentialManagementClientInterfaceGetCall { + c.Call = c.Call.DoAndReturn(f) + return c } // List mocks base method. @@ -80,9 +128,33 @@ func (m *MockAWSCredentialManagementClientInterface) List(arg0 context.Context) } // List indicates an expected call of List. -func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) List(arg0 any) *gomock.Call { +func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) List(arg0 any) *MockAWSCredentialManagementClientInterfaceListCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAWSCredentialManagementClientInterface)(nil).List), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAWSCredentialManagementClientInterface)(nil).List), arg0) + return &MockAWSCredentialManagementClientInterfaceListCall{Call: call} +} + +// MockAWSCredentialManagementClientInterfaceListCall wrap *gomock.Call +type MockAWSCredentialManagementClientInterfaceListCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCredentialManagementClientInterfaceListCall) Return(arg0 []CloudProviderStatus, arg1 error) *MockAWSCredentialManagementClientInterfaceListCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCredentialManagementClientInterfaceListCall) Do(f func(context.Context) ([]CloudProviderStatus, error)) *MockAWSCredentialManagementClientInterfaceListCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCredentialManagementClientInterfaceListCall) DoAndReturn(f func(context.Context) ([]CloudProviderStatus, error)) *MockAWSCredentialManagementClientInterfaceListCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Put mocks base method. @@ -94,7 +166,31 @@ func (m *MockAWSCredentialManagementClientInterface) Put(arg0 context.Context, a } // Put indicates an expected call of Put. -func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Put(arg0, arg1 any) *gomock.Call { +func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) Put(arg0, arg1 any) *MockAWSCredentialManagementClientInterfacePutCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockAWSCredentialManagementClientInterface)(nil).Put), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockAWSCredentialManagementClientInterface)(nil).Put), arg0, arg1) + return &MockAWSCredentialManagementClientInterfacePutCall{Call: call} +} + +// MockAWSCredentialManagementClientInterfacePutCall wrap *gomock.Call +type MockAWSCredentialManagementClientInterfacePutCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCredentialManagementClientInterfacePutCall) Return(arg0 error) *MockAWSCredentialManagementClientInterfacePutCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCredentialManagementClientInterfacePutCall) Do(f func(context.Context, v20231001preview.AwsCredentialResource) error) *MockAWSCredentialManagementClientInterfacePutCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCredentialManagementClientInterfacePutCall) DoAndReturn(f func(context.Context, v20231001preview.AwsCredentialResource) error) *MockAWSCredentialManagementClientInterfacePutCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/credential/mock_azure_credential_management.go b/pkg/cli/credential/mock_azure_credential_management.go index 79981386a53..b8c855436bc 100644 --- a/pkg/cli/credential/mock_azure_credential_management.go +++ b/pkg/cli/credential/mock_azure_credential_management.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_azure_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AzureCredentialManagementClientInterface +// mockgen -typed -destination=./mock_azure_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AzureCredentialManagementClientInterface // // Package credential is a generated GoMock package. @@ -50,9 +50,33 @@ func (m *MockAzureCredentialManagementClientInterface) Delete(arg0 context.Conte } // Delete indicates an expected call of Delete. -func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Delete(arg0, arg1 any) *MockAzureCredentialManagementClientInterfaceDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAzureCredentialManagementClientInterface)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAzureCredentialManagementClientInterface)(nil).Delete), arg0, arg1) + return &MockAzureCredentialManagementClientInterfaceDeleteCall{Call: call} +} + +// MockAzureCredentialManagementClientInterfaceDeleteCall wrap *gomock.Call +type MockAzureCredentialManagementClientInterfaceDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAzureCredentialManagementClientInterfaceDeleteCall) Return(arg0 bool, arg1 error) *MockAzureCredentialManagementClientInterfaceDeleteCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAzureCredentialManagementClientInterfaceDeleteCall) Do(f func(context.Context, string) (bool, error)) *MockAzureCredentialManagementClientInterfaceDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAzureCredentialManagementClientInterfaceDeleteCall) DoAndReturn(f func(context.Context, string) (bool, error)) *MockAzureCredentialManagementClientInterfaceDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Get mocks base method. @@ -65,9 +89,33 @@ func (m *MockAzureCredentialManagementClientInterface) Get(arg0 context.Context, } // Get indicates an expected call of Get. -func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Get(arg0, arg1 any) *gomock.Call { +func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Get(arg0, arg1 any) *MockAzureCredentialManagementClientInterfaceGetCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockAzureCredentialManagementClientInterface)(nil).Get), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockAzureCredentialManagementClientInterface)(nil).Get), arg0, arg1) + return &MockAzureCredentialManagementClientInterfaceGetCall{Call: call} +} + +// MockAzureCredentialManagementClientInterfaceGetCall wrap *gomock.Call +type MockAzureCredentialManagementClientInterfaceGetCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAzureCredentialManagementClientInterfaceGetCall) Return(arg0 ProviderCredentialConfiguration, arg1 error) *MockAzureCredentialManagementClientInterfaceGetCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAzureCredentialManagementClientInterfaceGetCall) Do(f func(context.Context, string) (ProviderCredentialConfiguration, error)) *MockAzureCredentialManagementClientInterfaceGetCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAzureCredentialManagementClientInterfaceGetCall) DoAndReturn(f func(context.Context, string) (ProviderCredentialConfiguration, error)) *MockAzureCredentialManagementClientInterfaceGetCall { + c.Call = c.Call.DoAndReturn(f) + return c } // List mocks base method. @@ -80,9 +128,33 @@ func (m *MockAzureCredentialManagementClientInterface) List(arg0 context.Context } // List indicates an expected call of List. -func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) List(arg0 any) *gomock.Call { +func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) List(arg0 any) *MockAzureCredentialManagementClientInterfaceListCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAzureCredentialManagementClientInterface)(nil).List), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAzureCredentialManagementClientInterface)(nil).List), arg0) + return &MockAzureCredentialManagementClientInterfaceListCall{Call: call} +} + +// MockAzureCredentialManagementClientInterfaceListCall wrap *gomock.Call +type MockAzureCredentialManagementClientInterfaceListCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAzureCredentialManagementClientInterfaceListCall) Return(arg0 []CloudProviderStatus, arg1 error) *MockAzureCredentialManagementClientInterfaceListCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAzureCredentialManagementClientInterfaceListCall) Do(f func(context.Context) ([]CloudProviderStatus, error)) *MockAzureCredentialManagementClientInterfaceListCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAzureCredentialManagementClientInterfaceListCall) DoAndReturn(f func(context.Context) ([]CloudProviderStatus, error)) *MockAzureCredentialManagementClientInterfaceListCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Put mocks base method. @@ -94,7 +166,31 @@ func (m *MockAzureCredentialManagementClientInterface) Put(arg0 context.Context, } // Put indicates an expected call of Put. -func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Put(arg0, arg1 any) *gomock.Call { +func (mr *MockAzureCredentialManagementClientInterfaceMockRecorder) Put(arg0, arg1 any) *MockAzureCredentialManagementClientInterfacePutCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockAzureCredentialManagementClientInterface)(nil).Put), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockAzureCredentialManagementClientInterface)(nil).Put), arg0, arg1) + return &MockAzureCredentialManagementClientInterfacePutCall{Call: call} +} + +// MockAzureCredentialManagementClientInterfacePutCall wrap *gomock.Call +type MockAzureCredentialManagementClientInterfacePutCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAzureCredentialManagementClientInterfacePutCall) Return(arg0 error) *MockAzureCredentialManagementClientInterfacePutCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAzureCredentialManagementClientInterfacePutCall) Do(f func(context.Context, v20231001preview.AzureCredentialResource) error) *MockAzureCredentialManagementClientInterfacePutCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAzureCredentialManagementClientInterfacePutCall) DoAndReturn(f func(context.Context, v20231001preview.AzureCredentialResource) error) *MockAzureCredentialManagementClientInterfacePutCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/credential/mock_credentialmanagementclient.go b/pkg/cli/credential/mock_credentialmanagementclient.go index bbefc6d66db..69fdc1255e4 100644 --- a/pkg/cli/credential/mock_credentialmanagementclient.go +++ b/pkg/cli/credential/mock_credentialmanagementclient.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_credentialmanagementclient.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential CredentialManagementClient +// mockgen -typed -destination=./mock_credentialmanagementclient.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential CredentialManagementClient // // Package credential is a generated GoMock package. @@ -50,9 +50,33 @@ func (m *MockCredentialManagementClient) Delete(arg0 context.Context, arg1 strin } // Delete indicates an expected call of Delete. -func (mr *MockCredentialManagementClientMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockCredentialManagementClientMockRecorder) Delete(arg0, arg1 any) *MockCredentialManagementClientDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockCredentialManagementClient)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockCredentialManagementClient)(nil).Delete), arg0, arg1) + return &MockCredentialManagementClientDeleteCall{Call: call} +} + +// MockCredentialManagementClientDeleteCall wrap *gomock.Call +type MockCredentialManagementClientDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCredentialManagementClientDeleteCall) Return(arg0 bool, arg1 error) *MockCredentialManagementClientDeleteCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCredentialManagementClientDeleteCall) Do(f func(context.Context, string) (bool, error)) *MockCredentialManagementClientDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCredentialManagementClientDeleteCall) DoAndReturn(f func(context.Context, string) (bool, error)) *MockCredentialManagementClientDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Get mocks base method. @@ -65,9 +89,33 @@ func (m *MockCredentialManagementClient) Get(arg0 context.Context, arg1 string) } // Get indicates an expected call of Get. -func (mr *MockCredentialManagementClientMockRecorder) Get(arg0, arg1 any) *gomock.Call { +func (mr *MockCredentialManagementClientMockRecorder) Get(arg0, arg1 any) *MockCredentialManagementClientGetCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockCredentialManagementClient)(nil).Get), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockCredentialManagementClient)(nil).Get), arg0, arg1) + return &MockCredentialManagementClientGetCall{Call: call} +} + +// MockCredentialManagementClientGetCall wrap *gomock.Call +type MockCredentialManagementClientGetCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCredentialManagementClientGetCall) Return(arg0 ProviderCredentialConfiguration, arg1 error) *MockCredentialManagementClientGetCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCredentialManagementClientGetCall) Do(f func(context.Context, string) (ProviderCredentialConfiguration, error)) *MockCredentialManagementClientGetCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCredentialManagementClientGetCall) DoAndReturn(f func(context.Context, string) (ProviderCredentialConfiguration, error)) *MockCredentialManagementClientGetCall { + c.Call = c.Call.DoAndReturn(f) + return c } // List mocks base method. @@ -80,9 +128,33 @@ func (m *MockCredentialManagementClient) List(arg0 context.Context) ([]CloudProv } // List indicates an expected call of List. -func (mr *MockCredentialManagementClientMockRecorder) List(arg0 any) *gomock.Call { +func (mr *MockCredentialManagementClientMockRecorder) List(arg0 any) *MockCredentialManagementClientListCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockCredentialManagementClient)(nil).List), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockCredentialManagementClient)(nil).List), arg0) + return &MockCredentialManagementClientListCall{Call: call} +} + +// MockCredentialManagementClientListCall wrap *gomock.Call +type MockCredentialManagementClientListCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCredentialManagementClientListCall) Return(arg0 []CloudProviderStatus, arg1 error) *MockCredentialManagementClientListCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCredentialManagementClientListCall) Do(f func(context.Context) ([]CloudProviderStatus, error)) *MockCredentialManagementClientListCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCredentialManagementClientListCall) DoAndReturn(f func(context.Context) ([]CloudProviderStatus, error)) *MockCredentialManagementClientListCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PutAWS mocks base method. @@ -94,9 +166,33 @@ func (m *MockCredentialManagementClient) PutAWS(arg0 context.Context, arg1 v2023 } // PutAWS indicates an expected call of PutAWS. -func (mr *MockCredentialManagementClientMockRecorder) PutAWS(arg0, arg1 any) *gomock.Call { +func (mr *MockCredentialManagementClientMockRecorder) PutAWS(arg0, arg1 any) *MockCredentialManagementClientPutAWSCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutAWS", reflect.TypeOf((*MockCredentialManagementClient)(nil).PutAWS), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutAWS", reflect.TypeOf((*MockCredentialManagementClient)(nil).PutAWS), arg0, arg1) + return &MockCredentialManagementClientPutAWSCall{Call: call} +} + +// MockCredentialManagementClientPutAWSCall wrap *gomock.Call +type MockCredentialManagementClientPutAWSCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCredentialManagementClientPutAWSCall) Return(arg0 error) *MockCredentialManagementClientPutAWSCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCredentialManagementClientPutAWSCall) Do(f func(context.Context, v20231001preview.AwsCredentialResource) error) *MockCredentialManagementClientPutAWSCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCredentialManagementClientPutAWSCall) DoAndReturn(f func(context.Context, v20231001preview.AwsCredentialResource) error) *MockCredentialManagementClientPutAWSCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PutAzure mocks base method. @@ -108,7 +204,31 @@ func (m *MockCredentialManagementClient) PutAzure(arg0 context.Context, arg1 v20 } // PutAzure indicates an expected call of PutAzure. -func (mr *MockCredentialManagementClientMockRecorder) PutAzure(arg0, arg1 any) *gomock.Call { +func (mr *MockCredentialManagementClientMockRecorder) PutAzure(arg0, arg1 any) *MockCredentialManagementClientPutAzureCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutAzure", reflect.TypeOf((*MockCredentialManagementClient)(nil).PutAzure), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutAzure", reflect.TypeOf((*MockCredentialManagementClient)(nil).PutAzure), arg0, arg1) + return &MockCredentialManagementClientPutAzureCall{Call: call} +} + +// MockCredentialManagementClientPutAzureCall wrap *gomock.Call +type MockCredentialManagementClientPutAzureCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCredentialManagementClientPutAzureCall) Return(arg0 error) *MockCredentialManagementClientPutAzureCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCredentialManagementClientPutAzureCall) Do(f func(context.Context, v20231001preview.AzureCredentialResource) error) *MockCredentialManagementClientPutAzureCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCredentialManagementClientPutAzureCall) DoAndReturn(f func(context.Context, v20231001preview.AzureCredentialResource) error) *MockCredentialManagementClientPutAzureCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/deploy/mock_deploy.go b/pkg/cli/deploy/mock_deploy.go index 79f7de81455..e7b3534b9b2 100644 --- a/pkg/cli/deploy/mock_deploy.go +++ b/pkg/cli/deploy/mock_deploy.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_deploy.go -package=deploy -self_package github.com/radius-project/radius/pkg/cli/deploy github.com/radius-project/radius/pkg/cli/deploy Interface +// mockgen -typed -destination=./mock_deploy.go -package=deploy -self_package github.com/radius-project/radius/pkg/cli/deploy github.com/radius-project/radius/pkg/cli/deploy Interface // // Package deploy is a generated GoMock package. @@ -50,7 +50,31 @@ func (m *MockInterface) DeployWithProgress(arg0 context.Context, arg1 Options) ( } // DeployWithProgress indicates an expected call of DeployWithProgress. -func (mr *MockInterfaceMockRecorder) DeployWithProgress(arg0, arg1 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) DeployWithProgress(arg0, arg1 any) *MockInterfaceDeployWithProgressCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeployWithProgress", reflect.TypeOf((*MockInterface)(nil).DeployWithProgress), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeployWithProgress", reflect.TypeOf((*MockInterface)(nil).DeployWithProgress), arg0, arg1) + return &MockInterfaceDeployWithProgressCall{Call: call} +} + +// MockInterfaceDeployWithProgressCall wrap *gomock.Call +type MockInterfaceDeployWithProgressCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceDeployWithProgressCall) Return(arg0 clients.DeploymentResult, arg1 error) *MockInterfaceDeployWithProgressCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceDeployWithProgressCall) Do(f func(context.Context, Options) (clients.DeploymentResult, error)) *MockInterfaceDeployWithProgressCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceDeployWithProgressCall) DoAndReturn(f func(context.Context, Options) (clients.DeploymentResult, error)) *MockInterfaceDeployWithProgressCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/deploy/types.go b/pkg/cli/deploy/types.go index e89142dc621..1e45fb4ec14 100644 --- a/pkg/cli/deploy/types.go +++ b/pkg/cli/deploy/types.go @@ -60,7 +60,7 @@ var _ Interface = (*Impl)(nil) type Impl struct { } -//go:generate mockgen -destination=./mock_deploy.go -package=deploy -self_package github.com/radius-project/radius/pkg/cli/deploy github.com/radius-project/radius/pkg/cli/deploy Interface +//go:generate mockgen -typed -destination=./mock_deploy.go -package=deploy -self_package github.com/radius-project/radius/pkg/cli/deploy github.com/radius-project/radius/pkg/cli/deploy Interface // DeployWithProgress runs a deployment and displays progress to the user. This is intended to be used // from the CLI and thus logs to the console. diff --git a/pkg/cli/framework/config.go b/pkg/cli/framework/config.go index 56393d0088e..3c8665869f0 100644 --- a/pkg/cli/framework/config.go +++ b/pkg/cli/framework/config.go @@ -53,7 +53,7 @@ func ConfigFromContext(ctx context.Context) *viper.Viper { return holder.Config } -//go:generate mockgen -destination=./mock_config.go -package=framework -self_package github.com/radius-project/radius/pkg/cli/framework github.com/radius-project/radius/pkg/cli/framework ConfigFileInterface +//go:generate mockgen -typed -destination=./mock_config.go -package=framework -self_package github.com/radius-project/radius/pkg/cli/framework github.com/radius-project/radius/pkg/cli/framework ConfigFileInterface type ConfigFileInterface interface { ConfigFromContext(ctx context.Context) *viper.Viper diff --git a/pkg/cli/framework/mock_config.go b/pkg/cli/framework/mock_config.go index 17fb203ab0f..2e3a5b5e5a6 100644 --- a/pkg/cli/framework/mock_config.go +++ b/pkg/cli/framework/mock_config.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_config.go -package=framework -self_package github.com/radius-project/radius/pkg/cli/framework github.com/radius-project/radius/pkg/cli/framework ConfigFileInterface +// mockgen -typed -destination=./mock_config.go -package=framework -self_package github.com/radius-project/radius/pkg/cli/framework github.com/radius-project/radius/pkg/cli/framework ConfigFileInterface // // Package framework is a generated GoMock package. @@ -50,9 +50,33 @@ func (m *MockConfigFileInterface) ConfigFromContext(arg0 context.Context) *viper } // ConfigFromContext indicates an expected call of ConfigFromContext. -func (mr *MockConfigFileInterfaceMockRecorder) ConfigFromContext(arg0 any) *gomock.Call { +func (mr *MockConfigFileInterfaceMockRecorder) ConfigFromContext(arg0 any) *MockConfigFileInterfaceConfigFromContextCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigFromContext", reflect.TypeOf((*MockConfigFileInterface)(nil).ConfigFromContext), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigFromContext", reflect.TypeOf((*MockConfigFileInterface)(nil).ConfigFromContext), arg0) + return &MockConfigFileInterfaceConfigFromContextCall{Call: call} +} + +// MockConfigFileInterfaceConfigFromContextCall wrap *gomock.Call +type MockConfigFileInterfaceConfigFromContextCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockConfigFileInterfaceConfigFromContextCall) Return(arg0 *viper.Viper) *MockConfigFileInterfaceConfigFromContextCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockConfigFileInterfaceConfigFromContextCall) Do(f func(context.Context) *viper.Viper) *MockConfigFileInterfaceConfigFromContextCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockConfigFileInterfaceConfigFromContextCall) DoAndReturn(f func(context.Context) *viper.Viper) *MockConfigFileInterfaceConfigFromContextCall { + c.Call = c.Call.DoAndReturn(f) + return c } // DeleteWorkspace mocks base method. @@ -64,9 +88,33 @@ func (m *MockConfigFileInterface) DeleteWorkspace(arg0 context.Context, arg1 *vi } // DeleteWorkspace indicates an expected call of DeleteWorkspace. -func (mr *MockConfigFileInterfaceMockRecorder) DeleteWorkspace(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockConfigFileInterfaceMockRecorder) DeleteWorkspace(arg0, arg1, arg2 any) *MockConfigFileInterfaceDeleteWorkspaceCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkspace", reflect.TypeOf((*MockConfigFileInterface)(nil).DeleteWorkspace), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkspace", reflect.TypeOf((*MockConfigFileInterface)(nil).DeleteWorkspace), arg0, arg1, arg2) + return &MockConfigFileInterfaceDeleteWorkspaceCall{Call: call} +} + +// MockConfigFileInterfaceDeleteWorkspaceCall wrap *gomock.Call +type MockConfigFileInterfaceDeleteWorkspaceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockConfigFileInterfaceDeleteWorkspaceCall) Return(arg0 error) *MockConfigFileInterfaceDeleteWorkspaceCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockConfigFileInterfaceDeleteWorkspaceCall) Do(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceDeleteWorkspaceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockConfigFileInterfaceDeleteWorkspaceCall) DoAndReturn(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceDeleteWorkspaceCall { + c.Call = c.Call.DoAndReturn(f) + return c } // EditWorkspaces mocks base method. @@ -78,9 +126,33 @@ func (m *MockConfigFileInterface) EditWorkspaces(arg0 context.Context, arg1 *vip } // EditWorkspaces indicates an expected call of EditWorkspaces. -func (mr *MockConfigFileInterfaceMockRecorder) EditWorkspaces(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockConfigFileInterfaceMockRecorder) EditWorkspaces(arg0, arg1, arg2 any) *MockConfigFileInterfaceEditWorkspacesCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EditWorkspaces", reflect.TypeOf((*MockConfigFileInterface)(nil).EditWorkspaces), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EditWorkspaces", reflect.TypeOf((*MockConfigFileInterface)(nil).EditWorkspaces), arg0, arg1, arg2) + return &MockConfigFileInterfaceEditWorkspacesCall{Call: call} +} + +// MockConfigFileInterfaceEditWorkspacesCall wrap *gomock.Call +type MockConfigFileInterfaceEditWorkspacesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockConfigFileInterfaceEditWorkspacesCall) Return(arg0 error) *MockConfigFileInterfaceEditWorkspacesCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockConfigFileInterfaceEditWorkspacesCall) Do(f func(context.Context, *viper.Viper, *workspaces.Workspace) error) *MockConfigFileInterfaceEditWorkspacesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockConfigFileInterfaceEditWorkspacesCall) DoAndReturn(f func(context.Context, *viper.Viper, *workspaces.Workspace) error) *MockConfigFileInterfaceEditWorkspacesCall { + c.Call = c.Call.DoAndReturn(f) + return c } // SetDefaultWorkspace mocks base method. @@ -92,7 +164,31 @@ func (m *MockConfigFileInterface) SetDefaultWorkspace(arg0 context.Context, arg1 } // SetDefaultWorkspace indicates an expected call of SetDefaultWorkspace. -func (mr *MockConfigFileInterfaceMockRecorder) SetDefaultWorkspace(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockConfigFileInterfaceMockRecorder) SetDefaultWorkspace(arg0, arg1, arg2 any) *MockConfigFileInterfaceSetDefaultWorkspaceCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDefaultWorkspace", reflect.TypeOf((*MockConfigFileInterface)(nil).SetDefaultWorkspace), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDefaultWorkspace", reflect.TypeOf((*MockConfigFileInterface)(nil).SetDefaultWorkspace), arg0, arg1, arg2) + return &MockConfigFileInterfaceSetDefaultWorkspaceCall{Call: call} +} + +// MockConfigFileInterfaceSetDefaultWorkspaceCall wrap *gomock.Call +type MockConfigFileInterfaceSetDefaultWorkspaceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockConfigFileInterfaceSetDefaultWorkspaceCall) Return(arg0 error) *MockConfigFileInterfaceSetDefaultWorkspaceCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockConfigFileInterfaceSetDefaultWorkspaceCall) Do(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceSetDefaultWorkspaceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockConfigFileInterfaceSetDefaultWorkspaceCall) DoAndReturn(f func(context.Context, *viper.Viper, string) error) *MockConfigFileInterfaceSetDefaultWorkspaceCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/helm/cluster.go b/pkg/cli/helm/cluster.go index 12e32e1e9a4..1b918071b82 100644 --- a/pkg/cli/helm/cluster.go +++ b/pkg/cli/helm/cluster.go @@ -194,7 +194,7 @@ type InstallState struct { Version string } -//go:generate mockgen -destination=./mock_cluster.go -package=helm -self_package github.com/radius-project/radius/pkg/cli/helm github.com/radius-project/radius/pkg/cli/helm Interface +//go:generate mockgen -typed -destination=./mock_cluster.go -package=helm -self_package github.com/radius-project/radius/pkg/cli/helm github.com/radius-project/radius/pkg/cli/helm Interface // Interface provides an abstraction over Helm operations for installing Radius. type Interface interface { diff --git a/pkg/cli/helm/mock_cluster.go b/pkg/cli/helm/mock_cluster.go index b0d4fd9d15a..4a0a1e05e8b 100644 --- a/pkg/cli/helm/mock_cluster.go +++ b/pkg/cli/helm/mock_cluster.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_cluster.go -package=helm -self_package github.com/radius-project/radius/pkg/cli/helm github.com/radius-project/radius/pkg/cli/helm Interface +// mockgen -typed -destination=./mock_cluster.go -package=helm -self_package github.com/radius-project/radius/pkg/cli/helm github.com/radius-project/radius/pkg/cli/helm Interface // // Package helm is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockInterface) CheckRadiusInstall(arg0 string) (InstallState, error) { } // CheckRadiusInstall indicates an expected call of CheckRadiusInstall. -func (mr *MockInterfaceMockRecorder) CheckRadiusInstall(arg0 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) CheckRadiusInstall(arg0 any) *MockInterfaceCheckRadiusInstallCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckRadiusInstall", reflect.TypeOf((*MockInterface)(nil).CheckRadiusInstall), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckRadiusInstall", reflect.TypeOf((*MockInterface)(nil).CheckRadiusInstall), arg0) + return &MockInterfaceCheckRadiusInstallCall{Call: call} +} + +// MockInterfaceCheckRadiusInstallCall wrap *gomock.Call +type MockInterfaceCheckRadiusInstallCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceCheckRadiusInstallCall) Return(arg0 InstallState, arg1 error) *MockInterfaceCheckRadiusInstallCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceCheckRadiusInstallCall) Do(f func(string) (InstallState, error)) *MockInterfaceCheckRadiusInstallCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceCheckRadiusInstallCall) DoAndReturn(f func(string) (InstallState, error)) *MockInterfaceCheckRadiusInstallCall { + c.Call = c.Call.DoAndReturn(f) + return c } // InstallRadius mocks base method. @@ -64,9 +88,33 @@ func (m *MockInterface) InstallRadius(arg0 context.Context, arg1 ClusterOptions, } // InstallRadius indicates an expected call of InstallRadius. -func (mr *MockInterfaceMockRecorder) InstallRadius(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) InstallRadius(arg0, arg1, arg2 any) *MockInterfaceInstallRadiusCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InstallRadius", reflect.TypeOf((*MockInterface)(nil).InstallRadius), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InstallRadius", reflect.TypeOf((*MockInterface)(nil).InstallRadius), arg0, arg1, arg2) + return &MockInterfaceInstallRadiusCall{Call: call} +} + +// MockInterfaceInstallRadiusCall wrap *gomock.Call +type MockInterfaceInstallRadiusCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceInstallRadiusCall) Return(arg0 bool, arg1 error) *MockInterfaceInstallRadiusCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceInstallRadiusCall) Do(f func(context.Context, ClusterOptions, string) (bool, error)) *MockInterfaceInstallRadiusCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceInstallRadiusCall) DoAndReturn(f func(context.Context, ClusterOptions, string) (bool, error)) *MockInterfaceInstallRadiusCall { + c.Call = c.Call.DoAndReturn(f) + return c } // UninstallRadius mocks base method. @@ -78,7 +126,31 @@ func (m *MockInterface) UninstallRadius(arg0 context.Context, arg1 string) error } // UninstallRadius indicates an expected call of UninstallRadius. -func (mr *MockInterfaceMockRecorder) UninstallRadius(arg0, arg1 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) UninstallRadius(arg0, arg1 any) *MockInterfaceUninstallRadiusCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UninstallRadius", reflect.TypeOf((*MockInterface)(nil).UninstallRadius), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UninstallRadius", reflect.TypeOf((*MockInterface)(nil).UninstallRadius), arg0, arg1) + return &MockInterfaceUninstallRadiusCall{Call: call} +} + +// MockInterfaceUninstallRadiusCall wrap *gomock.Call +type MockInterfaceUninstallRadiusCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceUninstallRadiusCall) Return(arg0 error) *MockInterfaceUninstallRadiusCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceUninstallRadiusCall) Do(f func(context.Context, string) error) *MockInterfaceUninstallRadiusCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceUninstallRadiusCall) DoAndReturn(f func(context.Context, string) error) *MockInterfaceUninstallRadiusCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/kubernetes/kubernetes.go b/pkg/cli/kubernetes/kubernetes.go index b09d787b671..52a1ffd26ab 100644 --- a/pkg/cli/kubernetes/kubernetes.go +++ b/pkg/cli/kubernetes/kubernetes.go @@ -157,7 +157,7 @@ func GetContextFromConfigFileIfExists(configFilePath, context string) (string, e return contextName, nil } -//go:generate mockgen -destination=./mock_kubernetes.go -package=kubernetes -self_package github.com/radius-project/radius/pkg/cli/kubernetes github.com/radius-project/radius/pkg/cli/kubernetes Interface +//go:generate mockgen -typed -destination=./mock_kubernetes.go -package=kubernetes -self_package github.com/radius-project/radius/pkg/cli/kubernetes github.com/radius-project/radius/pkg/cli/kubernetes Interface type Interface interface { GetKubeContext() (*api.Config, error) } diff --git a/pkg/cli/kubernetes/logstream/mock_logstream.go b/pkg/cli/kubernetes/logstream/mock_logstream.go index a5b5d28787e..04b6ba738e1 100644 --- a/pkg/cli/kubernetes/logstream/mock_logstream.go +++ b/pkg/cli/kubernetes/logstream/mock_logstream.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_logstream.go -package=logstream -self_package github.com/radius-project/radius/pkg/cli/kubernetes/logstream github.com/radius-project/radius/pkg/cli/kubernetes/logstream Interface +// mockgen -typed -destination=./mock_logstream.go -package=logstream -self_package github.com/radius-project/radius/pkg/cli/kubernetes/logstream github.com/radius-project/radius/pkg/cli/kubernetes/logstream Interface // // Package logstream is a generated GoMock package. @@ -48,7 +48,31 @@ func (m *MockInterface) Stream(arg0 context.Context, arg1 Options) error { } // Stream indicates an expected call of Stream. -func (mr *MockInterfaceMockRecorder) Stream(arg0, arg1 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Stream(arg0, arg1 any) *MockInterfaceStreamCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stream", reflect.TypeOf((*MockInterface)(nil).Stream), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stream", reflect.TypeOf((*MockInterface)(nil).Stream), arg0, arg1) + return &MockInterfaceStreamCall{Call: call} +} + +// MockInterfaceStreamCall wrap *gomock.Call +type MockInterfaceStreamCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceStreamCall) Return(arg0 error) *MockInterfaceStreamCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceStreamCall) Do(f func(context.Context, Options) error) *MockInterfaceStreamCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceStreamCall) DoAndReturn(f func(context.Context, Options) error) *MockInterfaceStreamCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/kubernetes/logstream/types.go b/pkg/cli/kubernetes/logstream/types.go index b61420e5215..2a99109b808 100644 --- a/pkg/cli/kubernetes/logstream/types.go +++ b/pkg/cli/kubernetes/logstream/types.go @@ -38,7 +38,7 @@ type Options struct { Out io.Writer } -//go:generate mockgen -destination=./mock_logstream.go -package=logstream -self_package github.com/radius-project/radius/pkg/cli/kubernetes/logstream github.com/radius-project/radius/pkg/cli/kubernetes/logstream Interface +//go:generate mockgen -typed -destination=./mock_logstream.go -package=logstream -self_package github.com/radius-project/radius/pkg/cli/kubernetes/logstream github.com/radius-project/radius/pkg/cli/kubernetes/logstream Interface // Interface is the interface type for streaming application logs. type Interface interface { diff --git a/pkg/cli/kubernetes/mock_kubernetes.go b/pkg/cli/kubernetes/mock_kubernetes.go index 6e698fd08a6..0eabef261c7 100644 --- a/pkg/cli/kubernetes/mock_kubernetes.go +++ b/pkg/cli/kubernetes/mock_kubernetes.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_kubernetes.go -package=kubernetes -self_package github.com/radius-project/radius/pkg/cli/kubernetes github.com/radius-project/radius/pkg/cli/kubernetes Interface +// mockgen -typed -destination=./mock_kubernetes.go -package=kubernetes -self_package github.com/radius-project/radius/pkg/cli/kubernetes github.com/radius-project/radius/pkg/cli/kubernetes Interface // // Package kubernetes is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockInterface) GetKubeContext() (*api.Config, error) { } // GetKubeContext indicates an expected call of GetKubeContext. -func (mr *MockInterfaceMockRecorder) GetKubeContext() *gomock.Call { +func (mr *MockInterfaceMockRecorder) GetKubeContext() *MockInterfaceGetKubeContextCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetKubeContext", reflect.TypeOf((*MockInterface)(nil).GetKubeContext)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetKubeContext", reflect.TypeOf((*MockInterface)(nil).GetKubeContext)) + return &MockInterfaceGetKubeContextCall{Call: call} +} + +// MockInterfaceGetKubeContextCall wrap *gomock.Call +type MockInterfaceGetKubeContextCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceGetKubeContextCall) Return(arg0 *api.Config, arg1 error) *MockInterfaceGetKubeContextCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceGetKubeContextCall) Do(f func() (*api.Config, error)) *MockInterfaceGetKubeContextCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceGetKubeContextCall) DoAndReturn(f func() (*api.Config, error)) *MockInterfaceGetKubeContextCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/kubernetes/portforward/mock_portforward.go b/pkg/cli/kubernetes/portforward/mock_portforward.go index 0b4ba835b50..c61cd0121c3 100644 --- a/pkg/cli/kubernetes/portforward/mock_portforward.go +++ b/pkg/cli/kubernetes/portforward/mock_portforward.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_portforward.go -package=portforward -self_package github.com/radius-project/radius/pkg/cli/kubernetes/portforward github.com/radius-project/radius/pkg/cli/kubernetes/portforward Interface +// mockgen -typed -destination=./mock_portforward.go -package=portforward -self_package github.com/radius-project/radius/pkg/cli/kubernetes/portforward github.com/radius-project/radius/pkg/cli/kubernetes/portforward Interface // // Package portforward is a generated GoMock package. @@ -48,7 +48,31 @@ func (m *MockInterface) Run(arg0 context.Context, arg1 Options) error { } // Run indicates an expected call of Run. -func (mr *MockInterfaceMockRecorder) Run(arg0, arg1 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) Run(arg0, arg1 any) *MockInterfaceRunCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockInterface)(nil).Run), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockInterface)(nil).Run), arg0, arg1) + return &MockInterfaceRunCall{Call: call} +} + +// MockInterfaceRunCall wrap *gomock.Call +type MockInterfaceRunCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceRunCall) Return(arg0 error) *MockInterfaceRunCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceRunCall) Do(f func(context.Context, Options) error) *MockInterfaceRunCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceRunCall) DoAndReturn(f func(context.Context, Options) error) *MockInterfaceRunCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/kubernetes/portforward/types.go b/pkg/cli/kubernetes/portforward/types.go index 29d76e7e798..76b553a3b3f 100644 --- a/pkg/cli/kubernetes/portforward/types.go +++ b/pkg/cli/kubernetes/portforward/types.go @@ -75,7 +75,7 @@ type StatusMessage struct { RemotePort uint16 } -//go:generate mockgen -destination=./mock_portforward.go -package=portforward -self_package github.com/radius-project/radius/pkg/cli/kubernetes/portforward github.com/radius-project/radius/pkg/cli/kubernetes/portforward Interface +//go:generate mockgen -typed -destination=./mock_portforward.go -package=portforward -self_package github.com/radius-project/radius/pkg/cli/kubernetes/portforward github.com/radius-project/radius/pkg/cli/kubernetes/portforward Interface // Interface is the interface type for port-forwarding. type Interface interface { diff --git a/pkg/cli/prompt/mock_prompter.go b/pkg/cli/prompt/mock_prompter.go index d296a3d00dc..2caa5686fb7 100644 --- a/pkg/cli/prompt/mock_prompter.go +++ b/pkg/cli/prompt/mock_prompter.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_prompter.go -package=prompt -self_package github.com/radius-project/radius/pkg/cli/prompt github.com/radius-project/radius/pkg/cli/prompt Interface +// mockgen -typed -destination=./mock_prompter.go -package=prompt -self_package github.com/radius-project/radius/pkg/cli/prompt github.com/radius-project/radius/pkg/cli/prompt Interface // // Package prompt is a generated GoMock package. @@ -50,9 +50,33 @@ func (m *MockInterface) GetListInput(arg0 []string, arg1 string) (string, error) } // GetListInput indicates an expected call of GetListInput. -func (mr *MockInterfaceMockRecorder) GetListInput(arg0, arg1 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) GetListInput(arg0, arg1 any) *MockInterfaceGetListInputCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListInput", reflect.TypeOf((*MockInterface)(nil).GetListInput), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListInput", reflect.TypeOf((*MockInterface)(nil).GetListInput), arg0, arg1) + return &MockInterfaceGetListInputCall{Call: call} +} + +// MockInterfaceGetListInputCall wrap *gomock.Call +type MockInterfaceGetListInputCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceGetListInputCall) Return(arg0 string, arg1 error) *MockInterfaceGetListInputCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceGetListInputCall) Do(f func([]string, string) (string, error)) *MockInterfaceGetListInputCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceGetListInputCall) DoAndReturn(f func([]string, string) (string, error)) *MockInterfaceGetListInputCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetTextInput mocks base method. @@ -65,9 +89,33 @@ func (m *MockInterface) GetTextInput(arg0 string, arg1 text.TextModelOptions) (s } // GetTextInput indicates an expected call of GetTextInput. -func (mr *MockInterfaceMockRecorder) GetTextInput(arg0, arg1 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) GetTextInput(arg0, arg1 any) *MockInterfaceGetTextInputCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTextInput", reflect.TypeOf((*MockInterface)(nil).GetTextInput), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTextInput", reflect.TypeOf((*MockInterface)(nil).GetTextInput), arg0, arg1) + return &MockInterfaceGetTextInputCall{Call: call} +} + +// MockInterfaceGetTextInputCall wrap *gomock.Call +type MockInterfaceGetTextInputCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceGetTextInputCall) Return(arg0 string, arg1 error) *MockInterfaceGetTextInputCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceGetTextInputCall) Do(f func(string, text.TextModelOptions) (string, error)) *MockInterfaceGetTextInputCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceGetTextInputCall) DoAndReturn(f func(string, text.TextModelOptions) (string, error)) *MockInterfaceGetTextInputCall { + c.Call = c.Call.DoAndReturn(f) + return c } // RunProgram mocks base method. @@ -80,7 +128,31 @@ func (m *MockInterface) RunProgram(arg0 *tea.Program) (tea.Model, error) { } // RunProgram indicates an expected call of RunProgram. -func (mr *MockInterfaceMockRecorder) RunProgram(arg0 any) *gomock.Call { +func (mr *MockInterfaceMockRecorder) RunProgram(arg0 any) *MockInterfaceRunProgramCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunProgram", reflect.TypeOf((*MockInterface)(nil).RunProgram), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunProgram", reflect.TypeOf((*MockInterface)(nil).RunProgram), arg0) + return &MockInterfaceRunProgramCall{Call: call} +} + +// MockInterfaceRunProgramCall wrap *gomock.Call +type MockInterfaceRunProgramCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockInterfaceRunProgramCall) Return(arg0 tea.Model, arg1 error) *MockInterfaceRunProgramCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockInterfaceRunProgramCall) Do(f func(*tea.Program) (tea.Model, error)) *MockInterfaceRunProgramCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockInterfaceRunProgramCall) DoAndReturn(f func(*tea.Program) (tea.Model, error)) *MockInterfaceRunProgramCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/cli/prompt/prompt.go b/pkg/cli/prompt/prompt.go index 357c0e4e9b3..89196d226dc 100644 --- a/pkg/cli/prompt/prompt.go +++ b/pkg/cli/prompt/prompt.go @@ -35,7 +35,7 @@ const ( ConfirmNo = "No" ) -//go:generate mockgen -destination=./mock_prompter.go -package=prompt -self_package github.com/radius-project/radius/pkg/cli/prompt github.com/radius-project/radius/pkg/cli/prompt Interface +//go:generate mockgen -typed -destination=./mock_prompter.go -package=prompt -self_package github.com/radius-project/radius/pkg/cli/prompt github.com/radius-project/radius/pkg/cli/prompt Interface // Interface contains operation to prompt the user interactively. // diff --git a/pkg/corerp/backend/deployment/deploymentprocessor.go b/pkg/corerp/backend/deployment/deploymentprocessor.go index e6a7193085b..f5745b74d0e 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor.go @@ -51,7 +51,7 @@ import ( controller_runtime "sigs.k8s.io/controller-runtime/pkg/client" ) -//go:generate mockgen -destination=./mock_deploymentprocessor.go -package=deployment -self_package github.com/radius-project/radius/pkg/corerp/backend/deployment github.com/radius-project/radius/pkg/corerp/backend/deployment DeploymentProcessor +//go:generate mockgen -typed -destination=./mock_deploymentprocessor.go -package=deployment -self_package github.com/radius-project/radius/pkg/corerp/backend/deployment github.com/radius-project/radius/pkg/corerp/backend/deployment DeploymentProcessor type DeploymentProcessor interface { Render(ctx context.Context, id resources.ID, resource v1.DataModelInterface) (renderers.RendererOutput, error) Deploy(ctx context.Context, id resources.ID, rendererOutput renderers.RendererOutput) (rpv1.DeploymentOutput, error) diff --git a/pkg/corerp/backend/deployment/mock_deploymentprocessor.go b/pkg/corerp/backend/deployment/mock_deploymentprocessor.go index 90a12badcdd..357d94eb06b 100644 --- a/pkg/corerp/backend/deployment/mock_deploymentprocessor.go +++ b/pkg/corerp/backend/deployment/mock_deploymentprocessor.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_deploymentprocessor.go -package=deployment -self_package github.com/radius-project/radius/pkg/corerp/backend/deployment github.com/radius-project/radius/pkg/corerp/backend/deployment DeploymentProcessor +// mockgen -typed -destination=./mock_deploymentprocessor.go -package=deployment -self_package github.com/radius-project/radius/pkg/corerp/backend/deployment github.com/radius-project/radius/pkg/corerp/backend/deployment DeploymentProcessor // // Package deployment is a generated GoMock package. @@ -52,9 +52,33 @@ func (m *MockDeploymentProcessor) Delete(arg0 context.Context, arg1 resources.ID } // Delete indicates an expected call of Delete. -func (mr *MockDeploymentProcessorMockRecorder) Delete(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockDeploymentProcessorMockRecorder) Delete(arg0, arg1, arg2 any) *MockDeploymentProcessorDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDeploymentProcessor)(nil).Delete), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDeploymentProcessor)(nil).Delete), arg0, arg1, arg2) + return &MockDeploymentProcessorDeleteCall{Call: call} +} + +// MockDeploymentProcessorDeleteCall wrap *gomock.Call +type MockDeploymentProcessorDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDeploymentProcessorDeleteCall) Return(arg0 error) *MockDeploymentProcessorDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDeploymentProcessorDeleteCall) Do(f func(context.Context, resources.ID, []v10.OutputResource) error) *MockDeploymentProcessorDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDeploymentProcessorDeleteCall) DoAndReturn(f func(context.Context, resources.ID, []v10.OutputResource) error) *MockDeploymentProcessorDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Deploy mocks base method. @@ -67,9 +91,33 @@ func (m *MockDeploymentProcessor) Deploy(arg0 context.Context, arg1 resources.ID } // Deploy indicates an expected call of Deploy. -func (mr *MockDeploymentProcessorMockRecorder) Deploy(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockDeploymentProcessorMockRecorder) Deploy(arg0, arg1, arg2 any) *MockDeploymentProcessorDeployCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Deploy", reflect.TypeOf((*MockDeploymentProcessor)(nil).Deploy), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Deploy", reflect.TypeOf((*MockDeploymentProcessor)(nil).Deploy), arg0, arg1, arg2) + return &MockDeploymentProcessorDeployCall{Call: call} +} + +// MockDeploymentProcessorDeployCall wrap *gomock.Call +type MockDeploymentProcessorDeployCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDeploymentProcessorDeployCall) Return(arg0 v10.DeploymentOutput, arg1 error) *MockDeploymentProcessorDeployCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDeploymentProcessorDeployCall) Do(f func(context.Context, resources.ID, renderers.RendererOutput) (v10.DeploymentOutput, error)) *MockDeploymentProcessorDeployCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDeploymentProcessorDeployCall) DoAndReturn(f func(context.Context, resources.ID, renderers.RendererOutput) (v10.DeploymentOutput, error)) *MockDeploymentProcessorDeployCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchSecrets mocks base method. @@ -82,9 +130,33 @@ func (m *MockDeploymentProcessor) FetchSecrets(arg0 context.Context, arg1 Resour } // FetchSecrets indicates an expected call of FetchSecrets. -func (mr *MockDeploymentProcessorMockRecorder) FetchSecrets(arg0, arg1 any) *gomock.Call { +func (mr *MockDeploymentProcessorMockRecorder) FetchSecrets(arg0, arg1 any) *MockDeploymentProcessorFetchSecretsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSecrets", reflect.TypeOf((*MockDeploymentProcessor)(nil).FetchSecrets), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSecrets", reflect.TypeOf((*MockDeploymentProcessor)(nil).FetchSecrets), arg0, arg1) + return &MockDeploymentProcessorFetchSecretsCall{Call: call} +} + +// MockDeploymentProcessorFetchSecretsCall wrap *gomock.Call +type MockDeploymentProcessorFetchSecretsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDeploymentProcessorFetchSecretsCall) Return(arg0 map[string]any, arg1 error) *MockDeploymentProcessorFetchSecretsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDeploymentProcessorFetchSecretsCall) Do(f func(context.Context, ResourceData) (map[string]any, error)) *MockDeploymentProcessorFetchSecretsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDeploymentProcessorFetchSecretsCall) DoAndReturn(f func(context.Context, ResourceData) (map[string]any, error)) *MockDeploymentProcessorFetchSecretsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Render mocks base method. @@ -97,7 +169,31 @@ func (m *MockDeploymentProcessor) Render(arg0 context.Context, arg1 resources.ID } // Render indicates an expected call of Render. -func (mr *MockDeploymentProcessorMockRecorder) Render(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockDeploymentProcessorMockRecorder) Render(arg0, arg1, arg2 any) *MockDeploymentProcessorRenderCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Render", reflect.TypeOf((*MockDeploymentProcessor)(nil).Render), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Render", reflect.TypeOf((*MockDeploymentProcessor)(nil).Render), arg0, arg1, arg2) + return &MockDeploymentProcessorRenderCall{Call: call} +} + +// MockDeploymentProcessorRenderCall wrap *gomock.Call +type MockDeploymentProcessorRenderCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDeploymentProcessorRenderCall) Return(arg0 renderers.RendererOutput, arg1 error) *MockDeploymentProcessorRenderCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDeploymentProcessorRenderCall) Do(f func(context.Context, resources.ID, v1.DataModelInterface) (renderers.RendererOutput, error)) *MockDeploymentProcessorRenderCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDeploymentProcessorRenderCall) DoAndReturn(f func(context.Context, resources.ID, v1.DataModelInterface) (renderers.RendererOutput, error)) *MockDeploymentProcessorRenderCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/corerp/handlers/mock_resource_handler.go b/pkg/corerp/handlers/mock_resource_handler.go index ba4c48d21c1..cb2c63ed719 100644 --- a/pkg/corerp/handlers/mock_resource_handler.go +++ b/pkg/corerp/handlers/mock_resource_handler.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_resource_handler.go -package=handlers -self_package github.com/radius-project/radius/pkg/corerp/handlers github.com/radius-project/radius/pkg/corerp/handlers ResourceHandler +// mockgen -typed -destination=./mock_resource_handler.go -package=handlers -self_package github.com/radius-project/radius/pkg/corerp/handlers github.com/radius-project/radius/pkg/corerp/handlers ResourceHandler // // Package handlers is a generated GoMock package. @@ -48,9 +48,33 @@ func (m *MockResourceHandler) Delete(arg0 context.Context, arg1 *DeleteOptions) } // Delete indicates an expected call of Delete. -func (mr *MockResourceHandlerMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockResourceHandlerMockRecorder) Delete(arg0, arg1 any) *MockResourceHandlerDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockResourceHandler)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockResourceHandler)(nil).Delete), arg0, arg1) + return &MockResourceHandlerDeleteCall{Call: call} +} + +// MockResourceHandlerDeleteCall wrap *gomock.Call +type MockResourceHandlerDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockResourceHandlerDeleteCall) Return(arg0 error) *MockResourceHandlerDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockResourceHandlerDeleteCall) Do(f func(context.Context, *DeleteOptions) error) *MockResourceHandlerDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockResourceHandlerDeleteCall) DoAndReturn(f func(context.Context, *DeleteOptions) error) *MockResourceHandlerDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Put mocks base method. @@ -63,7 +87,31 @@ func (m *MockResourceHandler) Put(arg0 context.Context, arg1 *PutOptions) (map[s } // Put indicates an expected call of Put. -func (mr *MockResourceHandlerMockRecorder) Put(arg0, arg1 any) *gomock.Call { +func (mr *MockResourceHandlerMockRecorder) Put(arg0, arg1 any) *MockResourceHandlerPutCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockResourceHandler)(nil).Put), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockResourceHandler)(nil).Put), arg0, arg1) + return &MockResourceHandlerPutCall{Call: call} +} + +// MockResourceHandlerPutCall wrap *gomock.Call +type MockResourceHandlerPutCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockResourceHandlerPutCall) Return(arg0 map[string]string, arg1 error) *MockResourceHandlerPutCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockResourceHandlerPutCall) Do(f func(context.Context, *PutOptions) (map[string]string, error)) *MockResourceHandlerPutCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockResourceHandlerPutCall) DoAndReturn(f func(context.Context, *PutOptions) (map[string]string, error)) *MockResourceHandlerPutCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/corerp/handlers/resource_handler.go b/pkg/corerp/handlers/resource_handler.go index 928b9daa016..b6b926177b0 100644 --- a/pkg/corerp/handlers/resource_handler.go +++ b/pkg/corerp/handlers/resource_handler.go @@ -57,7 +57,7 @@ type DeleteOptions struct { // ResourceHandler interface defines the methods that every output resource will implement // -//go:generate mockgen -destination=./mock_resource_handler.go -package=handlers -self_package github.com/radius-project/radius/pkg/corerp/handlers github.com/radius-project/radius/pkg/corerp/handlers ResourceHandler +//go:generate mockgen -typed -destination=./mock_resource_handler.go -package=handlers -self_package github.com/radius-project/radius/pkg/corerp/handlers github.com/radius-project/radius/pkg/corerp/handlers ResourceHandler type ResourceHandler interface { // Put deploys the rendered output resource and returns and populates the properties during deployment, // which can be used by the next resource handlers. diff --git a/pkg/corerp/renderers/mock_renderer.go b/pkg/corerp/renderers/mock_renderer.go index 4351a0136c2..9dbfe81815e 100644 --- a/pkg/corerp/renderers/mock_renderer.go +++ b/pkg/corerp/renderers/mock_renderer.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_renderer.go -package=renderers github.com/radius-project/radius/pkg/corerp/renderers Renderer +// mockgen -typed -destination=./mock_renderer.go -package=renderers github.com/radius-project/radius/pkg/corerp/renderers Renderer // // Package renderers is a generated GoMock package. @@ -52,9 +52,33 @@ func (m *MockRenderer) GetDependencyIDs(arg0 context.Context, arg1 v1.DataModelI } // GetDependencyIDs indicates an expected call of GetDependencyIDs. -func (mr *MockRendererMockRecorder) GetDependencyIDs(arg0, arg1 any) *gomock.Call { +func (mr *MockRendererMockRecorder) GetDependencyIDs(arg0, arg1 any) *MockRendererGetDependencyIDsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDependencyIDs", reflect.TypeOf((*MockRenderer)(nil).GetDependencyIDs), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDependencyIDs", reflect.TypeOf((*MockRenderer)(nil).GetDependencyIDs), arg0, arg1) + return &MockRendererGetDependencyIDsCall{Call: call} +} + +// MockRendererGetDependencyIDsCall wrap *gomock.Call +type MockRendererGetDependencyIDsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockRendererGetDependencyIDsCall) Return(arg0, arg1 []resources.ID, arg2 error) *MockRendererGetDependencyIDsCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockRendererGetDependencyIDsCall) Do(f func(context.Context, v1.DataModelInterface) ([]resources.ID, []resources.ID, error)) *MockRendererGetDependencyIDsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockRendererGetDependencyIDsCall) DoAndReturn(f func(context.Context, v1.DataModelInterface) ([]resources.ID, []resources.ID, error)) *MockRendererGetDependencyIDsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Render mocks base method. @@ -67,7 +91,31 @@ func (m *MockRenderer) Render(arg0 context.Context, arg1 v1.DataModelInterface, } // Render indicates an expected call of Render. -func (mr *MockRendererMockRecorder) Render(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockRendererMockRecorder) Render(arg0, arg1, arg2 any) *MockRendererRenderCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Render", reflect.TypeOf((*MockRenderer)(nil).Render), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Render", reflect.TypeOf((*MockRenderer)(nil).Render), arg0, arg1, arg2) + return &MockRendererRenderCall{Call: call} +} + +// MockRendererRenderCall wrap *gomock.Call +type MockRendererRenderCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockRendererRenderCall) Return(arg0 RendererOutput, arg1 error) *MockRendererRenderCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockRendererRenderCall) Do(f func(context.Context, v1.DataModelInterface, RenderOptions) (RendererOutput, error)) *MockRendererRenderCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockRendererRenderCall) DoAndReturn(f func(context.Context, v1.DataModelInterface, RenderOptions) (RendererOutput, error)) *MockRendererRenderCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/corerp/renderers/types.go b/pkg/corerp/renderers/types.go index 56c112036c8..fa059d10766 100644 --- a/pkg/corerp/renderers/types.go +++ b/pkg/corerp/renderers/types.go @@ -33,7 +33,7 @@ const ( DefaultSecurePort int32 = 443 ) -//go:generate mockgen -destination=./mock_renderer.go -package=renderers github.com/radius-project/radius/pkg/corerp/renderers Renderer +//go:generate mockgen -typed -destination=./mock_renderer.go -package=renderers github.com/radius-project/radius/pkg/corerp/renderers Renderer type Renderer interface { GetDependencyIDs(ctx context.Context, resource v1.DataModelInterface) (radiusResourceIDs []resources.ID, azureResourceIDs []resources.ID, err error) Render(ctx context.Context, resource v1.DataModelInterface, options RenderOptions) (RendererOutput, error) diff --git a/pkg/portableresources/processors/mock_resourceclient.go b/pkg/portableresources/processors/mock_resourceclient.go index 4d263caddcb..0d2efa5b70c 100644 --- a/pkg/portableresources/processors/mock_resourceclient.go +++ b/pkg/portableresources/processors/mock_resourceclient.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_resourceclient.go -package=processors -self_package github.com/radius-project/radius/pkg/portableresources/processors github.com/radius-project/radius/pkg/portableresources/processors ResourceClient +// mockgen -typed -destination=./mock_resourceclient.go -package=processors -self_package github.com/radius-project/radius/pkg/portableresources/processors github.com/radius-project/radius/pkg/portableresources/processors ResourceClient // // Package processors is a generated GoMock package. @@ -48,7 +48,31 @@ func (m *MockResourceClient) Delete(arg0 context.Context, arg1 string) error { } // Delete indicates an expected call of Delete. -func (mr *MockResourceClientMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockResourceClientMockRecorder) Delete(arg0, arg1 any) *MockResourceClientDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockResourceClient)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockResourceClient)(nil).Delete), arg0, arg1) + return &MockResourceClientDeleteCall{Call: call} +} + +// MockResourceClientDeleteCall wrap *gomock.Call +type MockResourceClientDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockResourceClientDeleteCall) Return(arg0 error) *MockResourceClientDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockResourceClientDeleteCall) Do(f func(context.Context, string) error) *MockResourceClientDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockResourceClientDeleteCall) DoAndReturn(f func(context.Context, string) error) *MockResourceClientDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/portableresources/processors/types.go b/pkg/portableresources/processors/types.go index 6c85769f1ab..16b65abec85 100644 --- a/pkg/portableresources/processors/types.go +++ b/pkg/portableresources/processors/types.go @@ -58,7 +58,7 @@ func (e *ValidationError) Error() string { return e.Message } -//go:generate mockgen -destination=./mock_resourceclient.go -package=processors -self_package github.com/radius-project/radius/pkg/portableresources/processors github.com/radius-project/radius/pkg/portableresources/processors ResourceClient +//go:generate mockgen -typed -destination=./mock_resourceclient.go -package=processors -self_package github.com/radius-project/radius/pkg/portableresources/processors github.com/radius-project/radius/pkg/portableresources/processors ResourceClient // ResourceClient is a client used by resource processors for interacting with UCP resources. type ResourceClient interface { diff --git a/pkg/recipes/configloader/environment.go b/pkg/recipes/configloader/environment.go index 66ae542f212..3fee6c15593 100644 --- a/pkg/recipes/configloader/environment.go +++ b/pkg/recipes/configloader/environment.go @@ -35,7 +35,7 @@ var ( ErrUnsupportedComputeKind = errors.New("unsupported compute kind in environment resource") ) -//go:generate mockgen -destination=./mock_config_loader.go -package=configloader -self_package github.com/radius-project/radius/pkg/recipes/configloader github.com/radius-project/radius/pkg/recipes/configloader ConfigurationLoader +//go:generate mockgen -typed -destination=./mock_config_loader.go -package=configloader -self_package github.com/radius-project/radius/pkg/recipes/configloader github.com/radius-project/radius/pkg/recipes/configloader ConfigurationLoader var _ ConfigurationLoader = (*environmentLoader)(nil) diff --git a/pkg/recipes/configloader/mock_config_loader.go b/pkg/recipes/configloader/mock_config_loader.go index 85711851786..01f2837b978 100644 --- a/pkg/recipes/configloader/mock_config_loader.go +++ b/pkg/recipes/configloader/mock_config_loader.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_config_loader.go -package=configloader -self_package github.com/radius-project/radius/pkg/recipes/configloader github.com/radius-project/radius/pkg/recipes/configloader ConfigurationLoader +// mockgen -typed -destination=./mock_config_loader.go -package=configloader -self_package github.com/radius-project/radius/pkg/recipes/configloader github.com/radius-project/radius/pkg/recipes/configloader ConfigurationLoader // // Package configloader is a generated GoMock package. @@ -50,9 +50,33 @@ func (m *MockConfigurationLoader) LoadConfiguration(arg0 context.Context, arg1 r } // LoadConfiguration indicates an expected call of LoadConfiguration. -func (mr *MockConfigurationLoaderMockRecorder) LoadConfiguration(arg0, arg1 any) *gomock.Call { +func (mr *MockConfigurationLoaderMockRecorder) LoadConfiguration(arg0, arg1 any) *MockConfigurationLoaderLoadConfigurationCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadConfiguration", reflect.TypeOf((*MockConfigurationLoader)(nil).LoadConfiguration), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadConfiguration", reflect.TypeOf((*MockConfigurationLoader)(nil).LoadConfiguration), arg0, arg1) + return &MockConfigurationLoaderLoadConfigurationCall{Call: call} +} + +// MockConfigurationLoaderLoadConfigurationCall wrap *gomock.Call +type MockConfigurationLoaderLoadConfigurationCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockConfigurationLoaderLoadConfigurationCall) Return(arg0 *recipes.Configuration, arg1 error) *MockConfigurationLoaderLoadConfigurationCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockConfigurationLoaderLoadConfigurationCall) Do(f func(context.Context, recipes.ResourceMetadata) (*recipes.Configuration, error)) *MockConfigurationLoaderLoadConfigurationCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockConfigurationLoaderLoadConfigurationCall) DoAndReturn(f func(context.Context, recipes.ResourceMetadata) (*recipes.Configuration, error)) *MockConfigurationLoaderLoadConfigurationCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LoadRecipe mocks base method. @@ -65,7 +89,31 @@ func (m *MockConfigurationLoader) LoadRecipe(arg0 context.Context, arg1 *recipes } // LoadRecipe indicates an expected call of LoadRecipe. -func (mr *MockConfigurationLoaderMockRecorder) LoadRecipe(arg0, arg1 any) *gomock.Call { +func (mr *MockConfigurationLoaderMockRecorder) LoadRecipe(arg0, arg1 any) *MockConfigurationLoaderLoadRecipeCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadRecipe", reflect.TypeOf((*MockConfigurationLoader)(nil).LoadRecipe), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadRecipe", reflect.TypeOf((*MockConfigurationLoader)(nil).LoadRecipe), arg0, arg1) + return &MockConfigurationLoaderLoadRecipeCall{Call: call} +} + +// MockConfigurationLoaderLoadRecipeCall wrap *gomock.Call +type MockConfigurationLoaderLoadRecipeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockConfigurationLoaderLoadRecipeCall) Return(arg0 *recipes.EnvironmentDefinition, arg1 error) *MockConfigurationLoaderLoadRecipeCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockConfigurationLoaderLoadRecipeCall) Do(f func(context.Context, *recipes.ResourceMetadata) (*recipes.EnvironmentDefinition, error)) *MockConfigurationLoaderLoadRecipeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockConfigurationLoaderLoadRecipeCall) DoAndReturn(f func(context.Context, *recipes.ResourceMetadata) (*recipes.EnvironmentDefinition, error)) *MockConfigurationLoaderLoadRecipeCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/recipes/configloader/mock_secret_loader.go b/pkg/recipes/configloader/mock_secret_loader.go index dfb2f1361f0..edc04503bda 100644 --- a/pkg/recipes/configloader/mock_secret_loader.go +++ b/pkg/recipes/configloader/mock_secret_loader.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_secret_loader.go -package=configloader -self_package github.com/radius-project/radius/pkg/recipes/configloader github.com/radius-project/radius/pkg/recipes/configloader SecretsLoader +// mockgen -typed -destination=./mock_secret_loader.go -package=configloader -self_package github.com/radius-project/radius/pkg/recipes/configloader github.com/radius-project/radius/pkg/recipes/configloader SecretsLoader // // Package configloader is a generated GoMock package. @@ -50,7 +50,31 @@ func (m *MockSecretsLoader) LoadSecrets(arg0 context.Context, arg1 string) (v202 } // LoadSecrets indicates an expected call of LoadSecrets. -func (mr *MockSecretsLoaderMockRecorder) LoadSecrets(arg0, arg1 any) *gomock.Call { +func (mr *MockSecretsLoaderMockRecorder) LoadSecrets(arg0, arg1 any) *MockSecretsLoaderLoadSecretsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadSecrets", reflect.TypeOf((*MockSecretsLoader)(nil).LoadSecrets), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadSecrets", reflect.TypeOf((*MockSecretsLoader)(nil).LoadSecrets), arg0, arg1) + return &MockSecretsLoaderLoadSecretsCall{Call: call} +} + +// MockSecretsLoaderLoadSecretsCall wrap *gomock.Call +type MockSecretsLoaderLoadSecretsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSecretsLoaderLoadSecretsCall) Return(arg0 v20231001preview.SecretStoresClientListSecretsResponse, arg1 error) *MockSecretsLoaderLoadSecretsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSecretsLoaderLoadSecretsCall) Do(f func(context.Context, string) (v20231001preview.SecretStoresClientListSecretsResponse, error)) *MockSecretsLoaderLoadSecretsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSecretsLoaderLoadSecretsCall) DoAndReturn(f func(context.Context, string) (v20231001preview.SecretStoresClientListSecretsResponse, error)) *MockSecretsLoaderLoadSecretsCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/recipes/configloader/types.go b/pkg/recipes/configloader/types.go index d032693b596..d381c0dbcd6 100644 --- a/pkg/recipes/configloader/types.go +++ b/pkg/recipes/configloader/types.go @@ -30,7 +30,7 @@ type ConfigurationLoader interface { LoadRecipe(ctx context.Context, recipe *recipes.ResourceMetadata) (*recipes.EnvironmentDefinition, error) } -//go:generate mockgen -destination=./mock_secret_loader.go -package=configloader -self_package github.com/radius-project/radius/pkg/recipes/configloader github.com/radius-project/radius/pkg/recipes/configloader SecretsLoader +//go:generate mockgen -typed -destination=./mock_secret_loader.go -package=configloader -self_package github.com/radius-project/radius/pkg/recipes/configloader github.com/radius-project/radius/pkg/recipes/configloader SecretsLoader type SecretsLoader interface { LoadSecrets(ctx context.Context, secretStore string) (v20231001preview.SecretStoresClientListSecretsResponse, error) } diff --git a/pkg/recipes/driver/mock_driver.go b/pkg/recipes/driver/mock_driver.go index 5bb1a1e0d47..d0943e95e54 100644 --- a/pkg/recipes/driver/mock_driver.go +++ b/pkg/recipes/driver/mock_driver.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_driver.go -package=driver -self_package github.com/radius-project/radius/pkg/recipes/driver github.com/radius-project/radius/pkg/recipes/driver Driver +// mockgen -typed -destination=./mock_driver.go -package=driver -self_package github.com/radius-project/radius/pkg/recipes/driver github.com/radius-project/radius/pkg/recipes/driver Driver // // Package driver is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockDriver) Delete(arg0 context.Context, arg1 DeleteOptions) error { } // Delete indicates an expected call of Delete. -func (mr *MockDriverMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockDriverMockRecorder) Delete(arg0, arg1 any) *MockDriverDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDriver)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDriver)(nil).Delete), arg0, arg1) + return &MockDriverDeleteCall{Call: call} +} + +// MockDriverDeleteCall wrap *gomock.Call +type MockDriverDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDriverDeleteCall) Return(arg0 error) *MockDriverDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDriverDeleteCall) Do(f func(context.Context, DeleteOptions) error) *MockDriverDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDriverDeleteCall) DoAndReturn(f func(context.Context, DeleteOptions) error) *MockDriverDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Execute mocks base method. @@ -64,9 +88,33 @@ func (m *MockDriver) Execute(arg0 context.Context, arg1 ExecuteOptions) (*recipe } // Execute indicates an expected call of Execute. -func (mr *MockDriverMockRecorder) Execute(arg0, arg1 any) *gomock.Call { +func (mr *MockDriverMockRecorder) Execute(arg0, arg1 any) *MockDriverExecuteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockDriver)(nil).Execute), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockDriver)(nil).Execute), arg0, arg1) + return &MockDriverExecuteCall{Call: call} +} + +// MockDriverExecuteCall wrap *gomock.Call +type MockDriverExecuteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDriverExecuteCall) Return(arg0 *recipes.RecipeOutput, arg1 error) *MockDriverExecuteCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDriverExecuteCall) Do(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverExecuteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDriverExecuteCall) DoAndReturn(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverExecuteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetRecipeMetadata mocks base method. @@ -79,7 +127,31 @@ func (m *MockDriver) GetRecipeMetadata(arg0 context.Context, arg1 BaseOptions) ( } // GetRecipeMetadata indicates an expected call of GetRecipeMetadata. -func (mr *MockDriverMockRecorder) GetRecipeMetadata(arg0, arg1 any) *gomock.Call { +func (mr *MockDriverMockRecorder) GetRecipeMetadata(arg0, arg1 any) *MockDriverGetRecipeMetadataCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockDriver)(nil).GetRecipeMetadata), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockDriver)(nil).GetRecipeMetadata), arg0, arg1) + return &MockDriverGetRecipeMetadataCall{Call: call} +} + +// MockDriverGetRecipeMetadataCall wrap *gomock.Call +type MockDriverGetRecipeMetadataCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDriverGetRecipeMetadataCall) Return(arg0 map[string]any, arg1 error) *MockDriverGetRecipeMetadataCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDriverGetRecipeMetadataCall) Do(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverGetRecipeMetadataCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDriverGetRecipeMetadataCall) DoAndReturn(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverGetRecipeMetadataCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/recipes/driver/mock_driver_with_secrets.go b/pkg/recipes/driver/mock_driver_with_secrets.go index 8d388d1c735..b48b487f489 100644 --- a/pkg/recipes/driver/mock_driver_with_secrets.go +++ b/pkg/recipes/driver/mock_driver_with_secrets.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_driver_with_secrets.go -package=driver -self_package github.com/radius-project/radius/pkg/recipes/driver github.com/radius-project/radius/pkg/recipes/driver DriverWithSecrets +// mockgen -typed -destination=./mock_driver_with_secrets.go -package=driver -self_package github.com/radius-project/radius/pkg/recipes/driver github.com/radius-project/radius/pkg/recipes/driver DriverWithSecrets // // Package driver is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockDriverWithSecrets) Delete(arg0 context.Context, arg1 DeleteOptions) } // Delete indicates an expected call of Delete. -func (mr *MockDriverWithSecretsMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockDriverWithSecretsMockRecorder) Delete(arg0, arg1 any) *MockDriverWithSecretsDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDriverWithSecrets)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDriverWithSecrets)(nil).Delete), arg0, arg1) + return &MockDriverWithSecretsDeleteCall{Call: call} +} + +// MockDriverWithSecretsDeleteCall wrap *gomock.Call +type MockDriverWithSecretsDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDriverWithSecretsDeleteCall) Return(arg0 error) *MockDriverWithSecretsDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDriverWithSecretsDeleteCall) Do(f func(context.Context, DeleteOptions) error) *MockDriverWithSecretsDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDriverWithSecretsDeleteCall) DoAndReturn(f func(context.Context, DeleteOptions) error) *MockDriverWithSecretsDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Execute mocks base method. @@ -64,9 +88,33 @@ func (m *MockDriverWithSecrets) Execute(arg0 context.Context, arg1 ExecuteOption } // Execute indicates an expected call of Execute. -func (mr *MockDriverWithSecretsMockRecorder) Execute(arg0, arg1 any) *gomock.Call { +func (mr *MockDriverWithSecretsMockRecorder) Execute(arg0, arg1 any) *MockDriverWithSecretsExecuteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockDriverWithSecrets)(nil).Execute), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockDriverWithSecrets)(nil).Execute), arg0, arg1) + return &MockDriverWithSecretsExecuteCall{Call: call} +} + +// MockDriverWithSecretsExecuteCall wrap *gomock.Call +type MockDriverWithSecretsExecuteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDriverWithSecretsExecuteCall) Return(arg0 *recipes.RecipeOutput, arg1 error) *MockDriverWithSecretsExecuteCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDriverWithSecretsExecuteCall) Do(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverWithSecretsExecuteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDriverWithSecretsExecuteCall) DoAndReturn(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockDriverWithSecretsExecuteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FindSecretIDs mocks base method. @@ -79,9 +127,33 @@ func (m *MockDriverWithSecrets) FindSecretIDs(arg0 context.Context, arg1 recipes } // FindSecretIDs indicates an expected call of FindSecretIDs. -func (mr *MockDriverWithSecretsMockRecorder) FindSecretIDs(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockDriverWithSecretsMockRecorder) FindSecretIDs(arg0, arg1, arg2 any) *MockDriverWithSecretsFindSecretIDsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindSecretIDs", reflect.TypeOf((*MockDriverWithSecrets)(nil).FindSecretIDs), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindSecretIDs", reflect.TypeOf((*MockDriverWithSecrets)(nil).FindSecretIDs), arg0, arg1, arg2) + return &MockDriverWithSecretsFindSecretIDsCall{Call: call} +} + +// MockDriverWithSecretsFindSecretIDsCall wrap *gomock.Call +type MockDriverWithSecretsFindSecretIDsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDriverWithSecretsFindSecretIDsCall) Return(arg0 string, arg1 error) *MockDriverWithSecretsFindSecretIDsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDriverWithSecretsFindSecretIDsCall) Do(f func(context.Context, recipes.Configuration, recipes.EnvironmentDefinition) (string, error)) *MockDriverWithSecretsFindSecretIDsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDriverWithSecretsFindSecretIDsCall) DoAndReturn(f func(context.Context, recipes.Configuration, recipes.EnvironmentDefinition) (string, error)) *MockDriverWithSecretsFindSecretIDsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetRecipeMetadata mocks base method. @@ -94,7 +166,31 @@ func (m *MockDriverWithSecrets) GetRecipeMetadata(arg0 context.Context, arg1 Bas } // GetRecipeMetadata indicates an expected call of GetRecipeMetadata. -func (mr *MockDriverWithSecretsMockRecorder) GetRecipeMetadata(arg0, arg1 any) *gomock.Call { +func (mr *MockDriverWithSecretsMockRecorder) GetRecipeMetadata(arg0, arg1 any) *MockDriverWithSecretsGetRecipeMetadataCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockDriverWithSecrets)(nil).GetRecipeMetadata), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockDriverWithSecrets)(nil).GetRecipeMetadata), arg0, arg1) + return &MockDriverWithSecretsGetRecipeMetadataCall{Call: call} +} + +// MockDriverWithSecretsGetRecipeMetadataCall wrap *gomock.Call +type MockDriverWithSecretsGetRecipeMetadataCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDriverWithSecretsGetRecipeMetadataCall) Return(arg0 map[string]any, arg1 error) *MockDriverWithSecretsGetRecipeMetadataCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDriverWithSecretsGetRecipeMetadataCall) Do(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverWithSecretsGetRecipeMetadataCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDriverWithSecretsGetRecipeMetadataCall) DoAndReturn(f func(context.Context, BaseOptions) (map[string]any, error)) *MockDriverWithSecretsGetRecipeMetadataCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/recipes/driver/types.go b/pkg/recipes/driver/types.go index ccfec40d835..dfbec5f1e00 100644 --- a/pkg/recipes/driver/types.go +++ b/pkg/recipes/driver/types.go @@ -33,7 +33,7 @@ const ( // Driver is an interface to implement recipe deployment and recipe resources deletion. // -//go:generate mockgen -destination=./mock_driver.go -package=driver -self_package github.com/radius-project/radius/pkg/recipes/driver github.com/radius-project/radius/pkg/recipes/driver Driver +//go:generate mockgen -typed -destination=./mock_driver.go -package=driver -self_package github.com/radius-project/radius/pkg/recipes/driver github.com/radius-project/radius/pkg/recipes/driver Driver type Driver interface { // Execute fetches the recipe contents and deploys the recipe and returns deployed resources, secrets and values. Execute(ctx context.Context, opts ExecuteOptions) (*recipes.RecipeOutput, error) @@ -47,7 +47,7 @@ type Driver interface { // DriverWithSecrets is an optional interface and used when the driver needs to load secrets for recipe deployment. // -//go:generate mockgen -destination=./mock_driver_with_secrets.go -package=driver -self_package github.com/radius-project/radius/pkg/recipes/driver github.com/radius-project/radius/pkg/recipes/driver DriverWithSecrets +//go:generate mockgen -typed -destination=./mock_driver_with_secrets.go -package=driver -self_package github.com/radius-project/radius/pkg/recipes/driver github.com/radius-project/radius/pkg/recipes/driver DriverWithSecrets type DriverWithSecrets interface { // Driver is an interface to implement recipe deployment and recipe resources deletion. Driver diff --git a/pkg/recipes/engine/mock_engine.go b/pkg/recipes/engine/mock_engine.go index 3b8ce5b1364..4540799a55b 100644 --- a/pkg/recipes/engine/mock_engine.go +++ b/pkg/recipes/engine/mock_engine.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_engine.go -package=engine -self_package github.com/radius-project/radius/pkg/recipes/engine github.com/radius-project/radius/pkg/recipes/engine Engine +// mockgen -typed -destination=./mock_engine.go -package=engine -self_package github.com/radius-project/radius/pkg/recipes/engine github.com/radius-project/radius/pkg/recipes/engine Engine // // Package engine is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockEngine) Delete(arg0 context.Context, arg1 DeleteOptions) error { } // Delete indicates an expected call of Delete. -func (mr *MockEngineMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockEngineMockRecorder) Delete(arg0, arg1 any) *MockEngineDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockEngine)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockEngine)(nil).Delete), arg0, arg1) + return &MockEngineDeleteCall{Call: call} +} + +// MockEngineDeleteCall wrap *gomock.Call +type MockEngineDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEngineDeleteCall) Return(arg0 error) *MockEngineDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEngineDeleteCall) Do(f func(context.Context, DeleteOptions) error) *MockEngineDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEngineDeleteCall) DoAndReturn(f func(context.Context, DeleteOptions) error) *MockEngineDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Execute mocks base method. @@ -64,9 +88,33 @@ func (m *MockEngine) Execute(arg0 context.Context, arg1 ExecuteOptions) (*recipe } // Execute indicates an expected call of Execute. -func (mr *MockEngineMockRecorder) Execute(arg0, arg1 any) *gomock.Call { +func (mr *MockEngineMockRecorder) Execute(arg0, arg1 any) *MockEngineExecuteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockEngine)(nil).Execute), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockEngine)(nil).Execute), arg0, arg1) + return &MockEngineExecuteCall{Call: call} +} + +// MockEngineExecuteCall wrap *gomock.Call +type MockEngineExecuteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEngineExecuteCall) Return(arg0 *recipes.RecipeOutput, arg1 error) *MockEngineExecuteCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEngineExecuteCall) Do(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockEngineExecuteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEngineExecuteCall) DoAndReturn(f func(context.Context, ExecuteOptions) (*recipes.RecipeOutput, error)) *MockEngineExecuteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetRecipeMetadata mocks base method. @@ -79,7 +127,31 @@ func (m *MockEngine) GetRecipeMetadata(arg0 context.Context, arg1 GetRecipeMetad } // GetRecipeMetadata indicates an expected call of GetRecipeMetadata. -func (mr *MockEngineMockRecorder) GetRecipeMetadata(arg0, arg1 any) *gomock.Call { +func (mr *MockEngineMockRecorder) GetRecipeMetadata(arg0, arg1 any) *MockEngineGetRecipeMetadataCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockEngine)(nil).GetRecipeMetadata), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockEngine)(nil).GetRecipeMetadata), arg0, arg1) + return &MockEngineGetRecipeMetadataCall{Call: call} +} + +// MockEngineGetRecipeMetadataCall wrap *gomock.Call +type MockEngineGetRecipeMetadataCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEngineGetRecipeMetadataCall) Return(arg0 map[string]any, arg1 error) *MockEngineGetRecipeMetadataCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEngineGetRecipeMetadataCall) Do(f func(context.Context, GetRecipeMetadataOptions) (map[string]any, error)) *MockEngineGetRecipeMetadataCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEngineGetRecipeMetadataCall) DoAndReturn(f func(context.Context, GetRecipeMetadataOptions) (map[string]any, error)) *MockEngineGetRecipeMetadataCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/recipes/engine/types.go b/pkg/recipes/engine/types.go index 97d71eb651f..ba362188adb 100644 --- a/pkg/recipes/engine/types.go +++ b/pkg/recipes/engine/types.go @@ -23,7 +23,7 @@ import ( rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) -//go:generate mockgen -destination=./mock_engine.go -package=engine -self_package github.com/radius-project/radius/pkg/recipes/engine github.com/radius-project/radius/pkg/recipes/engine Engine +//go:generate mockgen -typed -destination=./mock_engine.go -package=engine -self_package github.com/radius-project/radius/pkg/recipes/engine github.com/radius-project/radius/pkg/recipes/engine Engine type Engine interface { // Execute gathers environment configuration, recipe definition and calls the driver to deploy the recipe. diff --git a/pkg/recipes/terraform/config/backends/mock_backend.go b/pkg/recipes/terraform/config/backends/mock_backend.go index 9684c764e1d..5e3a3b806b1 100644 --- a/pkg/recipes/terraform/config/backends/mock_backend.go +++ b/pkg/recipes/terraform/config/backends/mock_backend.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_backend.go -package=backends -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/backends github.com/radius-project/radius/pkg/recipes/terraform/config/backends Backend +// mockgen -typed -destination=./mock_backend.go -package=backends -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/backends github.com/radius-project/radius/pkg/recipes/terraform/config/backends Backend // // Package backends is a generated GoMock package. @@ -50,9 +50,33 @@ func (m *MockBackend) BuildBackend(arg0 *recipes.ResourceMetadata) (map[string]a } // BuildBackend indicates an expected call of BuildBackend. -func (mr *MockBackendMockRecorder) BuildBackend(arg0 any) *gomock.Call { +func (mr *MockBackendMockRecorder) BuildBackend(arg0 any) *MockBackendBuildBackendCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildBackend", reflect.TypeOf((*MockBackend)(nil).BuildBackend), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildBackend", reflect.TypeOf((*MockBackend)(nil).BuildBackend), arg0) + return &MockBackendBuildBackendCall{Call: call} +} + +// MockBackendBuildBackendCall wrap *gomock.Call +type MockBackendBuildBackendCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockBackendBuildBackendCall) Return(arg0 map[string]any, arg1 error) *MockBackendBuildBackendCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockBackendBuildBackendCall) Do(f func(*recipes.ResourceMetadata) (map[string]any, error)) *MockBackendBuildBackendCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockBackendBuildBackendCall) DoAndReturn(f func(*recipes.ResourceMetadata) (map[string]any, error)) *MockBackendBuildBackendCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ValidateBackendExists mocks base method. @@ -65,7 +89,31 @@ func (m *MockBackend) ValidateBackendExists(arg0 context.Context, arg1 string) ( } // ValidateBackendExists indicates an expected call of ValidateBackendExists. -func (mr *MockBackendMockRecorder) ValidateBackendExists(arg0, arg1 any) *gomock.Call { +func (mr *MockBackendMockRecorder) ValidateBackendExists(arg0, arg1 any) *MockBackendValidateBackendExistsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateBackendExists", reflect.TypeOf((*MockBackend)(nil).ValidateBackendExists), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateBackendExists", reflect.TypeOf((*MockBackend)(nil).ValidateBackendExists), arg0, arg1) + return &MockBackendValidateBackendExistsCall{Call: call} +} + +// MockBackendValidateBackendExistsCall wrap *gomock.Call +type MockBackendValidateBackendExistsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockBackendValidateBackendExistsCall) Return(arg0 bool, arg1 error) *MockBackendValidateBackendExistsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockBackendValidateBackendExistsCall) Do(f func(context.Context, string) (bool, error)) *MockBackendValidateBackendExistsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockBackendValidateBackendExistsCall) DoAndReturn(f func(context.Context, string) (bool, error)) *MockBackendValidateBackendExistsCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/recipes/terraform/config/backends/types.go b/pkg/recipes/terraform/config/backends/types.go index 4fb79bce054..aadbc5fca21 100644 --- a/pkg/recipes/terraform/config/backends/types.go +++ b/pkg/recipes/terraform/config/backends/types.go @@ -22,7 +22,7 @@ import ( "github.com/radius-project/radius/pkg/recipes" ) -//go:generate mockgen -destination=./mock_backend.go -package=backends -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/backends github.com/radius-project/radius/pkg/recipes/terraform/config/backends Backend +//go:generate mockgen -typed -destination=./mock_backend.go -package=backends -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/backends github.com/radius-project/radius/pkg/recipes/terraform/config/backends Backend // Backend is an interface for generating Terraform backend configurations. type Backend interface { diff --git a/pkg/recipes/terraform/config/providers/mock_provider.go b/pkg/recipes/terraform/config/providers/mock_provider.go index a0ff5d5333c..ab7b8f49841 100644 --- a/pkg/recipes/terraform/config/providers/mock_provider.go +++ b/pkg/recipes/terraform/config/providers/mock_provider.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_provider.go -package=providers -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/providers github.com/radius-project/radius/pkg/recipes/terraform/config/providers Provider +// mockgen -typed -destination=./mock_provider.go -package=providers -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/providers github.com/radius-project/radius/pkg/recipes/terraform/config/providers Provider // // Package providers is a generated GoMock package. @@ -50,7 +50,31 @@ func (m *MockProvider) BuildConfig(arg0 context.Context, arg1 *recipes.Configura } // BuildConfig indicates an expected call of BuildConfig. -func (mr *MockProviderMockRecorder) BuildConfig(arg0, arg1 any) *gomock.Call { +func (mr *MockProviderMockRecorder) BuildConfig(arg0, arg1 any) *MockProviderBuildConfigCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildConfig", reflect.TypeOf((*MockProvider)(nil).BuildConfig), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildConfig", reflect.TypeOf((*MockProvider)(nil).BuildConfig), arg0, arg1) + return &MockProviderBuildConfigCall{Call: call} +} + +// MockProviderBuildConfigCall wrap *gomock.Call +type MockProviderBuildConfigCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProviderBuildConfigCall) Return(arg0 map[string]any, arg1 error) *MockProviderBuildConfigCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProviderBuildConfigCall) Do(f func(context.Context, *recipes.Configuration) (map[string]any, error)) *MockProviderBuildConfigCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProviderBuildConfigCall) DoAndReturn(f func(context.Context, *recipes.Configuration) (map[string]any, error)) *MockProviderBuildConfigCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/recipes/terraform/config/providers/types.go b/pkg/recipes/terraform/config/providers/types.go index 34293e280d9..5d57c7fc342 100644 --- a/pkg/recipes/terraform/config/providers/types.go +++ b/pkg/recipes/terraform/config/providers/types.go @@ -24,7 +24,7 @@ import ( ucp_provider "github.com/radius-project/radius/pkg/ucp/secret/provider" ) -//go:generate mockgen -destination=./mock_provider.go -package=providers -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/providers github.com/radius-project/radius/pkg/recipes/terraform/config/providers Provider +//go:generate mockgen -typed -destination=./mock_provider.go -package=providers -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/providers github.com/radius-project/radius/pkg/recipes/terraform/config/providers Provider // Provider is an interface for generating Terraform provider configurations. type Provider interface { diff --git a/pkg/recipes/terraform/mock_executor.go b/pkg/recipes/terraform/mock_executor.go index 70497ac0f8d..df6261fcf29 100644 --- a/pkg/recipes/terraform/mock_executor.go +++ b/pkg/recipes/terraform/mock_executor.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_executor.go -package=terraform -self_package github.com/radius-project/radius/pkg/recipes/terraform github.com/radius-project/radius/pkg/recipes/terraform TerraformExecutor +// mockgen -typed -destination=./mock_executor.go -package=terraform -self_package github.com/radius-project/radius/pkg/recipes/terraform github.com/radius-project/radius/pkg/recipes/terraform TerraformExecutor // // Package terraform is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockTerraformExecutor) Delete(arg0 context.Context, arg1 Options) error } // Delete indicates an expected call of Delete. -func (mr *MockTerraformExecutorMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockTerraformExecutorMockRecorder) Delete(arg0, arg1 any) *MockTerraformExecutorDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockTerraformExecutor)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockTerraformExecutor)(nil).Delete), arg0, arg1) + return &MockTerraformExecutorDeleteCall{Call: call} +} + +// MockTerraformExecutorDeleteCall wrap *gomock.Call +type MockTerraformExecutorDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockTerraformExecutorDeleteCall) Return(arg0 error) *MockTerraformExecutorDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockTerraformExecutorDeleteCall) Do(f func(context.Context, Options) error) *MockTerraformExecutorDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockTerraformExecutorDeleteCall) DoAndReturn(f func(context.Context, Options) error) *MockTerraformExecutorDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Deploy mocks base method. @@ -64,9 +88,33 @@ func (m *MockTerraformExecutor) Deploy(arg0 context.Context, arg1 Options) (*tfj } // Deploy indicates an expected call of Deploy. -func (mr *MockTerraformExecutorMockRecorder) Deploy(arg0, arg1 any) *gomock.Call { +func (mr *MockTerraformExecutorMockRecorder) Deploy(arg0, arg1 any) *MockTerraformExecutorDeployCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Deploy", reflect.TypeOf((*MockTerraformExecutor)(nil).Deploy), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Deploy", reflect.TypeOf((*MockTerraformExecutor)(nil).Deploy), arg0, arg1) + return &MockTerraformExecutorDeployCall{Call: call} +} + +// MockTerraformExecutorDeployCall wrap *gomock.Call +type MockTerraformExecutorDeployCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockTerraformExecutorDeployCall) Return(arg0 *tfjson.State, arg1 error) *MockTerraformExecutorDeployCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockTerraformExecutorDeployCall) Do(f func(context.Context, Options) (*tfjson.State, error)) *MockTerraformExecutorDeployCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockTerraformExecutorDeployCall) DoAndReturn(f func(context.Context, Options) (*tfjson.State, error)) *MockTerraformExecutorDeployCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetRecipeMetadata mocks base method. @@ -79,7 +127,31 @@ func (m *MockTerraformExecutor) GetRecipeMetadata(arg0 context.Context, arg1 Opt } // GetRecipeMetadata indicates an expected call of GetRecipeMetadata. -func (mr *MockTerraformExecutorMockRecorder) GetRecipeMetadata(arg0, arg1 any) *gomock.Call { +func (mr *MockTerraformExecutorMockRecorder) GetRecipeMetadata(arg0, arg1 any) *MockTerraformExecutorGetRecipeMetadataCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockTerraformExecutor)(nil).GetRecipeMetadata), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockTerraformExecutor)(nil).GetRecipeMetadata), arg0, arg1) + return &MockTerraformExecutorGetRecipeMetadataCall{Call: call} +} + +// MockTerraformExecutorGetRecipeMetadataCall wrap *gomock.Call +type MockTerraformExecutorGetRecipeMetadataCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockTerraformExecutorGetRecipeMetadataCall) Return(arg0 map[string]any, arg1 error) *MockTerraformExecutorGetRecipeMetadataCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockTerraformExecutorGetRecipeMetadataCall) Do(f func(context.Context, Options) (map[string]any, error)) *MockTerraformExecutorGetRecipeMetadataCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockTerraformExecutorGetRecipeMetadataCall) DoAndReturn(f func(context.Context, Options) (map[string]any, error)) *MockTerraformExecutorGetRecipeMetadataCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/recipes/terraform/types.go b/pkg/recipes/terraform/types.go index 44bd5883fed..b0204033041 100644 --- a/pkg/recipes/terraform/types.go +++ b/pkg/recipes/terraform/types.go @@ -34,7 +34,7 @@ const ( workingDirFileMode fs.FileMode = 0700 ) -//go:generate mockgen -destination=./mock_executor.go -package=terraform -self_package github.com/radius-project/radius/pkg/recipes/terraform github.com/radius-project/radius/pkg/recipes/terraform TerraformExecutor +//go:generate mockgen -typed -destination=./mock_executor.go -package=terraform -self_package github.com/radius-project/radius/pkg/recipes/terraform github.com/radius-project/radius/pkg/recipes/terraform TerraformExecutor type TerraformExecutor interface { // Deploy installs terraform and runs terraform init and apply on the terraform module referenced by the recipe using terraform-exec. Deploy(ctx context.Context, options Options) (*tfjson.State, error) diff --git a/pkg/ucp/aws/cloudcontrolclient.go b/pkg/ucp/aws/cloudcontrolclient.go index 8c31132f1ab..22b392a976e 100644 --- a/pkg/ucp/aws/cloudcontrolclient.go +++ b/pkg/ucp/aws/cloudcontrolclient.go @@ -25,7 +25,7 @@ import ( // Didn't see an interface for aws-sdk-go-v2, v1 had: https://pkg.go.dev/github.com/aws/aws-sdk-go/service/cloudcontrolapi/cloudcontrolapiiface // This is most likely due to using json schemas to define types rather than crafting by hand. There are significantly less functions in v2, so a small mock. // -//go:generate mockgen -destination=./mock_awscloudcontrolclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudControlClient +//go:generate mockgen -typed -destination=./mock_awscloudcontrolclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudControlClient type AWSCloudControlClient interface { GetResource(ctx context.Context, params *cloudcontrol.GetResourceInput, optFns ...func(*cloudcontrol.Options)) (*cloudcontrol.GetResourceOutput, error) ListResources(ctx context.Context, params *cloudcontrol.ListResourcesInput, optFns ...func(*cloudcontrol.Options)) (*cloudcontrol.ListResourcesOutput, error) diff --git a/pkg/ucp/aws/cloudformationclient.go b/pkg/ucp/aws/cloudformationclient.go index 4658297a10e..fdd2c0db9d7 100644 --- a/pkg/ucp/aws/cloudformationclient.go +++ b/pkg/ucp/aws/cloudformationclient.go @@ -22,7 +22,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudformation" ) -//go:generate mockgen -destination=./mock_awscloudformationclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudFormationClient +//go:generate mockgen -typed -destination=./mock_awscloudformationclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudFormationClient type AWSCloudFormationClient interface { DescribeType(ctx context.Context, params *cloudformation.DescribeTypeInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeTypeOutput, error) } diff --git a/pkg/ucp/aws/mock_awscloudcontrolclient.go b/pkg/ucp/aws/mock_awscloudcontrolclient.go index d7b768a4531..d5dce463e5a 100644 --- a/pkg/ucp/aws/mock_awscloudcontrolclient.go +++ b/pkg/ucp/aws/mock_awscloudcontrolclient.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_awscloudcontrolclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudControlClient +// mockgen -typed -destination=./mock_awscloudcontrolclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudControlClient // // Package aws is a generated GoMock package. @@ -54,10 +54,34 @@ func (m *MockAWSCloudControlClient) CancelResourceRequest(arg0 context.Context, } // CancelResourceRequest indicates an expected call of CancelResourceRequest. -func (mr *MockAWSCloudControlClientMockRecorder) CancelResourceRequest(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAWSCloudControlClientMockRecorder) CancelResourceRequest(arg0, arg1 any, arg2 ...any) *MockAWSCloudControlClientCancelResourceRequestCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelResourceRequest", reflect.TypeOf((*MockAWSCloudControlClient)(nil).CancelResourceRequest), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelResourceRequest", reflect.TypeOf((*MockAWSCloudControlClient)(nil).CancelResourceRequest), varargs...) + return &MockAWSCloudControlClientCancelResourceRequestCall{Call: call} +} + +// MockAWSCloudControlClientCancelResourceRequestCall wrap *gomock.Call +type MockAWSCloudControlClientCancelResourceRequestCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCloudControlClientCancelResourceRequestCall) Return(arg0 *cloudcontrol.CancelResourceRequestOutput, arg1 error) *MockAWSCloudControlClientCancelResourceRequestCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCloudControlClientCancelResourceRequestCall) Do(f func(context.Context, *cloudcontrol.CancelResourceRequestInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.CancelResourceRequestOutput, error)) *MockAWSCloudControlClientCancelResourceRequestCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCloudControlClientCancelResourceRequestCall) DoAndReturn(f func(context.Context, *cloudcontrol.CancelResourceRequestInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.CancelResourceRequestOutput, error)) *MockAWSCloudControlClientCancelResourceRequestCall { + c.Call = c.Call.DoAndReturn(f) + return c } // CreateResource mocks base method. @@ -74,10 +98,34 @@ func (m *MockAWSCloudControlClient) CreateResource(arg0 context.Context, arg1 *c } // CreateResource indicates an expected call of CreateResource. -func (mr *MockAWSCloudControlClientMockRecorder) CreateResource(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAWSCloudControlClientMockRecorder) CreateResource(arg0, arg1 any, arg2 ...any) *MockAWSCloudControlClientCreateResourceCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateResource", reflect.TypeOf((*MockAWSCloudControlClient)(nil).CreateResource), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateResource", reflect.TypeOf((*MockAWSCloudControlClient)(nil).CreateResource), varargs...) + return &MockAWSCloudControlClientCreateResourceCall{Call: call} +} + +// MockAWSCloudControlClientCreateResourceCall wrap *gomock.Call +type MockAWSCloudControlClientCreateResourceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCloudControlClientCreateResourceCall) Return(arg0 *cloudcontrol.CreateResourceOutput, arg1 error) *MockAWSCloudControlClientCreateResourceCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCloudControlClientCreateResourceCall) Do(f func(context.Context, *cloudcontrol.CreateResourceInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.CreateResourceOutput, error)) *MockAWSCloudControlClientCreateResourceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCloudControlClientCreateResourceCall) DoAndReturn(f func(context.Context, *cloudcontrol.CreateResourceInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.CreateResourceOutput, error)) *MockAWSCloudControlClientCreateResourceCall { + c.Call = c.Call.DoAndReturn(f) + return c } // DeleteResource mocks base method. @@ -94,10 +142,34 @@ func (m *MockAWSCloudControlClient) DeleteResource(arg0 context.Context, arg1 *c } // DeleteResource indicates an expected call of DeleteResource. -func (mr *MockAWSCloudControlClientMockRecorder) DeleteResource(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAWSCloudControlClientMockRecorder) DeleteResource(arg0, arg1 any, arg2 ...any) *MockAWSCloudControlClientDeleteResourceCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteResource", reflect.TypeOf((*MockAWSCloudControlClient)(nil).DeleteResource), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteResource", reflect.TypeOf((*MockAWSCloudControlClient)(nil).DeleteResource), varargs...) + return &MockAWSCloudControlClientDeleteResourceCall{Call: call} +} + +// MockAWSCloudControlClientDeleteResourceCall wrap *gomock.Call +type MockAWSCloudControlClientDeleteResourceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCloudControlClientDeleteResourceCall) Return(arg0 *cloudcontrol.DeleteResourceOutput, arg1 error) *MockAWSCloudControlClientDeleteResourceCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCloudControlClientDeleteResourceCall) Do(f func(context.Context, *cloudcontrol.DeleteResourceInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.DeleteResourceOutput, error)) *MockAWSCloudControlClientDeleteResourceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCloudControlClientDeleteResourceCall) DoAndReturn(f func(context.Context, *cloudcontrol.DeleteResourceInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.DeleteResourceOutput, error)) *MockAWSCloudControlClientDeleteResourceCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetResource mocks base method. @@ -114,10 +186,34 @@ func (m *MockAWSCloudControlClient) GetResource(arg0 context.Context, arg1 *clou } // GetResource indicates an expected call of GetResource. -func (mr *MockAWSCloudControlClientMockRecorder) GetResource(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAWSCloudControlClientMockRecorder) GetResource(arg0, arg1 any, arg2 ...any) *MockAWSCloudControlClientGetResourceCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResource", reflect.TypeOf((*MockAWSCloudControlClient)(nil).GetResource), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResource", reflect.TypeOf((*MockAWSCloudControlClient)(nil).GetResource), varargs...) + return &MockAWSCloudControlClientGetResourceCall{Call: call} +} + +// MockAWSCloudControlClientGetResourceCall wrap *gomock.Call +type MockAWSCloudControlClientGetResourceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCloudControlClientGetResourceCall) Return(arg0 *cloudcontrol.GetResourceOutput, arg1 error) *MockAWSCloudControlClientGetResourceCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCloudControlClientGetResourceCall) Do(f func(context.Context, *cloudcontrol.GetResourceInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.GetResourceOutput, error)) *MockAWSCloudControlClientGetResourceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCloudControlClientGetResourceCall) DoAndReturn(f func(context.Context, *cloudcontrol.GetResourceInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.GetResourceOutput, error)) *MockAWSCloudControlClientGetResourceCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetResourceRequestStatus mocks base method. @@ -134,10 +230,34 @@ func (m *MockAWSCloudControlClient) GetResourceRequestStatus(arg0 context.Contex } // GetResourceRequestStatus indicates an expected call of GetResourceRequestStatus. -func (mr *MockAWSCloudControlClientMockRecorder) GetResourceRequestStatus(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAWSCloudControlClientMockRecorder) GetResourceRequestStatus(arg0, arg1 any, arg2 ...any) *MockAWSCloudControlClientGetResourceRequestStatusCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResourceRequestStatus", reflect.TypeOf((*MockAWSCloudControlClient)(nil).GetResourceRequestStatus), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResourceRequestStatus", reflect.TypeOf((*MockAWSCloudControlClient)(nil).GetResourceRequestStatus), varargs...) + return &MockAWSCloudControlClientGetResourceRequestStatusCall{Call: call} +} + +// MockAWSCloudControlClientGetResourceRequestStatusCall wrap *gomock.Call +type MockAWSCloudControlClientGetResourceRequestStatusCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCloudControlClientGetResourceRequestStatusCall) Return(arg0 *cloudcontrol.GetResourceRequestStatusOutput, arg1 error) *MockAWSCloudControlClientGetResourceRequestStatusCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCloudControlClientGetResourceRequestStatusCall) Do(f func(context.Context, *cloudcontrol.GetResourceRequestStatusInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.GetResourceRequestStatusOutput, error)) *MockAWSCloudControlClientGetResourceRequestStatusCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCloudControlClientGetResourceRequestStatusCall) DoAndReturn(f func(context.Context, *cloudcontrol.GetResourceRequestStatusInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.GetResourceRequestStatusOutput, error)) *MockAWSCloudControlClientGetResourceRequestStatusCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListResourceRequests mocks base method. @@ -154,10 +274,34 @@ func (m *MockAWSCloudControlClient) ListResourceRequests(arg0 context.Context, a } // ListResourceRequests indicates an expected call of ListResourceRequests. -func (mr *MockAWSCloudControlClientMockRecorder) ListResourceRequests(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAWSCloudControlClientMockRecorder) ListResourceRequests(arg0, arg1 any, arg2 ...any) *MockAWSCloudControlClientListResourceRequestsCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourceRequests", reflect.TypeOf((*MockAWSCloudControlClient)(nil).ListResourceRequests), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResourceRequests", reflect.TypeOf((*MockAWSCloudControlClient)(nil).ListResourceRequests), varargs...) + return &MockAWSCloudControlClientListResourceRequestsCall{Call: call} +} + +// MockAWSCloudControlClientListResourceRequestsCall wrap *gomock.Call +type MockAWSCloudControlClientListResourceRequestsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCloudControlClientListResourceRequestsCall) Return(arg0 *cloudcontrol.ListResourceRequestsOutput, arg1 error) *MockAWSCloudControlClientListResourceRequestsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCloudControlClientListResourceRequestsCall) Do(f func(context.Context, *cloudcontrol.ListResourceRequestsInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.ListResourceRequestsOutput, error)) *MockAWSCloudControlClientListResourceRequestsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCloudControlClientListResourceRequestsCall) DoAndReturn(f func(context.Context, *cloudcontrol.ListResourceRequestsInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.ListResourceRequestsOutput, error)) *MockAWSCloudControlClientListResourceRequestsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListResources mocks base method. @@ -174,10 +318,34 @@ func (m *MockAWSCloudControlClient) ListResources(arg0 context.Context, arg1 *cl } // ListResources indicates an expected call of ListResources. -func (mr *MockAWSCloudControlClientMockRecorder) ListResources(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAWSCloudControlClientMockRecorder) ListResources(arg0, arg1 any, arg2 ...any) *MockAWSCloudControlClientListResourcesCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResources", reflect.TypeOf((*MockAWSCloudControlClient)(nil).ListResources), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListResources", reflect.TypeOf((*MockAWSCloudControlClient)(nil).ListResources), varargs...) + return &MockAWSCloudControlClientListResourcesCall{Call: call} +} + +// MockAWSCloudControlClientListResourcesCall wrap *gomock.Call +type MockAWSCloudControlClientListResourcesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCloudControlClientListResourcesCall) Return(arg0 *cloudcontrol.ListResourcesOutput, arg1 error) *MockAWSCloudControlClientListResourcesCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCloudControlClientListResourcesCall) Do(f func(context.Context, *cloudcontrol.ListResourcesInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.ListResourcesOutput, error)) *MockAWSCloudControlClientListResourcesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCloudControlClientListResourcesCall) DoAndReturn(f func(context.Context, *cloudcontrol.ListResourcesInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.ListResourcesOutput, error)) *MockAWSCloudControlClientListResourcesCall { + c.Call = c.Call.DoAndReturn(f) + return c } // UpdateResource mocks base method. @@ -194,8 +362,32 @@ func (m *MockAWSCloudControlClient) UpdateResource(arg0 context.Context, arg1 *c } // UpdateResource indicates an expected call of UpdateResource. -func (mr *MockAWSCloudControlClientMockRecorder) UpdateResource(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAWSCloudControlClientMockRecorder) UpdateResource(arg0, arg1 any, arg2 ...any) *MockAWSCloudControlClientUpdateResourceCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateResource", reflect.TypeOf((*MockAWSCloudControlClient)(nil).UpdateResource), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateResource", reflect.TypeOf((*MockAWSCloudControlClient)(nil).UpdateResource), varargs...) + return &MockAWSCloudControlClientUpdateResourceCall{Call: call} +} + +// MockAWSCloudControlClientUpdateResourceCall wrap *gomock.Call +type MockAWSCloudControlClientUpdateResourceCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCloudControlClientUpdateResourceCall) Return(arg0 *cloudcontrol.UpdateResourceOutput, arg1 error) *MockAWSCloudControlClientUpdateResourceCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCloudControlClientUpdateResourceCall) Do(f func(context.Context, *cloudcontrol.UpdateResourceInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.UpdateResourceOutput, error)) *MockAWSCloudControlClientUpdateResourceCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCloudControlClientUpdateResourceCall) DoAndReturn(f func(context.Context, *cloudcontrol.UpdateResourceInput, ...func(*cloudcontrol.Options)) (*cloudcontrol.UpdateResourceOutput, error)) *MockAWSCloudControlClientUpdateResourceCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/ucp/aws/mock_awscloudformationclient.go b/pkg/ucp/aws/mock_awscloudformationclient.go index ff4c9bfe4e8..de54f656d69 100644 --- a/pkg/ucp/aws/mock_awscloudformationclient.go +++ b/pkg/ucp/aws/mock_awscloudformationclient.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_awscloudformationclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudFormationClient +// mockgen -typed -destination=./mock_awscloudformationclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudFormationClient // // Package aws is a generated GoMock package. @@ -54,8 +54,32 @@ func (m *MockAWSCloudFormationClient) DescribeType(arg0 context.Context, arg1 *c } // DescribeType indicates an expected call of DescribeType. -func (mr *MockAWSCloudFormationClientMockRecorder) DescribeType(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAWSCloudFormationClientMockRecorder) DescribeType(arg0, arg1 any, arg2 ...any) *MockAWSCloudFormationClientDescribeTypeCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeType", reflect.TypeOf((*MockAWSCloudFormationClient)(nil).DescribeType), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeType", reflect.TypeOf((*MockAWSCloudFormationClient)(nil).DescribeType), varargs...) + return &MockAWSCloudFormationClientDescribeTypeCall{Call: call} +} + +// MockAWSCloudFormationClientDescribeTypeCall wrap *gomock.Call +type MockAWSCloudFormationClientDescribeTypeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAWSCloudFormationClientDescribeTypeCall) Return(arg0 *cloudformation.DescribeTypeOutput, arg1 error) *MockAWSCloudFormationClientDescribeTypeCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAWSCloudFormationClientDescribeTypeCall) Do(f func(context.Context, *cloudformation.DescribeTypeInput, ...func(*cloudformation.Options)) (*cloudformation.DescribeTypeOutput, error)) *MockAWSCloudFormationClientDescribeTypeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAWSCloudFormationClientDescribeTypeCall) DoAndReturn(f func(context.Context, *cloudformation.DescribeTypeInput, ...func(*cloudformation.Options)) (*cloudformation.DescribeTypeOutput, error)) *MockAWSCloudFormationClientDescribeTypeCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/ucp/dataprovider/mock_datastorage_provider.go b/pkg/ucp/dataprovider/mock_datastorage_provider.go index 48d7f12948f..e270701f4a5 100644 --- a/pkg/ucp/dataprovider/mock_datastorage_provider.go +++ b/pkg/ucp/dataprovider/mock_datastorage_provider.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_datastorage_provider.go -package=dataprovider -self_package github.com/radius-project/radius/pkg/ucp/dataprovider github.com/radius-project/radius/pkg/ucp/dataprovider DataStorageProvider +// mockgen -typed -destination=./mock_datastorage_provider.go -package=dataprovider -self_package github.com/radius-project/radius/pkg/ucp/dataprovider github.com/radius-project/radius/pkg/ucp/dataprovider DataStorageProvider // // Package dataprovider is a generated GoMock package. @@ -50,7 +50,31 @@ func (m *MockDataStorageProvider) GetStorageClient(arg0 context.Context, arg1 st } // GetStorageClient indicates an expected call of GetStorageClient. -func (mr *MockDataStorageProviderMockRecorder) GetStorageClient(arg0, arg1 any) *gomock.Call { +func (mr *MockDataStorageProviderMockRecorder) GetStorageClient(arg0, arg1 any) *MockDataStorageProviderGetStorageClientCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageClient", reflect.TypeOf((*MockDataStorageProvider)(nil).GetStorageClient), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageClient", reflect.TypeOf((*MockDataStorageProvider)(nil).GetStorageClient), arg0, arg1) + return &MockDataStorageProviderGetStorageClientCall{Call: call} +} + +// MockDataStorageProviderGetStorageClientCall wrap *gomock.Call +type MockDataStorageProviderGetStorageClientCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockDataStorageProviderGetStorageClientCall) Return(arg0 store.StorageClient, arg1 error) *MockDataStorageProviderGetStorageClientCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockDataStorageProviderGetStorageClientCall) Do(f func(context.Context, string) (store.StorageClient, error)) *MockDataStorageProviderGetStorageClientCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockDataStorageProviderGetStorageClientCall) DoAndReturn(f func(context.Context, string) (store.StorageClient, error)) *MockDataStorageProviderGetStorageClientCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/ucp/dataprovider/types.go b/pkg/ucp/dataprovider/types.go index 54e1b2619be..afba4427c5a 100644 --- a/pkg/ucp/dataprovider/types.go +++ b/pkg/ucp/dataprovider/types.go @@ -36,7 +36,7 @@ const ( TypeETCD StorageProviderType = "etcd" ) -//go:generate mockgen -destination=./mock_datastorage_provider.go -package=dataprovider -self_package github.com/radius-project/radius/pkg/ucp/dataprovider github.com/radius-project/radius/pkg/ucp/dataprovider DataStorageProvider +//go:generate mockgen -typed -destination=./mock_datastorage_provider.go -package=dataprovider -self_package github.com/radius-project/radius/pkg/ucp/dataprovider github.com/radius-project/radius/pkg/ucp/dataprovider DataStorageProvider // DataStorageProvider is an interfae to provide storage client. type DataStorageProvider interface { diff --git a/pkg/ucp/queue/client/client.go b/pkg/ucp/queue/client/client.go index f120008c9b6..7a4471bd6cf 100644 --- a/pkg/ucp/queue/client/client.go +++ b/pkg/ucp/queue/client/client.go @@ -41,7 +41,7 @@ var ( ErrEmptyMessage = errors.New("message must not be nil or message is empty") ) -//go:generate mockgen -destination=./mock_client.go -package=client -self_package github.com/radius-project/radius/pkg/ucp/queue/client github.com/radius-project/radius/pkg/ucp/queue/client Client +//go:generate mockgen -typed -destination=./mock_client.go -package=client -self_package github.com/radius-project/radius/pkg/ucp/queue/client github.com/radius-project/radius/pkg/ucp/queue/client Client // Client is an interface to implement queue operations. type Client interface { diff --git a/pkg/ucp/queue/client/client_test.go b/pkg/ucp/queue/client/client_test.go index d50f2e43708..f6c4a6ad1b9 100644 --- a/pkg/ucp/queue/client/client_test.go +++ b/pkg/ucp/queue/client/client_test.go @@ -50,7 +50,7 @@ func TestStartDequeuer(t *testing.T) { Data: []byte("{}"), }, nil) - secondCall := mockCli.EXPECT().Dequeue(gomock.Any(), gomock.Any()).Return(nil, ErrInvalidMessage).After(firstCall) + secondCall := mockCli.EXPECT().Dequeue(gomock.Any(), gomock.Any()).Return(nil, ErrInvalidMessage).After(firstCall.Call) mockCli.EXPECT().Dequeue(gomock.Any(), gomock.Any()). DoAndReturn(func(ctx context.Context, cfg QueueClientConfig) (*Message, error) { close(lastDequeueCh) diff --git a/pkg/ucp/queue/client/mock_client.go b/pkg/ucp/queue/client/mock_client.go index bfd2e38f18e..fe0165e80e2 100644 --- a/pkg/ucp/queue/client/mock_client.go +++ b/pkg/ucp/queue/client/mock_client.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_client.go -package=client -self_package github.com/radius-project/radius/pkg/ucp/queue/client github.com/radius-project/radius/pkg/ucp/queue/client Client +// mockgen -typed -destination=./mock_client.go -package=client -self_package github.com/radius-project/radius/pkg/ucp/queue/client github.com/radius-project/radius/pkg/ucp/queue/client Client // // Package client is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockClient) Dequeue(arg0 context.Context, arg1 QueueClientConfig) (*Mes } // Dequeue indicates an expected call of Dequeue. -func (mr *MockClientMockRecorder) Dequeue(arg0, arg1 any) *gomock.Call { +func (mr *MockClientMockRecorder) Dequeue(arg0, arg1 any) *MockClientDequeueCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dequeue", reflect.TypeOf((*MockClient)(nil).Dequeue), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dequeue", reflect.TypeOf((*MockClient)(nil).Dequeue), arg0, arg1) + return &MockClientDequeueCall{Call: call} +} + +// MockClientDequeueCall wrap *gomock.Call +type MockClientDequeueCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientDequeueCall) Return(arg0 *Message, arg1 error) *MockClientDequeueCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientDequeueCall) Do(f func(context.Context, QueueClientConfig) (*Message, error)) *MockClientDequeueCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientDequeueCall) DoAndReturn(f func(context.Context, QueueClientConfig) (*Message, error)) *MockClientDequeueCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Enqueue mocks base method. @@ -67,10 +91,34 @@ func (m *MockClient) Enqueue(arg0 context.Context, arg1 *Message, arg2 ...Enqueu } // Enqueue indicates an expected call of Enqueue. -func (mr *MockClientMockRecorder) Enqueue(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockClientMockRecorder) Enqueue(arg0, arg1 any, arg2 ...any) *MockClientEnqueueCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enqueue", reflect.TypeOf((*MockClient)(nil).Enqueue), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enqueue", reflect.TypeOf((*MockClient)(nil).Enqueue), varargs...) + return &MockClientEnqueueCall{Call: call} +} + +// MockClientEnqueueCall wrap *gomock.Call +type MockClientEnqueueCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientEnqueueCall) Return(arg0 error) *MockClientEnqueueCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientEnqueueCall) Do(f func(context.Context, *Message, ...EnqueueOptions) error) *MockClientEnqueueCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientEnqueueCall) DoAndReturn(f func(context.Context, *Message, ...EnqueueOptions) error) *MockClientEnqueueCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ExtendMessage mocks base method. @@ -82,9 +130,33 @@ func (m *MockClient) ExtendMessage(arg0 context.Context, arg1 *Message) error { } // ExtendMessage indicates an expected call of ExtendMessage. -func (mr *MockClientMockRecorder) ExtendMessage(arg0, arg1 any) *gomock.Call { +func (mr *MockClientMockRecorder) ExtendMessage(arg0, arg1 any) *MockClientExtendMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExtendMessage", reflect.TypeOf((*MockClient)(nil).ExtendMessage), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExtendMessage", reflect.TypeOf((*MockClient)(nil).ExtendMessage), arg0, arg1) + return &MockClientExtendMessageCall{Call: call} +} + +// MockClientExtendMessageCall wrap *gomock.Call +type MockClientExtendMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientExtendMessageCall) Return(arg0 error) *MockClientExtendMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientExtendMessageCall) Do(f func(context.Context, *Message) error) *MockClientExtendMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientExtendMessageCall) DoAndReturn(f func(context.Context, *Message) error) *MockClientExtendMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FinishMessage mocks base method. @@ -96,7 +168,31 @@ func (m *MockClient) FinishMessage(arg0 context.Context, arg1 *Message) error { } // FinishMessage indicates an expected call of FinishMessage. -func (mr *MockClientMockRecorder) FinishMessage(arg0, arg1 any) *gomock.Call { +func (mr *MockClientMockRecorder) FinishMessage(arg0, arg1 any) *MockClientFinishMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinishMessage", reflect.TypeOf((*MockClient)(nil).FinishMessage), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinishMessage", reflect.TypeOf((*MockClient)(nil).FinishMessage), arg0, arg1) + return &MockClientFinishMessageCall{Call: call} +} + +// MockClientFinishMessageCall wrap *gomock.Call +type MockClientFinishMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientFinishMessageCall) Return(arg0 error) *MockClientFinishMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientFinishMessageCall) Do(f func(context.Context, *Message) error) *MockClientFinishMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientFinishMessageCall) DoAndReturn(f func(context.Context, *Message) error) *MockClientFinishMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/ucp/secret/client.go b/pkg/ucp/secret/client.go index c3f9dfad988..a4ae6a3d0f3 100644 --- a/pkg/ucp/secret/client.go +++ b/pkg/ucp/secret/client.go @@ -21,7 +21,7 @@ import ( "encoding/json" ) -//go:generate mockgen -destination=./mock_client.go -package=secret -self_package github.com/radius-project/radius/pkg/ucp/secret github.com/radius-project/radius/pkg/ucp/secret Client +//go:generate mockgen -typed -destination=./mock_client.go -package=secret -self_package github.com/radius-project/radius/pkg/ucp/secret github.com/radius-project/radius/pkg/ucp/secret Client // Client is an interface to implement secret operations. type Client interface { diff --git a/pkg/ucp/secret/mock_client.go b/pkg/ucp/secret/mock_client.go index a097bbad2c3..492431c0278 100644 --- a/pkg/ucp/secret/mock_client.go +++ b/pkg/ucp/secret/mock_client.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_client.go -package=secret -self_package github.com/radius-project/radius/pkg/ucp/secret github.com/radius-project/radius/pkg/ucp/secret Client +// mockgen -typed -destination=./mock_client.go -package=secret -self_package github.com/radius-project/radius/pkg/ucp/secret github.com/radius-project/radius/pkg/ucp/secret Client // // Package secret is a generated GoMock package. @@ -48,9 +48,33 @@ func (m *MockClient) Delete(arg0 context.Context, arg1 string) error { } // Delete indicates an expected call of Delete. -func (mr *MockClientMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockClientMockRecorder) Delete(arg0, arg1 any) *MockClientDeleteCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockClient)(nil).Delete), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockClient)(nil).Delete), arg0, arg1) + return &MockClientDeleteCall{Call: call} +} + +// MockClientDeleteCall wrap *gomock.Call +type MockClientDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientDeleteCall) Return(arg0 error) *MockClientDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientDeleteCall) Do(f func(context.Context, string) error) *MockClientDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientDeleteCall) DoAndReturn(f func(context.Context, string) error) *MockClientDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Get mocks base method. @@ -63,9 +87,33 @@ func (m *MockClient) Get(arg0 context.Context, arg1 string) ([]byte, error) { } // Get indicates an expected call of Get. -func (mr *MockClientMockRecorder) Get(arg0, arg1 any) *gomock.Call { +func (mr *MockClientMockRecorder) Get(arg0, arg1 any) *MockClientGetCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockClient)(nil).Get), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockClient)(nil).Get), arg0, arg1) + return &MockClientGetCall{Call: call} +} + +// MockClientGetCall wrap *gomock.Call +type MockClientGetCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientGetCall) Return(arg0 []byte, arg1 error) *MockClientGetCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientGetCall) Do(f func(context.Context, string) ([]byte, error)) *MockClientGetCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientGetCall) DoAndReturn(f func(context.Context, string) ([]byte, error)) *MockClientGetCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Save mocks base method. @@ -77,7 +125,31 @@ func (m *MockClient) Save(arg0 context.Context, arg1 string, arg2 []byte) error } // Save indicates an expected call of Save. -func (mr *MockClientMockRecorder) Save(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockClientMockRecorder) Save(arg0, arg1, arg2 any) *MockClientSaveCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockClient)(nil).Save), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockClient)(nil).Save), arg0, arg1, arg2) + return &MockClientSaveCall{Call: call} +} + +// MockClientSaveCall wrap *gomock.Call +type MockClientSaveCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockClientSaveCall) Return(arg0 error) *MockClientSaveCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockClientSaveCall) Do(f func(context.Context, string, []byte) error) *MockClientSaveCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockClientSaveCall) DoAndReturn(f func(context.Context, string, []byte) error) *MockClientSaveCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/pkg/ucp/store/client.go b/pkg/ucp/store/client.go index 8f735c1b46d..1aee368b35e 100644 --- a/pkg/ucp/store/client.go +++ b/pkg/ucp/store/client.go @@ -20,7 +20,7 @@ import ( "context" ) -//go:generate mockgen -destination=./mock_storageClient.go -package=store -self_package github.com/radius-project/radius/pkg/ucp/store github.com/radius-project/radius/pkg/ucp/store StorageClient +//go:generate mockgen -typed -destination=./mock_storageClient.go -package=store -self_package github.com/radius-project/radius/pkg/ucp/store github.com/radius-project/radius/pkg/ucp/store StorageClient type StorageClient interface { Query(ctx context.Context, query Query, options ...QueryOptions) (*ObjectQueryResult, error) diff --git a/pkg/ucp/store/mock_storageClient.go b/pkg/ucp/store/mock_storageClient.go index 1c2224d090e..8784a9848c8 100644 --- a/pkg/ucp/store/mock_storageClient.go +++ b/pkg/ucp/store/mock_storageClient.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_storageClient.go -package=store -self_package github.com/radius-project/radius/pkg/ucp/store github.com/radius-project/radius/pkg/ucp/store StorageClient +// mockgen -typed -destination=./mock_storageClient.go -package=store -self_package github.com/radius-project/radius/pkg/ucp/store github.com/radius-project/radius/pkg/ucp/store StorageClient // // Package store is a generated GoMock package. @@ -52,10 +52,34 @@ func (m *MockStorageClient) Delete(arg0 context.Context, arg1 string, arg2 ...De } // Delete indicates an expected call of Delete. -func (mr *MockStorageClientMockRecorder) Delete(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockStorageClientMockRecorder) Delete(arg0, arg1 any, arg2 ...any) *MockStorageClientDeleteCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockStorageClient)(nil).Delete), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockStorageClient)(nil).Delete), varargs...) + return &MockStorageClientDeleteCall{Call: call} +} + +// MockStorageClientDeleteCall wrap *gomock.Call +type MockStorageClientDeleteCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorageClientDeleteCall) Return(arg0 error) *MockStorageClientDeleteCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorageClientDeleteCall) Do(f func(context.Context, string, ...DeleteOptions) error) *MockStorageClientDeleteCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorageClientDeleteCall) DoAndReturn(f func(context.Context, string, ...DeleteOptions) error) *MockStorageClientDeleteCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Get mocks base method. @@ -72,10 +96,34 @@ func (m *MockStorageClient) Get(arg0 context.Context, arg1 string, arg2 ...GetOp } // Get indicates an expected call of Get. -func (mr *MockStorageClientMockRecorder) Get(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockStorageClientMockRecorder) Get(arg0, arg1 any, arg2 ...any) *MockStorageClientGetCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockStorageClient)(nil).Get), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockStorageClient)(nil).Get), varargs...) + return &MockStorageClientGetCall{Call: call} +} + +// MockStorageClientGetCall wrap *gomock.Call +type MockStorageClientGetCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorageClientGetCall) Return(arg0 *Object, arg1 error) *MockStorageClientGetCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorageClientGetCall) Do(f func(context.Context, string, ...GetOptions) (*Object, error)) *MockStorageClientGetCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorageClientGetCall) DoAndReturn(f func(context.Context, string, ...GetOptions) (*Object, error)) *MockStorageClientGetCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Query mocks base method. @@ -92,10 +140,34 @@ func (m *MockStorageClient) Query(arg0 context.Context, arg1 Query, arg2 ...Quer } // Query indicates an expected call of Query. -func (mr *MockStorageClientMockRecorder) Query(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockStorageClientMockRecorder) Query(arg0, arg1 any, arg2 ...any) *MockStorageClientQueryCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Query", reflect.TypeOf((*MockStorageClient)(nil).Query), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Query", reflect.TypeOf((*MockStorageClient)(nil).Query), varargs...) + return &MockStorageClientQueryCall{Call: call} +} + +// MockStorageClientQueryCall wrap *gomock.Call +type MockStorageClientQueryCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorageClientQueryCall) Return(arg0 *ObjectQueryResult, arg1 error) *MockStorageClientQueryCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorageClientQueryCall) Do(f func(context.Context, Query, ...QueryOptions) (*ObjectQueryResult, error)) *MockStorageClientQueryCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorageClientQueryCall) DoAndReturn(f func(context.Context, Query, ...QueryOptions) (*ObjectQueryResult, error)) *MockStorageClientQueryCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Save mocks base method. @@ -111,8 +183,32 @@ func (m *MockStorageClient) Save(arg0 context.Context, arg1 *Object, arg2 ...Sav } // Save indicates an expected call of Save. -func (mr *MockStorageClientMockRecorder) Save(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockStorageClientMockRecorder) Save(arg0, arg1 any, arg2 ...any) *MockStorageClientSaveCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockStorageClient)(nil).Save), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockStorageClient)(nil).Save), varargs...) + return &MockStorageClientSaveCall{Call: call} +} + +// MockStorageClientSaveCall wrap *gomock.Call +type MockStorageClientSaveCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorageClientSaveCall) Return(arg0 error) *MockStorageClientSaveCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorageClientSaveCall) Do(f func(context.Context, *Object, ...SaveOptions) error) *MockStorageClientSaveCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorageClientSaveCall) DoAndReturn(f func(context.Context, *Object, ...SaveOptions) error) *MockStorageClientSaveCall { + c.Call = c.Call.DoAndReturn(f) + return c }