Polish "Add property for mongo auto-index creation"

See gh-16454
This commit is contained in:
Madhura Bhave 2019-04-15 16:52:44 -07:00
parent 2e9005de14
commit bf6f9b4c43
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ public class MongoProperties {
private Class<?> fieldNamingStrategy;
/**
* Enables/disables auto-index creation.
* Whether to enable auto-index creation.
*/
private Boolean autoIndexCreation;

View File

@ -135,12 +135,12 @@ public class MongoDataAutoConfigurationTests {
@Test
public void customAutoIndexCreation() {
this.contextRunner
.withPropertyValues("spring.data.mongodb.autoIndexCreation:true")
.withPropertyValues("spring.data.mongodb.autoIndexCreation:false")
.run((context) -> {
MongoMappingContext mappingContext = context
.getBean(MongoMappingContext.class);
assertThat(mappingContext.isAutoIndexCreation())
.isEqualTo(Boolean.TRUE);
.isEqualTo(Boolean.FALSE);
});
}