From c1f9e96a921891465d471bb177b4a5d3845ae703 Mon Sep 17 00:00:00 2001 From: "Yangkai.Shen" <237497819@qq.com> Date: Fri, 2 Aug 2019 14:21:20 +0800 Subject: [PATCH] =?UTF-8?q?:white=5Fcheck=5Fmark:=20=E4=BF=AE=E6=94=B9=20c?= =?UTF-8?q?ache=20=E6=B5=8B=E8=AF=95=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/zhyd/oauth/cache/AuthStateCacheTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/java/me/zhyd/oauth/cache/AuthStateCacheTest.java b/src/test/java/me/zhyd/oauth/cache/AuthStateCacheTest.java index 9c6e1e0..9ebb87c 100644 --- a/src/test/java/me/zhyd/oauth/cache/AuthStateCacheTest.java +++ b/src/test/java/me/zhyd/oauth/cache/AuthStateCacheTest.java @@ -9,24 +9,24 @@ public class AuthStateCacheTest { @Test public void cache1() throws InterruptedException { - AuthStateCache.cache("key", "value"); - Assert.assertEquals(AuthStateCache.get("key"), "value"); + AuthDefaultStateCache.INSTANCE.cache("key", "value"); + Assert.assertEquals(AuthDefaultStateCache.INSTANCE.get("key"), "value"); TimeUnit.MILLISECONDS.sleep(4); - Assert.assertEquals(AuthStateCache.get("key"), "value"); + Assert.assertEquals(AuthDefaultStateCache.INSTANCE.get("key"), "value"); } @Test public void cache2() throws InterruptedException { - AuthStateCache.cache("key", "value", 10); - Assert.assertEquals(AuthStateCache.get("key"), "value"); + AuthDefaultStateCache.INSTANCE.cache("key", "value", 10); + Assert.assertEquals(AuthDefaultStateCache.INSTANCE.get("key"), "value"); // 没过期 TimeUnit.MILLISECONDS.sleep(5); - Assert.assertEquals(AuthStateCache.get("key"), "value"); + Assert.assertEquals(AuthDefaultStateCache.INSTANCE.get("key"), "value"); // 过期 TimeUnit.MILLISECONDS.sleep(6); - Assert.assertNull(AuthStateCache.get("key")); + Assert.assertNull(AuthDefaultStateCache.INSTANCE.get("key")); } }