Skip to content

Commit

Permalink
tests: fix params
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan Arya committed Oct 16, 2024
1 parent cb7dc95 commit 3e88875
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions internal/server/v1/resources/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
},
Expand All @@ -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)
Expand All @@ -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",
Expand Down Expand Up @@ -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)
},
Expand All @@ -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)
},
Expand All @@ -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",
Expand Down Expand Up @@ -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)
},
Expand All @@ -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",
Expand Down

0 comments on commit 3e88875

Please sign in to comment.