From 6a678d19017e691512cd10508bda7abc84a38d14 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 03:02:09 +0000 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=B5=8B=E8=AF=95=E4=B8=AD?= =?UTF-8?q?=E7=9A=84Thread.sleep=E4=BB=A5=E6=8F=90=E9=AB=98=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=A8=B3=E5=AE=9A=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com> --- .../impl/WxCpServiceGetMsgAuditAccessTokenTest.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpServiceGetMsgAuditAccessTokenTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpServiceGetMsgAuditAccessTokenTest.java index 7cbbab204..25941a3f4 100644 --- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpServiceGetMsgAuditAccessTokenTest.java +++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpServiceGetMsgAuditAccessTokenTest.java @@ -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");