1
0
mirror of synced 2025-12-21 08:30:11 +08:00

#853 小程序模块获取二维码和小程序码接口增加对应返回byte数组的实现方法

This commit is contained in:
Binary Wang
2018-12-08 19:04:08 +08:00
parent 812de026a6
commit d59dff2f73
8 changed files with 310 additions and 69 deletions

View File

@@ -7,6 +7,9 @@ import org.testng.annotations.*;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.test.ApiTestModule;
import com.google.inject.Inject;
import me.chanjar.weixin.common.error.WxErrorException;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author <a href="https://github.com/binarywang">Binary Wang</a>
@@ -18,21 +21,38 @@ public class WxMaQrcodeServiceImplTest {
private WxMaService wxService;
@Test
public void testCreateQrCode() throws Exception {
public void testCreateQrcode() throws Exception {
final File qrCode = this.wxService.getQrcodeService().createQrcode("111", 122);
System.out.println(qrCode);
assertThat(qrCode).isNotNull();
}
@Test
public void testCreateWxaCode() throws Exception {
final File wxCode = this.wxService.getQrcodeService().createWxaCode("111", 122);
System.out.println(wxCode);
assertThat(wxCode).isNotNull();
}
@Test
public void testCreateWxaCodeUnlimit() throws Exception {
final File wxCode = this.wxService.getQrcodeService().createWxaCodeUnlimit("111", null);
System.out.println(wxCode);
assertThat(wxCode).isNotNull();
}
@Test
public void testCreateQrcodeBytes() throws WxErrorException {
final byte[] qrCode = this.wxService.getQrcodeService().createQrcodeBytes("111", 122);
assertThat(qrCode).isNotNull();
}
@Test
public void testCreateWxaCodeBytes() throws WxErrorException {
final byte[] wxCode = this.wxService.getQrcodeService().createWxaCodeBytes("111", 122, true, null, false);
assertThat(wxCode).isNotNull();
}
@Test
public void testCreateWxaCodeUnlimitBytes() throws WxErrorException {
final byte[] wxCode = this.wxService.getQrcodeService().createWxaCodeUnlimitBytes("111", null, 122, true, null, false);
assertThat(wxCode).isNotNull();
}
}