Fix deprecated method in policy-common 29/109529/1
authorJim Hahn <jrh3@att.com>
Wed, 24 Jun 2020 19:07:23 +0000 (15:07 -0400)
committerJim Hahn <jrh3@att.com>
Wed, 24 Jun 2020 19:08:30 +0000 (15:08 -0400)
Probably due to a jar update, some methods are now deprecated.
Fixed them.

Issue-ID: POLICY-2650
Change-Id: I48aabd4552faaf88671dfbe6556dc739a8c94809
Signed-off-by: Jim Hahn <jrh3@att.com>
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java

index 601c3e9..690fbd6 100644 (file)
@@ -37,6 +37,7 @@ import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
+import java.nio.charset.StandardCharsets;
 import java.util.UUID;
 import org.apache.commons.io.IOUtils;
 import org.junit.AfterClass;
@@ -612,7 +613,7 @@ public class HttpServerTest {
         conn.setDoOutput(true);
         conn.setRequestProperty("Content-Type", mediaType);
         conn.setRequestProperty("Accept", mediaType);
-        IOUtils.write(post, conn.getOutputStream());
+        IOUtils.write(post, conn.getOutputStream(), StandardCharsets.UTF_8);
         return response(conn);
     }
 
@@ -625,7 +626,7 @@ public class HttpServerTest {
      */
     private String response(URLConnection conn) throws IOException {
         try (InputStream inpstr = conn.getInputStream()) {
-            return String.join("", IOUtils.readLines(inpstr));
+            return String.join("", IOUtils.readLines(inpstr, StandardCharsets.UTF_8));
         }
     }