From 169a46b1aa27acbd88c7d336dac0b2221afdda76 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 1 Sep 2014 09:24:29 -0700 Subject: [PATCH] Rename MetricDataSourceAutoConfiguration Rename MetricDataSourceAutoConfiguration to DataSourceMetricsAutoConfiguration --- ...ration.java => DataSourceMetricsAutoConfiguration.java} | 2 +- .../boot/actuate/endpoint/DataSourcePublicMetrics.java | 2 +- .../src/main/resources/META-INF/spring.factories | 2 +- ...s.java => DataSourceMetricsAutoConfigurationTests.java} | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) rename spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/{MetricDataSourceAutoConfiguration.java => DataSourceMetricsAutoConfiguration.java} (97%) rename spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/{MetricDataSourceAutoConfigurationTests.java => DataSourceMetricsAutoConfigurationTests.java} (97%) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricDataSourceAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/DataSourceMetricsAutoConfiguration.java similarity index 97% rename from spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricDataSourceAutoConfiguration.java rename to spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/DataSourceMetricsAutoConfiguration.java index 0d2289ccaf..3489150b56 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricDataSourceAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/DataSourceMetricsAutoConfiguration.java @@ -39,7 +39,7 @@ import org.springframework.context.annotation.Import; @ConditionalOnBean(DataSource.class) @AutoConfigureAfter(DataSourceAutoConfiguration.class) @Import(DataSourceMetadataProvidersConfiguration.class) -public class MetricDataSourceAutoConfiguration { +public class DataSourceMetricsAutoConfiguration { @Bean @ConditionalOnBean(DataSourceMetadataProvider.class) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/DataSourcePublicMetrics.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/DataSourcePublicMetrics.java index 5511c441c1..f386836427 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/DataSourcePublicMetrics.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/DataSourcePublicMetrics.java @@ -119,7 +119,7 @@ public class DataSourcePublicMetrics implements PublicMetrics { } /** - * Specify if the given value ends with {@value #DATASOURCE_SUFFIX}. + * Specify if the given value ends with {@code dataSource}. */ protected boolean endWithDataSource(String value) { int suffixLength = DATASOURCE_SUFFIX.length(); diff --git a/spring-boot-actuator/src/main/resources/META-INF/spring.factories b/spring-boot-actuator/src/main/resources/META-INF/spring.factories index fc55c4cee0..aa77fbc180 100644 --- a/spring-boot-actuator/src/main/resources/META-INF/spring.factories +++ b/spring-boot-actuator/src/main/resources/META-INF/spring.factories @@ -1,6 +1,7 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ org.springframework.boot.actuate.autoconfigure.AuditAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration,\ +org.springframework.boot.actuate.autoconfigure.DataSourceMetricsAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.EndpointMBeanExportAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration,\ @@ -8,7 +9,6 @@ org.springframework.boot.actuate.autoconfigure.HealthIndicatorAutoConfiguration, org.springframework.boot.actuate.autoconfigure.JolokiaAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.ManagementSecurityAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration,\ -org.springframework.boot.actuate.autoconfigure.MetricDataSourceAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.TraceRepositoryAutoConfiguration,\ diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/MetricDataSourceAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/DataSourceMetricsAutoConfigurationTests.java similarity index 97% rename from spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/MetricDataSourceAutoConfigurationTests.java rename to spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/DataSourceMetricsAutoConfigurationTests.java index eb981a3207..54999b3b7e 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/MetricDataSourceAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/DataSourceMetricsAutoConfigurationTests.java @@ -46,9 +46,11 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** + * Tests for {@link DataSourceMetricsAutoConfiguration}. + * * @author Stephane Nicoll */ -public class MetricDataSourceAutoConfigurationTests { +public class DataSourceMetricsAutoConfigurationTests { private AnnotationConfigApplicationContext context; @@ -134,7 +136,7 @@ public class MetricDataSourceAutoConfigurationTests { if (config.length > 0) { this.context.register(config); } - this.context.register(MetricDataSourceAutoConfiguration.class); + this.context.register(DataSourceMetricsAutoConfiguration.class); this.context.refresh(); } @@ -193,4 +195,5 @@ public class MetricDataSourceAutoConfigurationTests { return DataSourceBuilder.create().driverClassName("org.hsqldb.jdbc.JDBCDriver") .url("jdbc:hsqldb:mem:test").username("sa"); } + }