Code example for CachingConfigurerSupport

Methods: mockCache

0
		} 
 
		@Bean 
		public CacheManager cacheManager() {
			SimpleCacheManager cacheManager = new SimpleCacheManager();
			cacheManager.setCaches(Arrays.asList(mockCache()));
			return cacheManager;
		} 
 
		@Bean 
		public Cache mockCache() {
			Cache cache = mock(Cache.class);
			given(cache.getName()).willReturn("test");
			return cache;
		} 
 
	} 
 
	@CacheConfig(cacheNames = "test") 
	public static class SimpleService { 
Experience pair programming with AI  Get Codota for Java