Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Sep 1, 2024
1 parent 1d3b340 commit d8465a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions integration_tests/mongo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ func testTypes(ctx context.Context, db *mongo.Database, mongoCfg config.MongoDB)
expectedPayload := map[string]any{
"objectId": "66a95fae3776c2f21f0ff568",
"array": []any{"item1", int32(2), true, 3.14},
"datetime": ts.Format(ext.ISO8601),
"datetime": ext.NewExtendedTime(ts, ext.DateTimeKindType, "2006-01-02T15:04:05.999-07:00"),
"int64": int64(64),
"__artie_delete": false,
"__artie_only_set_delete": false,
"timestamp": ts.Format(ext.ISO8601),
"timestamp": ext.NewExtendedTime(ts, ext.DateTimeKindType, "2006-01-02T15:04:05.999-07:00"),
"embeddedDocument": `{"field1":"value1","field2":"value2"}`,
"embeddedMap": `{"foo":"bar","hello":"world","pi":3.14159}`,
"binary": `{"$binary":{"base64":"YmluYXJ5IGRhdGE=","subType":"00"}}`,
Expand Down
3 changes: 2 additions & 1 deletion lib/mongo/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mongo
import (
"encoding/json"
"fmt"
"github.com/artie-labs/transfer/lib/typing/ext"
"testing"
"time"

Expand Down Expand Up @@ -105,7 +106,7 @@ func TestParseMessage(t *testing.T) {
"decimal": "1234.5",
"subDocument": `{"nestedString":"Nested value"}`,
"array": []any{"apple", "banana", "cherry"},
"datetime": "2024-02-13T20:37:48+00:00",
"datetime": ext.NewExtendedTime(time.Date(2024, time.February, 13, 20, 37, 48, 0, time.UTC), ext.DateTimeKindType, "2006-01-02T15:04:05.999-07:00"),
"trueValue": true,
"falseValue": false,
"nullValue": nil,
Expand Down

0 comments on commit d8465a0

Please sign in to comment.