1
0
mirror of synced 2025-12-22 00:48:00 +08:00
This commit is contained in:
dongfuqiang
2016-12-14 16:29:50 +08:00
parent 0d56d6c4ca
commit a7c72f613a
16 changed files with 668 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package me.chanjar.weixin.mp.api.impl;
import com.google.inject.Inject;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.mp.api.ApiTestModule;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.device.WxDeviceQrCodeResult;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
/**
* Created by keungtung on 14/12/2016.
*/
@Test(groups = "deviceApi")
@Guice(modules = ApiTestModule.class)
public class WxMpDeviceServiceImplTest {
@Inject
protected WxMpService wxService;
@Test(dataProvider = "productId")
public void testGetQrcode(String productId) {
try {
WxDeviceQrCodeResult result = wxService.getDeviceService().getQrCode(productId);
println(result.toJson());
} catch (WxErrorException e) {
println(e.getMessage());
}
}
private void println(String content) {
System.out.println(content);
}
@DataProvider(name = "productId")
public Object[][] getProductId() {
return new Object[][]{new Object[]{"25639"}};
}
}