Skip to content

Commit 18ecc15

Browse files
committed
unit test for custom CacheMesssagePublisher
1 parent 5bbfacc commit 18ecc15

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

jetcache-test/src/test/java/com/alicp/jetcache/anno/support/ConfigProvider_CustomCacheManager_Test.java

+8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import com.alicp.jetcache.anno.config.EnableMethodCache;
88
import com.alicp.jetcache.test.anno.TestUtil;
99
import com.alicp.jetcache.test.spring.SpringTestBase;
10+
import org.junit.After;
1011
import org.junit.Assert;
12+
import org.junit.Before;
1113
import org.junit.Test;
1214
import org.junit.runner.RunWith;
1315
import org.springframework.context.annotation.Bean;
@@ -39,6 +41,12 @@ public GlobalCacheConfig config() {
3941
return pc;
4042
}
4143

44+
@Before
45+
@After
46+
public void init() {
47+
SimpleCacheManager.defaultManager.rebuild();
48+
}
49+
4250
public static class CountBean {
4351
private int i;
4452

jetcache-test/src/test/java/com/alicp/jetcache/anno/support/ConfigProvider_DefaultCacheManager_Test.java

+8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import com.alicp.jetcache.anno.config.EnableMethodCache;
88
import com.alicp.jetcache.test.anno.TestUtil;
99
import com.alicp.jetcache.test.spring.SpringTestBase;
10+
import org.junit.After;
1011
import org.junit.Assert;
12+
import org.junit.Before;
1113
import org.junit.Test;
1214
import org.junit.runner.RunWith;
1315
import org.springframework.context.annotation.Bean;
@@ -35,6 +37,12 @@ public GlobalCacheConfig config() {
3537
return pc;
3638
}
3739

40+
@Before
41+
@After
42+
public void init() {
43+
SimpleCacheManager.defaultManager.rebuild();
44+
}
45+
3846

3947
public static class CountBean {
4048
private int i;

0 commit comments

Comments
 (0)