Use mongodb consistently in property names

Closes gh-47050
This commit is contained in:
Andy Wilkinson
2025-09-05 15:07:52 +01:00
parent 08c42701d9
commit ab9feff7fa
9 changed files with 36 additions and 12 deletions
@@ -41,7 +41,7 @@ import org.springframework.data.mongodb.core.MongoTemplate;
MongoAutoConfiguration.class })
@ConditionalOnClass({ MongoTemplate.class, MongoHealthIndicator.class, ConditionalOnEnabledHealthIndicator.class })
@ConditionalOnBean(MongoTemplate.class)
@ConditionalOnEnabledHealthIndicator("mongo")
@ConditionalOnEnabledHealthIndicator("mongodb")
public final class MongoHealthContributorAutoConfiguration
extends CompositeHealthContributorConfiguration<MongoHealthIndicator, MongoTemplate> {
@@ -43,7 +43,7 @@ import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
@ConditionalOnClass({ ReactiveMongoTemplate.class, Flux.class, MongoReactiveHealthIndicator.class,
ConditionalOnEnabledHealthIndicator.class })
@ConditionalOnBean(ReactiveMongoTemplate.class)
@ConditionalOnEnabledHealthIndicator("mongo")
@ConditionalOnEnabledHealthIndicator("mongodb")
public final class MongoReactiveHealthContributorAutoConfiguration
extends CompositeReactiveHealthContributorConfiguration<MongoReactiveHealthIndicator, ReactiveMongoTemplate> {
@@ -1,7 +1,15 @@
{
"properties": [
{
{
"name": "management.health.mongo.enabled",
"deprecation": {
"level": "error",
"replacement": "management.health.mongodb.enabled",
"since": "4.0.0"
}
},
{
"name": "management.health.mongodb.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable MongoDB health check.",
"defaultValue": true
@@ -45,7 +45,7 @@ class MongoHealthContributorAutoConfigurationTests {
@Test
void runWhenDisabledShouldNotCreateIndicator() {
this.contextRunner.withPropertyValues("management.health.mongo.enabled:false")
this.contextRunner.withPropertyValues("management.health.mongodb.enabled:false")
.run((context) -> assertThat(context).doesNotHaveBean(MongoHealthIndicator.class));
}
@@ -58,7 +58,7 @@ class MongoReactiveHealthContributorAutoConfigurationTests {
@Test
void runWhenDisabledShouldNotCreateIndicator() {
this.contextRunner.withPropertyValues("management.health.mongo.enabled:false")
this.contextRunner.withPropertyValues("management.health.mongodb.enabled:false")
.run((context) -> assertThat(context).doesNotHaveBean(MongoReactiveHealthIndicator.class)
.doesNotHaveBean("mongoHealthContributor"));
}