Fixing the subject unmarshall: Closes #32

Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
Fabio José 2019-08-22 17:21:00 -03:00
parent 88934971d5
commit b51876a020
2 changed files with 7 additions and 2 deletions

View File

@ -51,6 +51,10 @@ setterByAttribute[Constants.STRUCTURED_ATTRS_03.CONTENT_TYPE] = {
name: "dataContentType",
parser: (v) => v
};
setterByAttribute[Constants.STRUCTURED_ATTRS_03.SUBJECT] = {
name: "subject",
parser: (v) => v
};
setterByAttribute[Constants.STRUCTURED_ATTRS_03.DATA] = {
name: "data",
parser: (v) => v

View File

@ -9,7 +9,7 @@ const webhook = "https://cloudevents.io/webhook";
const contentType = "application/cloudevents+json; charset=utf-8";
const now = new Date();
const schemaurl = "http://cloudevents.io/schema.json";
const subject = "subject.ext";
const ceContentType = "application/json";
const data = {
@ -118,9 +118,10 @@ describe("HTTP Transport Binding Unmarshaller for CloudEvents v0.3", () => {
new Cloudevent(v03.Spec)
.type(type)
.source(source)
.contenttype(ceContentType)
.dataContentType(ceContentType)
.time(now)
.schemaurl(schemaurl)
.subject(subject)
.data(data)
.toString();