diff options
Diffstat (limited to 'src/test/java/com')
-rw-r--r-- | src/test/java/com/juick/rss/LegacyRSS.java | 3 | ||||
-rw-r--r-- | src/test/java/com/juick/tests/MessageTests.java | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/test/java/com/juick/rss/LegacyRSS.java b/src/test/java/com/juick/rss/LegacyRSS.java index ff84b784..1d6ef151 100644 --- a/src/test/java/com/juick/rss/LegacyRSS.java +++ b/src/test/java/com/juick/rss/LegacyRSS.java @@ -24,6 +24,7 @@ import com.juick.server.UserQueries; import com.juick.util.DateFormattersHolder; import com.juick.util.MessageUtils; import org.apache.commons.dbcp2.BasicDataSource; +import org.apache.commons.lang3.CharEncoding; import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.jdbc.core.JdbcTemplate; @@ -52,7 +53,7 @@ public class LegacyRSS { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getCharacterEncoding() == null) { - request.setCharacterEncoding("UTF-8"); + request.setCharacterEncoding(CharEncoding.UTF_8); } String uri = request.getRequestURI(); diff --git a/src/test/java/com/juick/tests/MessageTests.java b/src/test/java/com/juick/tests/MessageTests.java index a0cfd444..6bc291e2 100644 --- a/src/test/java/com/juick/tests/MessageTests.java +++ b/src/test/java/com/juick/tests/MessageTests.java @@ -5,6 +5,7 @@ import static org.junit.Assert.assertEquals; import com.juick.json.MessageSerializer; import com.juick.util.DateFormattersHolder; import com.juick.xmpp.extensions.JuickMessage; +import org.apache.commons.lang3.CharEncoding; import org.json.JSONObject; import org.junit.Test; @@ -40,7 +41,7 @@ public class MessageTests { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); - Document doc = db.parse(new ByteArrayInputStream(xmppMessage.toString().getBytes("UTF-8"))); + Document doc = db.parse(new ByteArrayInputStream(xmppMessage.toString().getBytes(CharEncoding.UTF_8))); Node juickNode = doc.getElementsByTagName("juick").item(0); NamedNodeMap attrs = juickNode.getAttributes(); assertEquals("date should be in ts field", DateFormattersHolder.getMessageFormatterInstance().format(currentDate), |