issue #5 生成带参数的二维码 - ticket
This commit is contained in:
39
src/test/java/chanjarster/weixin/api/WxQrCodeAPITest.java
Normal file
39
src/test/java/chanjarster/weixin/api/WxQrCodeAPITest.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user