From d8465a024efd1813291afbe60ab5183a6f94c5e1 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Sun, 1 Sep 2024 13:21:33 -0700 Subject: [PATCH] Fix tests. --- integration_tests/mongo/main.go | 4 ++-- lib/mongo/message_test.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integration_tests/mongo/main.go b/integration_tests/mongo/main.go index 8ecb031e..f3c2862c 100644 --- a/integration_tests/mongo/main.go +++ b/integration_tests/mongo/main.go @@ -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"}}`, diff --git a/lib/mongo/message_test.go b/lib/mongo/message_test.go index b0f32f02..509bcae4 100644 --- a/lib/mongo/message_test.go +++ b/lib/mongo/message_test.go @@ -3,6 +3,7 @@ package mongo import ( "encoding/json" "fmt" + "github.com/artie-labs/transfer/lib/typing/ext" "testing" "time" @@ -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,