From 3b5ecbd066675c62be7f02d6f7c29f209544121c Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Thu, 7 Apr 2016 18:45:47 +0900 Subject: [PATCH] Polish Closes gh-5627 --- .../OnEnabledEndpointElementCondition.java | 2 +- .../OnEnabledInfoContributorCondition.java | 2 +- .../springframework/boot/actuate/health/Health.java | 12 ++++++------ .../org/springframework/boot/actuate/info/Info.java | 12 ++++++------ .../InfoContributorAutoConfigurationTests.java | 12 ++++++------ .../boot/actuate/endpoint/InfoEndpointTests.java | 2 +- .../actuate/endpoint/mvc/InfoMvcEndpointTests.java | 2 +- ... InfoMvcEndpointWithNoInfoContributorsTests.java} | 6 +++--- .../mvc/JolokiaMvcEndpointContextPathTests.java | 2 ++ .../autoconfigure/ImportAutoConfigurationTests.java | 2 +- .../asciidoc/appendix-application-properties.adoc | 4 ++-- .../boot/bind/PropertySourcesBinder.java | 2 +- 12 files changed, 31 insertions(+), 29 deletions(-) rename spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/{InfoMvcEndpointWithoutAnyInfoProvidersTests.java => InfoMvcEndpointWithNoInfoContributorsTests.java} (94%) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEnabledEndpointElementCondition.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEnabledEndpointElementCondition.java index a3ec1f35ab..06931de70f 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEnabledEndpointElementCondition.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEnabledEndpointElementCondition.java @@ -24,7 +24,7 @@ import org.springframework.core.annotation.AnnotationAttributes; import org.springframework.core.type.AnnotatedTypeMetadata; /** - * Base endpoint element condition. An element can be disabled globally via the `defaults` + * Base endpoint element condition. An element can be disabled globally via the {@code defaults} * name or individually via the name of the element. * * @author Stephane Nicoll diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEnabledInfoContributorCondition.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEnabledInfoContributorCondition.java index ca4c15f250..b934121c4e 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEnabledInfoContributorCondition.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/OnEnabledInfoContributorCondition.java @@ -19,7 +19,7 @@ package org.springframework.boot.actuate.autoconfigure; import org.springframework.context.annotation.Condition; /** - * {@link Condition} that checks if a info indicator is enabled. + * {@link Condition} that checks if an info indicator is enabled. * * @author Stephane Nicoll */ diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java index 290c3711a0..9d6b0ab6f1 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 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. @@ -219,15 +219,15 @@ public final class Health { } /** - * Record detail using {@code key} and {@code value}. + * Record detail using given {@code key} and {@code value}. * @param key the detail key - * @param data the detail data + * @param value the detail value * @return this {@link Builder} instance */ - public Builder withDetail(String key, Object data) { + public Builder withDetail(String key, Object value) { Assert.notNull(key, "Key must not be null"); - Assert.notNull(data, "Data must not be null"); - this.details.put(key, data); + Assert.notNull(value, "Value must not be null"); + this.details.put(key, value); return this; } diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java index ef6e019ed6..d8267c065e 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; /** * Carries information of the application. *

- * Each detail element can be singular or a hierarchical object such as a pojo or a nested + * Each detail element can be singular or a hierarchical object such as a POJO or a nested * Map. * * @author Meang Akira Tanaka @@ -100,13 +100,13 @@ public final class Info { } /** - * Record detail using {@code key} and {@code value}. + * Record detail using given {@code key} and {@code value}. * @param key the detail key - * @param data the detail data + * @param value the detail value * @return this {@link Builder} instance */ - public Builder withDetail(String key, Object data) { - this.content.put(key, data); + public Builder withDetail(String key, Object value) { + this.content.put(key, value); return this; } @@ -122,7 +122,7 @@ public final class Info { } /** - * Create a new {@link Info} instance base on the state of this builder. + * Create a new {@link Info} instance based on the state of this builder. * @return a new {@link Info} instance */ public Info build() { diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/InfoContributorAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/InfoContributorAutoConfigurationTests.java index a05fcfd324..a99ddf0069 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/InfoContributorAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/InfoContributorAutoConfigurationTests.java @@ -69,7 +69,7 @@ public class InfoContributorAutoConfigurationTests { @Test public void defaultInfoContributorsDisabledWithCustomOne() { - load(CustomInfoProviderConfiguration.class, + load(CustomInfoContributorConfiguration.class, "management.info.defaults.enabled:false"); Map beans = this.context .getBeansOfType(InfoContributor.class); @@ -108,7 +108,7 @@ public class InfoContributorAutoConfigurationTests { @Test public void customGitInfoContributor() { - load(CustomGitInfoProviderConfiguration.class); + load(CustomGitInfoContributorConfiguration.class); assertThat(this.context.getBean(GitInfoContributor.class)) .isSameAs(this.context.getBean("customGitInfoContributor")); } @@ -143,7 +143,7 @@ public class InfoContributorAutoConfigurationTests { @Test public void customBuildInfoContributor() { - load(CustomBuildInfoProviderConfiguration.class); + load(CustomBuildInfoContributorConfiguration.class); assertThat(this.context.getBean(BuildInfoContributor.class)) .isSameAs(this.context.getBean("customBuildInfoContributor")); } @@ -198,7 +198,7 @@ public class InfoContributorAutoConfigurationTests { } @Configuration - static class CustomInfoProviderConfiguration { + static class CustomInfoContributorConfiguration { @Bean public InfoContributor customInfoContributor() { @@ -212,7 +212,7 @@ public class InfoContributorAutoConfigurationTests { } @Configuration - static class CustomGitInfoProviderConfiguration { + static class CustomGitInfoContributorConfiguration { @Bean public GitInfoContributor customGitInfoContributor() { @@ -222,7 +222,7 @@ public class InfoContributorAutoConfigurationTests { } @Configuration - static class CustomBuildInfoProviderConfiguration { + static class CustomBuildInfoContributorConfiguration { @Bean public BuildInfoContributor customBuildInfoContributor() { diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/InfoEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/InfoEndpointTests.java index 29306e73dd..b76a74061d 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/InfoEndpointTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/InfoEndpointTests.java @@ -52,7 +52,7 @@ public class InfoEndpointTests extends AbstractEndpointTests { public static class Config { @Bean - public InfoContributor infoProvider() { + public InfoContributor infoContributor() { return new InfoContributor() { @Override diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointTests.java index 3921715372..c51ae0b736 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointTests.java @@ -49,7 +49,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** - * Tests for {@link InfoMvcEndpointTests} + * Tests for {@link InfoEndpoint} with {@link MockMvc}. * * @author Meang Akira Tanaka * @author Stephane Nicoll diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointWithoutAnyInfoProvidersTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointWithNoInfoContributorsTests.java similarity index 94% rename from spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointWithoutAnyInfoProvidersTests.java rename to spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointWithNoInfoContributorsTests.java index c19c2e7d96..35e019fb63 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointWithoutAnyInfoProvidersTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointWithNoInfoContributorsTests.java @@ -43,13 +43,14 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** - * Tests for {@link InfoMvcEndpointWithoutAnyInfoProvidersTests} + * Tests for {@link InfoEndpoint} with {@link MockMvc} when there are no + * {@link InfoContributor InfoContributors}. * * @author Meang Akira Tanaka */ @RunWith(SpringRunner.class) @SpringBootTest -public class InfoMvcEndpointWithoutAnyInfoProvidersTests { +public class InfoMvcEndpointWithNoInfoContributorsTests { @Autowired private WebApplicationContext context; @@ -58,7 +59,6 @@ public class InfoMvcEndpointWithoutAnyInfoProvidersTests { @Before public void setUp() { - this.context.getBean(InfoEndpoint.class).setEnabled(true); this.mvc = MockMvcBuilders.webAppContextSetup(this.context).build(); } diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpointContextPathTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpointContextPathTests.java index 085e36ecee..a0a5e8c22e 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpointContextPathTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpointContextPathTests.java @@ -49,6 +49,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** + * Tests for {@link JolokiaMvcEndpoint} with a custom management context path. + * * @author Christian Dupuis * @author Dave Syer */ diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationTests.java index 59cf0c0af0..af4c26e174 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ImportAutoConfigurationTests.java @@ -30,7 +30,7 @@ import org.springframework.util.ClassUtils; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link ImportAutoConfigurationTests}. + * Tests for {@link ImportAutoConfiguration}. * * @author Phillip Webb */ diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 20f9b7d7a1..1c1cce0c3b 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -969,12 +969,12 @@ content into your application; rather pick only the properties that you need. # INFO CONTRIBUTORS management.info.build.enabled=true # Enable build info. management.info.build.mode=simple # Mode to use to expose build information. - management.info.defaults.enabled=true # Enable default health indicators. + management.info.defaults.enabled=true # Enable default info contributors. management.info.env.enabled=true # Enable environment info. management.info.git.enabled=true # Enable git info. management.info.git.mode=simple # Mode to use to expose git information. - # TRACING (({sc-spring-boot-actuator}/trace/TraceProperties.{sc-ext}[TraceProperties]) + # TRACING ({sc-spring-boot-actuator}/trace/TraceProperties.{sc-ext}[TraceProperties]) management.trace.include=request-headers,response-headers,errors # Items to be included in the trace. # REMOTE SHELL diff --git a/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesBinder.java b/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesBinder.java index 7186b38fe4..c23bbd248d 100644 --- a/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesBinder.java +++ b/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesBinder.java @@ -83,7 +83,7 @@ public class PropertySourcesBinder { /** * Extract the keys using the specified {@code prefix}. The prefix won't be included. *

- * Any key that starts with the {@code prefix} will be included + * Any key that starts with the {@code prefix} will be included. * @param prefix the prefix to use * @return the keys matching the prefix */