org.springframework.cache.support.NoOpCacheManager Java Examples

The following examples show how to use org.springframework.cache.support.NoOpCacheManager. 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: LoadBalancerCacheAutoConfigurationTests.java    From spring-cloud-commons with Apache License 2.0 5 votes vote down vote up
@Test
void defaultLoadBalancerCacheShouldNotOverrideCacheTypeSetting() {
	ApplicationContextRunner contextRunner = noCaffeineRunner()
			.withUserConfiguration(TestConfiguration.class)
			.withPropertyValues("spring.cache.type=none");

	contextRunner.run(context -> {
		assertThat(context.getBeansOfType(CacheManager.class)).hasSize(2);
		assertThat(context.getBean("defaultLoadBalancerCacheManager"))
				.isInstanceOf(DefaultLoadBalancerCacheManager.class);
		assertThat(context.getBeansOfType(CacheManager.class).get("cacheManager"))
				.isInstanceOf(NoOpCacheManager.class);

	});
}
 
Example #2
Source File: LoadBalancerCacheAutoConfigurationTests.java    From spring-cloud-commons with Apache License 2.0 5 votes vote down vote up
@Test
void caffeineLoadBalancerCacheShouldNotOverrideCacheTypeSetting() {
	ApplicationContextRunner contextRunner = baseApplicationRunner()
			.withUserConfiguration(TestConfiguration.class)
			.withPropertyValues("spring.cache.type=none");

	contextRunner.run(context -> {
		assertThat(context.getBeansOfType(CacheManager.class)).hasSize(2);
		assertThat(context.getBean("caffeineLoadBalancerCacheManager"))
				.isInstanceOf(CaffeineCacheManager.class);
		assertThat(context.getBeansOfType(CacheManager.class).get("cacheManager"))
				.isInstanceOf(NoOpCacheManager.class);

	});
}
 
Example #3
Source File: MemcachedAutoConfigurationTest.java    From memcached-spring-boot with Apache License 2.0 5 votes vote down vote up
@Test
public void whenCacheTypeIsNoneThenNoOpCacheLoaded() {
    loadContext(CacheConfiguration.class, "spring.cache.type=none");

    CacheManager cacheManager = this.applicationContext.getBean(CacheManager.class);

    assertThat(cacheManager).isInstanceOf(NoOpCacheManager.class);
}
 
Example #4
Source File: MemcachedAutoConfigurationIT.java    From memcached-spring-boot with Apache License 2.0 5 votes vote down vote up
@Test
public void whenCacheTypeIsNoneThenNoOpCacheLoaded() {
    loadContext(CacheConfiguration.class, "spring.cache.type=none");

    CacheManager cacheManager = this.applicationContext.getBean(CacheManager.class);

    assertThat(cacheManager).isInstanceOf(NoOpCacheManager.class);
}
 
Example #5
Source File: AspectJEnableCachingIsolatedTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public CacheManager cm2() {
	return new NoOpCacheManager();
}
 
Example #6
Source File: EnableCachingTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManager cm1() {
	return new NoOpCacheManager();
}
 
Example #7
Source File: EnableCachingTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManager cm1() {
	return new NoOpCacheManager();
}
 
Example #8
Source File: CompileCacheOperation.java    From n2o-framework with Apache License 2.0 4 votes vote down vote up
public CompileCacheOperation() {
    this.cacheTemplate = new CacheTemplate(new NoOpCacheManager());
}
 
Example #9
Source File: SourceCacheOperation.java    From n2o-framework with Apache License 2.0 4 votes vote down vote up
public SourceCacheOperation() {
    this.cacheTemplate = new CacheTemplate(new NoOpCacheManager());
}
 
Example #10
Source File: AspectJEnableCachingIsolatedTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
@Bean
public CacheManager cacheManager() {
	return new NoOpCacheManager();
}
 
Example #11
Source File: AspectJEnableCachingIsolatedTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public CacheManager cm() {
	return new NoOpCacheManager();
}
 
Example #12
Source File: AspectJEnableCachingIsolatedTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public CacheManager cm2() {
	return new NoOpCacheManager();
}
 
Example #13
Source File: AspectJEnableCachingIsolatedTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public CacheManager cm1() {
	return new NoOpCacheManager();
}
 
Example #14
Source File: EnableCachingTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManager cm2() {
	return new NoOpCacheManager();
}
 
Example #15
Source File: AspectJEnableCachingIsolatedTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public CacheManager cm1() {
	return new NoOpCacheManager();
}
 
Example #16
Source File: AspectJEnableCachingIsolatedTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public CacheManager cm1() {
	return new NoOpCacheManager();
}
 
Example #17
Source File: JCacheJavaConfigTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
@Bean
public CacheManager cacheManager() {
	return new NoOpCacheManager();
}
 
Example #18
Source File: EnableCachingTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManager cm2() {
	return new NoOpCacheManager();
}
 
Example #19
Source File: EnableCachingTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManager cm1() {
	return new NoOpCacheManager();
}
 
Example #20
Source File: JCacheJavaConfigTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
public CacheManager cm() {
	return new NoOpCacheManager();
}
 
Example #21
Source File: EnableCachingTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManager cm() {
	return new NoOpCacheManager();
}
 
Example #22
Source File: EnableCachingTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
@Bean
public CacheManager cacheManager() {
	return new NoOpCacheManager();
}
 
Example #23
Source File: NoOpCacheManagerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
	manager = new NoOpCacheManager();
}
 
Example #24
Source File: EnableCachingIntegrationTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
CacheManager mgr() {
	return new NoOpCacheManager();
}
 
Example #25
Source File: EnableCachingIntegrationTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
CacheManager cacheManager() {
	return new NoOpCacheManager();
}
 
Example #26
Source File: JCacheJavaConfigTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
@Bean
public CacheManager cacheManager() {
	return new NoOpCacheManager();
}
 
Example #27
Source File: JCacheJavaConfigTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManager cm() {
	return new NoOpCacheManager();
}
 
Example #28
Source File: JCacheJavaConfigTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
@Bean
public CacheManager cacheManager() {
	return new NoOpCacheManager();
}
 
Example #29
Source File: PermissionServiceImpl.java    From rice with Educational Community License v2.0 4 votes vote down vote up
public PermissionServiceImpl() {
    this.cacheManager = new NoOpCacheManager();
}
 
Example #30
Source File: RoleServiceImpl.java    From rice with Educational Community License v2.0 4 votes vote down vote up
public RoleServiceImpl() {
    this.cacheManager = new NoOpCacheManager();
}