Fixing the subject unmarshall: Closes #32
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
88934971d5
commit
b51876a020
|
@ -51,6 +51,10 @@ setterByAttribute[Constants.STRUCTURED_ATTRS_03.CONTENT_TYPE] = {
|
||||||
name: "dataContentType",
|
name: "dataContentType",
|
||||||
parser: (v) => v
|
parser: (v) => v
|
||||||
};
|
};
|
||||||
|
setterByAttribute[Constants.STRUCTURED_ATTRS_03.SUBJECT] = {
|
||||||
|
name: "subject",
|
||||||
|
parser: (v) => v
|
||||||
|
};
|
||||||
setterByAttribute[Constants.STRUCTURED_ATTRS_03.DATA] = {
|
setterByAttribute[Constants.STRUCTURED_ATTRS_03.DATA] = {
|
||||||
name: "data",
|
name: "data",
|
||||||
parser: (v) => v
|
parser: (v) => v
|
||||||
|
|
|
@ -9,7 +9,7 @@ const webhook = "https://cloudevents.io/webhook";
|
||||||
const contentType = "application/cloudevents+json; charset=utf-8";
|
const contentType = "application/cloudevents+json; charset=utf-8";
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const schemaurl = "http://cloudevents.io/schema.json";
|
const schemaurl = "http://cloudevents.io/schema.json";
|
||||||
|
const subject = "subject.ext";
|
||||||
const ceContentType = "application/json";
|
const ceContentType = "application/json";
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
@ -118,9 +118,10 @@ describe("HTTP Transport Binding Unmarshaller for CloudEvents v0.3", () => {
|
||||||
new Cloudevent(v03.Spec)
|
new Cloudevent(v03.Spec)
|
||||||
.type(type)
|
.type(type)
|
||||||
.source(source)
|
.source(source)
|
||||||
.contenttype(ceContentType)
|
.dataContentType(ceContentType)
|
||||||
.time(now)
|
.time(now)
|
||||||
.schemaurl(schemaurl)
|
.schemaurl(schemaurl)
|
||||||
|
.subject(subject)
|
||||||
.data(data)
|
.data(data)
|
||||||
.toString();
|
.toString();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue