企业付款相关接口抽取为一个独立的接口实现类
This commit is contained in:
@@ -245,31 +245,6 @@ public class BaseWxPayServiceImplTest {
|
||||
this.logger.info(redpackResult.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link WxPayService#entPay(WxEntPayRequest)}.
|
||||
*/
|
||||
@Test
|
||||
public void testEntPay() throws WxPayException {
|
||||
WxEntPayRequest request = WxEntPayRequest.newBuilder()
|
||||
.partnerTradeNo("Eb6Aep7uVTdbkJqrP4")
|
||||
.openid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP4")
|
||||
.amount(1)
|
||||
.spbillCreateIp("10.10.10.10")
|
||||
.checkName(CheckNameOption.NO_CHECK)
|
||||
.description("描述信息")
|
||||
.build();
|
||||
|
||||
this.logger.info(this.payService.entPay(request).toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for {@link WxPayService#queryEntPay(String)}.
|
||||
*/
|
||||
@Test
|
||||
public void testQueryEntPay() throws WxPayException {
|
||||
this.logger.info(this.payService.queryEntPay("11212121").toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateScanPayQrcodeMode1() throws Exception {
|
||||
String productId = "abc";
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.github.binarywang.wxpay.service.impl;
|
||||
|
||||
import com.github.binarywang.wxpay.bean.entpay.EntPayRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxEntPayRequest;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants;
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
||||
import com.google.inject.Inject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.testng.annotations.Guice;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 企业付款测试类
|
||||
* Created by BinaryWang on 2017/12/19.
|
||||
* </pre>
|
||||
*
|
||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||
*/
|
||||
@Test
|
||||
@Guice(modules = ApiTestModule.class)
|
||||
public class EntPayServiceImplTest {
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Inject
|
||||
private WxPayService payService;
|
||||
|
||||
@Test
|
||||
public void testEntPay_old() throws WxPayException {
|
||||
this.logger.info(this.payService.entPay(WxEntPayRequest.builder()
|
||||
.partnerTradeNo("Eb6Aep7uVTdbkJqrP4")
|
||||
.openid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP4")
|
||||
.amount(1)
|
||||
.spbillCreateIp("10.10.10.10")
|
||||
.checkName(WxPayConstants.CheckNameOption.NO_CHECK)
|
||||
.description("描述信息")
|
||||
.build()).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEntPay() throws WxPayException {
|
||||
EntPayRequest request = EntPayRequest.newBuilder()
|
||||
.partnerTradeNo("Eb6Aep7uVTdbkJqrP4")
|
||||
.openid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP4")
|
||||
.amount(1)
|
||||
.spbillCreateIp("10.10.10.10")
|
||||
.checkName(WxPayConstants.CheckNameOption.NO_CHECK)
|
||||
.description("描述信息")
|
||||
.build();
|
||||
|
||||
this.logger.info(this.payService.getEntPaySerivce().entPay(request).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryEntPay_old() throws WxPayException {
|
||||
this.logger.info(this.payService.queryEntPay("11212121").toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryEntPay() throws WxPayException {
|
||||
this.logger.info(this.payService.getEntPaySerivce().queryEntPay("11212121").toString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user