### Question:
AjaxError extends AjaxJson { public void addDetailMsg(String value) { addMsg("detail", value); } AjaxError(String brief);  AjaxError(String brief, String detail); void addDetailMsg(String value); AjaxError putError(String key, String value);  }### Answer:
@Test public void testAddDetailMsg() { String expected = "test"; AjaxError error = new AjaxError("服务器异常，请联系管理员！"); error.addDetailMsg(new Exception(expected).getMessage()); JSONObject json = JSONObject.fromObject(error.toString()); String actual = json.getJSONObject("msg").getString("detail"); Assert.assertEquals("AjaxError 解析错误", false, json.get("success")); Assert.assertEquals("AjaxError 解析错误", expected, actual); }