Polish
This commit is contained in:
@@ -103,13 +103,11 @@ public class ReactiveCloudFoundryActuatorAutoConfiguration {
|
||||
public CloudFoundryInfoEndpointWebExtension cloudFoundryInfoEndpointWebExtension(
|
||||
GitProperties properties, ObjectProvider<InfoContributor> infoContributors) {
|
||||
List<InfoContributor> contributors = infoContributors.orderedStream()
|
||||
.map((infoContributor) -> {
|
||||
if (infoContributor instanceof GitInfoContributor) {
|
||||
return new GitInfoContributor(properties,
|
||||
InfoPropertiesInfoContributor.Mode.FULL);
|
||||
}
|
||||
return infoContributor;
|
||||
}).collect(Collectors.toList());
|
||||
.map((infoContributor) -> (infoContributor instanceof GitInfoContributor)
|
||||
? new GitInfoContributor(properties,
|
||||
InfoPropertiesInfoContributor.Mode.FULL)
|
||||
: infoContributor)
|
||||
.collect(Collectors.toList());
|
||||
return new CloudFoundryInfoEndpointWebExtension(new InfoEndpoint(contributors));
|
||||
}
|
||||
|
||||
|
||||
@@ -104,13 +104,11 @@ public class CloudFoundryActuatorAutoConfiguration {
|
||||
public CloudFoundryInfoEndpointWebExtension cloudFoundryInfoEndpointWebExtension(
|
||||
GitProperties properties, ObjectProvider<InfoContributor> infoContributors) {
|
||||
List<InfoContributor> contributors = infoContributors.orderedStream()
|
||||
.map((infoContributor) -> {
|
||||
if (infoContributor instanceof GitInfoContributor) {
|
||||
return new GitInfoContributor(properties,
|
||||
InfoPropertiesInfoContributor.Mode.FULL);
|
||||
}
|
||||
return infoContributor;
|
||||
}).collect(Collectors.toList());
|
||||
.map((infoContributor) -> (infoContributor instanceof GitInfoContributor)
|
||||
? new GitInfoContributor(properties,
|
||||
InfoPropertiesInfoContributor.Mode.FULL)
|
||||
: infoContributor)
|
||||
.collect(Collectors.toList());
|
||||
return new CloudFoundryInfoEndpointWebExtension(new InfoEndpoint(contributors));
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.log.LogMessage;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to Prometheus.
|
||||
@@ -142,7 +143,7 @@ public class PrometheusMetricsExportAutoConfiguration {
|
||||
return new PushGateway(new URL(url));
|
||||
}
|
||||
catch (MalformedURLException ex) {
|
||||
logger.warn(String.format(
|
||||
logger.warn(LogMessage.format(
|
||||
"Invalid PushGateway base url '%s': update your configuration to a valid URL",
|
||||
url));
|
||||
return new PushGateway(url);
|
||||
|
||||
@@ -157,8 +157,8 @@ public class ManagementContextAutoConfiguration {
|
||||
AbstractApplicationContext context = (AbstractApplicationContext) this.applicationContext;
|
||||
List<BeanFactoryPostProcessor> postProcessors = context
|
||||
.getBeanFactoryPostProcessors();
|
||||
return postProcessors.stream().anyMatch((
|
||||
postProcessor) -> postProcessor instanceof LazyInitializationBeanFactoryPostProcessor);
|
||||
return postProcessors.stream().anyMatch(
|
||||
LazyInitializationBeanFactoryPostProcessor.class::isInstance);
|
||||
}
|
||||
|
||||
private void setClassLoaderIfPossible(ConfigurableApplicationContext child) {
|
||||
|
||||
@@ -56,7 +56,6 @@ public class ManagementContextAutoConfigurationTests {
|
||||
contextRunner.withPropertyValues("server.port=0", "management.server.port=0").run(
|
||||
(context) -> assertThat(tomcatStartedOccurencesIn(this.output.toString()))
|
||||
.isEqualTo(2));
|
||||
|
||||
}
|
||||
|
||||
private int tomcatStartedOccurencesIn(String output) {
|
||||
|
||||
Reference in New Issue
Block a user