Browse Source

Polish

pull/12008/head
Phillip Webb 8 years ago
parent
commit
0348889fd7
  1. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointProperties.java
  2. 6
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicMetricsExportAutoConfiguration.java
  3. 1
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/InvocationContext.java
  4. 2
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizer.java
  5. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointRunners.java
  6. 3
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfiguration.java
  7. 22
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBeanCreationFailureAnalyzer.java
  8. 3
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java
  9. 2
      spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
  10. 7
      spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java
  11. 2
      spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/CorsSampleActuatorApplicationTests.java

1
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointProperties.java

@ -82,7 +82,6 @@ public class JmxEndpointProperties { @@ -82,7 +82,6 @@ public class JmxEndpointProperties {
return this.staticNames;
}
public static class Exposure {
/**

6
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicMetricsExportAutoConfiguration.java

@ -47,12 +47,6 @@ import org.springframework.context.annotation.Configuration; @@ -47,12 +47,6 @@ import org.springframework.context.annotation.Configuration;
@EnableConfigurationProperties(NewRelicProperties.class)
public class NewRelicMetricsExportAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public Clock micrometerClock() {
return Clock.SYSTEM;
}
@Bean
@ConditionalOnMissingBean
public NewRelicConfig newRelicConfig(NewRelicProperties props) {

1
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/InvocationContext.java

@ -36,7 +36,6 @@ public class InvocationContext { @@ -36,7 +36,6 @@ public class InvocationContext {
/**
* Creates a new context for an operation being invoked by the given {@code principal}
* with the given available {@code arguments}.
*
* @param principal the principal invoking the operation. May be {@code null}
* @param arguments the arguments available to the operation. Never {@code null}
*/

2
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizer.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointRunners.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

3
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfiguration.java

@ -48,7 +48,8 @@ import org.springframework.data.mongodb.core.convert.MongoConverter; @@ -48,7 +48,8 @@ import org.springframework.data.mongodb.core.convert.MongoConverter;
@Configuration
@ConditionalOnClass({ MongoClient.class, ReactiveMongoTemplate.class })
@EnableConfigurationProperties(MongoProperties.class)
@AutoConfigureAfter({ MongoReactiveAutoConfiguration.class, MongoDataAutoConfiguration.class })
@AutoConfigureAfter({ MongoReactiveAutoConfiguration.class,
MongoDataAutoConfiguration.class })
public class MongoReactiveDataAutoConfiguration {
private final MongoProperties properties;

22
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBeanCreationFailureAnalyzer.java

@ -51,17 +51,24 @@ class DataSourceBeanCreationFailureAnalyzer @@ -51,17 +51,24 @@ class DataSourceBeanCreationFailureAnalyzer
}
private FailureAnalysis getFailureAnalysis(DataSourceBeanCreationException cause) {
String description = getDescription(cause);
String action = getAction(cause);
return new FailureAnalysis(description, action, cause);
}
private String getDescription(DataSourceBeanCreationException cause) {
StringBuilder description = new StringBuilder();
boolean datasourceUrlSpecified = this.environment.containsProperty(
"spring.datasource.url");
description.append("Failed to auto-configure a DataSource: ");
if (!datasourceUrlSpecified) {
if (!this.environment.containsProperty("spring.datasource.url")) {
description.append("'spring.datasource.url' is not specified and ");
}
description.append(String.format(
"no embedded datasource could be auto-configured.%n"));
description.append(
String.format("no embedded datasource could be auto-configured.%n"));
description.append(String.format("%nReason: %s%n", cause.getMessage()));
return description.toString();
}
private String getAction(DataSourceBeanCreationException cause) {
StringBuilder action = new StringBuilder();
action.append(String.format("Consider the following:%n"));
if (EmbeddedDatabaseConnection.NONE == cause.getConnection()) {
@ -69,11 +76,12 @@ class DataSourceBeanCreationFailureAnalyzer @@ -69,11 +76,12 @@ class DataSourceBeanCreationFailureAnalyzer
+ "Derby), please put it on the classpath.%n"));
}
else {
action.append(String.format("\tReview the configuration of %s%n.", cause.getConnection()));
action.append(String.format("\tReview the configuration of %s%n.",
cause.getConnection()));
}
action.append("\tIf you have database settings to be loaded from a particular "
+ "profile you may need to activate it").append(getActiveProfiles());
return new FailureAnalysis(description.toString(), action.toString(), cause);
return action.toString();
}
private String getActiveProfiles() {

3
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java

@ -47,8 +47,7 @@ import org.springframework.util.StringUtils; @@ -47,8 +47,7 @@ import org.springframework.util.StringUtils;
* @since 1.1.0
*/
@ConfigurationProperties(prefix = "spring.datasource")
public class DataSourceProperties
implements BeanClassLoaderAware, InitializingBean {
public class DataSourceProperties implements BeanClassLoaderAware, InitializingBean {
private ClassLoader classLoader;

2
spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

@ -5990,6 +5990,8 @@ TIP: Do not forget to add `@RunWith(SpringRunner.class)` to your test. Otherwise @@ -5990,6 +5990,8 @@ TIP: Do not forget to add `@RunWith(SpringRunner.class)` to your test. Otherwise
annotations are ignored.
[[boot-features-testing-spring-boot-applications-detecting-web-app-type]]
==== Detecting Web Application Type
If Spring MVC is available, a regular MVC-based application context is configured. If you
have only Spring WebFlux, we'll detect that and configure a WebFlux-based application

7
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java

@ -125,9 +125,10 @@ public class TestRestTemplate { @@ -125,9 +125,10 @@ public class TestRestTemplate {
* @param httpClientOptions client options to use if the Apache HTTP Client is used
* @since 2.0.0
*/
public TestRestTemplate(RestTemplateBuilder restTemplateBuilder, String username, String password,
HttpClientOption... httpClientOptions) {
this(buildRestTemplate(restTemplateBuilder), username, password, httpClientOptions);
public TestRestTemplate(RestTemplateBuilder restTemplateBuilder, String username,
String password, HttpClientOption... httpClientOptions) {
this(buildRestTemplate(restTemplateBuilder), username, password,
httpClientOptions);
}
private TestRestTemplate(RestTemplate restTemplate, String username, String password,

2
spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/CorsSampleActuatorApplicationTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

Loading…
Cancel
Save