use of org.springframework.cache.concurrent.ConcurrentMapCacheManager in project spring-boot by spring-projects.
the class CacheAutoConfigurationTests method cacheManagerBackOff.
@Test
public void cacheManagerBackOff() {
load(CustomCacheManagerConfiguration.class);
ConcurrentMapCacheManager cacheManager = validateCacheManager(ConcurrentMapCacheManager.class);
assertThat(cacheManager.getCacheNames()).containsOnly("custom1");
}
use of org.springframework.cache.concurrent.ConcurrentMapCacheManager in project spring-security by spring-projects.
the class SpringCacheBasedUserCacheTests method initCacheManaer.
@BeforeAll
public static void initCacheManaer() {
cacheManager = new ConcurrentMapCacheManager();
cacheManager.getCache("springbasedusercachetests");
}
use of org.springframework.cache.concurrent.ConcurrentMapCacheManager in project spring-boot by spring-projects.
the class CacheManagerCustomizersTests method customizeSimpleCacheManager.
@Test
void customizeSimpleCacheManager() {
CacheManagerCustomizers customizers = new CacheManagerCustomizers(Collections.singletonList(new CacheNamesCacheManagerCustomizer()));
ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager();
customizers.customize(cacheManager);
assertThat(cacheManager.getCacheNames()).containsOnly("one", "two");
}
use of org.springframework.cache.concurrent.ConcurrentMapCacheManager in project spring-boot by spring-projects.
the class CacheAutoConfigurationTests method simpleCacheExplicitWithCacheNames.
@Test
void simpleCacheExplicitWithCacheNames() {
this.contextRunner.withUserConfiguration(DefaultCacheConfiguration.class).withPropertyValues("spring.cache.type=simple", "spring.cache.cacheNames[0]=foo", "spring.cache.cacheNames[1]=bar").run((context) -> {
ConcurrentMapCacheManager cacheManager = getCacheManager(context, ConcurrentMapCacheManager.class);
assertThat(cacheManager.getCacheNames()).containsOnly("foo", "bar");
});
}
use of org.springframework.cache.concurrent.ConcurrentMapCacheManager in project spring-boot by spring-projects.
the class CachesEndpointTests method namedCacheWithSingleCacheManager.
@Test
void namedCacheWithSingleCacheManager() {
CachesEndpoint endpoint = new CachesEndpoint(Collections.singletonMap("test", new ConcurrentMapCacheManager("b", "a")));
CacheEntry entry = endpoint.cache("a", null);
assertThat(entry).isNotNull();
assertThat(entry.getCacheManager()).isEqualTo("test");
assertThat(entry.getName()).isEqualTo("a");
assertThat(entry.getTarget()).isEqualTo(ConcurrentHashMap.class.getName());
}
Aggregations