From 54c0cf513bbb1871a058f281cee7d993bb77258d Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 17 Jan 2018 19:01:19 +0000 Subject: [PATCH] Polish --- .../CloudFoundryEndpointFilter.java | 1 - ...dryReactiveHealthEndpointWebExtension.java | 4 +- ...CloudFoundryActuatorAutoConfiguration.java | 3 +- ...CloudFoundryActuatorAutoConfiguration.java | 3 +- ...ndpointManagementContextConfiguration.java | 5 +- .../export/datadog/DatadogProperties.java | 8 +- .../DatadogPropertiesConfigAdapter.java | 8 +- .../export/influx/InfluxProperties.java | 6 +- .../influx/InfluxPropertiesConfigAdapter.java | 7 +- .../export/statsd/StatsdProperties.java | 6 +- .../security/reactive/EndpointRequest.java | 20 +++-- ...oseExcludePropertyEndpointFilterTests.java | 6 +- .../AbstractEndpointDocumentationTests.java | 2 +- .../LiquibaseEndpointDocumentationTests.java | 8 +- .../LoggersEndpointDocumentationTests.java | 3 +- .../MetricsEndpointDocumentationTests.java | 3 +- .../WebFluxEndpointCorsIntegrationTests.java | 84 ++++++++----------- ...FileWebEndpointAutoConfigurationTests.java | 5 +- ...DumpWebEndpointAutoConfigurationTests.java | 5 +- .../cache/CacheMetricsConfigurationTests.java | 15 ++-- ...RestTemplateMetricsConfigurationTests.java | 10 +-- .../reactive/EndpointRequestTests.java | 22 +++-- .../actuate/endpoint/jmx/EndpointMBean.java | 5 +- .../jmx/EndpointMBeanInfoAssembler.java | 5 +- .../endpoint/web/EndpointLinksResolver.java | 5 +- ...AbstractWebFluxEndpointHandlerMapping.java | 5 +- .../AbstractWebMvcEndpointHandlerMapping.java | 5 +- .../boot/actuate/metrics/MetricsEndpoint.java | 3 +- .../web/servlet/WebMvcMetricsFilterTests.java | 5 +- .../autoconfigure/gson/GsonProperties.java | 4 +- ...sonHttpMessageConvertersConfiguration.java | 5 +- .../session/SessionProperties.java | 5 +- .../web/embedded/jetty/JettyCustomizer.java | 19 ++--- .../web/embedded/tomcat/TomcatCustomizer.java | 22 ++--- .../embedded/undertow/UndertowCustomizer.java | 19 ++--- ...ultReactiveWebServerFactoryCustomizer.java | 5 +- .../AbstractErrorWebExceptionHandler.java | 3 +- .../error/DefaultErrorAttributes.java | 4 +- .../web/servlet/WebMvcAutoConfiguration.java | 23 ++--- .../web/servlet/WebMvcProperties.java | 25 +++--- .../WebSocketMessagingAutoConfiguration.java | 11 +-- .../cache/CacheAutoConfigurationTests.java | 6 +- ...ngoRepositoriesAutoConfigurationTests.java | 6 +- .../DataSourceInitializerInvokerTests.java | 5 +- .../MailSenderAutoConfigurationTests.java | 5 +- ...ConfigurationEarlyInitializationTests.java | 5 +- .../SessionAutoConfigurationTests.java | 26 +++--- ...activeWebServerFactoryCustomizerTests.java | 30 ++++--- ...activeWebServerAutoConfigurationTests.java | 7 +- ...orWebExceptionHandlerIntegrationTests.java | 3 +- .../servlet/WebMvcAutoConfigurationTests.java | 55 +++++++----- .../WelcomePageHandlerMappingTests.java | 5 +- ...SocketMessagingAutoConfigurationTests.java | 6 +- .../compiler/GenericBomAstTransformation.java | 6 +- .../UserServiceAutoConfiguration.java | 3 +- .../RandomPortWebTestClientExampleTests.java | 5 +- .../SimpleTwoDataSourcesExampleTests.java | 8 +- .../test/json/AbstractJsonMarshalTester.java | 5 +- .../web/client/TestRestTemplateTests.java | 5 +- ...gurationMetadataRepositoryJsonBuilder.java | 9 +- .../json/JSONArray.java | 4 +- .../json/JSONObject.java | 4 +- .../json/JSONStringer.java | 2 +- .../configurationprocessor/TypeUtils.java | 5 +- .../metadata/JsonMarshaller.java | 3 +- .../configurationprocessor/TestProject.java | 5 +- .../boot/gradle/plugin/JavaPluginAction.java | 1 + .../boot/loader/tools/TestJarFile.java | 5 +- .../boot/loader/util/SystemPropertyUtils.java | 6 +- .../data/RandomAccessDataFileTests.java | 8 +- .../context/properties/PropertyMapper.java | 6 +- .../boot/context/properties/bind/Binder.java | 6 +- .../bind/convert/DurationConverter.java | 8 +- ...cationContextServerWebExchangeMatcher.java | 8 +- .../jetty/JettyReactiveWebServerFactory.java | 4 +- .../jetty/JettyServletWebServerFactory.java | 5 +- .../TomcatReactiveWebServerFactory.java | 5 +- .../web/embedded/tomcat/TomcatWebServer.java | 4 +- .../UndertowCompressionConfigurer.java | 3 +- .../UndertowReactiveWebServerFactory.java | 17 ++-- .../UndertowServletWebServerFactory.java | 1 + .../embedded/undertow/UndertowWebServer.java | 5 +- ...igReactiveWebServerApplicationContext.java | 6 +- .../web/servlet/DynamicRegistrationBean.java | 4 +- .../ServletContextInitializerBeans.java | 4 +- ...figServletWebServerApplicationContext.java | 6 +- .../servlet/server/SessionStoreDirectory.java | 5 +- .../boot/ExitCodeGeneratorsTests.java | 5 +- .../bind/convert/DurationConverterTests.java | 5 +- ...erviceLocatorApplicationListenerTests.java | 7 +- ...nContextServerWebExchangeMatcherTests.java | 38 +++++---- ...AbstractReactiveWebServerFactoryTests.java | 81 ++++++++++-------- .../AbstractServletWebServerFactoryTests.java | 2 +- 93 files changed, 455 insertions(+), 435 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryEndpointFilter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryEndpointFilter.java index fb4d5ea4ca1..8572e084229 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryEndpointFilter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryEndpointFilter.java @@ -36,4 +36,3 @@ class CloudFoundryEndpointFilter implements EndpointFilter { } } - diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtension.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtension.java index 2cc5faf1806..fa029141d22 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtension.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryReactiveHealthEndpointWebExtension.java @@ -27,8 +27,8 @@ import org.springframework.boot.actuate.health.HealthEndpoint; import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension; /** - * Reactive {@link EndpointExtension} for the {@link HealthEndpoint} that always - * exposes full health details. + * Reactive {@link EndpointExtension} for the {@link HealthEndpoint} that always exposes + * full health details. * * @author Madhura Bhave * @since 2.0.0 diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfiguration.java index 14ba680f8a5..5b754994ad8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfiguration.java @@ -75,8 +75,7 @@ public class ReactiveCloudFoundryActuatorAutoConfiguration { @Bean @ConditionalOnMissingBean @ConditionalOnEnabledEndpoint - @ConditionalOnBean({ HealthEndpoint.class, - ReactiveHealthEndpointWebExtension.class }) + @ConditionalOnBean({ HealthEndpoint.class, ReactiveHealthEndpointWebExtension.class }) public CloudFoundryReactiveHealthEndpointWebExtension cloudFoundryReactiveHealthEndpointWebExtension( ReactiveHealthEndpointWebExtension reactiveHealthEndpointWebExtension) { return new CloudFoundryReactiveHealthEndpointWebExtension( diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java index 349e0cb8916..53aff3a958f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java @@ -60,7 +60,8 @@ import org.springframework.web.servlet.DispatcherServlet; */ @Configuration @ConditionalOnProperty(prefix = "management.cloudfoundry", name = "enabled", matchIfMissing = true) -@AutoConfigureAfter({ ServletManagementContextAutoConfiguration.class, HealthEndpointAutoConfiguration.class }) +@AutoConfigureAfter({ ServletManagementContextAutoConfiguration.class, + HealthEndpointAutoConfiguration.class }) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) @ConditionalOnClass(DispatcherServlet.class) @ConditionalOnBean(DispatcherServlet.class) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/reactive/WebFluxEndpointManagementContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/reactive/WebFluxEndpointManagementContextConfiguration.java index 5b2947dedca..2d463119e45 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/reactive/WebFluxEndpointManagementContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/reactive/WebFluxEndpointManagementContextConfiguration.java @@ -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. @@ -56,7 +56,8 @@ public class WebFluxEndpointManagementContextConfiguration { WebEndpointProperties webEndpointProperties) { return new WebFluxEndpointHandlerMapping( new EndpointMapping(webEndpointProperties.getBasePath()), - endpointDiscoverer.discoverEndpoints(), endpointMediaTypes, corsProperties.toCorsConfiguration()); + endpointDiscoverer.discoverEndpoints(), endpointMediaTypes, + corsProperties.toCorsConfiguration()); } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java index f8b3c74a980..c1600031bd0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java @@ -34,8 +34,8 @@ public class DatadogProperties extends StepRegistryProperties { private String apiKey; /** - * Datadog application key. Not strictly required, but improves the Datadog - * experience by sending meter descriptions, types, and base units to Datadog. + * Datadog application key. Not strictly required, but improves the Datadog experience + * by sending meter descriptions, types, and base units to Datadog. */ private String applicationKey; @@ -46,8 +46,8 @@ public class DatadogProperties extends StepRegistryProperties { private Boolean descriptions; /** - * Tag that will be mapped to "host" when shipping metrics to Datadog. Can be - * omitted if host should be omitted on publishing. + * Tag that will be mapped to "host" when shipping metrics to Datadog. Can be omitted + * if host should be omitted on publishing. */ private String hostTag; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogPropertiesConfigAdapter.java index 3e5b03c0520..36fb28c0d0a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogPropertiesConfigAdapter.java @@ -26,9 +26,8 @@ import org.springframework.boot.actuate.autoconfigure.metrics.export.StepRegistr * @author Jon Schneider * @author Phillip Webb */ -class DatadogPropertiesConfigAdapter - extends StepRegistryPropertiesConfigAdapter - implements DatadogConfig { +class DatadogPropertiesConfigAdapter extends + StepRegistryPropertiesConfigAdapter implements DatadogConfig { DatadogPropertiesConfigAdapter(DatadogProperties properties) { super(properties); @@ -41,7 +40,8 @@ class DatadogPropertiesConfigAdapter @Override public String applicationKey() { - return get(DatadogProperties::getApplicationKey, DatadogConfig.super::applicationKey); + return get(DatadogProperties::getApplicationKey, + DatadogConfig.super::applicationKey); } @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxProperties.java index c31e822e8d5..1bc883a544b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxProperties.java @@ -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. @@ -31,8 +31,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties; public class InfluxProperties extends StepRegistryProperties { /** - * Tag that will be mapped to "host" when shipping metrics to Influx. Can be - * omitted if host should be omitted on publishing. + * Tag that will be mapped to "host" when shipping metrics to Influx. Can be omitted + * if host should be omitted on publishing. */ private String db; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxPropertiesConfigAdapter.java index 5cb8ebd666e..1df1c3bbec4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxPropertiesConfigAdapter.java @@ -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. @@ -27,9 +27,8 @@ import org.springframework.boot.actuate.autoconfigure.metrics.export.StepRegistr * @author Jon Schneider * @author Phillip Webb */ -class InfluxPropertiesConfigAdapter - extends StepRegistryPropertiesConfigAdapter - implements InfluxConfig { +class InfluxPropertiesConfigAdapter extends + StepRegistryPropertiesConfigAdapter implements InfluxConfig { InfluxPropertiesConfigAdapter(InfluxProperties properties) { super(properties); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java index fe7b481efff..0c6f90b0b62 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java @@ -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. @@ -58,8 +58,8 @@ public class StatsdProperties { private Integer maxPacketLength = 1400; /** - * 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. + * 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. */ private Duration pollingFrequency = Duration.ofSeconds(10); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java index f81191ef627..b299794feae 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java @@ -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. @@ -39,8 +39,8 @@ import org.springframework.util.Assert; import org.springframework.web.server.ServerWebExchange; /** - * Factory that can be used to create a {@link ServerWebExchangeMatcher} for actuator endpoint - * locations. + * Factory that can be used to create a {@link ServerWebExchangeMatcher} for actuator + * endpoint locations. * * @author Madhura Bhave * @since 2.0.0 @@ -52,8 +52,9 @@ public final class EndpointRequest { /** * Returns a matcher that includes all {@link Endpoint actuator endpoints}. The - * {@link EndpointServerWebExchangeMatcher#excluding(Class...) excluding} method can be used to - * further remove specific endpoints if required. For example:
+	 * {@link EndpointServerWebExchangeMatcher#excluding(Class...) excluding} method can
+	 * be used to further remove specific endpoints if required. For example:
+	 * 
 	 * EndpointServerWebExchangeMatcher.toAnyEndpoint().excluding(ShutdownEndpoint.class)
 	 * 
* @return the configured {@link ServerWebExchangeMatcher} @@ -87,7 +88,8 @@ public final class EndpointRequest { } /** - * The {@link ServerWebExchangeMatcher} used to match against {@link Endpoint actuator endpoints}. + * The {@link ServerWebExchangeMatcher} used to match against {@link Endpoint actuator + * endpoints}. */ public final static class EndpointServerWebExchangeMatcher extends ApplicationContextServerWebExchangeMatcher { @@ -116,7 +118,8 @@ public final class EndpointRequest { this.excludes = Collections.emptyList(); } - private EndpointServerWebExchangeMatcher(List includes, List excludes) { + private EndpointServerWebExchangeMatcher(List includes, + List excludes) { super(EndpointPathProvider.class); this.includes = includes; this.excludes = excludes; @@ -167,7 +170,8 @@ public final class EndpointRequest { } private List getDelegateMatchers(Set paths) { - return paths.stream().map((path) -> new PathPatternParserServerWebExchangeMatcher(path + "/**")) + return paths.stream().map( + (path) -> new PathPatternParserServerWebExchangeMatcher(path + "/**")) .collect(Collectors.toList()); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilterTests.java index 88b3d8f5ae0..2e6bc26ad50 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilterTests.java @@ -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. @@ -74,7 +74,7 @@ public class ExposeExcludePropertyEndpointFilterTests { public void createWhenPrefixIsNullShouldThrowException() { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("Prefix must not be empty"); - new ExposeExcludePropertyEndpointFilter(TestEndpointDiscoverer.class, + new ExposeExcludePropertyEndpointFilter<>(TestEndpointDiscoverer.class, this.environment, null); } @@ -82,7 +82,7 @@ public class ExposeExcludePropertyEndpointFilterTests { public void createWhenPrefixIsEmptyShouldThrowException() { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("Prefix must not be empty"); - new ExposeExcludePropertyEndpointFilter(TestEndpointDiscoverer.class, + new ExposeExcludePropertyEndpointFilter<>(TestEndpointDiscoverer.class, this.environment, ""); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/AbstractEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/AbstractEndpointDocumentationTests.java index 97493d07f2d..0882fc8d645 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/AbstractEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/AbstractEndpointDocumentationTests.java @@ -113,7 +113,7 @@ public class AbstractEndpointDocumentationTests { @SuppressWarnings("unchecked") private Map select(Map candidates, Predicate filter) { - Map selected = new HashMap(); + Map selected = new HashMap<>(); candidates.entrySet().stream().filter((candidate) -> filter.test((T) candidate)) .limit(3) .forEach((entry) -> selected.put(entry.getKey(), entry.getValue())); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LiquibaseEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LiquibaseEndpointDocumentationTests.java index abaddf1a6fb..6ed2892e30d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LiquibaseEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LiquibaseEndpointDocumentationTests.java @@ -56,11 +56,9 @@ public class LiquibaseEndpointDocumentationTests responseFields( fieldWithPath("contexts") .description("Application contexts keyed by id"), - changeSetsField) - .andWithPrefix( - "contexts.*.liquibaseBeans.*.changeSets[].", - getChangeSetFieldDescriptors()) - .and(parentIdField()))); + changeSetsField).andWithPrefix( + "contexts.*.liquibaseBeans.*.changeSets[].", + getChangeSetFieldDescriptors()).and(parentIdField()))); } private List getChangeSetFieldDescriptors() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LoggersEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LoggersEndpointDocumentationTests.java index 08f6e48b00b..9d748a0bbd5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LoggersEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LoggersEndpointDocumentationTests.java @@ -48,8 +48,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Andy Wilkinson */ -public class LoggersEndpointDocumentationTests - extends MockMvcEndpointDocumentationTests { +public class LoggersEndpointDocumentationTests extends MockMvcEndpointDocumentationTests { private static final List levelFields = Arrays.asList( fieldWithPath("configuredLevel") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MetricsEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MetricsEndpointDocumentationTests.java index d242b91d14f..ca0ce123792 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MetricsEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MetricsEndpointDocumentationTests.java @@ -39,8 +39,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Andy Wilkinson */ -public class MetricsEndpointDocumentationTests - extends MockMvcEndpointDocumentationTests { +public class MetricsEndpointDocumentationTests extends MockMvcEndpointDocumentationTests { @Test public void metricNames() throws Exception { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointCorsIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointCorsIntegrationTests.java index 83ecc679f25..34a43343ce7 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointCorsIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointCorsIntegrationTests.java @@ -48,9 +48,9 @@ public class WebFluxEndpointCorsIntegrationTests { public void createContext() { this.context = new AnnotationConfigReactiveWebApplicationContext(); this.context.register(JacksonAutoConfiguration.class, - CodecsAutoConfiguration.class, - WebFluxAutoConfiguration.class, HttpHandlerAutoConfiguration.class, - EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, + CodecsAutoConfiguration.class, WebFluxAutoConfiguration.class, + HttpHandlerAutoConfiguration.class, EndpointAutoConfiguration.class, + WebEndpointAutoConfiguration.class, ManagementContextAutoConfiguration.class, ReactiveManagementContextAutoConfiguration.class, BeansEndpointAutoConfiguration.class); @@ -59,13 +59,11 @@ public class WebFluxEndpointCorsIntegrationTests { @Test public void corsIsDisabledByDefault() { - createWebTestClient() - .options().uri("/actuator/beans") + createWebTestClient().options().uri("/actuator/beans") .header("Origin", "spring.example.org") - .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET") - .exchange() - .expectStatus().isForbidden() - .expectHeader().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN); + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET").exchange() + .expectStatus().isForbidden().expectHeader() + .doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN); } @Test @@ -73,11 +71,9 @@ public class WebFluxEndpointCorsIntegrationTests { TestPropertyValues .of("management.endpoints.web.cors.allowed-origins:spring.example.org") .applyTo(this.context); - createWebTestClient() - .options().uri("/actuator/beans") + createWebTestClient().options().uri("/actuator/beans") .header("Origin", "test.example.org") - .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET") - .exchange() + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET").exchange() .expectStatus().isForbidden(); performAcceptedCorsRequest("/actuator/beans"); } @@ -87,8 +83,8 @@ public class WebFluxEndpointCorsIntegrationTests { TestPropertyValues .of("management.endpoints.web.cors.allowed-origins:spring.example.org") .applyTo(this.context); - performAcceptedCorsRequest("/actuator/beans") - .expectHeader().valueEquals(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800"); + performAcceptedCorsRequest("/actuator/beans").expectHeader() + .valueEquals(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800"); } @Test @@ -97,8 +93,8 @@ public class WebFluxEndpointCorsIntegrationTests { .of("management.endpoints.web.cors.allowed-origins:spring.example.org", "management.endpoints.web.cors.max-age: 2400") .applyTo(this.context); - performAcceptedCorsRequest("/actuator/beans") - .expectHeader().valueEquals(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "2400"); + performAcceptedCorsRequest("/actuator/beans").expectHeader() + .valueEquals(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "2400"); } @Test @@ -106,12 +102,10 @@ public class WebFluxEndpointCorsIntegrationTests { TestPropertyValues .of("management.endpoints.web.cors.allowed-origins:spring.example.org") .applyTo(this.context); - createWebTestClient() - .options().uri("/actuator/beans") + createWebTestClient().options().uri("/actuator/beans") .header("Origin", "spring.example.org") .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET") - .header(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Alpha") - .exchange() + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Alpha").exchange() .expectStatus().isForbidden(); } @@ -121,14 +115,12 @@ public class WebFluxEndpointCorsIntegrationTests { .of("management.endpoints.web.cors.allowed-origins:spring.example.org", "management.endpoints.web.cors.allowed-headers:Alpha,Bravo") .applyTo(this.context); - createWebTestClient() - .options().uri("/actuator/beans") + createWebTestClient().options().uri("/actuator/beans") .header("Origin", "spring.example.org") .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET") - .header(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Alpha") - .exchange() - .expectStatus().isOk() - .expectHeader().valueEquals(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, "Alpha"); + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Alpha").exchange() + .expectStatus().isOk().expectHeader() + .valueEquals(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, "Alpha"); } @Test @@ -136,11 +128,9 @@ public class WebFluxEndpointCorsIntegrationTests { TestPropertyValues .of("management.endpoints.web.cors.allowed-origins:spring.example.org") .applyTo(this.context); - createWebTestClient() - .options().uri("/actuator/beans") + createWebTestClient().options().uri("/actuator/beans") .header("Origin", "spring.example.org") - .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "PATCH") - .exchange() + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "PATCH").exchange() .expectStatus().isForbidden(); } @@ -150,13 +140,11 @@ public class WebFluxEndpointCorsIntegrationTests { .of("management.endpoints.web.cors.allowed-origins:spring.example.org", "management.endpoints.web.cors.allowed-methods:GET,HEAD") .applyTo(this.context); - createWebTestClient() - .options().uri("/actuator/beans") + createWebTestClient().options().uri("/actuator/beans") .header("Origin", "spring.example.org") - .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "HEAD") - .exchange() - .expectStatus().isOk() - .expectHeader().valueEquals(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,HEAD"); + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "HEAD").exchange() + .expectStatus().isOk().expectHeader() + .valueEquals(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,HEAD"); } @Test @@ -165,8 +153,8 @@ public class WebFluxEndpointCorsIntegrationTests { .of("management.endpoints.web.cors.allowed-origins:spring.example.org", "management.endpoints.web.cors.allow-credentials:true") .applyTo(this.context); - performAcceptedCorsRequest("/actuator/beans") - .expectHeader().valueEquals(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"); + performAcceptedCorsRequest("/actuator/beans").expectHeader() + .valueEquals(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"); } @Test @@ -175,24 +163,22 @@ public class WebFluxEndpointCorsIntegrationTests { .of("management.endpoints.web.cors.allowed-origins:spring.example.org", "management.endpoints.web.cors.allow-credentials:false") .applyTo(this.context); - performAcceptedCorsRequest("/actuator/beans") - .expectHeader().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS); + performAcceptedCorsRequest("/actuator/beans").expectHeader() + .doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS); } - private WebTestClient createWebTestClient() { this.context.refresh(); - return WebTestClient.bindToApplicationContext(this.context) - .configureClient().baseUrl("https://spring.example.org").build(); + return WebTestClient.bindToApplicationContext(this.context).configureClient() + .baseUrl("https://spring.example.org").build(); } private WebTestClient.ResponseSpec performAcceptedCorsRequest(String url) { - return createWebTestClient() - .options().uri(url) + return createWebTestClient().options().uri(url) .header(HttpHeaders.ORIGIN, "spring.example.org") - .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET") - .exchange() - .expectHeader().valueEquals(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "spring.example.org") + .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET").exchange() + .expectHeader().valueEquals(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, + "spring.example.org") .expectStatus().isOk(); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/LogFileWebEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/LogFileWebEndpointAutoConfigurationTests.java index 42e64a1cb1c..f426ad24b3f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/LogFileWebEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/LogFileWebEndpointAutoConfigurationTests.java @@ -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. @@ -45,8 +45,7 @@ public class LogFileWebEndpointAutoConfigurationTests { public TemporaryFolder temp = new TemporaryFolder(); private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() - .withUserConfiguration( - LogFileWebEndpointAutoConfiguration.class); + .withUserConfiguration(LogFileWebEndpointAutoConfiguration.class); @Test public void logFileWebEndpointIsAutoConfiguredWhenLoggingFileIsSet() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/management/HeapDumpWebEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/management/HeapDumpWebEndpointAutoConfigurationTests.java index 85f32129b8c..1cf4b4d56b8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/management/HeapDumpWebEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/management/HeapDumpWebEndpointAutoConfigurationTests.java @@ -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. @@ -32,8 +32,7 @@ public class HeapDumpWebEndpointAutoConfigurationTests { private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() .withPropertyValues("management.endpoints.web.expose:*") - .withUserConfiguration( - HeapDumpWebEndpointAutoConfiguration.class); + .withUserConfiguration(HeapDumpWebEndpointAutoConfiguration.class); @Test public void runShouldCreateIndicator() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java index 5b47ae65057..c014c51f95b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java @@ -39,15 +39,14 @@ public class CacheMetricsConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withUserConfiguration(RegistryConfiguration.class) - .withConfiguration(AutoConfigurations.of(MetricsAutoConfiguration.class, CacheAutoConfiguration.class)) + .withConfiguration(AutoConfigurations.of(MetricsAutoConfiguration.class, + CacheAutoConfiguration.class)) .withPropertyValues("management.metrics.use-global-registry=false"); @Test public void autoConfiguredCacheManagerIsInstrumented() { - this.contextRunner - .withPropertyValues("spring.cache.type=caffeine", - "spring.cache.cache-names=cache1,cache2") - .run((context) -> { + this.contextRunner.withPropertyValues("spring.cache.type=caffeine", + "spring.cache.cache-names=cache1,cache2").run((context) -> { MeterRegistry registry = context.getBean(MeterRegistry.class); assertThat(registry.find("cache.requests").tags("name", "cache1") .tags("cacheManager", "cacheManager").meter()).isPresent(); @@ -73,10 +72,8 @@ public class CacheMetricsConfigurationTests { @Test public void autoConfiguredNonSupportedCacheManagerIsIgnored() { - this.contextRunner - .withPropertyValues("spring.cache.type=simple", - "spring.cache.cache-names=cache1,cache2") - .run((context) -> { + this.contextRunner.withPropertyValues("spring.cache.type=simple", + "spring.cache.cache-names=cache1,cache2").run((context) -> { MeterRegistry registry = context.getBean(MeterRegistry.class); assertThat(registry.find("cache.requests").tags("name", "cache1") .tags("cacheManager", "cacheManager").meter()).isNotPresent(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsConfigurationTests.java index 70cf20b9307..64e7467da70 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsConfigurationTests.java @@ -45,11 +45,10 @@ public class RestTemplateMetricsConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withPropertyValues("management.metrics.use-global-registry=false") - .withConfiguration(AutoConfigurations.of( - RestTemplateAutoConfiguration.class, MetricsAutoConfiguration.class)) + .withConfiguration(AutoConfigurations.of(RestTemplateAutoConfiguration.class, + MetricsAutoConfiguration.class)) .withUserConfiguration(RegistryConfiguration.class); - @Test public void restTemplateCreatedWithBuilderIsInstrumented() { this.contextRunner.run((context) -> { @@ -64,8 +63,9 @@ public class RestTemplateMetricsConfigurationTests { public void restTemplateCanBeCustomizedManually() { this.contextRunner.run((context) -> { assertThat(context).hasSingleBean(MetricsRestTemplateCustomizer.class); - RestTemplate restTemplate = new RestTemplateBuilder().customizers( - context.getBean(MetricsRestTemplateCustomizer.class)).build(); + RestTemplate restTemplate = new RestTemplateBuilder() + .customizers(context.getBean(MetricsRestTemplateCustomizer.class)) + .build(); MeterRegistry registry = context.getBean(MeterRegistry.class); validateRestTemplate(restTemplate, registry); }); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java index ddf69001848..5a1a39eae3b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java @@ -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. @@ -91,7 +91,8 @@ public class EndpointRequestTests { @Test public void excludeByIdShouldNotMatchExcluded() { - ServerWebExchangeMatcher matcher = EndpointRequest.toAnyEndpoint().excluding("foo"); + ServerWebExchangeMatcher matcher = EndpointRequest.toAnyEndpoint() + .excluding("foo"); assertMatcher(matcher).doesNotMatch("/actuator/foo"); assertMatcher(matcher).matches("/actuator/bar"); } @@ -113,13 +114,16 @@ public class EndpointRequestTests { private final ServerWebExchangeMatcher matcher; - RequestMatcherAssert(StaticApplicationContext context, ServerWebExchangeMatcher matcher) { + RequestMatcherAssert(StaticApplicationContext context, + ServerWebExchangeMatcher matcher) { this.context = context; this.matcher = matcher; } void matches(String path) { - ServerWebExchange exchange = webHandler().createExchange(MockServerHttpRequest.get(path).build(), new MockServerHttpResponse()); + ServerWebExchange exchange = webHandler().createExchange( + MockServerHttpRequest.get(path).build(), + new MockServerHttpResponse()); matches(exchange); } @@ -129,7 +133,9 @@ public class EndpointRequestTests { } void doesNotMatch(String path) { - ServerWebExchange exchange = webHandler().createExchange(MockServerHttpRequest.get(path).build(), new MockServerHttpResponse()); + ServerWebExchange exchange = webHandler().createExchange( + MockServerHttpRequest.get(path).build(), + new MockServerHttpResponse()); doesNotMatch(exchange); } @@ -139,7 +145,8 @@ public class EndpointRequestTests { } private TestHttpWebHandlerAdapter webHandler() { - TestHttpWebHandlerAdapter adapter = new TestHttpWebHandlerAdapter(mock(WebHandler.class)); + TestHttpWebHandlerAdapter adapter = new TestHttpWebHandlerAdapter( + mock(WebHandler.class)); adapter.setApplicationContext(this.context); return adapter; } @@ -157,7 +164,8 @@ public class EndpointRequestTests { } @Override - protected ServerWebExchange createExchange(ServerHttpRequest request, ServerHttpResponse response) { + protected ServerWebExchange createExchange(ServerHttpRequest request, + ServerHttpResponse response) { return super.createExchange(request, response); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java index ab0fea59dfb..9579f21a0ae 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java @@ -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. @@ -76,8 +76,7 @@ public class EndpointMBean implements DynamicMBean { @Override public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException { - JmxOperation operation = this.endpointInfo.getOperations() - .get(actionName); + JmxOperation operation = this.endpointInfo.getOperations().get(actionName); if (operation != null) { Map arguments = getArguments(params, operation.getParameters()); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanInfoAssembler.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanInfoAssembler.java index ea9f54ceca0..c5d56c7e20e 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanInfoAssembler.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanInfoAssembler.java @@ -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. @@ -53,8 +53,7 @@ class EndpointMBeanInfoAssembler { * @param endpointInfo the endpoint to handle * @return the mbean info for the endpoint */ - EndpointMBeanInfo createEndpointMBeanInfo( - EndpointInfo endpointInfo) { + EndpointMBeanInfo createEndpointMBeanInfo(EndpointInfo endpointInfo) { Map operationsMapping = getOperationInfo(endpointInfo); ModelMBeanOperationInfo[] operationsMBeanInfo = operationsMapping.values() .stream().map((t) -> t.mBeanOperationInfo).collect(Collectors.toList()) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolver.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolver.java index e3dde0783d7..6c045ed825a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolver.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolver.java @@ -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. @@ -38,8 +38,7 @@ public class EndpointLinksResolver { * @return the links */ public Map resolveLinks( - Collection> webEndpoints, - String requestUrl) { + Collection> webEndpoints, String requestUrl) { String normalizedUrl = normalizeRequestUrl(requestUrl); Map links = new LinkedHashMap<>(); links.put("self", new Link(normalizedUrl)); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java index 51f379a796c..b657553cf82 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java @@ -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. @@ -117,8 +117,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping registerMapping(mapping, this, getLinks()); } - protected RequestMappingInfo createRequestMappingInfo( - WebOperation operationInfo) { + protected RequestMappingInfo createRequestMappingInfo(WebOperation operationInfo) { OperationRequestPredicate requestPredicate = operationInfo.getRequestPredicate(); PatternsRequestCondition patterns = new PatternsRequestCondition(pathPatternParser .parse(this.endpointMapping.createSubPath(requestPredicate.getPath()))); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java index ab3cb30d629..a6080556974 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java @@ -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. @@ -132,8 +132,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping protected abstract void registerMappingForOperation(WebOperation operation); - protected RequestMappingInfo createRequestMappingInfo( - WebOperation operationInfo) { + protected RequestMappingInfo createRequestMappingInfo(WebOperation operationInfo) { OperationRequestPredicate requestPredicate = operationInfo.getRequestPredicate(); PatternsRequestCondition patterns = patternsRequestConditionForPattern( requestPredicate.getPath()); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/MetricsEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/MetricsEndpoint.java index 9e068fdaca2..9a69fc97ba0 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/MetricsEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/MetricsEndpoint.java @@ -91,8 +91,7 @@ public class MetricsEndpoint { Map samples = getSamples(meters); Map> availableTags = getAvailableTags(meters); tags.forEach((t) -> availableTags.remove(t.getKey())); - return new MetricResponse(requiredMetricName, - asList(samples, Sample::new), + return new MetricResponse(requiredMetricName, asList(samples, Sample::new), asList(availableTags, AvailableTag::new)); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java index 9ec0d32285c..416b0ef3572 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java @@ -247,14 +247,15 @@ public class WebMvcMetricsFilterTests { @Bean PrometheusMeterRegistry prometheus() { - PrometheusMeterRegistry r = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT, new CollectorRegistry(), Clock.SYSTEM); + PrometheusMeterRegistry r = new PrometheusMeterRegistry( + PrometheusConfig.DEFAULT, new CollectorRegistry(), Clock.SYSTEM); r.config().meterFilter(new MeterFilter() { @Override public MeterFilterReply accept(Meter.Id id) { for (Tag tag : id.getTags()) { if (tag.getKey().equals("uri") && (tag.getValue().contains("histogram") - || tag.getValue().contains("percentiles"))) { + || tag.getValue().contains("percentiles"))) { return MeterFilterReply.ACCEPT; } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/gson/GsonProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/gson/GsonProperties.java index b3a73e6ad20..b3efc87954f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/gson/GsonProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/gson/GsonProperties.java @@ -64,8 +64,8 @@ public class GsonProperties { private LongSerializationPolicy longSerializationPolicy; /** - * Naming policy that should be applied to an object's field during serialization - * and deserialization. + * Naming policy that should be applied to an object's field during serialization and + * deserialization. */ private FieldNamingPolicy fieldNamingPolicy; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/GsonHttpMessageConvertersConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/GsonHttpMessageConvertersConfiguration.java index 394a589f3dc..e594187c8cd 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/GsonHttpMessageConvertersConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/GsonHttpMessageConvertersConfiguration.java @@ -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. @@ -75,7 +75,8 @@ class GsonHttpMessageConvertersConfiguration { } - private static class JacksonAndJsonbUnavailableCondition extends NoneNestedConditions { + private static class JacksonAndJsonbUnavailableCondition + extends NoneNestedConditions { JacksonAndJsonbUnavailableCondition() { super(ConfigurationPhase.REGISTER_BEAN); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java index e6bf4164b70..3f09b6c8eed 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java @@ -53,7 +53,8 @@ public class SessionProperties { public SessionProperties(ObjectProvider serverProperties) { ServerProperties properties = serverProperties.getIfUnique(); - Session session = (properties == null ? null : properties.getServlet().getSession()); + Session session = (properties == null ? null + : properties.getServlet().getSession()); this.timeout = (session == null ? null : session.getTimeout()); } @@ -68,7 +69,7 @@ public class SessionProperties { /** * Return the session timeout. * @return the session timeout - * @see ServerProperties.Servlet#getSession() + * @see Session#getTimeout() */ public Duration getTimeout() { return this.timeout; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/jetty/JettyCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/jetty/JettyCustomizer.java index 2974ca449da..c9a132da4d0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/jetty/JettyCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/jetty/JettyCustomizer.java @@ -35,8 +35,7 @@ import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer; import org.springframework.core.env.Environment; /** - * Customization for Jetty-specific features common - * for both Servlet and Reactive servers. + * Customization for Jetty-specific features common for both Servlet and Reactive servers. * * @author Brian Clozel * @since 2.0.0 @@ -58,16 +57,14 @@ public final class JettyCustomizer { factory.setSelectors(jettyProperties.getSelectors()); } if (serverProperties.getMaxHttpHeaderSize() > 0) { - customizeMaxHttpHeaderSize(factory, - serverProperties.getMaxHttpHeaderSize()); + customizeMaxHttpHeaderSize(factory, serverProperties.getMaxHttpHeaderSize()); } if (jettyProperties.getMaxHttpPostSize() > 0) { customizeMaxHttpPostSize(factory, jettyProperties.getMaxHttpPostSize()); } if (serverProperties.getConnectionTimeout() != null) { - customizeConnectionTimeout(factory, - serverProperties.getConnectionTimeout()); + customizeConnectionTimeout(factory, serverProperties.getConnectionTimeout()); } if (jettyProperties.getAccesslog().isEnabled()) { customizeAccessLog(factory, jettyProperties.getAccesslog()); @@ -86,8 +83,7 @@ public final class JettyCustomizer { private static void customizeConnectionTimeout( ConfigurableJettyWebServerFactory factory, Duration connectionTimeout) { factory.addServerCustomizers((server) -> { - for (org.eclipse.jetty.server.Connector connector : server - .getConnectors()) { + for (org.eclipse.jetty.server.Connector connector : server.getConnectors()) { if (connector instanceof AbstractConnector) { ((AbstractConnector) connector) .setIdleTimeout(connectionTimeout.toMillis()); @@ -123,8 +119,8 @@ public final class JettyCustomizer { }); } - private static void customizeMaxHttpPostSize(ConfigurableJettyWebServerFactory factory, - int maxHttpPostSize) { + private static void customizeMaxHttpPostSize( + ConfigurableJettyWebServerFactory factory, int maxHttpPostSize) { factory.addServerCustomizers(new JettyServerCustomizer() { @Override @@ -136,8 +132,7 @@ public final class JettyCustomizer { Handler... handlers) { for (Handler handler : handlers) { if (handler instanceof ContextHandler) { - ((ContextHandler) handler) - .setMaxFormContentSize(maxHttpPostSize); + ((ContextHandler) handler).setMaxFormContentSize(maxHttpPostSize); } else if (handler instanceof HandlerWrapper) { setHandlerMaxHttpPostSize(maxHttpPostSize, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java index e829752508b..1f20e8a5847 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java @@ -32,8 +32,8 @@ import org.springframework.core.env.Environment; import org.springframework.util.StringUtils; /** - * Customization for Tomcat-specific features common - * for both Servlet and Reactive servers. + * Customization for Tomcat-specific features common for both Servlet and Reactive + * servers. * * @author Brian Clozel * @since 2.0.0 @@ -50,8 +50,8 @@ public final class TomcatCustomizer { factory.setBaseDirectory(tomcatProperties.getBasedir()); } if (tomcatProperties.getBackgroundProcessorDelay() != null) { - factory.setBackgroundProcessorDelay((int) tomcatProperties - .getBackgroundProcessorDelay().getSeconds()); + factory.setBackgroundProcessorDelay( + (int) tomcatProperties.getBackgroundProcessorDelay().getSeconds()); } customizeRemoteIpValve(serverProperties, environment, factory); if (tomcatProperties.getMaxThreads() > 0) { @@ -76,8 +76,7 @@ public final class TomcatCustomizer { factory.setUriEncoding(tomcatProperties.getUriEncoding()); } if (serverProperties.getConnectionTimeout() != null) { - customizeConnectionTimeout(factory, - serverProperties.getConnectionTimeout()); + customizeConnectionTimeout(factory, serverProperties.getConnectionTimeout()); } if (tomcatProperties.getMaxConnections() > 0) { customizeMaxConnections(factory, tomcatProperties.getMaxConnections()); @@ -99,8 +98,8 @@ public final class TomcatCustomizer { }); } - private static void customizeMaxConnections(ConfigurableTomcatWebServerFactory factory, - int maxConnections) { + private static void customizeMaxConnections( + ConfigurableTomcatWebServerFactory factory, int maxConnections) { factory.addConnectorCustomizers((connector) -> { ProtocolHandler handler = connector.getProtocolHandler(); if (handler instanceof AbstractProtocol) { @@ -129,8 +128,8 @@ public final class TomcatCustomizer { if (StringUtils.hasText(protocolHeader) || StringUtils.hasText(remoteIpHeader) || getOrDeduceUseForwardHeaders(properties, environment)) { RemoteIpValve valve = new RemoteIpValve(); - valve.setProtocolHeader(StringUtils.hasLength(protocolHeader) - ? protocolHeader : "X-Forwarded-Proto"); + valve.setProtocolHeader(StringUtils.hasLength(protocolHeader) ? protocolHeader + : "X-Forwarded-Proto"); if (StringUtils.hasLength(remoteIpHeader)) { valve.setRemoteIpHeader(remoteIpHeader); } @@ -213,7 +212,8 @@ public final class TomcatCustomizer { factory.addEngineValves(valve); } - private static void customizeStaticResources(ServerProperties.Tomcat.Resource resource, + private static void customizeStaticResources( + ServerProperties.Tomcat.Resource resource, ConfigurableTomcatWebServerFactory factory) { if (resource.getCacheTtl() == null) { return; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/undertow/UndertowCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/undertow/UndertowCustomizer.java index 8876f37354c..74677389574 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/undertow/UndertowCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/undertow/UndertowCustomizer.java @@ -26,8 +26,8 @@ import org.springframework.boot.web.embedded.undertow.ConfigurableUndertowWebSer import org.springframework.core.env.Environment; /** - * Customization for Undertow-specific features common - * for both Servlet and Reactive servers. + * Customization for Undertow-specific features common for both Servlet and Reactive + * servers. * * @author Brian Clozel */ @@ -62,18 +62,16 @@ public final class UndertowCustomizer { factory.setAccessLogPrefix(accesslogProperties.getPrefix()); factory.setAccessLogSuffix(accesslogProperties.getSuffix()); factory.setAccessLogRotate(accesslogProperties.isRotate()); - factory.setUseForwardHeaders(getOrDeduceUseForwardHeaders(serverProperties, environment)); + factory.setUseForwardHeaders( + getOrDeduceUseForwardHeaders(serverProperties, environment)); if (serverProperties.getMaxHttpHeaderSize() > 0) { - customizeMaxHttpHeaderSize(factory, - serverProperties.getMaxHttpHeaderSize()); + customizeMaxHttpHeaderSize(factory, serverProperties.getMaxHttpHeaderSize()); } if (undertowProperties.getMaxHttpPostSize() > 0) { - customizeMaxHttpPostSize(factory, - undertowProperties.getMaxHttpPostSize()); + customizeMaxHttpPostSize(factory, undertowProperties.getMaxHttpPostSize()); } if (serverProperties.getConnectionTimeout() != null) { - customizeConnectionTimeout(factory, - serverProperties.getConnectionTimeout()); + customizeConnectionTimeout(factory, serverProperties.getConnectionTimeout()); } factory.addDeploymentInfoCustomizers((deploymentInfo) -> deploymentInfo .setEagerFilterInit(undertowProperties.isEagerFilterInit())); @@ -82,8 +80,7 @@ public final class UndertowCustomizer { private static void customizeConnectionTimeout( ConfigurableUndertowWebServerFactory factory, Duration connectionTimeout) { factory.addBuilderCustomizers((builder) -> builder.setSocketOption( - UndertowOptions.NO_REQUEST_TIMEOUT, - (int) connectionTimeout.toMillis())); + UndertowOptions.NO_REQUEST_TIMEOUT, (int) connectionTimeout.toMillis())); } private static void customizeMaxHttpHeaderSize( diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizer.java index 430eed31abc..efc074b874c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizer.java @@ -35,8 +35,9 @@ import org.springframework.core.env.Environment; * @author Brian Clozel * @since 2.0.0 */ -public class DefaultReactiveWebServerFactoryCustomizer implements - WebServerFactoryCustomizer, EnvironmentAware, Ordered { +public class DefaultReactiveWebServerFactoryCustomizer + implements WebServerFactoryCustomizer, + EnvironmentAware, Ordered { private final ServerProperties serverProperties; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java index b33f2eb3210..5fcdc93e4bb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java @@ -192,7 +192,8 @@ public abstract class AbstractErrorWebExceptionHandler .append("

This application has no configured error view, so you are seeing this as a fallback.

") .append("
").append(timestamp.toString()) .append("
").append("
There was an unexpected error (type=") - .append(HtmlUtils.htmlEscape(error.get("error").toString())).append(", status=") + .append(HtmlUtils.htmlEscape(error.get("error").toString())) + .append(", status=") .append(HtmlUtils.htmlEscape(error.get("status").toString())) .append(").
").append("
") .append(HtmlUtils.htmlEscape(error.get("message").toString())) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorAttributes.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorAttributes.java index 176e351e975..471802061de 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorAttributes.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorAttributes.java @@ -118,8 +118,8 @@ public class DefaultErrorAttributes implements ErrorAttributes { errorAttributes.put("trace", stackTrace.toString()); } - private void handleException(Map errorAttributes, - Throwable error, boolean includeStackTrace) { + private void handleException(Map errorAttributes, Throwable error, + boolean includeStackTrace) { if (this.includeException) { errorAttributes.put("exception", error.getClass().getName()); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java index 4c2b70ac62f..5c14825f25a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java @@ -217,22 +217,23 @@ public class WebMvcAutoConfiguration { @Override public void configurePathMatch(PathMatchConfigurer configurer) { - configurer.setUseSuffixPatternMatch(this.mvcProperties - .getPathMatch().isUseSuffixPattern()); - configurer.setUseRegisteredSuffixPatternMatch(this.mvcProperties - .getPathMatch().isUseRegisteredSuffixPattern()); + configurer.setUseSuffixPatternMatch( + this.mvcProperties.getPathMatch().isUseSuffixPattern()); + configurer.setUseRegisteredSuffixPatternMatch( + this.mvcProperties.getPathMatch().isUseRegisteredSuffixPattern()); } @Override public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { - WebMvcProperties.ContentNegotiation contentNegotiation - = this.mvcProperties.getContentNegotiation(); + WebMvcProperties.ContentNegotiation contentNegotiation = this.mvcProperties + .getContentNegotiation(); configurer.favorPathExtension(contentNegotiation.isFavorPathExtension()); configurer.favorParameter(contentNegotiation.isFavorParameter()); if (contentNegotiation.getParameterName() != null) { configurer.parameterName(contentNegotiation.getParameterName()); } - Map mediaTypes = this.mvcProperties.getContentNegotiation().getMediaTypes(); + Map mediaTypes = this.mvcProperties.getContentNegotiation() + .getMediaTypes(); for (Entry mediaType : mediaTypes.entrySet()) { configurer.mediaType(mediaType.getKey(), mediaType.getValue()); } @@ -324,8 +325,8 @@ public class WebMvcAutoConfiguration { registry.addResourceHandler("/webjars/**") .addResourceLocations( "classpath:/META-INF/resources/webjars/") - .setCachePeriod(getSeconds(cachePeriod)) - .setCacheControl(cacheControl)); + .setCachePeriod(getSeconds(cachePeriod)) + .setCacheControl(cacheControl)); } String staticPathPattern = this.mvcProperties.getStaticPathPattern(); if (!registry.hasMappingForPattern(staticPathPattern)) { @@ -333,8 +334,8 @@ public class WebMvcAutoConfiguration { registry.addResourceHandler(staticPathPattern) .addResourceLocations(getResourceLocations( this.resourceProperties.getStaticLocations())) - .setCachePeriod(getSeconds(cachePeriod)) - .setCacheControl(cacheControl)); + .setCachePeriod(getSeconds(cachePeriod)) + .setCacheControl(cacheControl)); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java index c881359fcca..27555b92c07 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java @@ -273,20 +273,21 @@ public class WebMvcProperties { public static class ContentNegotiation { /** - * Whether the path extension in the URL path should be used to determine - * the requested media type. If enabled a request "/users.pdf" will be - * interpreted as a request for "application/pdf" regardless of the 'Accept' header. + * Whether the path extension in the URL path should be used to determine the + * requested media type. If enabled a request "/users.pdf" will be interpreted as + * a request for "application/pdf" regardless of the 'Accept' header. */ private boolean favorPathExtension = false; /** - * Whether a request parameter ("format" by default) should be used to - * determine the requested media type. + * Whether a request parameter ("format" by default) should be used to determine + * the requested media type. */ private boolean favorParameter = false; /** - * Maps file extensions to media types for content negotiation, e.g. yml to text/yaml. + * Maps file extensions to media types for content negotiation, e.g. yml to + * text/yaml. */ private Map mediaTypes = new LinkedHashMap<>(); @@ -331,16 +332,16 @@ public class WebMvcProperties { public static class PathMatch { /** - * Whether to use suffix pattern match (".*") when matching patterns to - * requests. If enabled a method mapped to "/users" also matches to "/users.*". + * Whether to use suffix pattern match (".*") when matching patterns to requests. + * If enabled a method mapped to "/users" also matches to "/users.*". */ private boolean useSuffixPattern = false; /** - * Whether suffix pattern matching should work only against extensions - * registered with "spring.mvc.content-negotiation.media-types.*". - * This is generally recommended to reduce ambiguity and to - * avoid issues such as when a "." appears in the path for other reasons. + * Whether suffix pattern matching should work only against extensions registered + * with "spring.mvc.content-negotiation.media-types.*". This is generally + * recommended to reduce ambiguity and to avoid issues such as when a "." appears + * in the path for other reasons. */ private boolean useRegisteredSuffixPattern = false; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfiguration.java index 367a3476fd3..0e09ca1f89f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfiguration.java @@ -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. @@ -35,9 +35,7 @@ import org.springframework.messaging.converter.MessageConverter; import org.springframework.messaging.converter.StringMessageConverter; import org.springframework.messaging.simp.config.AbstractMessageBrokerConfiguration; import org.springframework.util.MimeTypeUtils; -import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer; import org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration; -import org.springframework.web.socket.config.annotation.StompEndpointRegistry; import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; /** @@ -56,7 +54,7 @@ public class WebSocketMessagingAutoConfiguration { ObjectMapper.class }) @ConditionalOnClass({ ObjectMapper.class, AbstractMessageBrokerConfiguration.class }) static class WebSocketMessageConverterConfiguration - extends AbstractWebSocketMessageBrokerConfigurer { + implements WebSocketMessageBrokerConfigurer { private final ObjectMapper objectMapper; @@ -64,11 +62,6 @@ public class WebSocketMessagingAutoConfiguration { this.objectMapper = objectMapper; } - @Override - public void registerStompEndpoints(StompEndpointRegistry registry) { - // The user must register their own endpoints - } - @Override public boolean configureMessageConverters( List messageConverters) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index 7d4f32bbbc3..5cad6d56562 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -321,8 +321,7 @@ public class CacheAutoConfigurationTests { @Test public void redisCacheWithCustomizers() { - this.contextRunner - .withUserConfiguration(RedisWithCustomizersConfiguration.class) + this.contextRunner.withUserConfiguration(RedisWithCustomizersConfiguration.class) .withPropertyValues("spring.cache.type=" + "redis") .run(dunno("allCacheManagerCustomizer", "redisCacheManagerCustomizer")); } @@ -954,8 +953,7 @@ public class CacheAutoConfigurationTests { @Bean public org.springframework.data.redis.cache.RedisCacheConfiguration customRedisCacheConfiguration() { return org.springframework.data.redis.cache.RedisCacheConfiguration - .defaultCacheConfig() - .entryTtl(java.time.Duration.ofSeconds(30)) + .defaultCacheConfig().entryTtl(java.time.Duration.ofSeconds(30)) .prefixKeysWith("bar"); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfigurationTests.java index 26c5cbe55d2..256eb575b11 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfigurationTests.java @@ -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. @@ -67,8 +67,8 @@ public class MongoRepositoriesAutoConfigurationTests { @Test public void testNoRepositoryConfiguration() { - this.runner.withUserConfiguration(EmptyConfiguration.class).run((context) -> - assertThat(context).hasSingleBean(MongoClient.class)); + this.runner.withUserConfiguration(EmptyConfiguration.class) + .run((context) -> assertThat(context).hasSingleBean(MongoClient.class)); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerInvokerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerInvokerTests.java index 8fdf6efea71..36db35ca78f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerInvokerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerInvokerTests.java @@ -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. @@ -60,8 +60,7 @@ public class DataSourceInitializerInvokerTests { private ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class)) .withPropertyValues("spring.datasource.initialization-mode=never", - "spring.datasource.url:jdbc:hsqldb:mem:init-" - + UUID.randomUUID()); + "spring.datasource.url:jdbc:hsqldb:mem:init-" + UUID.randomUUID()); @Test public void dataSourceInitialized() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfigurationTests.java index 3ad4a2da97f..766eae170d9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mail/MailSenderAutoConfigurationTests.java @@ -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. @@ -194,8 +194,7 @@ public class MailSenderAutoConfigurationTests { verify(mailSender, never()).testConnection(); } - private Session configureJndiSession(String name) - throws IllegalStateException { + private Session configureJndiSession(String name) throws IllegalStateException { Properties properties = new Properties(); Session session = Session.getDefaultInstance(properties); TestableInitialContextFactory.bind(name, session); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityFilterAutoConfigurationEarlyInitializationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityFilterAutoConfigurationEarlyInitializationTests.java index b3c0d18799e..079894cb66e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityFilterAutoConfigurationEarlyInitializationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityFilterAutoConfigurationEarlyInitializationTests.java @@ -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. @@ -63,7 +63,8 @@ public class SecurityFilterAutoConfigurationEarlyInitializationTests { context.refresh(); int port = context.getWebServer().getPort(); String password = this.outputCapture.toString() - .split("Using generated security password: ")[1].split("\n")[0].trim(); + .split("Using generated security password: ")[1].split("\n")[0] + .trim(); new TestRestTemplate("user", password) .getForEntity("http://localhost:" + port, Object.class); // If early initialization occurred a ConverterNotFoundException is thrown diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java index 07ac3f04a96..efd14bfbd7e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java @@ -153,24 +153,24 @@ public class SessionAutoConfigurationTests extends AbstractSessionAutoConfigurat @Test public void sessionCookieConfigurationIsPickedUp() { - new WebApplicationContextRunner( + WebApplicationContextRunner webRunner = new WebApplicationContextRunner( AnnotationConfigServletWebServerApplicationContext::new) .withConfiguration(AutoConfigurations .of(ServletWebServerFactoryAutoConfiguration.class)) .withUserConfiguration(SessionRepositoryConfiguration.class) .withPropertyValues("server.port=0", - "server.servlet.session.cookie.name=testname") - .run((context) -> { - SessionRepositoryFilter filter = context - .getBean(SessionRepositoryFilter.class); - CookieHttpSessionIdResolver sessionIdResolver = (CookieHttpSessionIdResolver) ReflectionTestUtils - .getField(filter, "httpSessionIdResolver"); - DefaultCookieSerializer cookieSerializer = (DefaultCookieSerializer) ReflectionTestUtils - .getField(sessionIdResolver, "cookieSerializer"); - String cookieName = (String) ReflectionTestUtils - .getField(cookieSerializer, "cookieName"); - assertThat(cookieName).isEqualTo("testname"); - }); + "server.servlet.session.cookie.name=testname"); + webRunner.run((context) -> { + SessionRepositoryFilter filter = context + .getBean(SessionRepositoryFilter.class); + CookieHttpSessionIdResolver sessionIdResolver = (CookieHttpSessionIdResolver) ReflectionTestUtils + .getField(filter, "httpSessionIdResolver"); + DefaultCookieSerializer cookieSerializer = (DefaultCookieSerializer) ReflectionTestUtils + .getField(sessionIdResolver, "cookieSerializer"); + String cookieName = (String) ReflectionTestUtils.getField(cookieSerializer, + "cookieName"); + assertThat(cookieName).isEqualTo("testname"); + }); } @Configuration diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizerTests.java index 6fbf4ab8420..a705a019f29 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizerTests.java @@ -170,7 +170,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { public void defaultTomcatBackgroundProcessorDelay() { TomcatReactiveWebServerFactory factory = new TomcatReactiveWebServerFactory(); this.customizer.customize(factory); - TomcatWebServer webServer = (TomcatWebServer) factory.getWebServer(mock(HttpHandler.class)); + TomcatWebServer webServer = (TomcatWebServer) factory + .getWebServer(mock(HttpHandler.class)); assertThat(webServer.getTomcat().getEngine().getBackgroundProcessorDelay()) .isEqualTo(30); webServer.stop(); @@ -183,7 +184,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { bindProperties(map); TomcatReactiveWebServerFactory factory = new TomcatReactiveWebServerFactory(); this.customizer.customize(factory); - TomcatWebServer webServer = (TomcatWebServer) factory.getWebServer(mock(HttpHandler.class)); + TomcatWebServer webServer = (TomcatWebServer) factory + .getWebServer(mock(HttpHandler.class)); assertThat(webServer.getTomcat().getEngine().getBackgroundProcessorDelay()) .isEqualTo(5); webServer.stop(); @@ -261,7 +263,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { bindProperties(map); TomcatReactiveWebServerFactory factory = new TomcatReactiveWebServerFactory(0); this.customizer.customize(factory); - TomcatWebServer server = (TomcatWebServer) factory.getWebServer(mock(HttpHandler.class)); + TomcatWebServer server = (TomcatWebServer) factory + .getWebServer(mock(HttpHandler.class)); server.start(); try { assertThat(((AbstractProtocol) server.getTomcat().getConnector() @@ -279,7 +282,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { bindProperties(map); TomcatReactiveWebServerFactory factory = new TomcatReactiveWebServerFactory(0); this.customizer.customize(factory); - TomcatWebServer server = (TomcatWebServer) factory.getWebServer(mock(HttpHandler.class)); + TomcatWebServer server = (TomcatWebServer) factory + .getWebServer(mock(HttpHandler.class)); server.start(); try { assertThat(((AbstractProtocol) server.getTomcat().getConnector() @@ -297,7 +301,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { bindProperties(map); TomcatReactiveWebServerFactory factory = new TomcatReactiveWebServerFactory(0); this.customizer.customize(factory); - TomcatWebServer server = (TomcatWebServer) factory.getWebServer(mock(HttpHandler.class)); + TomcatWebServer server = (TomcatWebServer) factory + .getWebServer(mock(HttpHandler.class)); server.start(); try { assertThat(server.getTomcat().getConnector().getMaxPostSize()) @@ -315,7 +320,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { bindProperties(map); TomcatReactiveWebServerFactory factory = new TomcatReactiveWebServerFactory(0); this.customizer.customize(factory); - TomcatWebServer server = (TomcatWebServer) factory.getWebServer(mock(HttpHandler.class)); + TomcatWebServer server = (TomcatWebServer) factory + .getWebServer(mock(HttpHandler.class)); server.start(); try { assertThat(server.getTomcat().getConnector().getMaxPostSize()).isEqualTo(-1); @@ -340,7 +346,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { bindProperties(map); TomcatReactiveWebServerFactory factory = new TomcatReactiveWebServerFactory(0); this.customizer.customize(factory); - TomcatWebServer server = (TomcatWebServer) factory.getWebServer(mock(HttpHandler.class)); + TomcatWebServer server = (TomcatWebServer) factory + .getWebServer(mock(HttpHandler.class)); server.start(); try { Tomcat tomcat = server.getTomcat(); @@ -382,7 +389,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { map.put("server.jetty.accesslog.enabled", "true"); bindProperties(map); this.customizer.customize(factory); - JettyWebServer webServer = (JettyWebServer) factory.getWebServer(mock(HttpHandler.class)); + JettyWebServer webServer = (JettyWebServer) factory + .getWebServer(mock(HttpHandler.class)); try { NCSARequestLog requestLog = getNCSARequestLog(webServer); assertThat(requestLog.getFilename()).isNull(); @@ -417,7 +425,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { map.put("server.jetty.accesslog.log-latency", "true"); bindProperties(map); this.customizer.customize(factory); - JettyWebServer webServer = (JettyWebServer) factory.getWebServer(mock(HttpHandler.class)); + JettyWebServer webServer = (JettyWebServer) factory + .getWebServer(mock(HttpHandler.class)); NCSARequestLog requestLog = getNCSARequestLog(webServer); try { assertThat(requestLog.getFilename()).isEqualTo(logFile.getAbsolutePath()); @@ -461,7 +470,8 @@ public class DefaultReactiveWebServerFactoryCustomizerTests { @Test public void setUseForwardHeadersUndertow() { this.properties.setUseForwardHeaders(true); - UndertowReactiveWebServerFactory factory = spy(new UndertowReactiveWebServerFactory()); + UndertowReactiveWebServerFactory factory = spy( + new UndertowReactiveWebServerFactory()); this.customizer.customize(factory); verify(factory).setUseForwardHeaders(true); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java index 628b2d0f71c..00ff26a75e7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java @@ -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. @@ -54,8 +54,9 @@ public class ReactiveWebServerAutoConfigurationTests { .hasSize(1); assertThat(this.context.getBeansOfType(WebServerFactoryCustomizer.class)) .hasSize(1); - assertThat(this.context.getBeansOfType(DefaultReactiveWebServerFactoryCustomizer.class)) - .hasSize(1); + assertThat(this.context + .getBeansOfType(DefaultReactiveWebServerFactoryCustomizer.class)) + .hasSize(1); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java index 66eb61aa491..d259064bba4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java @@ -233,8 +233,7 @@ public class DefaultErrorWebExceptionHandlerIntegrationTests { .contentType(MediaType.TEXT_HTML).expectBody(String.class) .returnResult().getResponseBody(); assertThat(body).contains("Whitelabel Error Page") - .doesNotContain("