From 9df0992bd975194651041d3cf305f65e1789de4a Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 13 Jul 2017 10:59:16 +0200 Subject: [PATCH] Polish "Align with breaking API changes in RedisCacheManager" Closes gh-9734 --- .../boot/autoconfigure/cache/RedisCacheConfiguration.java | 1 - .../autoconfigure/cache/CacheAutoConfigurationTests.java | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java index 59f9ec9ac9..34cc3e7e2a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java @@ -57,7 +57,6 @@ class RedisCacheConfiguration { @Bean public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) { - RedisCacheManagerBuilder builder = RedisCacheManager.builder(redisConnectionFactory); List cacheNames = this.cacheProperties.getCacheNames(); if (!cacheNames.isEmpty()) { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index 111b931b05..aa18a6fbb3 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -283,9 +283,9 @@ public class CacheAutoConfigurationTests { RedisCacheManager cacheManager = validateCacheManager(context, RedisCacheManager.class); assertThat(cacheManager.getCacheNames()).isEmpty(); - org.springframework.data.redis.cache.RedisCacheConfiguration configuration = (org.springframework.data.redis.cache.RedisCacheConfiguration) new DirectFieldAccessor( - cacheManager).getPropertyValue("defaultCacheConfig"); - assertThat(configuration.usePrefix()).isTrue(); + assertThat(((org.springframework.data.redis.cache.RedisCacheConfiguration) + new DirectFieldAccessor(cacheManager).getPropertyValue( + "defaultCacheConfig")).usePrefix()).isTrue(); }); }