#362 修复okhttp实现的qrcode二维码图片下载代码
This commit is contained in:
@@ -5,11 +5,13 @@ import me.chanjar.weixin.common.exception.WxErrorException;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.api.test.ApiTestModule;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.testng.*;
|
||||
import org.testng.annotations.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 测试用户相关的接口
|
||||
@@ -65,6 +67,12 @@ public class WxMpQrcodeServiceImplTest {
|
||||
File file = this.wxService.getQrcodeService().qrCodePicture(ticket);
|
||||
Assert.assertNotNull(file);
|
||||
System.out.println(file.getAbsolutePath());
|
||||
|
||||
try {
|
||||
FileUtils.copyFile(file,new File("d:\\t.jpg"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void testQrCodePictureUrl() throws WxErrorException {
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.thoughtworks.xstream.XStream;
|
||||
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
|
||||
import me.chanjar.weixin.mp.api.WxMpConfigStorage;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceApacheHttpClientImpl;
|
||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceOkHttpImpl;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
Reference in New Issue
Block a user