Merge pull request #11805 from izeye:polish-20180127

* pr/11805:
  Polish
pull/11809/merge
Stephane Nicoll 7 years ago
commit 6830ad7892

@ -124,7 +124,7 @@ public class WebEndpointAutoConfiguration {
}
@Bean
public ExposeExcludePropertyEndpointFilter<ExposableWebEndpoint> webIncludeExcludePropertyEndpointFilter() {
public ExposeExcludePropertyEndpointFilter<ExposableWebEndpoint> webExposeExcludePropertyEndpointFilter() {
Set<String> expose = this.properties.getExpose();
Set<String> exclude = this.properties.getExclude();
return new ExposeExcludePropertyEndpointFilter<>(ExposableWebEndpoint.class,
@ -132,7 +132,7 @@ public class WebEndpointAutoConfiguration {
}
@Bean
public ExposeExcludePropertyEndpointFilter<ExposableControllerEndpoint> controllerIncludeExcludePropertyEndpointFilter() {
public ExposeExcludePropertyEndpointFilter<ExposableControllerEndpoint> controllerExposeExcludePropertyEndpointFilter() {
Set<String> expose = this.properties.getExpose();
Set<String> exclude = this.properties.getExclude();
return new ExposeExcludePropertyEndpointFilter<>(

@ -82,8 +82,8 @@ public class WebEndpointAutoConfigurationTests {
public void webApplicationConfiguresExposeExcludePropertyEndpointFilter() {
this.contextRunner.run((context) -> assertThat(context)
.getBeans(ExposeExcludePropertyEndpointFilter.class)
.containsKeys("webIncludeExcludePropertyEndpointFilter",
"controllerIncludeExcludePropertyEndpointFilter"));
.containsKeys("webExposeExcludePropertyEndpointFilter",
"controllerExposeExcludePropertyEndpointFilter"));
}
@Test

@ -32,7 +32,6 @@ import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoCon
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebApplicationContext;
import org.springframework.security.authentication.TestingAuthenticationToken;
@ -75,7 +74,6 @@ public class ControllerEndpointWebFluxIntegrationTests {
ReactiveManagementContextAutoConfiguration.class,
AuditAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class,
WebFluxAutoConfiguration.class, ManagementContextAutoConfiguration.class,
AuditAutoConfiguration.class, DispatcherServletAutoConfiguration.class,
BeansEndpointAutoConfiguration.class })
static class DefaultConfiguration {

@ -108,7 +108,7 @@ public class ControllerEndpointWebMvcIntegrationTests {
WebEndpointAutoConfiguration.class,
ServletManagementContextAutoConfiguration.class, AuditAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class, WebMvcAutoConfiguration.class,
ManagementContextAutoConfiguration.class, AuditAutoConfiguration.class,
ManagementContextAutoConfiguration.class,
DispatcherServletAutoConfiguration.class,
BeansEndpointAutoConfiguration.class })
static class DefaultConfiguration {

@ -52,7 +52,7 @@ public abstract class AbstractDiscoveredEndpoint<O extends Operation>
Collection<? extends O> operations) {
super(id, enabledByDefault, operations);
Assert.notNull(discoverer, "Discoverer must not be null");
Assert.notNull(discoverer, "EndpointBean must not be null");
Assert.notNull(endpointBean, "EndpointBean must not be null");
this.discoverer = discoverer;
this.endpointBean = endpointBean;
}

@ -273,10 +273,10 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
/**
* Determine if an endpoint bean should be exposed. Subclasses can override this
* method to provide additional logic.
* @param extensionBean the extension bean
* @return {@code true} if the extension is exposed
* @param endpointBean the endpoint bean
* @return {@code true} if the endpoint is exposed
*/
protected boolean isEndpointExposed(Object extensionBean) {
protected boolean isEndpointExposed(Object endpointBean) {
return true;
}

@ -61,7 +61,7 @@ import org.springframework.web.util.DefaultUriBuilderFactory;
*/
public class ControllerEndpointHandlerMappingIntegrationTests {
public ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(
private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(
AnnotationConfigReactiveWebServerApplicationContext::new)
.withUserConfiguration(EndpointConfiguration.class,
ExampleWebFluxEndpoint.class);

@ -60,7 +60,7 @@ import org.springframework.web.util.DefaultUriBuilderFactory;
*/
public class ControllerEndpointHandlerMappingIntegrationTests {
public WebApplicationContextRunner contextRunner = new WebApplicationContextRunner(
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner(
AnnotationConfigServletWebServerApplicationContext::new)
.withUserConfiguration(EndpointConfiguration.class,
ExampleMvcEndpoint.class);

@ -33,7 +33,7 @@ public class RabbitMetricsTests {
@Test
public void connectionFactoryIsInstrumented() {
ConnectionFactory connectionFactory = mockConnectionFactory();
ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
SimpleMeterRegistry registry = new SimpleMeterRegistry();
new RabbitMetrics(connectionFactory, "rabbit", null).bindTo(registry);
registry.get("rabbit.connections");
@ -41,7 +41,7 @@ public class RabbitMetricsTests {
@Test
public void connectionFactoryWithTagsIsInstrumented() {
ConnectionFactory connectionFactory = mockConnectionFactory();
ConnectionFactory connectionFactory = mock(ConnectionFactory.class);
SimpleMeterRegistry registry = new SimpleMeterRegistry();
new RabbitMetrics(connectionFactory, "test", Tags.of("env", "prod"))
.bindTo(registry);
@ -50,8 +50,4 @@ public class RabbitMetricsTests {
assertThat(registry.find("test.connections").tags("env", "dev").meter()).isNull();
}
private ConnectionFactory mockConnectionFactory() {
return mock(ConnectionFactory.class);
}
}

@ -193,7 +193,7 @@ public abstract class AbstractErrorWebExceptionHandler
Date timestamp = (Date) error.get("timestamp");
builder.append("<html><body><h1>Whitelabel Error Page</h1>")
.append("<p>This application has no configured error view, so you are seeing this as a fallback.</p>")
.append("<div id='created'>").append(timestamp.toString())
.append("<div id='created'>").append(timestamp)
.append("</div>").append("<div>There was an unexpected error (type=")
.append(htmlEscape(error.get("error"))).append(", status=")
.append(htmlEscape(error.get("status"))).append(").</div>");

@ -1365,8 +1365,8 @@ content into your application. Rather, pick only the properties that you need.
management.metrics.export.statsd.polling-frequency=10s # How often gauges will be polled. When a gauge is polled, its value is recalculated and if the value has changed, it is sent to the StatsD server.
management.metrics.export.statsd.port=8125 # Port of the StatsD server to receive exported metrics.
management.metrics.export.statsd.queue-size=2147483647 # Maximum size of the queue of items waiting to be sent to the StatsD server.
management.metrics.jdbc.metric-name=data.source # Name of the metric for data source usage.
management.metrics.jdbc.instrument=true # Instrument all available data sources.
management.metrics.jdbc.metric-name=data.source # Name of the metric for data source usage.
management.metrics.rabbitmq.instrument=true # Instrument all available connection factories.
management.metrics.rabbitmq.metric-name=rabbitmq # Name of the metric for RabbitMQ usage.
management.metrics.use-global-registry=true # Whether auto-configured MeterRegistry implementations should be bound to the global static registry on Metrics.

@ -2140,7 +2140,7 @@ one and mark its `@Bean` as `@FlywayDataSource`. If you do so and want two data
remember to create another one and mark it as `@Primary`. Alternatively, you can use
Flyway's native `DataSource` by setting `spring.flyway.[url,user,password]`
in external properties. Setting either `spring.flyway.url` or `spring.flyway.user`
is sufficent to cause Flyway to use its own `DataSource`. If any of the three
is sufficient to cause Flyway to use its own `DataSource`. If any of the three
properties has not be set, the value of its equivalent `spring.datasource` property will
be used.
@ -2179,7 +2179,7 @@ mark its `@Bean` as `@LiquibaseDataSource`. If you do so and you want two data s
remember to create another one and mark it as `@Primary`. Alternatively, you can use
Liquibase's native `DataSource` by setting `spring.liquibase.[url,user,password]` in
external properties. Setting either `spring.liquibase.url` or `spring.liquibase.user`
is sufficent to cause Liquibase to use its own `DataSource`. If any of the three
is sufficient to cause Liquibase to use its own `DataSource`. If any of the three
properties has not be set, the value of its equivalent `spring.datasource` property will
be used.

@ -66,6 +66,7 @@ public interface SpringApplicationRunListener {
* {@link CommandLineRunner CommandLineRunners} and {@link ApplicationRunner
* ApplicationRunners} have not been called.
* @param context the application context.
* @since 2.0.0
*/
void started(ConfigurableApplicationContext context);

Loading…
Cancel
Save