|
|
@ -51,11 +51,13 @@ public class RedisAutoConfigurationTests {
|
|
|
|
public void testOverrideRedisConfiguration() throws Exception {
|
|
|
|
public void testOverrideRedisConfiguration() throws Exception {
|
|
|
|
this.context = new AnnotationConfigApplicationContext();
|
|
|
|
this.context = new AnnotationConfigApplicationContext();
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context, "spring.redis.host:foo");
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context, "spring.redis.host:foo");
|
|
|
|
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context, "spring.redis.database:1");
|
|
|
|
this.context.register(RedisAutoConfiguration.class,
|
|
|
|
this.context.register(RedisAutoConfiguration.class,
|
|
|
|
PropertyPlaceholderAutoConfiguration.class);
|
|
|
|
PropertyPlaceholderAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
assertEquals("foo", this.context.getBean(JedisConnectionFactory.class)
|
|
|
|
assertEquals("foo", this.context.getBean(JedisConnectionFactory.class)
|
|
|
|
.getHostName());
|
|
|
|
.getHostName());
|
|
|
|
|
|
|
|
assertEquals(1, this.context.getBean(JedisConnectionFactory.class).getDatabase());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|