title: Disable Redis AutoConfig in spring boot when testing
body: <p>I am trying to disable Redis when I am testing with spring boot. I have disabled my configuration but the auto config created a default connection and fails because it can't connect to a non-existent service. For testing I am content to just use a basic in-memory cache or a no-op cache. That doesn't work either. Here is what I have tried:</p>
  
  <p>per <a href="https://github.com/spring-projects/spring-boot/issues/5386" rel="noreferrer">this issue</a> I added said configuration to my test app properties</p>
  
  <pre><code>spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
  </code></pre>
  
  <p>But. That gets me a bit further. But ultimately I get a <code>NoSuchBeanDefinitionException</code> <code>redisTemplate</code> - this is because <code>redisReferenceResolver</code> is trying to look that up. </p>
  
  <p>Looking at my debugger right now, the bean it's trying to hydrate is:
  <code>org.springframework.data.redis.core.convert.ReferenceResolverImpl</code> which is coming from <code>spring-data-redis:1.8.0.RELEASE</code> which is coming from this dependency: <code>compile('org.springframework.boot:spring-boot-starter-data-redis')</code> . I admit, the bean name is a bit misleading. The type it actually resolves to is not</p>
  
  <p>The only other reference to redis is in our hibernate support. </p>
  
  <p>Can someone explain how to turn this off for testing?</p>