Skip to content

Commit 07ed7ab

Browse files
committed
Merge branch '2.4.x' into 2.5.x
Closes gh-28482
2 parents ae93bb3 + 2462f67 commit 07ed7ab

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,21 @@ void customFieldNamingStrategy() {
147147
}
148148

149149
@Test
150-
void customAutoIndexCreation() {
151-
this.contextRunner.withPropertyValues("spring.data.mongodb.autoIndexCreation:false").run((context) -> {
150+
void defaultAutoIndexCreation() {
151+
this.contextRunner.run((context) -> {
152152
MongoMappingContext mappingContext = context.getBean(MongoMappingContext.class);
153153
assertThat(mappingContext.isAutoIndexCreation()).isFalse();
154154
});
155155
}
156156

157+
@Test
158+
void customAutoIndexCreation() {
159+
this.contextRunner.withPropertyValues("spring.data.mongodb.autoIndexCreation:true").run((context) -> {
160+
MongoMappingContext mappingContext = context.getBean(MongoMappingContext.class);
161+
assertThat(mappingContext.isAutoIndexCreation()).isTrue();
162+
});
163+
}
164+
157165
@Test
158166
void interfaceFieldNamingStrategy() {
159167
this.contextRunner

0 commit comments

Comments
 (0)