This commit is contained in:
Phillip Webb
2019-04-11 13:39:26 -07:00
parent dabe75a281
commit 2dfd916c96
34 changed files with 517 additions and 451 deletions

View File

@@ -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));
}

View File

@@ -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));
}

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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) {