增加新的统一下单接口,并添加对接口格式的单元测试,并未对实际功能进行测试

This commit is contained in:
BinaryWang
2016-09-26 12:34:37 +08:00
parent c4838295e5
commit 839ecadaa7
10 changed files with 1090 additions and 367 deletions

View File

@@ -35,6 +35,12 @@ public class SimplePostRequestExecutor implements RequestExecutor<String, String
try (CloseableHttpResponse response = httpclient.execute(httpPost)) {
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);
if (responseContent.isEmpty()) {
throw new WxErrorException(
WxError.newBuilder().setErrorCode(9999).setErrorMsg("无响应内容")
.build());
}
if (responseContent.startsWith("<xml>")) {
//xml格式输出直接返回
return responseContent;