No more transaction cache
This commit is contained in:
		
							parent
							
								
									a5050cdf7f
								
							
						
					
					
						commit
						923dcff8e5
					
				@ -21,8 +21,8 @@ import org.junit.jupiter.api.extension.ExtendWith;
 | 
				
			|||||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
 | 
					import org.springframework.boot.context.properties.EnableConfigurationProperties;
 | 
				
			||||||
import org.springframework.cache.CacheManager;
 | 
					import org.springframework.cache.CacheManager;
 | 
				
			||||||
import org.springframework.cache.transaction.TransactionAwareCacheDecorator;
 | 
					import org.springframework.cache.caffeine.CaffeineCache;
 | 
				
			||||||
import org.springframework.cache.transaction.TransactionAwareCacheManagerProxy;
 | 
					import org.springframework.cache.support.SimpleCacheManager;
 | 
				
			||||||
import org.springframework.test.context.ContextConfiguration;
 | 
					import org.springframework.test.context.ContextConfiguration;
 | 
				
			||||||
import org.springframework.test.context.TestPropertySource;
 | 
					import org.springframework.test.context.TestPropertySource;
 | 
				
			||||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
 | 
					import org.springframework.test.context.junit.jupiter.SpringExtension;
 | 
				
			||||||
@ -45,14 +45,16 @@ public class CacheSpecsMapTest {
 | 
				
			|||||||
    CacheManager cacheManager;
 | 
					    CacheManager cacheManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
    public void verifyTransactionAwareCacheManagerProxy() {
 | 
					    public void verifyNotTransactionAwareCacheManagerProxy() {
 | 
				
			||||||
        assertThat(cacheManager).isInstanceOf(TransactionAwareCacheManagerProxy.class);
 | 
					        // We no longer use built-in transaction support for the caches, because we have our own cache cleanup and transaction logic that implements CAS.
 | 
				
			||||||
 | 
					        assertThat(cacheManager).isInstanceOf(SimpleCacheManager.class);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
    public void givenCacheConfig_whenCacheManagerReady_thenVerifyExistedCachesWithTransactionAwareCacheDecorator() {
 | 
					    public void givenCacheConfig_whenCacheManagerReady_thenVerifyExistedCachesWithNoTransactionAwareCacheDecorator() {
 | 
				
			||||||
        assertThat(cacheManager.getCache("relations")).isInstanceOf(TransactionAwareCacheDecorator.class);
 | 
					        // We no longer use built-in transaction support for the caches, because we have our own cache cleanup and transaction logic that implements CAS.
 | 
				
			||||||
        assertThat(cacheManager.getCache("devices")).isInstanceOf(TransactionAwareCacheDecorator.class);
 | 
					        assertThat(cacheManager.getCache("relations")).isInstanceOf(CaffeineCache.class);
 | 
				
			||||||
 | 
					        assertThat(cacheManager.getCache("devices")).isInstanceOf(CaffeineCache.class);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user