@@ -109,6 +109,7 @@ func TestFromProto(t *testing.T) {
109109 Type : "some.type" ,
110110 Attributes : map [string ]* pb.CloudEventAttributeValue {
111111 "datacontenttype" : {Attr : & pb.CloudEventAttributeValue_CeString {CeString : "application/json" }},
112+ "dataschema" : {Attr : & pb.CloudEventAttributeValue_CeUri {CeUri : "link" }},
112113 "extra1" : {Attr : & pb.CloudEventAttributeValue_CeString {CeString : "extra1 value" }},
113114 "extra2" : {Attr : & pb.CloudEventAttributeValue_CeInteger {CeInteger : 2 }},
114115 "extra3" : {Attr : & pb.CloudEventAttributeValue_CeBoolean {CeBoolean : true }},
@@ -124,6 +125,7 @@ func TestFromProto(t *testing.T) {
124125 out .SetSource ("/source" )
125126 out .SetType ("some.type" )
126127 _ = out .SetData ("application/json" , map [string ]interface {}{"unit" : "test" })
128+ out .SetDataSchema ("link" )
127129 out .SetExtension ("extra1" , "extra1 value" )
128130 out .SetExtension ("extra2" , 2 )
129131 out .SetExtension ("extra3" , true )
@@ -140,6 +142,7 @@ func TestFromProto(t *testing.T) {
140142 Type : "some.type" ,
141143 Attributes : map [string ]* pb.CloudEventAttributeValue {
142144 "datacontenttype" : {Attr : & pb.CloudEventAttributeValue_CeString {CeString : "text/plain" }},
145+ "dataschema" : {Attr : & pb.CloudEventAttributeValue_CeUri {CeUri : "link" }},
143146 "extra1" : {Attr : & pb.CloudEventAttributeValue_CeString {CeString : "extra1 value" }},
144147 "extra2" : {Attr : & pb.CloudEventAttributeValue_CeInteger {CeInteger : 2 }},
145148 "extra3" : {Attr : & pb.CloudEventAttributeValue_CeBoolean {CeBoolean : true }},
@@ -155,6 +158,7 @@ func TestFromProto(t *testing.T) {
155158 out .SetSource ("/source" )
156159 out .SetType ("some.type" )
157160 _ = out .SetData ("text/plain" , `this is some text with a "quote"` )
161+ out .SetDataSchema ("link" )
158162 out .SetExtension ("extra1" , "extra1 value" )
159163 out .SetExtension ("extra2" , 2 )
160164 out .SetExtension ("extra3" , true )
@@ -171,6 +175,7 @@ func TestFromProto(t *testing.T) {
171175 Type : "some.type" ,
172176 Attributes : map [string ]* pb.CloudEventAttributeValue {
173177 "datacontenttype" : {Attr : & pb.CloudEventAttributeValue_CeString {CeString : "application/json" }},
178+ "dataschema" : {Attr : & pb.CloudEventAttributeValue_CeUri {CeUri : "link" }},
174179 "extra1" : {Attr : & pb.CloudEventAttributeValue_CeString {CeString : "extra1 value" }},
175180 "extra2" : {Attr : & pb.CloudEventAttributeValue_CeInteger {CeInteger : 2 }},
176181 "extra3" : {Attr : & pb.CloudEventAttributeValue_CeBoolean {CeBoolean : true }},
@@ -186,6 +191,7 @@ func TestFromProto(t *testing.T) {
186191 out .SetSource ("/source" )
187192 out .SetType ("some.type" )
188193 _ = out .SetData ("application/json" , `{"unit":"test"}` )
194+ out .SetDataSchema ("link" )
189195 out .SetExtension ("extra1" , "extra1 value" )
190196 out .SetExtension ("extra2" , 2 )
191197 out .SetExtension ("extra3" , true )
0 commit comments