From d18cbcceeb64edd5cfbb54b2b8e90b8eebbba6e5 Mon Sep 17 00:00:00 2001 From: Christian Amend Date: Tue, 7 Jul 2015 15:41:58 +0200 Subject: [PATCH] [OLINGO-659] Delete pretty printer from service document json --- .../server/core/serializer/json/ODataJsonSerializer.java | 3 +-- .../java/org/apache/olingo/server/core/ODataHandlerTest.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java index a3b7805c4..c1292de16 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java @@ -91,8 +91,7 @@ public class ODataJsonSerializer implements ODataSerializer { try { buffer = new CircleStreamBuffer(); - gen = new JsonFactory().createGenerator(buffer.getOutputStream()) - .setPrettyPrinter(new DefaultPrettyPrinter()); + gen = new JsonFactory().createGenerator(buffer.getOutputStream()); new ServiceDocumentJsonSerializer(metadata, serviceRoot, isODataMetadataNone).writeServiceDocument(gen); diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java index a3f75eb87..236c1b74e 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java @@ -112,8 +112,8 @@ public class ODataHandlerTest { assertNotNull(response.getContent()); String doc = IOUtils.toString(response.getContent()); - assertThat(doc, containsString("\"@odata.context\" : \"$metadata\"")); - assertThat(doc, containsString("\"value\" :")); + assertThat(doc, containsString("\"@odata.context\":\"$metadata\"")); + assertThat(doc, containsString("\"value\":")); } @Test