🆕 #3084【公众号】增加获取稳定版接口调用凭据的接口
This commit is contained in:
@@ -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() {
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user