1
0
mirror of synced 2025-12-22 00:48:00 +08:00

issue #5 生成带参数的二维码 - showcode

This commit is contained in:
Daniel Qian
2014-08-26 14:53:55 +08:00
parent 37dbee6efc
commit b2dfa5d48c
6 changed files with 92 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
package chanjarster.weixin.api;
import java.io.File;
import org.testng.Assert;
import org.testng.annotations.Guice;
@@ -12,8 +13,8 @@ import com.google.inject.Inject;
/**
* 测试用户相关的接口
*
* @author chanjarster
*
*/
@Test(groups = "qrCodeAPI", dependsOnGroups = { "baseAPI" })
@Guice(modules = ApiTestModule.class)
@@ -21,19 +22,25 @@ public class WxQrCodeAPITest {
@Inject
protected WxServiceImpl wxService;
public void testQrCodeCreateTmpTicket() throws WxErrorException {
public void testQrCodeCreateTmpTicket() throws WxErrorException {
WxQrCodeTicket ticket = wxService.qrCodeCreateTmpTicket(1, null);
Assert.assertNotNull(ticket.getUrl());
Assert.assertNotNull(ticket.getTicket());
Assert.assertTrue(ticket.getExpire_seconds() != -1);
}
public void testQrCodeCreateLastTicket() throws WxErrorException {
public void testQrCodeCreateLastTicket() throws WxErrorException {
WxQrCodeTicket ticket = wxService.qrCodeCreateLastTicket(1);
Assert.assertNotNull(ticket.getUrl());
Assert.assertNotNull(ticket.getTicket());
Assert.assertTrue(ticket.getExpire_seconds() == -1);
}
public void testQrCodePicture() throws WxErrorException {
WxQrCodeTicket ticket = wxService.qrCodeCreateLastTicket(1);
File file = wxService.qrCodePicture(ticket);
Assert.assertNotNull(file);
}
}