mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-02 23:39:34 +00:00
Use mongodb consistently in property names
Closes gh-47050
This commit is contained in:
+2
-2
@@ -996,7 +996,7 @@ To disable the auto-configured command metrics, set the following property:
|
||||
----
|
||||
management:
|
||||
metrics:
|
||||
mongo:
|
||||
mongodb:
|
||||
command:
|
||||
enabled: false
|
||||
----
|
||||
@@ -1035,7 +1035,7 @@ To disable the auto-configured connection pool metrics, set the following proper
|
||||
----
|
||||
management:
|
||||
metrics:
|
||||
mongo:
|
||||
mongodb:
|
||||
connectionpool:
|
||||
enabled: false
|
||||
----
|
||||
|
||||
+1
-1
@@ -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> {
|
||||
|
||||
|
||||
+1
-1
@@ -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> {
|
||||
|
||||
|
||||
+9
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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"));
|
||||
}
|
||||
|
||||
+2
-2
@@ -49,7 +49,7 @@ import org.springframework.context.annotation.Bean;
|
||||
public final class MongoMetricsAutoConfiguration {
|
||||
|
||||
@ConditionalOnClass(MongoMetricsCommandListener.class)
|
||||
@ConditionalOnBooleanProperty(name = "management.metrics.mongo.command.enabled", matchIfMissing = true)
|
||||
@ConditionalOnBooleanProperty(name = "management.metrics.mongodb.command.enabled", matchIfMissing = true)
|
||||
static class MongoCommandMetricsConfiguration {
|
||||
|
||||
@Bean
|
||||
@@ -74,7 +74,7 @@ public final class MongoMetricsAutoConfiguration {
|
||||
}
|
||||
|
||||
@ConditionalOnClass(MongoMetricsConnectionPoolListener.class)
|
||||
@ConditionalOnBooleanProperty(name = "management.metrics.mongo.connectionpool.enabled", matchIfMissing = true)
|
||||
@ConditionalOnBooleanProperty(name = "management.metrics.mongodb.connectionpool.enabled", matchIfMissing = true)
|
||||
static class MongoConnectionPoolMetricsConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
+17
-1
@@ -3,11 +3,27 @@
|
||||
"properties": [
|
||||
{
|
||||
"name": "management.metrics.mongo.command.enabled",
|
||||
"deprecation": {
|
||||
"level": "error",
|
||||
"replacement": "management.metrics.mongodb.command.enabled",
|
||||
"since": "4.0.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "management.metrics.mongo.connectionpool.enabled",
|
||||
"deprecation": {
|
||||
"level": "error",
|
||||
"replacement": "management.metrics.mongodb.connectionpool.enabled",
|
||||
"since": "4.0.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "management.metrics.mongodb.command.enabled",
|
||||
"description": "Whether to enable Mongo client command metrics.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "management.metrics.mongo.connectionpool.enabled",
|
||||
"name": "management.metrics.mongodb.connectionpool.enabled",
|
||||
"description": "Whether to enable Mongo connection pool metrics.",
|
||||
"defaultValue": true
|
||||
},
|
||||
|
||||
+2
-2
@@ -152,7 +152,7 @@ class MongoMetricsAutoConfigurationTests {
|
||||
void whenMetricsCommandListenerEnabledPropertyFalseThenNoMetricsCommandListenerIsAdded() {
|
||||
this.contextRunner.withBean(SimpleMeterRegistry.class)
|
||||
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class))
|
||||
.withPropertyValues("management.metrics.mongo.command.enabled:false")
|
||||
.withPropertyValues("management.metrics.mongodb.command.enabled:false")
|
||||
.run(assertThatMetricsCommandListenerNotAdded());
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ class MongoMetricsAutoConfigurationTests {
|
||||
void whenMetricsConnectionPoolListenerEnabledPropertyFalseThenNoMetricsConnectionPoolListenerIsAdded() {
|
||||
this.contextRunner.withBean(SimpleMeterRegistry.class)
|
||||
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class))
|
||||
.withPropertyValues("management.metrics.mongo.connectionpool.enabled:false")
|
||||
.withPropertyValues("management.metrics.mongodb.connectionpool.enabled:false")
|
||||
.run(assertThatMetricsConnectionPoolListenerNotAdded());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user