issue #5 生成带参数的二维码 - showcode
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user