diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfigurationTests.java index 3e133911dc..b03474e5c7 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfigurationTests.java @@ -84,7 +84,8 @@ public class MongoDataAutoConfigurationTests { @Test public void gridFsTemplateExists() { this.context = new AnnotationConfigApplicationContext(); - TestPropertyValues.of("spring.data.mongodb.gridFsDatabase:grid"); + TestPropertyValues.of("spring.data.mongodb.gridFsDatabase:grid") + .applyTo(this.context); this.context.register(PropertyPlaceholderAutoConfiguration.class, MongoAutoConfiguration.class, MongoDataAutoConfiguration.class); this.context.refresh(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java index 3339ebe92e..46dd5cf92f 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java @@ -53,7 +53,7 @@ public class TomcatDataSourceConfigurationTests { @Before public void init() { - TestPropertyValues.of(PREFIX + "initialize:false"); + TestPropertyValues.of(PREFIX + "initialize:false").applyTo(this.context); } @After diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/SitePreferenceAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/SitePreferenceAutoConfigurationTests.java index bcb98957bb..233b018af4 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/SitePreferenceAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mobile/SitePreferenceAutoConfigurationTests.java @@ -67,7 +67,8 @@ public class SitePreferenceAutoConfigurationTests { @Test public void sitePreferenceHandlerInterceptorEnabled() throws Exception { this.context = new AnnotationConfigWebApplicationContext(); - TestPropertyValues.of("spring.mobile.sitepreference.enabled:true"); + TestPropertyValues.of("spring.mobile.sitepreference.enabled:true") + .applyTo(this.context); this.context.register(SitePreferenceAutoConfiguration.class); this.context.refresh(); assertThat(this.context.getBean(SitePreferenceHandlerInterceptor.class)) @@ -97,7 +98,8 @@ public class SitePreferenceAutoConfigurationTests { @Test public void sitePreferenceMethodArgumentResolverEnabled() throws Exception { this.context = new AnnotationConfigWebApplicationContext(); - TestPropertyValues.of("spring.mobile.sitepreference.enabled:true"); + TestPropertyValues.of("spring.mobile.sitepreference.enabled:true") + .applyTo(this.context); this.context.register(SitePreferenceAutoConfiguration.class); this.context.refresh(); assertThat( diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfigurationTests.java index ea4e43df09..d6ca492d5e 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoAutoConfigurationTests.java @@ -60,7 +60,7 @@ public class MongoAutoConfigurationTests { @Test public void optionsAdded() { this.context = new AnnotationConfigApplicationContext(); - TestPropertyValues.of("spring.data.mongodb.host:localhost"); + TestPropertyValues.of("spring.data.mongodb.host:localhost").applyTo(this.context); this.context.register(OptionsConfig.class, PropertyPlaceholderAutoConfiguration.class, MongoAutoConfiguration.class); this.context.refresh(); @@ -71,7 +71,8 @@ public class MongoAutoConfigurationTests { @Test public void optionsAddedButNoHost() { this.context = new AnnotationConfigApplicationContext(); - TestPropertyValues.of("spring.data.mongodb.uri:mongodb://localhost/test"); + TestPropertyValues.of("spring.data.mongodb.uri:mongodb://localhost/test") + .applyTo(this.context); this.context.register(OptionsConfig.class, PropertyPlaceholderAutoConfiguration.class, MongoAutoConfiguration.class); this.context.refresh(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java index fb59dbf910..cacf312377 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java @@ -78,7 +78,8 @@ public class MongoReactiveAutoConfigurationTests { @Test public void optionsAddedButNoHost() { this.context = new AnnotationConfigApplicationContext(); - TestPropertyValues.of("spring.data.mongodb.uri:mongodb://localhost/test"); + TestPropertyValues.of("spring.data.mongodb.uri:mongodb://localhost/test") + .applyTo(this.context); this.context.register(OptionsConfig.class, PropertyPlaceholderAutoConfiguration.class, MongoReactiveAutoConfiguration.class); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java index f911370d0a..4599d426ad 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java @@ -84,7 +84,7 @@ public class CustomHibernateJpaAutoConfigurationTests { @Test public void testDefaultDdlAutoForEmbedded() throws Exception { - TestPropertyValues.of("spring.datasource.initialize:false"); + TestPropertyValues.of("spring.datasource.initialize:false").applyTo(this.context); this.context.register(TestConfiguration.class, EmbeddedDataSourceConfiguration.class, PropertyPlaceholderAutoConfiguration.class, diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java index 37fa34c611..22024413df 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java @@ -162,7 +162,7 @@ public class SecurityAutoConfigurationTests { this.context.setServletContext(new MockServletContext()); this.context.register(SecurityAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); - TestPropertyValues.of("security.basic.enabled:false"); + TestPropertyValues.of("security.basic.enabled:false").applyTo(this.context); this.context.refresh(); // Ignores and the "matches-none" filter only assertThat(this.context.getBeanNamesForType(FilterChainProxy.class).length) @@ -277,8 +277,8 @@ public class SecurityAutoConfigurationTests { public void testJpaCoexistsHappily() throws Exception { this.context = new AnnotationConfigWebApplicationContext(); this.context.setServletContext(new MockServletContext()); - TestPropertyValues.of("spring.datasource.url:jdbc:hsqldb:mem:testsecdb"); - TestPropertyValues.of("spring.datasource.initialize:false"); + TestPropertyValues.of("spring.datasource.url:jdbc:hsqldb:mem:testsecdb", + "spring.datasource.initialize:false").applyTo(this.context); this.context.register(EntityConfiguration.class, PropertyPlaceholderAutoConfiguration.class, DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,