use of org.springframework.cache.concurrent.ConcurrentMapCacheManager in project spring-boot by spring-projects.
the class CachesEndpointTests method namedCacheWithSeveralCacheManagersWithCacheManagerFilter.
@Test
void namedCacheWithSeveralCacheManagersWithCacheManagerFilter() {
Map<String, CacheManager> cacheManagers = new LinkedHashMap<>();
cacheManagers.put("test", new ConcurrentMapCacheManager("b", "a"));
cacheManagers.put("another", new ConcurrentMapCacheManager("c", "a"));
CachesEndpoint endpoint = new CachesEndpoint(cacheManagers);
CacheEntry entry = endpoint.cache("a", "test");
assertThat(entry).isNotNull();
assertThat(entry.getCacheManager()).isEqualTo("test");
assertThat(entry.getName()).isEqualTo("a");
}
use of org.springframework.cache.concurrent.ConcurrentMapCacheManager in project spring-boot by spring-projects.
the class CachesEndpointTests method namedCacheWithWrongCacheManager.
@Test
void namedCacheWithWrongCacheManager() {
Map<String, CacheManager> cacheManagers = new LinkedHashMap<>();
cacheManagers.put("test", new ConcurrentMapCacheManager("b", "a"));
cacheManagers.put("another", new ConcurrentMapCacheManager("c", "a"));
CachesEndpoint endpoint = new CachesEndpoint(cacheManagers);
CacheEntry entry = endpoint.cache("c", "test");
assertThat(entry).isNull();
}
Aggregations