mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-04 12:47:46 +08:00
增加一点测试代码
This commit is contained in:
parent
0eb3a642c4
commit
158171c5d1
@ -12,7 +12,9 @@ import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
|
|||||||
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
|
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付订单和退款的异步通知共用的响应类
|
* 微信支付订单和退款的异步通知共用的响应类.
|
||||||
|
*
|
||||||
|
* @author someone
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder(builderMethodName = "newBuilder")
|
@Builder(builderMethodName = "newBuilder")
|
||||||
@ -21,9 +23,9 @@ import me.chanjar.weixin.common.util.xml.XStreamInitializer;
|
|||||||
@XStreamAlias("xml")
|
@XStreamAlias("xml")
|
||||||
public class WxPayNotifyResponse {
|
public class WxPayNotifyResponse {
|
||||||
@XStreamOmitField
|
@XStreamOmitField
|
||||||
private transient static final String FAIL = "FAIL";
|
private static final transient String FAIL = "FAIL";
|
||||||
@XStreamOmitField
|
@XStreamOmitField
|
||||||
private transient static final String SUCCESS = "SUCCESS";
|
private static final transient String SUCCESS = "SUCCESS";
|
||||||
|
|
||||||
@XStreamAlias("return_code")
|
@XStreamAlias("return_code")
|
||||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.github.binarywang.wxpay.bean.notify;
|
||||||
|
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WxPayNotifyResponse 测试.
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
|
* @date 2019-06-30
|
||||||
|
*/
|
||||||
|
public class WxPayNotifyResponseTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSuccess() {
|
||||||
|
final String result = WxPayNotifyResponse.success("OK");
|
||||||
|
assertThat(result).isEqualTo("<xml>\n" +
|
||||||
|
" <return_code><![CDATA[SUCCESS]]></return_code>\n" +
|
||||||
|
" <return_msg><![CDATA[OK]]></return_msg>\n" +
|
||||||
|
"</xml>");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user