mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-24 16:18:51 +08:00
✅ 增加些测试代码
This commit is contained in:
parent
5e8d4a2ec6
commit
fa79568a47
@ -26,8 +26,8 @@ import me.chanjar.weixin.cp.util.xml.XStreamTransformer;
|
|||||||
@XStreamAlias("xml")
|
@XStreamAlias("xml")
|
||||||
@Data
|
@Data
|
||||||
public class WxCpTpXmlPackage implements Serializable {
|
public class WxCpTpXmlPackage implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6031833682211475786L;
|
private static final long serialVersionUID = 6031833682211475786L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用dom4j解析的存放所有xml属性和值的map.
|
* 使用dom4j解析的存放所有xml属性和值的map.
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package me.chanjar.weixin.cp.bean;
|
||||||
|
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.testng.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* .
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
|
* @date 2019-08-18
|
||||||
|
*/
|
||||||
|
public class WxCpTpXmlPackageTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFromXml() {
|
||||||
|
WxCpTpXmlPackage result = WxCpTpXmlPackage.fromXml("<xml> \n" +
|
||||||
|
" <ToUserName><![CDATA[toUser]]></ToUserName>\n" +
|
||||||
|
" <AgentID><![CDATA[toAgentID]]></AgentID>\n" +
|
||||||
|
" <Encrypt><![CDATA[msg_encrypt]]></Encrypt>\n" +
|
||||||
|
"</xml>\n");
|
||||||
|
assertThat(result).isNotNull();
|
||||||
|
assertThat(result.getToUserName()).isEqualTo("toUser");
|
||||||
|
assertThat(result.getAgentId()).isEqualTo("toAgentID");
|
||||||
|
assertThat(result.getMsgEncrypt()).isEqualTo("msg_encrypt");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user