1
0
mirror of synced 2026-02-08 03:37:49 +08:00

移除测试中的Thread.sleep以提高测试稳定性

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-27 03:02:09 +00:00
parent 677ffe07d2
commit 6a678d1901

View File

@@ -68,14 +68,8 @@ public class WxCpServiceGetMsgAuditAccessTokenTest {
*/
@Test
public void testGetMsgAuditAccessToken_Expired() throws WxErrorException {
// 设置一个已过期的token过期时间为0
config.updateMsgAuditAccessToken("expired_token", 0);
// 等待一下确保过期
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
// 设置一个已过期的token过期时间为负数,确保立即过期
config.updateMsgAuditAccessToken("expired_token", -1);
BaseWxCpServiceImpl service = createTestServiceWithMockToken(config, "refreshed_token");