Skip to content

Commit faaf7fe

Browse files
committed
合并测试文件
1 parent 73286d4 commit faaf7fe

File tree

3 files changed

+21
-62
lines changed

3 files changed

+21
-62
lines changed

weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/WxMpMiscAPITest.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/WxMpShortUrlAPITest.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImplTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import org.testng.annotations.Guice;
1212
import org.testng.annotations.Test;
1313

14+
import java.util.Arrays;
15+
1416
import static org.assertj.core.api.Assertions.assertThat;
1517
import static org.testng.Assert.assertFalse;
1618
import static org.testng.Assert.assertTrue;
@@ -93,4 +95,23 @@ public void testNectCheckResult() {
9395
Assert.assertEquals(result.getPingInfos().get(1), pingInfo);
9496

9597
}
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+
}
96117
}

0 commit comments

Comments
 (0)