Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
evisdrenova committed Dec 23, 2024
1 parent 84f00a6 commit 4af38e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion worker/pkg/benthos/transformers/transformer_initializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
if err != nil {
return nil, err
}
transform := NewTransformCharacterScramble().Transform
transform := NewTransformUuid().Transform
return &TransformerExecutor{
Opts: opts,
Mutate: func(value any, opts any) (any, error) {
Expand Down
13 changes: 6 additions & 7 deletions worker/pkg/benthos/transformers/transformer_initializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"testing"
"time"

"github.com/gofrs/uuid"
mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
presidioapi "github.com/nucleuscloud/neosync/internal/ee/presidio"
"github.com/stretchr/testify/mock"
Expand Down Expand Up @@ -1688,11 +1687,11 @@ func Test_InitializeTransformerByConfigType(t *testing.T) {
executor, err := InitializeTransformerByConfigType(config)
require.NoError(t, err)
require.NotNil(t, executor)
originalValue := generateUuid(false)
originalValue := generateUuid(true)
result, err := executor.Mutate(originalValue, executor.Opts)
require.NoError(t, err)
transformedValue := *result.(*uuid.UUID)
require.NotEqual(t, originalValue, transformedValue)
require.NotEqual(t, originalValue, result)
require.NotEmpty(t, result)
})

t.Run("TransformUuidConfig_Nil", func(t *testing.T) {
Expand All @@ -1702,11 +1701,11 @@ func Test_InitializeTransformerByConfigType(t *testing.T) {
executor, err := InitializeTransformerByConfigType(config)
require.NoError(t, err)
require.NotNil(t, executor)
originalValue := generateUuid(false)
originalValue := generateUuid(true)
result, err := executor.Mutate(originalValue, executor.Opts)
require.NoError(t, err)
transformedValue := *result.(*uuid.UUID)
require.NotEqual(t, originalValue, transformedValue)
require.NotEqual(t, originalValue, result)
require.NotEmpty(t, result)
})

t.Run("UnsupportedConfig", func(t *testing.T) {
Expand Down

0 comments on commit 4af38e3

Please sign in to comment.