File tree 4 files changed +6
-15
lines changed
spring/src/test/java/io/github/xanthic/cache/spring
spring-java17/src/test/java/io/github/xanthic/cache/springjdk17
4 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,10 @@ public void valueLoaderTest() {
126
126
@ DisplayName ("Tests the eviction of entries based on max size" )
127
127
public void valueLoaderConcurrentTest () throws InterruptedException {
128
128
XanthicSpringCacheManager xanthicSpringCacheManager = (XanthicSpringCacheManager ) cacheManager ;
129
- xanthicSpringCacheManager .registerCache ("value-cache" , spec -> {
129
+ xanthicSpringCacheManager .registerCache ("value-cache-concurrent " , spec -> {
130
130
spec .maxSize (100L );
131
131
});
132
- Cache cache = Objects .requireNonNull (cacheManager .getCache ("value-cache" ));
132
+ Cache cache = Objects .requireNonNull (cacheManager .getCache ("value-cache-concurrent " ));
133
133
134
134
AtomicInteger callCounter = new AtomicInteger (0 );
135
135
Callable <String > valueLoader = () -> {
Original file line number Diff line number Diff line change @@ -11,13 +11,9 @@ public class CacheConfiguration {
11
11
12
12
@ Bean
13
13
public CacheManager cacheManager () {
14
- XanthicSpringCacheManager cacheManager = new XanthicSpringCacheManager (spec -> {
14
+ return new XanthicSpringCacheManager (spec -> {
15
15
spec .expiryType (ExpiryType .POST_ACCESS );
16
16
});
17
- cacheManager .registerCache ("my-custom-cache" , spec -> {
18
- spec .maxSize (10L );
19
- });
20
- return cacheManager ;
21
17
}
22
18
23
19
}
Original file line number Diff line number Diff line change @@ -113,10 +113,10 @@ public void valueLoaderTest() {
113
113
@ DisplayName ("Tests the eviction of entries based on max size" )
114
114
public void valueLoaderConcurrentTest () throws InterruptedException {
115
115
XanthicSpringCacheManager xanthicSpringCacheManager = (XanthicSpringCacheManager ) cacheManager ;
116
- xanthicSpringCacheManager .registerCache ("value-cache" , spec -> {
116
+ xanthicSpringCacheManager .registerCache ("value-cache-concurrent " , spec -> {
117
117
spec .maxSize (100L );
118
118
});
119
- Cache cache = Objects .requireNonNull (cacheManager .getCache ("value-cache" ));
119
+ Cache cache = Objects .requireNonNull (cacheManager .getCache ("value-cache-concurrent " ));
120
120
121
121
AtomicInteger callCounter = new AtomicInteger (0 );
122
122
Callable <String > valueLoader = () -> {
Original file line number Diff line number Diff line change @@ -11,14 +11,9 @@ public class CacheConfiguration {
11
11
12
12
@ Bean
13
13
public CacheManager cacheManager () {
14
- XanthicSpringCacheManager cacheManager = new XanthicSpringCacheManager (spec -> {
14
+ return new XanthicSpringCacheManager (spec -> {
15
15
spec .expiryType (ExpiryType .POST_ACCESS );
16
16
});
17
- cacheManager .registerCache ("my-custom-cache" , spec -> {
18
- spec .maxSize (10L );
19
- });
20
-
21
- return cacheManager ;
22
17
}
23
18
24
19
}
You can’t perform that action at this time.
0 commit comments