### Question:
HuaweiCharge { public static final HttpMessage chargeNotify(HttpMessage httpMessage, String variable) { logger.info("Huawei Charge request is coming"); String content = null; boolean success = true; if ( httpMessage == null ) { logger.warn("Huawei Charge HTTP is null"); success = false; } else { content = httpMessage.getRequestContent(); if ( content == null || content.length()==0 ) { if ( variable != null ) { content = variable; } else { logger.warn("Huawei Charge HTTP request content is null"); success = false; } } } if ( success ) { ScriptResult result = ScriptManager.getInstance().runScript(ScriptHook.CHARGE_HUAWEI, content); if ( result.getType() == ScriptResult.Type.SUCCESS_RETURN ) { HttpMessage response = (HttpMessage)result.getResult().get(0); return response; } } HttpMessage response = new HttpMessage(); response.setResponseContentType(HttpGameHandler.CONTENT_PLAIN_TYPE); response.setResponseContent("result=1".getBytes()); return response; }  static final HttpMessage chargeNotify(HttpMessage httpMessage, String variable);  }### Answer:
@Test public void testCmccChargeNotif() throws UnsupportedEncodingException { String roleName = "test-001"; String requestContent = "result=0&userName=Sohu鐣呮父&productName=灏忓皬椋炲脊&payType=4&amount=10.0&orderId=A2012120402302878666F1FD&notifyTime=1354638600021&requestId=1354602444701&sign=QzZY%2FaxKrL%2FGl9E0UANSxvoP5NYGxKB3ln8b9IbsJECSAad45baI%2F%2FyvLf0ef2NJNxgSV6MNPf7GRgGy5vaTEg%3D%3D"; final HttpMessage request = new HttpMessage(); request.setRequestUri("/huawei"); User user = new User(); user.set_id(new UserId(roleName)); user.setRoleName(roleName); user.setUsername(roleName); UserManager.getInstance().removeUser(roleName); UserManager.getInstance().saveUser(user, true); String transId = ChargeManager.getInstance().generateTranscationID("s0001", user); String post = MessageFormatter.format(requestContent, transId).getMessage(); request.appendRequestContent(post); HttpMessage response = HuaweiCharge.chargeNotify(request, null); String text = new String(response.getResponseContent(), "utf8"); System.out.println(text); }