Commit 77e350ac authored by Andy Wilkinson's avatar Andy Wilkinson

Polish contribution

parent 3e291ff0
/* /*
* Copyright 2012-2015 the original author or authors. * Copyright 2012-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -50,6 +50,7 @@ import org.springframework.util.StringUtils; ...@@ -50,6 +50,7 @@ import org.springframework.util.StringUtils;
* *
* @author Phillip Webb * @author Phillip Webb
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Vladimir Tsanev
* @since 1.3.0 * @since 1.3.0
*/ */
@Configuration @Configuration
...@@ -164,12 +165,14 @@ public class LocalDevToolsAutoConfiguration { ...@@ -164,12 +165,14 @@ public class LocalDevToolsAutoConfiguration {
} }
@Configuration @Configuration
@ConditionalOnBean(name = "sessionRedisTemplate") @ConditionalOnBean(name = RedisRestartConfiguration.SESSION_REDIS_TEMPLATE_BEAN_NAME)
static class RedisRestartConfiguration { static class RedisRestartConfiguration {
static final String SESSION_REDIS_TEMPLATE_BEAN_NAME = "sessionRedisTemplate";
@Bean @Bean
public RestartCompatibleRedisSerializerConfigurer restartCompatibleRedisSerializerConfigurer( public RestartCompatibleRedisSerializerConfigurer restartCompatibleRedisSerializerConfigurer(
@Qualifier("sessionRedisTemplate") RedisTemplate<?, ?> sessionRedisTemplate) { @Qualifier(SESSION_REDIS_TEMPLATE_BEAN_NAME) RedisTemplate<?, ?> sessionRedisTemplate) {
return new RestartCompatibleRedisSerializerConfigurer( return new RestartCompatibleRedisSerializerConfigurer(
sessionRedisTemplate); sessionRedisTemplate);
} }
......
/* /*
* Copyright 2012-2015 the original author or authors. * Copyright 2012-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* Copyright 2012-2015 the original author or authors. * Copyright 2012-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -68,6 +68,7 @@ import static org.mockito.Mockito.verify; ...@@ -68,6 +68,7 @@ import static org.mockito.Mockito.verify;
* *
* @author Phillip Webb * @author Phillip Webb
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Vladimir Tsanev
*/ */
public class LocalDevToolsAutoConfigurationTests { public class LocalDevToolsAutoConfigurationTests {
...@@ -244,14 +245,14 @@ public class LocalDevToolsAutoConfigurationTests { ...@@ -244,14 +245,14 @@ public class LocalDevToolsAutoConfigurationTests {
public void sessionRedisTemplateIsConfiguredWithCustomDeserializers10() public void sessionRedisTemplateIsConfiguredWithCustomDeserializers10()
throws Exception { throws Exception {
sessionRedisTemplateIsConfiguredWithCustomDeserializers( sessionRedisTemplateIsConfiguredWithCustomDeserializers(
SessionRedisTemplateConfig10.class); Session10RedisTemplateConfig.class);
} }
@Test @Test
public void sessionRedisTemplateIsConfiguredWithCustomDeserializers11() public void sessionRedisTemplateIsConfiguredWithCustomDeserializers11()
throws Exception { throws Exception {
sessionRedisTemplateIsConfiguredWithCustomDeserializers( sessionRedisTemplateIsConfiguredWithCustomDeserializers(
SessionRedisTemplateConfig11.class); Session11RedisTemplateConfig.class);
} }
private void sessionRedisTemplateIsConfiguredWithCustomDeserializers( private void sessionRedisTemplateIsConfiguredWithCustomDeserializers(
...@@ -320,7 +321,7 @@ public class LocalDevToolsAutoConfigurationTests { ...@@ -320,7 +321,7 @@ public class LocalDevToolsAutoConfigurationTests {
} }
@Configuration @Configuration
public static class SessionRedisTemplateConfig10 { public static class Session10RedisTemplateConfig {
@Bean @Bean
public RedisTemplate<String, ExpiringSession> sessionRedisTemplate() { public RedisTemplate<String, ExpiringSession> sessionRedisTemplate() {
...@@ -328,10 +329,11 @@ public class LocalDevToolsAutoConfigurationTests { ...@@ -328,10 +329,11 @@ public class LocalDevToolsAutoConfigurationTests {
redisTemplate.setConnectionFactory(mock(RedisConnectionFactory.class)); redisTemplate.setConnectionFactory(mock(RedisConnectionFactory.class));
return redisTemplate; return redisTemplate;
} }
} }
@Configuration @Configuration
public static class SessionRedisTemplateConfig11 { public static class Session11RedisTemplateConfig {
@Bean @Bean
public RedisTemplate<Object, Object> sessionRedisTemplate() { public RedisTemplate<Object, Object> sessionRedisTemplate() {
...@@ -339,5 +341,7 @@ public class LocalDevToolsAutoConfigurationTests { ...@@ -339,5 +341,7 @@ public class LocalDevToolsAutoConfigurationTests {
redisTemplate.setConnectionFactory(mock(RedisConnectionFactory.class)); redisTemplate.setConnectionFactory(mock(RedisConnectionFactory.class));
return redisTemplate; return redisTemplate;
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment