### Question:
DingTalkUtils { public static String textToJsonString(String text) { Map<String, Object> items = new HashMap<String, Object>(); items.put("msgtype", "text"); Map<String, String> textContent = new HashMap<String, String>(); byte[] byt = StringUtils.getBytesUtf8(text); String txt = StringUtils.newStringUtf8(byt); textContent.put("content", txt); items.put("text", textContent); return JSONUtils.toJsonString(items); }  static String sendDingTalkMsg(String msg, String charset); static HttpPost constructHttpPost(String msg, String charset); static CloseableHttpClient getProxyClient(); static CloseableHttpClient getDefaultClient(); static RequestConfig getProxyConfig(); static String textToJsonString(String text); static final Logger logger; static final boolean isEnableDingTalk; }### Answer:
@Test public void testDingTalkMsgToJson() { String jsonString = DingTalkUtils.textToJsonString("this is test"); logger.info(jsonString); String expect = "{\"text\":{\"content\":\"this is test\"},\"msgtype\":\"text\"}"; Assert.assertEquals(expect, jsonString); }
@Test public void testDingTalkMsgUtf8() { String msg = DingTalkUtils.textToJsonString("this is test:中文"); logger.info("test support utf8, actual:" + msg); logger.info("test support utf8, actual:" + DingTalkUtils.isEnableDingTalk); String expect = "{\"text\":{\"content\":\"this is test:中文\"},\"msgtype\":\"text\"}"; Assert.assertEquals(expect, msg); }