Formatting

This commit is contained in:
Phillip Webb
2016-10-03 22:19:35 -07:00
parent 39ed0d4dfb
commit 3326841a97
23 changed files with 82 additions and 77 deletions

View File

@@ -183,14 +183,15 @@ public class EndpointWebMvcManagementContextConfiguration {
AnnotatedTypeMetadata metadata) {
Environment environment = context.getEnvironment();
String config = environment.resolvePlaceholders("${logging.file:}");
ConditionMessage.Builder message = ConditionMessage
.forCondition("Log File");
ConditionMessage.Builder message = ConditionMessage.forCondition("Log File");
if (StringUtils.hasText(config)) {
return ConditionOutcome.match(message.found("logging.file").items(config));
return ConditionOutcome
.match(message.found("logging.file").items(config));
}
config = environment.resolvePlaceholders("${logging.path:}");
if (StringUtils.hasText(config)) {
return ConditionOutcome.match(message.found("logging.path").items(config));
return ConditionOutcome
.match(message.found("logging.path").items(config));
}
config = new RelaxedPropertyResolver(environment, "endpoints.logfile.")
.getProperty("external-file");

View File

@@ -98,7 +98,8 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
MongoDataAutoConfiguration.class, RabbitAutoConfiguration.class,
RedisAutoConfiguration.class, SolrAutoConfiguration.class })
@EnableConfigurationProperties({ HealthIndicatorProperties.class })
@Import({ ElasticsearchHealthIndicatorConfiguration.ElasticsearchClientHealthIndicatorConfiguration.class,
@Import({
ElasticsearchHealthIndicatorConfiguration.ElasticsearchClientHealthIndicatorConfiguration.class,
ElasticsearchHealthIndicatorConfiguration.ElasticsearchJestHealthIndicatorConfiguration.class })
public class HealthIndicatorAutoConfiguration {

View File

@@ -34,7 +34,6 @@ public class InfoContributorProperties {
return this.git;
}
public static class Git {
/**

View File

@@ -98,8 +98,7 @@ public class JolokiaAutoConfiguration {
public ConditionOutcome getMatchOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) {
boolean endpointsEnabled = isEnabled(context, "endpoints.", true);
ConditionMessage.Builder message = ConditionMessage
.forCondition("Jolokia");
ConditionMessage.Builder message = ConditionMessage.forCondition("Jolokia");
if (isEnabled(context, "endpoints.jolokia.", endpointsEnabled)) {
return ConditionOutcome.match(message.because("enabled"));
}

View File

@@ -398,9 +398,9 @@ public class HealthIndicatorAutoConfigurationTests {
EnvironmentTestUtils.addEnvironment(this.context,
"spring.data.elasticsearch.properties.path.home:target",
"management.health.diskspace.enabled:false");
this.context.register(JestClientConfiguration.class,
JestAutoConfiguration.class, ElasticsearchAutoConfiguration.class,
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class,
ElasticsearchAutoConfiguration.class, ManagementServerProperties.class,
HealthIndicatorAutoConfiguration.class);
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
@@ -414,9 +414,8 @@ public class HealthIndicatorAutoConfigurationTests {
public void elasticsearchJestHealthIndicator() {
EnvironmentTestUtils.addEnvironment(this.context,
"management.health.diskspace.enabled:false");
this.context.register(JestClientConfiguration.class,
JestAutoConfiguration.class, ManagementServerProperties.class,
HealthIndicatorAutoConfiguration.class);
this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class,
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
@@ -432,9 +431,9 @@ public class HealthIndicatorAutoConfigurationTests {
"management.health.elasticsearch.enabled:false",
"spring.data.elasticsearch.properties.path.home:target",
"management.health.diskspace.enabled:false");
this.context.register(JestClientConfiguration.class,
JestAutoConfiguration.class, ElasticsearchAutoConfiguration.class,
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class,
ElasticsearchAutoConfiguration.class, ManagementServerProperties.class,
HealthIndicatorAutoConfiguration.class);
this.context.refresh();
Map<String, HealthIndicator> beans = this.context

View File

@@ -73,8 +73,8 @@ public class AuthorizationAuditListenerTests {
@Test
public void testDetailsAreIncludedInAuditEvent() throws Exception {
Object details = new Object();
UsernamePasswordAuthenticationToken authentication =
new UsernamePasswordAuthenticationToken("user", "password");
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"user", "password");
authentication.setDetails(details);
this.listener.onApplicationEvent(new AuthorizationFailureEvent(this,
Arrays.<ConfigAttribute>asList(new SecurityConfig("USER")),