@@ -928,3 +928,34 @@ func TestMultipleReprocessingCycles(t *testing.T) {
928928 }
929929 }
930930}
931+
932+ func TestTransformToEventTimestamp (t * testing.T ) {
933+ // Test that transformToEvent correctly converts timestamp format
934+ eventMap := map [string ]any {
935+ "eventId" : "test-event-id" ,
936+ "eventType" : "TASK_DEFINITION_EVENT" ,
937+ "sourceType" : "CORE_WORKER" ,
938+ "timestamp" : "2026-01-16T19:22:49.414579427Z" ,
939+ "severity" : "INFO" ,
940+ "taskDefinitionEvent" : map [string ]any {
941+ "taskId" : "task-123" ,
942+ "jobId" : "AQAAAA==" ,
943+ },
944+ }
945+
946+ event := transformToEvent (eventMap )
947+
948+ // Verify timestamp is converted to Unix milliseconds
949+ expectedTimestamp := "1768591369414"
950+ if event .Timestamp != expectedTimestamp {
951+ t .Errorf ("transformToEvent timestamp = %q, want %q" , event .Timestamp , expectedTimestamp )
952+ }
953+
954+ // Verify other fields are preserved
955+ if event .EventID != "test-event-id" {
956+ t .Errorf ("EventID = %q, want %q" , event .EventID , "test-event-id" )
957+ }
958+ if event .SourceType != "CORE_WORKER" {
959+ t .Errorf ("SourceType = %q, want %q" , event .SourceType , "CORE_WORKER" )
960+ }
961+ }
0 commit comments