Apply TestPropertyValues to the context under test

Closes gh-9367
pull/9370/head
Andy Wilkinson 8 years ago
parent 2a3d7611ba
commit a9cecc860c

@ -64,8 +64,7 @@ public class MixedNeo4jRepositoriesAutoConfigurationTests {
@Test @Test
public void testDefaultRepositoryConfiguration() throws Exception { public void testDefaultRepositoryConfiguration() throws Exception {
TestPropertyValues.of( TestPropertyValues.of("spring.datasource.initialize:false").applyTo(this.context);
"spring.datasource.initialize:false").applyTo(this.context);
this.context.register(TestConfiguration.class, BaseConfiguration.class); this.context.register(TestConfiguration.class, BaseConfiguration.class);
this.context.refresh(); this.context.refresh();
assertThat(this.context.getBean(CountryRepository.class)).isNotNull(); assertThat(this.context.getBean(CountryRepository.class)).isNotNull();
@ -73,8 +72,7 @@ public class MixedNeo4jRepositoriesAutoConfigurationTests {
@Test @Test
public void testMixedRepositoryConfiguration() throws Exception { public void testMixedRepositoryConfiguration() throws Exception {
TestPropertyValues.of( TestPropertyValues.of("spring.datasource.initialize:false").applyTo(this.context);
"spring.datasource.initialize:false");
this.context.register(MixedConfiguration.class, BaseConfiguration.class); this.context.register(MixedConfiguration.class, BaseConfiguration.class);
this.context.refresh(); this.context.refresh();
assertThat(this.context.getBean(CountryRepository.class)).isNotNull(); assertThat(this.context.getBean(CountryRepository.class)).isNotNull();
@ -83,8 +81,7 @@ public class MixedNeo4jRepositoriesAutoConfigurationTests {
@Test @Test
public void testJpaRepositoryConfigurationWithNeo4jTemplate() throws Exception { public void testJpaRepositoryConfigurationWithNeo4jTemplate() throws Exception {
TestPropertyValues.of( TestPropertyValues.of("spring.datasource.initialize:false").applyTo(this.context);
"spring.datasource.initialize:false").applyTo(this.context);
this.context.register(JpaConfiguration.class, BaseConfiguration.class); this.context.register(JpaConfiguration.class, BaseConfiguration.class);
this.context.refresh(); this.context.refresh();
assertThat(this.context.getBean(CityRepository.class)).isNotNull(); assertThat(this.context.getBean(CityRepository.class)).isNotNull();
@ -93,8 +90,7 @@ public class MixedNeo4jRepositoriesAutoConfigurationTests {
@Test @Test
@Ignore @Ignore
public void testJpaRepositoryConfigurationWithNeo4jOverlap() throws Exception { public void testJpaRepositoryConfigurationWithNeo4jOverlap() throws Exception {
TestPropertyValues.of( TestPropertyValues.of("spring.datasource.initialize:false").applyTo(this.context);
"spring.datasource.initialize:false").applyTo(this.context);
this.context.register(OverlapConfiguration.class, BaseConfiguration.class); this.context.register(OverlapConfiguration.class, BaseConfiguration.class);
this.context.refresh(); this.context.refresh();
assertThat(this.context.getBean(CityRepository.class)).isNotNull(); assertThat(this.context.getBean(CityRepository.class)).isNotNull();
@ -103,9 +99,10 @@ public class MixedNeo4jRepositoriesAutoConfigurationTests {
@Test @Test
public void testJpaRepositoryConfigurationWithNeo4jOverlapDisabled() public void testJpaRepositoryConfigurationWithNeo4jOverlapDisabled()
throws Exception { throws Exception {
TestPropertyValues.of( TestPropertyValues
"spring.datasource.initialize:false", .of("spring.datasource.initialize:false",
"spring.data.neo4j.repositories.enabled:false").applyTo(this.context); "spring.data.neo4j.repositories.enabled:false")
.applyTo(this.context);
this.context.register(OverlapConfiguration.class, BaseConfiguration.class); this.context.register(OverlapConfiguration.class, BaseConfiguration.class);
this.context.refresh(); this.context.refresh();
assertThat(this.context.getBean(CityRepository.class)).isNotNull(); assertThat(this.context.getBean(CityRepository.class)).isNotNull();

Loading…
Cancel
Save