Fix incomplete polish of RedisSessionProperties

Fix polish commit from 919913ae66 to correctly name the property
getter/setters.

See gh-17022
pull/17129/head
Phillip Webb 6 years ago
parent b59dc5bce4
commit e0aa90cf32

@ -54,14 +54,14 @@ class RedisSessionConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public ConfigureRedisAction configureRedisAction(RedisSessionProperties redisSessionProperties) { public ConfigureRedisAction configureRedisAction(RedisSessionProperties redisSessionProperties) {
switch (redisSessionProperties.getConfigurationStrategy()) { switch (redisSessionProperties.getConfigureAction()) {
case NOTIFY_KEYSPACE_EVENTS: case NOTIFY_KEYSPACE_EVENTS:
return new ConfigureNotifyKeyspaceEventsAction(); return new ConfigureNotifyKeyspaceEventsAction();
case NONE: case NONE:
return ConfigureRedisAction.NO_OP; return ConfigureRedisAction.NO_OP;
} }
throw new IllegalStateException("Unsupported redis configuration strategy '" throw new IllegalStateException(
+ redisSessionProperties.getConfigurationStrategy() + "'."); "Unsupported redis configure action '" + redisSessionProperties.getConfigureAction() + "'.");
} }
@Configuration @Configuration

@ -75,12 +75,12 @@ public class RedisSessionProperties {
this.cleanupCron = cleanupCron; this.cleanupCron = cleanupCron;
} }
public ConfigureAction getConfigurationStrategy() { public ConfigureAction getConfigureAction() {
return this.configureAction; return this.configureAction;
} }
public void setConfigurationStrategy(ConfigureAction configurationStrategy) { public void setConfigureAction(ConfigureAction configureAction) {
this.configureAction = configurationStrategy; this.configureAction = configureAction;
} }
/** /**

@ -89,7 +89,7 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio
} }
@Test @Test
void redisSessionConfigureNoStrategy() { void redisSessionWithConfigureActionNone() {
this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)) this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class))
.withPropertyValues("spring.session.store-type=redis", "spring.session.redis.configure-action=none", .withPropertyValues("spring.session.store-type=redis", "spring.session.redis.configure-action=none",
"spring.redis.port=" + redis.getFirstMappedPort()) "spring.redis.port=" + redis.getFirstMappedPort())
@ -97,7 +97,7 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio
} }
@Test @Test
void redisSessionConfigureDefaultStrategy() { void redisSessionWithDefaultConfigureActionNone() {
this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)) this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class))
.withPropertyValues("spring.session.store-type=redis", .withPropertyValues("spring.session.store-type=redis",
"spring.redis.port=" + redis.getFirstMappedPort()) "spring.redis.port=" + redis.getFirstMappedPort())
@ -106,7 +106,7 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio
} }
@Test @Test
void redisSessionConfigureCustomStrategy() { void redisSessionWithCustomConfigureRedisActionBean() {
this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)) this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class))
.withUserConfiguration(MaxEntriesRedisAction.class) .withUserConfiguration(MaxEntriesRedisAction.class)
.withPropertyValues("spring.session.store-type=redis", .withPropertyValues("spring.session.store-type=redis",

Loading…
Cancel
Save