1
0
mirror of synced 2025-12-22 18:08:12 +08:00

🆕 #3084【公众号】增加获取稳定版接口调用凭据的接口

This commit is contained in:
Sky
2023-07-17 23:24:04 +08:00
committed by GitHub
parent e5b0498401
commit c5e9f17607
10 changed files with 251 additions and 103 deletions

View File

@@ -211,6 +211,16 @@ public class BaseWxMpServiceImplTest {
return "模拟一个过期的access token:" + System.currentTimeMillis();
}
@Override
protected String doGetAccessTokenRequest() throws IOException {
return null;
}
@Override
protected String doGetStableAccessTokenRequest(boolean forceRefresh) throws IOException {
return null;
}
@Override
public void initHttp() {

View File

@@ -59,4 +59,15 @@ public class WxMpServiceImplTest {
Assert.assertNotEquals(before, after);
Assert.assertTrue(StringUtils.isNotBlank(after));
}
public void testStableRefreshAccessToken() throws WxErrorException {
WxMpConfigStorage configStorage = this.wxService.getWxMpConfigStorage();
configStorage.useStableAccessToken(true);
String before = configStorage.getAccessToken();
this.wxService.getAccessToken(false);
String after = configStorage.getAccessToken();
Assert.assertNotEquals(before, after);
Assert.assertTrue(StringUtils.isNotBlank(after));
}
}