org.springframework.cache.jcache.support.TestableCacheResolver Java Examples

The following examples show how to use org.springframework.cache.jcache.support.TestableCacheResolver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AnnotationCacheOperationSourceTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void customCacheResolver() {
	CacheResultOperation operation =
			getCacheOperation(CacheResultOperation.class, CustomService.class, name.getMethodName(), Long.class);
	assertJCacheResolver(operation.getCacheResolver(), TestableCacheResolver.class);
	assertJCacheResolver(operation.getExceptionCacheResolver(), null);
	assertEquals(KeyGeneratorAdapter.class, operation.getKeyGenerator().getClass());
	assertEquals(defaultKeyGenerator, ((KeyGeneratorAdapter) operation.getKeyGenerator()).getTarget());
}
 
Example #2
Source File: AnnotationCacheOperationSourceTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void customKeyGeneratorAndCacheResolver() {
	CacheResultOperation operation = getCacheOperation(CacheResultOperation.class,
			CustomServiceWithDefaults.class, name.getMethodName(), Long.class);
	assertJCacheResolver(operation.getCacheResolver(), TestableCacheResolver.class);
	assertJCacheResolver(operation.getExceptionCacheResolver(), null);
	assertCacheKeyGenerator(operation.getKeyGenerator(), TestableCacheKeyGenerator.class);
}
 
Example #3
Source File: AnnotationCacheOperationSourceTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void customKeyGeneratorAndCacheResolverWithExceptionName() {
	CacheResultOperation operation = getCacheOperation(CacheResultOperation.class,
			CustomServiceWithDefaults.class, name.getMethodName(), Long.class);
	assertJCacheResolver(operation.getCacheResolver(), TestableCacheResolver.class);
	assertJCacheResolver(operation.getExceptionCacheResolver(), TestableCacheResolver.class);
	assertCacheKeyGenerator(operation.getKeyGenerator(), TestableCacheKeyGenerator.class);
}
 
Example #4
Source File: AnnotationCacheOperationSourceTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void customCacheResolver() {
	CacheResultOperation operation =
			getCacheOperation(CacheResultOperation.class, CustomService.class, name.getMethodName(), Long.class);
	assertJCacheResolver(operation.getCacheResolver(), TestableCacheResolver.class);
	assertJCacheResolver(operation.getExceptionCacheResolver(), null);
	assertEquals(KeyGeneratorAdapter.class, operation.getKeyGenerator().getClass());
	assertEquals(defaultKeyGenerator, ((KeyGeneratorAdapter) operation.getKeyGenerator()).getTarget());
}
 
Example #5
Source File: AnnotationCacheOperationSourceTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void customKeyGeneratorAndCacheResolver() {
	CacheResultOperation operation = getCacheOperation(CacheResultOperation.class,
			CustomServiceWithDefaults.class, name.getMethodName(), Long.class);
	assertJCacheResolver(operation.getCacheResolver(), TestableCacheResolver.class);
	assertJCacheResolver(operation.getExceptionCacheResolver(), null);
	assertCacheKeyGenerator(operation.getKeyGenerator(), TestableCacheKeyGenerator.class);
}
 
Example #6
Source File: AnnotationCacheOperationSourceTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void customKeyGeneratorAndCacheResolverWithExceptionName() {
	CacheResultOperation operation = getCacheOperation(CacheResultOperation.class,
			CustomServiceWithDefaults.class, name.getMethodName(), Long.class);
	assertJCacheResolver(operation.getCacheResolver(), TestableCacheResolver.class);
	assertJCacheResolver(operation.getExceptionCacheResolver(), TestableCacheResolver.class);
	assertCacheKeyGenerator(operation.getKeyGenerator(), TestableCacheKeyGenerator.class);
}
 
Example #7
Source File: AnnotationCacheOperationSourceTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void customCacheResolver() {
	CacheResultOperation operation =
			getCacheOperation(CacheResultOperation.class, CustomService.class, name.getMethodName(), Long.class);
	assertJCacheResolver(operation.getCacheResolver(), TestableCacheResolver.class);
	assertJCacheResolver(operation.getExceptionCacheResolver(), null);
	assertEquals(KeyGeneratorAdapter.class, operation.getKeyGenerator().getClass());
	assertEquals(defaultKeyGenerator, ((KeyGeneratorAdapter) operation.getKeyGenerator()).getTarget());
}
 
Example #8
Source File: AnnotationCacheOperationSourceTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void customKeyGeneratorAndCacheResolver() {
	CacheResultOperation operation = getCacheOperation(CacheResultOperation.class,
			CustomServiceWithDefaults.class, name.getMethodName(), Long.class);
	assertJCacheResolver(operation.getCacheResolver(), TestableCacheResolver.class);
	assertJCacheResolver(operation.getExceptionCacheResolver(), null);
	assertCacheKeyGenerator(operation.getKeyGenerator(), TestableCacheKeyGenerator.class);
}
 
Example #9
Source File: AnnotationCacheOperationSourceTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void customKeyGeneratorAndCacheResolverWithExceptionName() {
	CacheResultOperation operation = getCacheOperation(CacheResultOperation.class,
			CustomServiceWithDefaults.class, name.getMethodName(), Long.class);
	assertJCacheResolver(operation.getCacheResolver(), TestableCacheResolver.class);
	assertJCacheResolver(operation.getExceptionCacheResolver(), TestableCacheResolver.class);
	assertCacheKeyGenerator(operation.getKeyGenerator(), TestableCacheKeyGenerator.class);
}