Commit a9cecc86 authored by Andy Wilkinson's avatar Andy Wilkinson

Apply TestPropertyValues to the context under test

Closes gh-9367
parent 2a3d7611
...@@ -64,8 +64,7 @@ public class MixedNeo4jRepositoriesAutoConfigurationTests { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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();
......
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