mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-05 17:38:05 +08:00
🎨 日志代码统一使用@Slf4j
This commit is contained in:
parent
0640c10671
commit
142c3c857e
@ -1,6 +1,7 @@
|
|||||||
package me.chanjar.weixin.mp.util.requestexecuter.material;
|
package me.chanjar.weixin.mp.util.requestexecuter.material;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.chanjar.weixin.common.enums.WxType;
|
import me.chanjar.weixin.common.enums.WxType;
|
||||||
import me.chanjar.weixin.common.error.WxError;
|
import me.chanjar.weixin.common.error.WxError;
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
import me.chanjar.weixin.common.error.WxErrorException;
|
||||||
@ -15,8 +16,6 @@ import org.apache.http.client.methods.CloseableHttpResponse;
|
|||||||
import org.apache.http.client.methods.HttpPost;
|
import org.apache.http.client.methods.HttpPost;
|
||||||
import org.apache.http.entity.StringEntity;
|
import org.apache.http.entity.StringEntity;
|
||||||
import org.apache.http.impl.client.CloseableHttpClient;
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -26,9 +25,9 @@ import java.io.IOException;
|
|||||||
* @author ecoolper
|
* @author ecoolper
|
||||||
* created on 2017/5/5
|
* created on 2017/5/5
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
public class MaterialNewsInfoApacheHttpRequestExecutor
|
public class MaterialNewsInfoApacheHttpRequestExecutor
|
||||||
extends MaterialNewsInfoRequestExecutor<CloseableHttpClient, HttpHost> {
|
extends MaterialNewsInfoRequestExecutor<CloseableHttpClient, HttpHost> {
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
||||||
|
|
||||||
public MaterialNewsInfoApacheHttpRequestExecutor(RequestHttp requestHttp) {
|
public MaterialNewsInfoApacheHttpRequestExecutor(RequestHttp requestHttp) {
|
||||||
super(requestHttp);
|
super(requestHttp);
|
||||||
@ -45,7 +44,7 @@ public class MaterialNewsInfoApacheHttpRequestExecutor
|
|||||||
httpPost.setEntity(new StringEntity(WxGsonBuilder.create().toJson(ImmutableMap.of("media_id", materialId))));
|
httpPost.setEntity(new StringEntity(WxGsonBuilder.create().toJson(ImmutableMap.of("media_id", materialId))));
|
||||||
try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpPost)) {
|
try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpPost)) {
|
||||||
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);
|
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);
|
||||||
this.logger.debug("响应原始数据:{}", responseContent);
|
log.debug("响应原始数据:{}", responseContent);
|
||||||
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
WxError error = WxError.fromJson(responseContent, WxType.MP);
|
||||||
if (error.getErrorCode() != 0) {
|
if (error.getErrorCode() != 0) {
|
||||||
throw new WxErrorException(error);
|
throw new WxErrorException(error);
|
||||||
|
@ -6,8 +6,7 @@ import com.github.binarywang.wxpay.exception.WxPayException;
|
|||||||
import com.github.binarywang.wxpay.service.WxPayService;
|
import com.github.binarywang.wxpay.service.WxPayService;
|
||||||
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import org.slf4j.Logger;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.testng.annotations.Guice;
|
import org.testng.annotations.Guice;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
@ -23,11 +22,9 @@ import java.io.IOException;
|
|||||||
* @author <a href="https://gitee.com/jeequan/jeepay">jmdhappy</a>
|
* @author <a href="https://gitee.com/jeequan/jeepay">jmdhappy</a>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
|
@Slf4j
|
||||||
@Guice(modules = ApiTestModule.class)
|
@Guice(modules = ApiTestModule.class)
|
||||||
public class ComplaintServiceImplTest {
|
public class ComplaintServiceImplTest {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private WxPayService payService;
|
private WxPayService payService;
|
||||||
|
|
||||||
@ -35,6 +32,7 @@ public class ComplaintServiceImplTest {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询投诉单列表API
|
* 查询投诉单列表API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -47,11 +45,12 @@ public class ComplaintServiceImplTest {
|
|||||||
.endDate("2022-03-20")
|
.endDate("2022-03-20")
|
||||||
.complaintedMchid(this.payService.getConfig().getMchId())
|
.complaintedMchid(this.payService.getConfig().getMchId())
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getComplaintsService().queryComplaints(request).toString());
|
log.info(this.payService.getComplaintsService().queryComplaints(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询投诉单详情API
|
* 查询投诉单详情API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -60,11 +59,12 @@ public class ComplaintServiceImplTest {
|
|||||||
.newBuilder()
|
.newBuilder()
|
||||||
.complaintId(complaintId)
|
.complaintId(complaintId)
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getComplaintsService().getComplaint(request).toString());
|
log.info(this.payService.getComplaintsService().getComplaint(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询投诉协商历史API
|
* 查询投诉协商历史API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -75,11 +75,12 @@ public class ComplaintServiceImplTest {
|
|||||||
.offset(0)
|
.offset(0)
|
||||||
.limit(20)
|
.limit(20)
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getComplaintsService().queryNegotiationHistorys(request).toString());
|
log.info(this.payService.getComplaintsService().queryNegotiationHistorys(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建投诉通知回调地址API
|
* 创建投诉通知回调地址API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -88,20 +89,22 @@ public class ComplaintServiceImplTest {
|
|||||||
.newBuilder()
|
.newBuilder()
|
||||||
.url("https://jeepay.natapp4.cc")
|
.url("https://jeepay.natapp4.cc")
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getComplaintsService().addComplaintNotifyUrl(request).toString());
|
log.info(this.payService.getComplaintsService().addComplaintNotifyUrl(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询投诉通知回调地址API
|
* 查询投诉通知回调地址API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGetComplaintNotifyUrl() throws WxPayException {
|
public void testGetComplaintNotifyUrl() throws WxPayException {
|
||||||
this.logger.info(this.payService.getComplaintsService().getComplaintNotifyUrl().toString());
|
log.info(this.payService.getComplaintsService().getComplaintNotifyUrl().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新投诉通知回调地址API
|
* 更新投诉通知回调地址API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -110,11 +113,12 @@ public class ComplaintServiceImplTest {
|
|||||||
.newBuilder()
|
.newBuilder()
|
||||||
.url("https://jeepay1.natapp4.cc")
|
.url("https://jeepay1.natapp4.cc")
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getComplaintsService().updateComplaintNotifyUrl(request).toString());
|
log.info(this.payService.getComplaintsService().updateComplaintNotifyUrl(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除投诉通知回调地址API
|
* 删除投诉通知回调地址API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -124,6 +128,7 @@ public class ComplaintServiceImplTest {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交回复API
|
* 提交回复API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -141,6 +146,7 @@ public class ComplaintServiceImplTest {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 反馈处理完成API
|
* 反馈处理完成API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -154,13 +160,14 @@ public class ComplaintServiceImplTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户上传反馈图片API
|
* 商户上传反馈图片API
|
||||||
|
*
|
||||||
* @throws WxPayException
|
* @throws WxPayException
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testUploadResponseImage() throws WxPayException, IOException {
|
public void testUploadResponseImage() throws WxPayException, IOException {
|
||||||
String filePath="你的图片文件的路径地址";
|
String filePath = "你的图片文件的路径地址";
|
||||||
// String filePath="WxJava/images/banners/wiki.jpg";
|
// String filePath="WxJava/images/banners/wiki.jpg";
|
||||||
|
|
||||||
File file = new File(filePath);
|
File file = new File(filePath);
|
||||||
|
@ -6,6 +6,7 @@ import com.github.binarywang.wxpay.exception.WxPayException;
|
|||||||
import com.github.binarywang.wxpay.service.WxPayService;
|
import com.github.binarywang.wxpay.service.WxPayService;
|
||||||
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.testng.annotations.Guice;
|
import org.testng.annotations.Guice;
|
||||||
@ -23,6 +24,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@Guice(modules = ApiTestModule.class)
|
@Guice(modules = ApiTestModule.class)
|
||||||
|
@Slf4j
|
||||||
public class EntPayServiceImplTest {
|
public class EntPayServiceImplTest {
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
@ -45,7 +47,7 @@ public class EntPayServiceImplTest {
|
|||||||
.description("描述信息")
|
.description("描述信息")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
this.logger.info(this.payService.getEntPayService().entPay(request).toString());
|
log.info(this.payService.getEntPayService().entPay(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,7 +57,7 @@ public class EntPayServiceImplTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testQueryEntPay() throws WxPayException {
|
public void testQueryEntPay() throws WxPayException {
|
||||||
this.logger.info(this.payService.getEntPayService().queryEntPay("11212121").toString());
|
log.info(this.payService.getEntPayService().queryEntPay("11212121").toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -65,7 +67,7 @@ public class EntPayServiceImplTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGetPublicKey() throws Exception {
|
public void testGetPublicKey() throws Exception {
|
||||||
this.logger.info(this.payService.getEntPayService().getPublicKey());
|
log.info(this.payService.getEntPayService().getPublicKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,7 +85,7 @@ public class EntPayServiceImplTest {
|
|||||||
.partnerTradeNo("3")
|
.partnerTradeNo("3")
|
||||||
.description("11")
|
.description("11")
|
||||||
.build());
|
.build());
|
||||||
this.logger.info(result.toString());
|
log.info(result.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -93,13 +95,13 @@ public class EntPayServiceImplTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testQueryPayBank() throws Exception {
|
public void testQueryPayBank() throws Exception {
|
||||||
this.logger.info(this.payService.getEntPayService().queryPayBank("123").toString());
|
log.info(this.payService.getEntPayService().queryPayBank("123").toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送企业红包
|
* 发送企业红包
|
||||||
|
*
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -107,7 +109,7 @@ public class EntPayServiceImplTest {
|
|||||||
EntPayRedpackRequest request = new EntPayRedpackRequest();
|
EntPayRedpackRequest request = new EntPayRedpackRequest();
|
||||||
request.setMchId("1");
|
request.setMchId("1");
|
||||||
//商户单号
|
//商户单号
|
||||||
request.setMchBillNo(request.getMchId()+"20191202"+"1");
|
request.setMchBillNo(request.getMchId() + "20191202" + "1");
|
||||||
//企业微信corpid即为此appId
|
//企业微信corpid即为此appId
|
||||||
request.setWxAppId("1");
|
request.setWxAppId("1");
|
||||||
// request.setSenderName("1");
|
// request.setSenderName("1");
|
||||||
@ -125,11 +127,12 @@ public class EntPayServiceImplTest {
|
|||||||
redpackResult = this.payService.getEntPayService().sendEnterpriseRedpack(request);
|
redpackResult = this.payService.getEntPayService().sendEnterpriseRedpack(request);
|
||||||
} catch (WxPayException e) {
|
} catch (WxPayException e) {
|
||||||
}
|
}
|
||||||
this.logger.info(redpackResult.toString());
|
log.info(redpackResult.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询企业红包
|
* 查询企业红包
|
||||||
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@ -142,7 +145,7 @@ public class EntPayServiceImplTest {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
EntPayRedpackQueryResult result = this.payService.getEntPayService().queryEnterpriseRedpack(request);
|
EntPayRedpackQueryResult result = this.payService.getEntPayService().queryEnterpriseRedpack(request);
|
||||||
this.logger.info(result.toString());
|
log.info(result.toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
TimeUnit.SECONDS.sleep(3);
|
TimeUnit.SECONDS.sleep(3);
|
||||||
|
@ -6,16 +6,14 @@ import com.github.binarywang.wxpay.exception.WxPayException;
|
|||||||
import com.github.binarywang.wxpay.service.WxPayService;
|
import com.github.binarywang.wxpay.service.WxPayService;
|
||||||
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import org.slf4j.Logger;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.testng.annotations.Guice;
|
import org.testng.annotations.Guice;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Slf4j
|
||||||
@Guice(modules = ApiTestModule.class)
|
@Guice(modules = ApiTestModule.class)
|
||||||
public class ProfitSharingServiceImplTest {
|
public class ProfitSharingServiceImplTest {
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private WxPayService payService;
|
private WxPayService payService;
|
||||||
|
|
||||||
@ -33,7 +31,7 @@ public class ProfitSharingServiceImplTest {
|
|||||||
.transactionId("4200000431201910234736634272")
|
.transactionId("4200000431201910234736634272")
|
||||||
.receivers(instance.toJSONString())
|
.receivers(instance.toJSONString())
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getProfitSharingService().profitSharing(request).toString());
|
log.info(this.payService.getProfitSharingService().profitSharing(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -49,7 +47,7 @@ public class ProfitSharingServiceImplTest {
|
|||||||
.transactionId("4200000448201910238249687345")//order_id=30000102922019102310821824010
|
.transactionId("4200000448201910238249687345")//order_id=30000102922019102310821824010
|
||||||
.receivers(instance.toJSONString())
|
.receivers(instance.toJSONString())
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getProfitSharingService().multiProfitSharing(request).toString());
|
log.info(this.payService.getProfitSharingService().multiProfitSharing(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -60,7 +58,7 @@ public class ProfitSharingServiceImplTest {
|
|||||||
.transactionId("4200000441201910238267278073")
|
.transactionId("4200000441201910238267278073")
|
||||||
.description("分账完成")
|
.description("分账完成")
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getProfitSharingService().profitSharingFinish(request).toString());
|
log.info(this.payService.getProfitSharingService().profitSharingFinish(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -74,7 +72,7 @@ public class ProfitSharingServiceImplTest {
|
|||||||
.newBuilder()
|
.newBuilder()
|
||||||
.receiver(receiver.toJSONString())
|
.receiver(receiver.toJSONString())
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getProfitSharingService().addReceiver(request).toString());
|
log.info(this.payService.getProfitSharingService().addReceiver(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -85,7 +83,7 @@ public class ProfitSharingServiceImplTest {
|
|||||||
.newBuilder()
|
.newBuilder()
|
||||||
.receiver(receiver.toJSONString())
|
.receiver(receiver.toJSONString())
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getProfitSharingService().removeReceiver(request).toString());
|
log.info(this.payService.getProfitSharingService().removeReceiver(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -96,8 +94,8 @@ public class ProfitSharingServiceImplTest {
|
|||||||
.transactionId("4200000431201910234736634272")
|
.transactionId("4200000431201910234736634272")
|
||||||
.build();
|
.build();
|
||||||
ProfitSharingQueryResult result = this.payService.getProfitSharingService().profitSharingQuery(request);
|
ProfitSharingQueryResult result = this.payService.getProfitSharingService().profitSharingQuery(request);
|
||||||
this.logger.info(result.formatReceivers().toString());
|
log.info(result.formatReceivers().toString());
|
||||||
this.logger.info(result.toString());
|
log.info(result.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -105,17 +103,17 @@ public class ProfitSharingServiceImplTest {
|
|||||||
final String subMchId = "subMchid";
|
final String subMchId = "subMchid";
|
||||||
final ProfitSharingMerchantRatioQueryRequest request = new ProfitSharingMerchantRatioQueryRequest(subMchId);
|
final ProfitSharingMerchantRatioQueryRequest request = new ProfitSharingMerchantRatioQueryRequest(subMchId);
|
||||||
final ProfitSharingMerchantRatioQueryResult result = payService.getProfitSharingService().profitSharingMerchantRatioQuery(request);
|
final ProfitSharingMerchantRatioQueryResult result = payService.getProfitSharingService().profitSharingMerchantRatioQuery(request);
|
||||||
logger.info(result.toString());
|
log.info(result.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testProfitSharingOrderAmountQuery() throws WxPayException {
|
public void testProfitSharingOrderAmountQuery() throws WxPayException {
|
||||||
final String transactionId = "4200000916202012281633853127";
|
final String transactionId = "4200000916202012281633853127";
|
||||||
final ProfitSharingOrderAmountQueryRequest request = ProfitSharingOrderAmountQueryRequest.newBuilder()
|
final ProfitSharingOrderAmountQueryRequest request = ProfitSharingOrderAmountQueryRequest.newBuilder()
|
||||||
.transactionId(transactionId)
|
.transactionId(transactionId)
|
||||||
.build();
|
.build();
|
||||||
final ProfitSharingOrderAmountQueryResult result = payService.getProfitSharingService().profitSharingOrderAmountQuery(request);
|
final ProfitSharingOrderAmountQueryResult result = payService.getProfitSharingService().profitSharingOrderAmountQuery(request);
|
||||||
logger.info(result.toString());
|
log.info(result.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -129,7 +127,7 @@ public class ProfitSharingServiceImplTest {
|
|||||||
.returnAmount(2)
|
.returnAmount(2)
|
||||||
.description("用户退款")
|
.description("用户退款")
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getProfitSharingService().profitSharingReturn(request).toString());
|
log.info(this.payService.getProfitSharingService().profitSharingReturn(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -139,7 +137,7 @@ public class ProfitSharingServiceImplTest {
|
|||||||
.outOrderNo("20191023154723316420060")
|
.outOrderNo("20191023154723316420060")
|
||||||
.outReturnNo("R2019102315")
|
.outReturnNo("R2019102315")
|
||||||
.build();
|
.build();
|
||||||
this.logger.info(this.payService.getProfitSharingService().profitSharingReturnQuery(request).toString());
|
log.info(this.payService.getProfitSharingService().profitSharingReturnQuery(request).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import com.github.binarywang.wxpay.exception.WxPayException;
|
|||||||
import com.github.binarywang.wxpay.service.WxPayService;
|
import com.github.binarywang.wxpay.service.WxPayService;
|
||||||
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.testng.annotations.Guice;
|
import org.testng.annotations.Guice;
|
||||||
@ -17,11 +18,9 @@ import org.testng.annotations.Test;
|
|||||||
* @create 2022-04-26-22:33 PM
|
* @create 2022-04-26-22:33 PM
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
|
@Slf4j
|
||||||
@Guice(modules = ApiTestModule.class)
|
@Guice(modules = ApiTestModule.class)
|
||||||
public class ProfitSharingV3ServiceImplTest {
|
public class ProfitSharingV3ServiceImplTest {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private WxPayService payService;
|
private WxPayService payService;
|
||||||
|
|
||||||
@ -33,6 +32,6 @@ public class ProfitSharingV3ServiceImplTest {
|
|||||||
header.setNonce("Wechatpay-Nonce");
|
header.setNonce("Wechatpay-Nonce");
|
||||||
header.setSigned("Wechatpay-Signature");
|
header.setSigned("Wechatpay-Signature");
|
||||||
String data = "body";
|
String data = "body";
|
||||||
this.logger.info(this.payService.getProfitSharingV3Service().getProfitSharingNotifyData(data,header).toString());
|
log.info(this.payService.getProfitSharingV3Service().getProfitSharingNotifyData(data,header).toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user