File tree Expand file tree Collapse file tree 3 files changed +21
-62
lines changed
weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api Expand file tree Collapse file tree 3 files changed +21
-62
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11
11
import org .testng .annotations .Guice ;
12
12
import org .testng .annotations .Test ;
13
13
14
+ import java .util .Arrays ;
15
+
14
16
import static org .assertj .core .api .Assertions .assertThat ;
15
17
import static org .testng .Assert .assertFalse ;
16
18
import static org .testng .Assert .assertTrue ;
@@ -93,4 +95,23 @@ public void testNectCheckResult() {
93
95
Assert .assertEquals (result .getPingInfos ().get (1 ), pingInfo );
94
96
95
97
}
98
+
99
+ @ Test
100
+ public void testGetCallbackIP () throws WxErrorException {
101
+ String [] ipArray = this .wxService .getCallbackIP ();
102
+ System .out .println (Arrays .toString (ipArray ));
103
+ Assert .assertNotNull (ipArray );
104
+ Assert .assertNotEquals (ipArray .length , 0 );
105
+ }
106
+
107
+ public void testShortUrl () throws WxErrorException {
108
+ String shortUrl = this .wxService .shortUrl ("http://www.baidu.com/test?access_token=123" );
109
+ assertThat (shortUrl ).isNotEmpty ();
110
+ System .out .println (shortUrl );
111
+ }
112
+
113
+ @ Test (expectedExceptions = WxErrorException .class )
114
+ public void testShortUrl_with_exceptional_url () throws WxErrorException {
115
+ this .wxService .shortUrl ("http://www.baidu.com/test?redirect_count=1&access_token=123" );
116
+ }
96
117
}
You can’t perform that action at this time.
0 commit comments