@@ -13,7 +13,6 @@ import (
1313 "time"
1414
1515 cloudevents "github.com/cloudevents/sdk-go/v2"
16- // "github.com/cloudevents/sdk-go/v2/types"
1716)
1817
1918func TestSenderReceiver_binary_v1 (t * testing.T ) {
@@ -117,7 +116,7 @@ func TestSenderReceiver_structured_v1(t *testing.T) {
117116 Context : cloudevents.EventContextV1 {
118117 ID : "ABC-123" ,
119118 Type : "unit.test.client.sent" ,
120- Time : & cloudevents.Timestamp {Time : now . Truncate ( time . Second ) },
119+ Time : & cloudevents.Timestamp {Time : now },
121120 Source : * cloudevents .ParseURIRef ("/unit/test/client" ),
122121 Subject : strptr ("resource" ),
123122 DataContentType : cloudevents .StringOfApplicationJSON (),
@@ -130,7 +129,7 @@ func TestSenderReceiver_structured_v1(t *testing.T) {
130129 Header : map [string ][]string {
131130 "content-type" : {"application/cloudevents+json" },
132131 },
133- Body : fmt .Sprintf (`{"data":{"hello":"unittest"},"id":"ABC-123","source":"/unit/test/client","specversion":"1.0","subject":"resource","time":%q,"type":"unit.test.client.sent"}` , now .Truncate ( time . Second ). Format (time .RFC3339 )),
132+ Body : fmt .Sprintf (`{"data":{"hello":"unittest"},"id":"ABC-123","source":"/unit/test/client","specversion":"1.0","subject":"resource","time":%q,"type":"unit.test.client.sent"}` , now .Format (time .RFC3339 )),
134133 ContentLength : 182 ,
135134 },
136135 },
@@ -163,7 +162,7 @@ func TestSenderReceiver_data_base64_v1(t *testing.T) {
163162 Context : cloudevents.EventContextV1 {
164163 ID : "ABC-123" ,
165164 Type : "unit.test.client.sent" ,
166- Time : & cloudevents.Timestamp {Time : now . Truncate ( time . Second ) },
165+ Time : & cloudevents.Timestamp {Time : now },
167166 Source : * cloudevents .ParseURIRef ("/unit/test/client" ),
168167 Subject : strptr ("resource" ),
169168 DataContentType : cloudevents .StringOfTextPlain (),
@@ -176,7 +175,7 @@ func TestSenderReceiver_data_base64_v1(t *testing.T) {
176175 Header : map [string ][]string {
177176 "content-type" : {"application/cloudevents+json" },
178177 },
179- Body : fmt .Sprintf (`{"data_base64":"aGVsbG86IHVuaXR0ZXN0","id":"ABC-123","source":"/unit/test/client","specversion":"1.0","subject":"resource","time":%q,"type":"unit.test.client.sent"}` , now .Truncate ( time . Second ). Format (time .RFC3339 )),
178+ Body : fmt .Sprintf (`{"data_base64":"aGVsbG86IHVuaXR0ZXN0","id":"ABC-123","source":"/unit/test/client","specversion":"1.0","subject":"resource","time":%q,"type":"unit.test.client.sent"}` , now .Format (time .RFC3339 )),
180179 ContentLength : 191 ,
181180 },
182181 },
0 commit comments