Add missing TestPropertyValues 'apply' calls

Update a few usages of `TestPropertyValues` so that `apply` is called
consistently.
pull/9641/merge
Phillip Webb 7 years ago
parent e1602fe59a
commit fd1dfbb247

@ -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();

@ -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

@ -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(

@ -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();

@ -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);

@ -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,

@ -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,

Loading…
Cancel
Save