Skip to content

Commit 37b7f07

Browse files
[azsystemevents] Re-enabling the scheduledOn test that was disabled (Azure#23698)
Service team confirmed the example in the docs was incorrect, and that the time format for ScheduledOn is actually RFC3339.
1 parent f498f54 commit 37b7f07

File tree

2 files changed

+81
-4
lines changed

2 files changed

+81
-4
lines changed

sdk/messaging/eventgrid/azsystemevents/system_events5_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package azsystemevents_test
88

99
import (
1010
"testing"
11+
"time"
1112

1213
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
1314
"github.com/Azure/azure-sdk-for-go/sdk/messaging/eventgrid/azsystemevents"
@@ -102,21 +103,23 @@ func TestConsumeCloudEventAcsRouterJobReceivedEvent(t *testing.T) {
102103
"ttlSeconds": 36
103104
}
104105
],
105-
"scheduledOn": "2007-03-28T19:13:50+00:00",
106+
"scheduledOn": "2022-02-17T00:55:25.1736293Z",
106107
"unavailableForMatching": false
107108
},
108109
"type": "Microsoft.Communication.RouterJobReceived",
109110
"specversion": "1.0",
110111
"time": "2022-02-17T00:55:25.1736293Z"
111112
}`
112113

113-
// TODO: formatting for the time is different - not ISO.
114-
// "scheduledOn": "3/28/2007 7:13:50 PM +00:00",
115-
116114
event := parseCloudEvent(t, requestContent)
117115

118116
sysEvent := deserializeSystemEvent[azsystemevents.ACSRouterJobReceivedEventData](t, event.Data)
119117
require.Equal(t, azsystemevents.ACSRouterJobStatusPendingClassification, *sysEvent.JobStatus)
118+
119+
expectedTime, err := time.Parse(time.RFC3339Nano, "2022-02-17T00:55:25.1736293Z")
120+
require.NoError(t, err)
121+
122+
require.Equal(t, expectedTime, *sysEvent.ScheduledOn)
120123
}
121124

122125
// Health Data Services events

sdk/messaging/eventgrid/azsystemevents/time_rfc1123.go

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)