pull/9544/head
Andy Wilkinson 8 years ago
parent cbae31364f
commit 2ffe480490

@ -53,8 +53,8 @@ public class InfluxDbAutoConfiguration {
if (Strings.isNullOrEmpty(this.properties.getUser())) { if (Strings.isNullOrEmpty(this.properties.getUser())) {
return InfluxDBFactory.connect(this.properties.getUrl()); return InfluxDBFactory.connect(this.properties.getUrl());
} }
return InfluxDBFactory.connect(this.properties.getUrl(), this.properties.getUser(), return InfluxDBFactory.connect(this.properties.getUrl(),
this.properties.getPassword()); this.properties.getUser(), this.properties.getPassword());
} }
} }

@ -91,12 +91,10 @@ public class MixedNeo4jRepositoriesAutoConfigurationTests {
assertThat(this.context.getBean(CityRepository.class)).isNotNull(); assertThat(this.context.getBean(CityRepository.class)).isNotNull();
} }
private void load(Class config, String... environment) { private void load(Class<?> config, String... environment) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
TestPropertyValues.of(environment) TestPropertyValues.of(environment).and("spring.datasource.initialize", "false")
.and("spring.datasource.initialize", "false") .and("spring.data.neo4j.uri", "http://localhost:8989").applyTo(ctx);
.and("spring.data.neo4j.uri", "http://localhost:8989")
.applyTo(ctx);
ctx.register(config); ctx.register(config);
ctx.register(DataSourceAutoConfiguration.class, ctx.register(DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class, HibernateJpaAutoConfiguration.class,

@ -86,7 +86,8 @@ public class RedisAutoConfigurationTests {
@Test @Test
public void testCustomizeRedisConfiguration() { public void testCustomizeRedisConfiguration() {
load(CustomConfiguration.class); load(CustomConfiguration.class);
LettuceConnectionFactory cf = this.context.getBean(LettuceConnectionFactory.class); LettuceConnectionFactory cf = this.context
.getBean(LettuceConnectionFactory.class);
assertThat(cf.isUseSsl()).isTrue(); assertThat(cf.isUseSsl()).isTrue();
} }

@ -50,8 +50,7 @@ public class InfluxDbAutoConfigurationTests {
@Test @Test
public void influxDbCanBeCustomized() { public void influxDbCanBeCustomized() {
load("spring.influx.url=http://localhost", load("spring.influx.url=http://localhost", "spring.influx.password:password",
"spring.influx.password:password",
"spring.influx.user:user"); "spring.influx.user:user");
assertThat(this.context.getBeansOfType(InfluxDB.class)).hasSize(1); assertThat(this.context.getBeansOfType(InfluxDB.class)).hasSize(1);
} }

Loading…
Cancel
Save