See gh-28836
pull/28902/head
izeye 3 years ago committed by Stephane Nicoll
parent 88aa849f90
commit c7921468fc

@ -69,7 +69,7 @@ public abstract class OnEndpointElementCondition extends SpringBootCondition {
} }
/** /**
* Return the default outcome that should be used if not property is set. By default * Return the default outcome that should be used if property is not set. By default
* this method will use the {@code <prefix>.defaults.enabled} property, matching if it * this method will use the {@code <prefix>.defaults.enabled} property, matching if it
* is {@code true} or if it is not configured. * is {@code true} or if it is not configured.
* @param context the condition context * @param context the condition context

@ -76,12 +76,10 @@ class InfoContributorAutoConfigurationTests {
@Test @Test
void defaultInfoContributorsDisabledWithCustomOne() { void defaultInfoContributorsDisabledWithCustomOne() {
this.contextRunner.withPropertyValues("management.info.defaults.enabled=false") this.contextRunner.withUserConfiguration(CustomInfoContributorConfiguration.class).run((context) -> {
.withUserConfiguration(CustomInfoContributorConfiguration.class).run((context) -> { assertThat(context).hasSingleBean(InfoContributor.class);
assertThat(context).hasSingleBean(InfoContributor.class); assertThat(context.getBean(InfoContributor.class)).isSameAs(context.getBean("customInfoContributor"));
assertThat(context.getBean(InfoContributor.class)) });
.isSameAs(context.getBean("customInfoContributor"));
});
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")

@ -1147,7 +1147,7 @@ When appropriate, Spring auto-configures the following `InfoContributor` beans:
[cols="1,4,8,4"] [cols="1,4,8,4"]
|=== |===
| ID | Name | Description | Prequisites | ID | Name | Description | Prerequisites
| `build` | `build`
| {spring-boot-actuator-module-code}/info/BuildInfoContributor.java[`BuildInfoContributor`] | {spring-boot-actuator-module-code}/info/BuildInfoContributor.java[`BuildInfoContributor`]
@ -1174,7 +1174,7 @@ When appropriate, Spring auto-configures the following `InfoContributor` beans:
Whether or not an individual contributor is enabled is controlled by its `management.info.<id>.enabled` property. Whether or not an individual contributor is enabled is controlled by its `management.info.<id>.enabled` property.
Different contributors have different defaults for this property, depending on their prerequisites and the nature of the information that they expose. Different contributors have different defaults for this property, depending on their prerequisites and the nature of the information that they expose.
With no prequisites to indicate that they should be enabled, the `env` and `java` contributors are disabled by default. With no prerequisites to indicate that they should be enabled, the `env` and `java` contributors are disabled by default.
You can enable them by setting the configprop:management.info.env.enabled[] or configprop:management.info.java.enabled[] properties to `true`. You can enable them by setting the configprop:management.info.env.enabled[] or configprop:management.info.java.enabled[] properties to `true`.
The `build` and `git` info contributors are enabled by default. The `build` and `git` info contributors are enabled by default.

@ -81,7 +81,7 @@ public class JavaInfo {
} }
/** /**
* Information about the Java Virtual Machine) the application is running in. * Information about the Java Virtual Machine the application is running in.
*/ */
public static class JavaVirtualMachineInfo { public static class JavaVirtualMachineInfo {

Loading…
Cancel
Save