From 3e8887571de3c55f1a9e16cd069b6df05a7dcfec Mon Sep 17 00:00:00 2001 From: Ishan Arya Date: Wed, 16 Oct 2024 11:29:34 +0530 Subject: [PATCH] tests: fix params --- internal/server/v1/resources/server_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/server/v1/resources/server_test.go b/internal/server/v1/resources/server_test.go index 4371b85..92f7ef4 100644 --- a/internal/server/v1/resources/server_test.go +++ b/internal/server/v1/resources/server_test.go @@ -17,6 +17,7 @@ import ( "google.golang.org/protobuf/types/known/structpb" "google.golang.org/protobuf/types/known/timestamppb" + "github.com/goto/entropy/core" "github.com/goto/entropy/core/resource" "github.com/goto/entropy/internal/server/v1/mocks" "github.com/goto/entropy/pkg/errors" @@ -44,7 +45,7 @@ func TestAPIServer_CreateResource(t *testing.T) { t.Helper() resourceService := &mocks.ResourceService{} resourceService.EXPECT(). - CreateResource(mock.Anything, mock.Anything). + CreateResource(mock.Anything, mock.Anything, core.WithDryRun(false)). Return(nil, errors.ErrConflict).Once() return NewAPIServer(resourceService) }, @@ -68,7 +69,7 @@ func TestAPIServer_CreateResource(t *testing.T) { t.Helper() resourceService := &mocks.ResourceService{} resourceService.EXPECT(). - CreateResource(mock.Anything, mock.Anything). + CreateResource(mock.Anything, mock.Anything, core.WithDryRun(false)). Return(nil, errors.ErrInvalid).Once() return NewAPIServer(resourceService) @@ -93,7 +94,7 @@ func TestAPIServer_CreateResource(t *testing.T) { t.Helper() resourceService := &mocks.ResourceService{} resourceService.EXPECT(). - CreateResource(mock.Anything, mock.Anything). + CreateResource(mock.Anything, mock.Anything, core.WithDryRun(false)). Return(&resource.Resource{ URN: "p-testdata-gl-testname-log", Kind: "log", @@ -189,7 +190,7 @@ func TestAPIServer_UpdateResource(t *testing.T) { t.Helper() resourceService := &mocks.ResourceService{} resourceService.EXPECT(). - UpdateResource(mock.Anything, "p-testdata-gl-testname-log", mock.Anything). + UpdateResource(mock.Anything, "p-testdata-gl-testname-log", mock.Anything, core.WithDryRun(false)). Return(nil, errors.ErrNotFound).Once() return NewAPIServer(resourceService) }, @@ -208,7 +209,7 @@ func TestAPIServer_UpdateResource(t *testing.T) { t.Helper() resourceService := &mocks.ResourceService{} resourceService.EXPECT(). - UpdateResource(mock.Anything, "p-testdata-gl-testname-log", mock.Anything). + UpdateResource(mock.Anything, "p-testdata-gl-testname-log", mock.Anything, core.WithDryRun(false)). Return(nil, errors.ErrInvalid).Once() return NewAPIServer(resourceService) }, @@ -227,7 +228,7 @@ func TestAPIServer_UpdateResource(t *testing.T) { t.Helper() resourceService := &mocks.ResourceService{} resourceService.EXPECT(). - UpdateResource(mock.Anything, "p-testdata-gl-testname-log", mock.Anything). + UpdateResource(mock.Anything, "p-testdata-gl-testname-log", mock.Anything, core.WithDryRun(false)). Return(&resource.Resource{ URN: "p-testdata-gl-testname-log", Kind: "log", @@ -593,7 +594,7 @@ func TestAPIServer_ApplyAction(t *testing.T) { t.Helper() resourceService := &mocks.ResourceService{} resourceService.EXPECT(). - ApplyAction(mock.Anything, "p-testdata-gl-testname-log", mock.Anything). + ApplyAction(mock.Anything, "p-testdata-gl-testname-log", mock.Anything, core.WithDryRun(false)). Return(nil, errors.ErrNotFound).Once() return NewAPIServer(resourceService) }, @@ -610,7 +611,7 @@ func TestAPIServer_ApplyAction(t *testing.T) { t.Helper() resourceService := &mocks.ResourceService{} resourceService.EXPECT(). - ApplyAction(mock.Anything, "p-testdata-gl-testname-log", mock.Anything). + ApplyAction(mock.Anything, "p-testdata-gl-testname-log", mock.Anything, core.WithDryRun(false)). Return(&resource.Resource{ URN: "p-testdata-gl-testname-log", Kind: "log",