File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
main/java/cn/binarywang/wx/miniapp/util/xml
test/java/cn/binarywang/wx/miniapp/message Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 8
8
import java .util .Map ;
9
9
10
10
import cn .binarywang .wx .miniapp .bean .WxMaMessage ;
11
+ import cn .binarywang .wx .miniapp .message .WxMaXmlOutMessage ;
11
12
import com .thoughtworks .xstream .XStream ;
12
13
import me .chanjar .weixin .common .util .xml .XStreamInitializer ;
13
14
@@ -19,6 +20,7 @@ public class XStreamTransformer {
19
20
20
21
static {
21
22
registerClass (WxMaMessage .class );
23
+ registerClass (WxMaXmlOutMessage .class );
22
24
}
23
25
24
26
/**
Original file line number Diff line number Diff line change
1
+ package cn .binarywang .wx .miniapp .message ;
2
+
3
+ import me .chanjar .weixin .common .api .WxConsts ;
4
+ import org .testng .annotations .Test ;
5
+
6
+ import static org .assertj .core .api .Assertions .assertThat ;
7
+ import static org .testng .Assert .*;
8
+
9
+ public class WxMaXmlOutMessageTest {
10
+
11
+ @ Test
12
+ public void testToXml () {
13
+ WxMaXmlOutMessage message = WxMaXmlOutMessage .builder ()
14
+ .fromUserName ("1" )
15
+ .toUserName ("2" )
16
+ .msgType (WxConsts .XmlMsgType .TRANSFER_CUSTOMER_SERVICE )
17
+ .createTime (System .currentTimeMillis () / 1000 )
18
+ .build ();
19
+
20
+ assertThat (message .toXml ()).isNotEmpty ();
21
+ System .out .println (message .toXml ());
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments