### Question:
DangleCharge { public static final HttpMessage chargeNotify(HttpMessage httpMessage, String variable) { logger.debug("Dangle Charge request is coming"); String content = null; boolean success = true; if ( httpMessage == null ) { logger.warn("Dangle Charge HTTP is null"); success = false; } else { content = httpMessage.getRequestContent(); if ( content == null || content.length()==0 ) { if ( variable != null ) { content = variable; } else { logger.warn("Dangle Charge HTTP request content is null"); success = false; } } } if ( success ) { ScriptResult result = ScriptManager.getInstance().runScript(ScriptHook.CHARGE_DANGLE, content); if ( result.getType() == ScriptResult.Type.SUCCESS_RETURN ) { HttpMessage response = (HttpMessage)result.getResult().get(0); return response; } } HttpMessage response = new HttpMessage(); if ( success ) { response.setResponseContentType(HttpGameHandler.CONTENT_PLAIN_TYPE); response.setResponseContent("result=1&msg=success".getBytes()); } else { response.setResponseContentType(HttpGameHandler.CONTENT_PLAIN_TYPE); response.setResponseContent("result=0&msg=failure".getBytes()); } return response; }  static final HttpMessage chargeNotify(HttpMessage httpMessage, String variable);  }### Answer:
@Test public void testChargeNotify() { HttpMessage message = new HttpMessage(); String content = "result=1&orderid=391001001H3h8mmnj5b&amount=1.00&mid=391&gid=1&sid=1&uif=xq123&utp=0&eif=xq123&pcid=014&cardno=&timestamp=20121023142311&errorcode=&verstring=333547f4c346f6c1a2e8d29261d94e53&remark=1%3A%E4%BA%A4%E6%98%93%E5%AE%8C%E6%88%90"; message.appendRequestContent(content); HttpMessage response = DangleCharge.chargeNotify(message, null); System.out.println(response.getResponseCode()); System.out.println(response.getResponseContent()); }