|
|
@ -25,6 +25,7 @@ import org.springframework.boot.actuate.env.EnvironmentEndpoint;
|
|
|
|
import org.springframework.boot.actuate.env.EnvironmentEndpoint.EnvironmentDescriptor;
|
|
|
|
import org.springframework.boot.actuate.env.EnvironmentEndpoint.EnvironmentDescriptor;
|
|
|
|
import org.springframework.boot.actuate.env.EnvironmentEndpoint.PropertySourceDescriptor;
|
|
|
|
import org.springframework.boot.actuate.env.EnvironmentEndpoint.PropertySourceDescriptor;
|
|
|
|
import org.springframework.boot.actuate.env.EnvironmentEndpoint.PropertyValueDescriptor;
|
|
|
|
import org.springframework.boot.actuate.env.EnvironmentEndpoint.PropertyValueDescriptor;
|
|
|
|
|
|
|
|
import org.springframework.boot.actuate.env.EnvironmentEndpointWebExtension;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
|
|
|
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
|
|
|
|
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
|
|
|
|
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
|
|
|
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
|
|
@ -93,6 +94,15 @@ class EnvironmentEndpointAutoConfigurationTests {
|
|
|
|
.run(validateSystemProperties("******", "******"));
|
|
|
|
.run(validateSystemProperties("******", "******"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
void runWhenOnlyExposedOverJmxShouldHaveEndpointBeanWithoutWebExtension() {
|
|
|
|
|
|
|
|
this.contextRunner
|
|
|
|
|
|
|
|
.withPropertyValues("management.endpoints.web.exposure.include=info", "spring.jmx.enabled=true",
|
|
|
|
|
|
|
|
"management.endpoints.jmx.exposure.include=env")
|
|
|
|
|
|
|
|
.run((context) -> assertThat(context).hasSingleBean(EnvironmentEndpoint.class)
|
|
|
|
|
|
|
|
.doesNotHaveBean(EnvironmentEndpointWebExtension.class));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ContextConsumer<AssertableApplicationContext> validateSystemProperties(String dbPassword, String apiKey) {
|
|
|
|
private ContextConsumer<AssertableApplicationContext> validateSystemProperties(String dbPassword, String apiKey) {
|
|
|
|
return (context) -> {
|
|
|
|
return (context) -> {
|
|
|
|
assertThat(context).hasSingleBean(EnvironmentEndpoint.class);
|
|
|
|
assertThat(context).hasSingleBean(EnvironmentEndpoint.class);
|
|
|
|