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

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

This commit is contained in:
Daniel Qian
2014-08-26 14:41:07 +08:00
parent 4bbb729ac7
commit 37dbee6efc
5 changed files with 141 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
package chanjarster.weixin.api;
import org.testng.Assert;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import chanjarster.weixin.bean.result.WxQrCodeTicket;
import chanjarster.weixin.exception.WxErrorException;
import com.google.inject.Inject;
/**
* 测试用户相关的接口
* @author chanjarster
*
*/
@Test(groups = "qrCodeAPI", dependsOnGroups = { "baseAPI" })
@Guice(modules = ApiTestModule.class)
public class WxQrCodeAPITest {
@Inject
protected WxServiceImpl wxService;
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 {
WxQrCodeTicket ticket = wxService.qrCodeCreateLastTicket(1);
Assert.assertNotNull(ticket.getUrl());
Assert.assertNotNull(ticket.getTicket());
Assert.assertTrue(ticket.getExpire_seconds() == -1);
}
}

View File

@@ -10,6 +10,7 @@
<class name="chanjarster.weixin.api.WxMassMessageAPITest" />
<class name="chanjarster.weixin.api.WxMediaAPITest" />
<class name="chanjarster.weixin.api.WxMassMessageAPITest" />
<class name="chanjarster.weixin.api.WxUserAPITest" />
</classes>
</test>