#293 重构OkHttp的实现代码,同时修复JSApi的bug
* update travis settings * feat(okhttp): 修改okhttp底层调用方法 直接用OkHttpClient代替connect.使客户端单一化.Okhttp 自动管理连接池优化 * feat(log,jsApi): 添加log debug 标记明确下调用底层效果,修复jsAPI Lock 为null 问题 添加log debug 标记明确下调用底层效果,修复jsAPI Lock 为null 问题 #293
This commit is contained in:
@@ -29,4 +29,10 @@ public class WxMpBaseAPITest {
|
||||
Assert.assertTrue(StringUtils.isNotBlank(after));
|
||||
}
|
||||
|
||||
public void testJsapiTicket() throws WxErrorException {
|
||||
String jsapiTicket = this.wxService.getJsapiTicket(false);
|
||||
System.out.println(jsapiTicket);
|
||||
Assert.assertNotNull(jsapiTicket);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,11 +20,7 @@ public class WxMpJsAPITest {
|
||||
protected WxMpService wxService;
|
||||
|
||||
|
||||
public void testJsapiTicket() throws WxErrorException {
|
||||
String jsapiTicket = this.wxService.getJsapiTicket(false);
|
||||
System.out.println(jsapiTicket);
|
||||
Assert.assertNotNull(jsapiTicket);
|
||||
}
|
||||
|
||||
|
||||
public void test() {
|
||||
long timestamp = 1419835025l;
|
||||
|
||||
@@ -7,6 +7,7 @@ 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;
|
||||
import java.io.InputStream;
|
||||
@@ -19,7 +20,7 @@ public class ApiTestModule implements Module {
|
||||
try (InputStream is1 = ClassLoader.getSystemResourceAsStream("test-config.xml")) {
|
||||
TestConfigStorage config = this.fromXml(TestConfigStorage.class, is1);
|
||||
config.setAccessTokenLock(new ReentrantLock());
|
||||
WxMpService wxService = new WxMpServiceApacheHttpClientImpl();
|
||||
WxMpService wxService = new WxMpServiceOkHttpImpl();
|
||||
wxService.setWxMpConfigStorage(config);
|
||||
|
||||
binder.bind(WxMpService.class).toInstance(wxService);
|
||||
|
||||
Reference in New Issue
Block a user