Bug 2358 - Changed modifier of method in AbstractBodyReaderTest to protected
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / rest / impl / test / providers / TestJsonBodyWriter.java
index aea0d479d06f637ca51cd37e26034a56c3abb3e8..e5cda6c94d12a81edb61815dc4eac4679a7980aa 100644 (file)
@@ -9,10 +9,13 @@
 package org.opendaylight.controller.sal.rest.impl.test.providers;
 
 import static org.junit.Assert.assertTrue;
+
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
+
 import javax.ws.rs.core.MediaType;
+
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.opendaylight.controller.sal.rest.impl.JsonNormalizedNodeBodyReader;
@@ -21,14 +24,13 @@ import org.opendaylight.controller.sal.restconf.impl.NormalizedNodeContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 /**
- * sal-rest-connector
- * org.opendaylight.controller.sal.rest.impl.test.providers
+ * sal-rest-connector org.opendaylight.controller.sal.rest.impl.test.providers
  *
  *
  *
  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
  *
- * Created: Mar 12, 2015
+ *         Created: Mar 12, 2015
  */
 public class TestJsonBodyWriter extends AbstractBodyReaderTest {
 
@@ -36,20 +38,22 @@ public class TestJsonBodyWriter extends AbstractBodyReaderTest {
     private final NormalizedNodeJsonBodyWriter jsonBodyWriter;
     private static SchemaContext schemaContext;
 
-    public TestJsonBodyWriter () throws NoSuchFieldException, SecurityException {
+    public TestJsonBodyWriter() throws NoSuchFieldException, SecurityException {
         super();
         jsonBodyWriter = new NormalizedNodeJsonBodyWriter();
         jsonBodyReader = new JsonNormalizedNodeBodyReader();
     }
 
     @Override
-    MediaType getMediaType() {
+    protected MediaType getMediaType() {
         return new MediaType(MediaType.APPLICATION_XML, null);
     }
 
     @BeforeClass
-    public static void initialization() throws NoSuchFieldException, SecurityException {
-        schemaContext = schemaContextLoader("/instanceidentifier/yang", schemaContext);
+    public static void initialization() throws NoSuchFieldException,
+            SecurityException {
+        schemaContext = schemaContextLoader("/instanceidentifier/yang",
+                schemaContext);
         schemaContext = schemaContextLoader("/modules", schemaContext);
         schemaContext = schemaContextLoader("/invoke-rpc", schemaContext);
         controllerContext.setSchemas(schemaContext);
@@ -61,10 +65,11 @@ public class TestJsonBodyWriter extends AbstractBodyReaderTest {
         mockBodyReader(uri, jsonBodyReader, true);
         final InputStream inputStream = TestJsonBodyWriter.class
                 .getResourceAsStream("/invoke-rpc/json/rpc-output.json");
-        final NormalizedNodeContext returnValue = jsonBodyReader
-                .readFrom(null, null, null, mediaType, null, inputStream);
+        final NormalizedNodeContext returnValue = jsonBodyReader.readFrom(null,
+                null, null, mediaType, null, inputStream);
         final OutputStream output = new ByteArrayOutputStream();
-        jsonBodyWriter.writeTo(returnValue, null, null, null, mediaType, null, output);
+        jsonBodyWriter.writeTo(returnValue, null, null, null, mediaType, null,
+                output);
         assertTrue(output.toString().contains("lf-test"));
     }
 }