File tree Expand file tree Collapse file tree 4 files changed +6
-15
lines changed
spring-java17/src/test/java/io/github/xanthic/cache/springjdk17
spring/src/test/java/io/github/xanthic/cache/spring Expand file tree Collapse file tree 4 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,10 @@ public void valueLoaderTest() {
126126 @ DisplayName ("Tests the eviction of entries based on max size" )
127127 public void valueLoaderConcurrentTest () throws InterruptedException {
128128 XanthicSpringCacheManager xanthicSpringCacheManager = (XanthicSpringCacheManager ) cacheManager ;
129- xanthicSpringCacheManager .registerCache ("value-cache" , spec -> {
129+ xanthicSpringCacheManager .registerCache ("value-cache-concurrent " , spec -> {
130130 spec .maxSize (100L );
131131 });
132- Cache cache = Objects .requireNonNull (cacheManager .getCache ("value-cache" ));
132+ Cache cache = Objects .requireNonNull (cacheManager .getCache ("value-cache-concurrent " ));
133133
134134 AtomicInteger callCounter = new AtomicInteger (0 );
135135 Callable <String > valueLoader = () -> {
Original file line number Diff line number Diff line change @@ -11,13 +11,9 @@ public class CacheConfiguration {
1111
1212 @ Bean
1313 public CacheManager cacheManager () {
14- XanthicSpringCacheManager cacheManager = new XanthicSpringCacheManager (spec -> {
14+ return new XanthicSpringCacheManager (spec -> {
1515 spec .expiryType (ExpiryType .POST_ACCESS );
1616 });
17- cacheManager .registerCache ("my-custom-cache" , spec -> {
18- spec .maxSize (10L );
19- });
20- return cacheManager ;
2117 }
2218
2319}
Original file line number Diff line number Diff line change @@ -113,10 +113,10 @@ public void valueLoaderTest() {
113113 @ DisplayName ("Tests the eviction of entries based on max size" )
114114 public void valueLoaderConcurrentTest () throws InterruptedException {
115115 XanthicSpringCacheManager xanthicSpringCacheManager = (XanthicSpringCacheManager ) cacheManager ;
116- xanthicSpringCacheManager .registerCache ("value-cache" , spec -> {
116+ xanthicSpringCacheManager .registerCache ("value-cache-concurrent " , spec -> {
117117 spec .maxSize (100L );
118118 });
119- Cache cache = Objects .requireNonNull (cacheManager .getCache ("value-cache" ));
119+ Cache cache = Objects .requireNonNull (cacheManager .getCache ("value-cache-concurrent " ));
120120
121121 AtomicInteger callCounter = new AtomicInteger (0 );
122122 Callable <String > valueLoader = () -> {
Original file line number Diff line number Diff line change @@ -11,14 +11,9 @@ public class CacheConfiguration {
1111
1212 @ Bean
1313 public CacheManager cacheManager () {
14- XanthicSpringCacheManager cacheManager = new XanthicSpringCacheManager (spec -> {
14+ return new XanthicSpringCacheManager (spec -> {
1515 spec .expiryType (ExpiryType .POST_ACCESS );
1616 });
17- cacheManager .registerCache ("my-custom-cache" , spec -> {
18- spec .maxSize (10L );
19- });
20-
21- return cacheManager ;
2217 }
2318
2419}
You can’t perform that action at this time.
0 commit comments