Skip to content

Commit bf6f9b4

Browse files
committed
Polish "Add property for mongo auto-index creation"
See gh-16454
1 parent 2e9005d commit bf6f9b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class MongoProperties {
9292
private Class<?> fieldNamingStrategy;
9393

9494
/**
95-
* Enables/disables auto-index creation.
95+
* Whether to enable auto-index creation.
9696
*/
9797
private Boolean autoIndexCreation;
9898

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ public void customFieldNamingStrategy() {
135135
@Test
136136
public void customAutoIndexCreation() {
137137
this.contextRunner
138-
.withPropertyValues("spring.data.mongodb.autoIndexCreation:true")
138+
.withPropertyValues("spring.data.mongodb.autoIndexCreation:false")
139139
.run((context) -> {
140140
MongoMappingContext mappingContext = context
141141
.getBean(MongoMappingContext.class);
142142
assertThat(mappingContext.isAutoIndexCreation())
143-
.isEqualTo(Boolean.TRUE);
143+
.isEqualTo(Boolean.FALSE);
144144
});
145145
}
146146

0 commit comments

Comments
 (0)