1
0
mirror of synced 2025-12-25 12:08:00 +08:00

#321 微信支付下载对账单接口增加对GZIP格式的支持

This commit is contained in:
Binary Wang
2017-12-16 17:07:16 +08:00
parent 2e85dfdf7a
commit cbf18e8ca4
7 changed files with 256 additions and 76 deletions

View File

@@ -26,6 +26,8 @@ import java.nio.file.Path;
import java.util.Calendar;
import java.util.Date;
import static com.github.binarywang.wxpay.constant.WxPayConstants.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.testng.Assert.*;
/**
@@ -139,7 +141,13 @@ public class WxPayServiceAbstractImplTest {
@DataProvider
public Object[][] billingData() {
return new Object[][]{
// {"20170831", BillType.ALL, null, "deviceInfo"},
{"20170831", BillType.ALL, TarType.GZIP, "deviceInfo"},
{"20170831", BillType.RECHARGE_REFUND, TarType.GZIP, "deviceInfo"},
{"20170831", BillType.REFUND, TarType.GZIP, "deviceInfo"},
{"20170831", BillType.SUCCESS, TarType.GZIP, "deviceInfo"},
{"20170831", BillType.ALL, null, "deviceInfo"},
{"20170831", BillType.RECHARGE_REFUND, null, "deviceInfo"},
{"20170831", BillType.REFUND, null, "deviceInfo"},
{"20170831", BillType.SUCCESS, null, "deviceInfo"}
};
}
@@ -148,11 +156,11 @@ public class WxPayServiceAbstractImplTest {
public void testDownloadBill(String billDate, String billType,
String tarType, String deviceInfo) throws Exception {
WxPayBillResult billResult = this.payService.downloadBill(billDate, billType, tarType, deviceInfo);
assertNotNull(billResult);
assertThat(billResult).isNotNull();
this.logger.info(billResult.toString());
}
@Test
@Test(expectedExceptions = WxPayException.class)
public void testDownloadBill_withNoParams() throws Exception {
//必填字段为空时,抛出异常
this.payService.downloadBill("", "", "", null);
@@ -247,7 +255,7 @@ public class WxPayServiceAbstractImplTest {
.openid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP4")
.amount(1)
.spbillCreateIp("10.10.10.10")
.checkName(WxPayConstants.CheckNameOption.NO_CHECK)
.checkName(CheckNameOption.NO_CHECK)
.description("描述信息")
.build();