Merge "Replace deprecated methods in aai-common"
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / PayloadUtil.java
index 7ee6c39..d944898 100644 (file)
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertNotNull;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.regex.Matcher;
@@ -44,7 +45,7 @@ public class PayloadUtil {
         String message = String.format("Unable to find the %s in src/test/resources", fileName);
         assertNotNull(message, inputStream);
 
-        String resource = IOUtils.toString(inputStream);
+        String resource = IOUtils.toString(inputStream, Charset.defaultCharset());
 
         inputStream.close();
         return resource;
@@ -58,7 +59,7 @@ public class PayloadUtil {
         String message = String.format("Unable to find the %s in src/test/resources", fileName);
         assertNotNull(message, inputStream);
 
-        String resource = IOUtils.toString(inputStream);
+        String resource = IOUtils.toString(inputStream, Charset.defaultCharset());
 
         inputStream.close();
         return resource;
@@ -77,7 +78,7 @@ public class PayloadUtil {
         if (cache.containsKey(fileName)) {
             resource = cache.get(fileName);
         } else {
-            resource = IOUtils.toString(inputStream);
+            resource = IOUtils.toString(inputStream, Charset.defaultCharset());
             cache.put(fileName, resource);
         }