From 18e2b19b7103e5e2430208dba131b4fbdcf799e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20Jos=C3=A9?= Date: Thu, 12 Sep 2019 22:26:49 -0300 Subject: [PATCH] Fix the expected json data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabio José --- .../v02/http/HTTPStructuredMarshallerTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api/src/test/java/io/cloudevents/v02/http/HTTPStructuredMarshallerTest.java b/api/src/test/java/io/cloudevents/v02/http/HTTPStructuredMarshallerTest.java index 32dd08cd..85008cee 100644 --- a/api/src/test/java/io/cloudevents/v02/http/HTTPStructuredMarshallerTest.java +++ b/api/src/test/java/io/cloudevents/v02/http/HTTPStructuredMarshallerTest.java @@ -32,6 +32,7 @@ import io.cloudevents.format.StructuredMarshaller; import io.cloudevents.format.Wire; import io.cloudevents.json.Json; import io.cloudevents.json.types.Much; +import io.cloudevents.v02.Accessor; import io.cloudevents.v02.AttributesImpl; import io.cloudevents.v02.CloudEventBuilder; import io.cloudevents.v02.CloudEventImpl; @@ -49,7 +50,7 @@ public class HTTPStructuredMarshallerTest { @Test public void should_marshal_all_as_json() { // setup - String expected = "{\"data\":{\"wow\":\"yes!\"},\"id\":\"x10\",\"source\":\"/source\",\"specversion\":\"0.2\",\"type\":\"event-type\",\"contenttype\":\"application/json\",\"mediaType\":\"application/json\"}"; + String expected = "{\"data\":{\"wow\":\"yes!\"},\"id\":\"x10\",\"source\":\"/source\",\"specversion\":\"0.2\",\"type\":\"event-type\",\"contenttype\":\"application/json\"}"; Much ceData = new Much(); ceData.setWow("yes!"); @@ -81,7 +82,7 @@ public class HTTPStructuredMarshallerTest { @Test public void should_marshal_data_as_text_and_evelope_as_json() { // setup - String expected = "{\"data\":\"yes!\",\"id\":\"x10\",\"source\":\"/source\",\"specversion\":\"0.2\",\"type\":\"event-type\",\"contenttype\":\"text/plain\",\"mediaType\":\"text/plain\"}"; + String expected = "{\"data\":\"yes!\",\"id\":\"x10\",\"source\":\"/source\",\"specversion\":\"0.2\",\"type\":\"event-type\",\"contenttype\":\"text/plain\"}"; String ceData = "yes!"; CloudEventImpl ce = @@ -163,7 +164,9 @@ public class HTTPStructuredMarshallerTest { .map((event) -> { return Json.marshaller().marshal(event, NO_HEADERS); }) - .skip() + .map(Accessor::extensionsOf) + .map(ExtensionFormat::marshal) + .map(HeaderMapper::map) .withEvent(() -> ce) .marshal();