mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
Align test for spring.data.mongodb.autoIndexCreation with new default
Closes gh-28481
This commit is contained in:
parent
10f0017d69
commit
2462f67be4
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -147,13 +147,21 @@ class MongoDataAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void customAutoIndexCreation() {
|
||||
this.contextRunner.withPropertyValues("spring.data.mongodb.autoIndexCreation:false").run((context) -> {
|
||||
void defaultAutoIndexCreation() {
|
||||
this.contextRunner.run((context) -> {
|
||||
MongoMappingContext mappingContext = context.getBean(MongoMappingContext.class);
|
||||
assertThat(mappingContext.isAutoIndexCreation()).isFalse();
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void customAutoIndexCreation() {
|
||||
this.contextRunner.withPropertyValues("spring.data.mongodb.autoIndexCreation:true").run((context) -> {
|
||||
MongoMappingContext mappingContext = context.getBean(MongoMappingContext.class);
|
||||
assertThat(mappingContext.isAutoIndexCreation()).isTrue();
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void interfaceFieldNamingStrategy() {
|
||||
this.contextRunner
|
||||
|
Loading…
Reference in New Issue
Block a user