From 038ad079718f9ef2a780000df470abacc650668d Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Wed, 5 Aug 2020 22:27:44 +0900 Subject: [PATCH] Polish --- ...aSourceHealthContributorAutoConfigurationTests.java | 10 +++++----- .../web/format/WebConversionServiceTests.java | 6 +++--- .../src/docs/asciidoc/production-ready-features.adoc | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfigurationTests.java index 094e4d7e0e4d..c921d0cea364 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfigurationTests.java @@ -74,7 +74,7 @@ void runWhenMultipleDataSourceBeansShouldCreateCompositeIndicator() { @Test void runWithRoutingAndEmbeddedDataSourceShouldIncludeRoutingDataSource() { - this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, RoutingDatasourceConfig.class) + this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, RoutingDataSourceConfig.class) .run((context) -> { CompositeHealthContributor composite = context.getBean(CompositeHealthContributor.class); assertThat(composite.getContributor("dataSource")).isInstanceOf(DataSourceHealthIndicator.class); @@ -85,7 +85,7 @@ void runWithRoutingAndEmbeddedDataSourceShouldIncludeRoutingDataSource() { @Test void runWithRoutingAndEmbeddedDataSourceShouldNotIncludeRoutingDataSourceWhenIgnored() { - this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, RoutingDatasourceConfig.class) + this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, RoutingDataSourceConfig.class) .withPropertyValues("management.health.db.ignore-routing-datasources:true").run((context) -> { assertThat(context).doesNotHaveBean(CompositeHealthContributor.class); assertThat(context).hasSingleBean(DataSourceHealthIndicator.class); @@ -95,13 +95,13 @@ void runWithRoutingAndEmbeddedDataSourceShouldNotIncludeRoutingDataSourceWhenIgn @Test void runWithOnlyRoutingDataSourceShouldIncludeRoutingDataSource() { - this.contextRunner.withUserConfiguration(RoutingDatasourceConfig.class) + this.contextRunner.withUserConfiguration(RoutingDataSourceConfig.class) .run((context) -> assertThat(context).hasSingleBean(RoutingDataSourceHealthIndicator.class)); } @Test void runWithOnlyRoutingDataSourceShouldCrashWhenIgnored() { - this.contextRunner.withUserConfiguration(RoutingDatasourceConfig.class) + this.contextRunner.withUserConfiguration(RoutingDataSourceConfig.class) .withPropertyValues("management.health.db.ignore-routing-datasources:true") .run((context) -> assertThat(context).hasFailed().getFailure() .hasRootCauseInstanceOf(IllegalArgumentException.class)); @@ -140,7 +140,7 @@ DataSource testDataSource() { } @Configuration(proxyBeanMethods = false) - static class RoutingDatasourceConfig { + static class RoutingDataSourceConfig { @Bean AbstractRoutingDataSource routingDataSource() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/format/WebConversionServiceTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/format/WebConversionServiceTests.java index d248c1669bdb..dd6d51c340b4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/format/WebConversionServiceTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/format/WebConversionServiceTests.java @@ -138,10 +138,10 @@ void hyphenatedIsoOffsetDateTimeFormat() { private void isoOffsetDateTimeFormat(DateTimeFormatters formatters) { WebConversionService conversionService = new WebConversionService(formatters); - OffsetDateTime offsetdate = OffsetDateTime.of(LocalDate.of(2020, 4, 26), LocalTime.of(12, 45, 23), + OffsetDateTime offsetDateTime = OffsetDateTime.of(LocalDate.of(2020, 4, 26), LocalTime.of(12, 45, 23), ZoneOffset.ofHoursMinutes(1, 30)); - assertThat(conversionService.convert(offsetdate, String.class)) - .isEqualTo(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(offsetdate)); + assertThat(conversionService.convert(offsetDateTime, String.class)) + .isEqualTo(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(offsetDateTime)); } @Test diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc index 06ddff640aec..6c86289ef4b8 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc @@ -2127,7 +2127,7 @@ To register custom metrics, inject `MeterRegistry` into your component, as shown include::{code-examples}/actuate/metrics/MetricsMeterRegistryInjectionExample.java[tag=component] ---- -If you metrics depend on other beans, it is recommend that you use a `MeterBinder` to register them, as shown in the following example: +If your metrics depend on other beans, it is recommended that you use a `MeterBinder` to register them, as shown in the following example: [source,java,indent=0] ---- @@ -2136,7 +2136,7 @@ include::{code-examples}/actuate/metrics/SampleMeterBinderConfiguration.java[tag Using a `MeterBinder` ensures that the correct dependency relationships are set up and that the bean is available when the metric's value is retrieved. By default, metrics from all `MeterBinder` beans will be automatically bound to the Spring-managed `MeterRegistry`. -A `MeterBinder` implementation can also be useful if you find that you repeatedly instrument a suite of metrics across components or applications.. +A `MeterBinder` implementation can also be useful if you find that you repeatedly instrument a suite of metrics across components or applications.