diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java index 3ffcdc0491..646c5d70dc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java @@ -134,6 +134,7 @@ class CloudFoundryWebEndpointServletHandlerMapping } return this.delegate.handle(request, body); } + } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java index b0acd639a1..b556ff9972 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java @@ -31,7 +31,6 @@ import org.springframework.context.annotation.Configuration; * * @author Phillip Webb * @author Andy Wilkinson - * * @since 2.0.0 */ @Configuration diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurer.java index b5e992f7be..b1907d7b3a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurer.java @@ -28,11 +28,11 @@ import io.micrometer.core.instrument.config.MeterFilter; import org.springframework.boot.util.LambdaSafe; /** - * Configurer to apply {@link MeterRegistryCustomizer customizers}, - * {@link MeterFilter filters}, {@link MeterBinder binders} and {@link Metrics#addRegistry - * global registration} to {@link MeterRegistry meter registries}. This configurer - * intentionally skips {@link CompositeMeterRegistry} with the assumptions that the - * registries it contains are beans and will be customized directly. + * Configurer to apply {@link MeterRegistryCustomizer customizers}, {@link MeterFilter + * filters}, {@link MeterBinder binders} and {@link Metrics#addRegistry global + * registration} to {@link MeterRegistry meter registries}. This configurer intentionally + * skips {@link CompositeMeterRegistry} with the assumptions that the registries it + * contains are beans and will be customized directly. * * @author Jon Schneider * @author Phillip Webb diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java index e314602d79..a57a5fdbf0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java @@ -33,6 +33,7 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints; +import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPathProvider; import org.springframework.boot.security.servlet.ApplicationContextRequestMatcher; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; @@ -40,6 +41,7 @@ import org.springframework.security.web.util.matcher.OrRequestMatcher; import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; import org.springframework.util.StringUtils; +import org.springframework.web.context.WebApplicationContext; /** * Factory that can be used to create a {@link RequestMatcher} for actuator endpoint @@ -114,7 +116,7 @@ public final class EndpointRequest { * The request matcher used to match against {@link Endpoint actuator endpoints}. */ public static final class EndpointRequestMatcher - extends ApplicationContextRequestMatcher { + extends ApplicationContextRequestMatcher { private final List includes; @@ -140,7 +142,7 @@ public final class EndpointRequest { private EndpointRequestMatcher(List includes, List excludes, boolean includeLinks) { - super(PathMappedEndpoints.class); + super(WebApplicationContext.class); this.includes = includes; this.excludes = excludes; this.includeLinks = includeLinks; @@ -163,32 +165,40 @@ public final class EndpointRequest { } @Override - protected void initialized(Supplier pathMappedEndpoints) { - this.delegate = createDelegate(pathMappedEndpoints); + protected void initialized( + Supplier webApplicationContext) { + this.delegate = createDelegate(webApplicationContext); } private RequestMatcher createDelegate( - Supplier pathMappedEndpoints) { + Supplier webApplicationContext) { try { - return createDelegate(pathMappedEndpoints.get()); + WebApplicationContext context = webApplicationContext.get(); + PathMappedEndpoints pathMappedEndpoints = context + .getBean(PathMappedEndpoints.class); + DispatcherServletPathProvider pathProvider = context + .getBean(DispatcherServletPathProvider.class); + return createDelegate(pathMappedEndpoints, pathProvider.getServletPath()); } catch (NoSuchBeanDefinitionException ex) { return EMPTY_MATCHER; } } - private RequestMatcher createDelegate(PathMappedEndpoints pathMappedEndpoints) { + private RequestMatcher createDelegate(PathMappedEndpoints pathMappedEndpoints, + String servletPath) { Set paths = new LinkedHashSet<>(); if (this.includes.isEmpty()) { paths.addAll(pathMappedEndpoints.getAllPaths()); } streamPaths(this.includes, pathMappedEndpoints).forEach(paths::add); streamPaths(this.excludes, pathMappedEndpoints).forEach(paths::remove); - List delegateMatchers = getDelegateMatchers(paths); + List delegateMatchers = getDelegateMatchers(servletPath, + paths); if (this.includeLinks && StringUtils.hasText(pathMappedEndpoints.getBasePath())) { - delegateMatchers.add( - new AntPathRequestMatcher(pathMappedEndpoints.getBasePath())); + delegateMatchers.add(new AntPathRequestMatcher( + servletPath + pathMappedEndpoints.getBasePath())); } return new OrRequestMatcher(delegateMatchers); } @@ -216,14 +226,16 @@ public final class EndpointRequest { return annotation.id(); } - private List getDelegateMatchers(Set paths) { - return paths.stream().map((path) -> new AntPathRequestMatcher(path + "/**")) + private List getDelegateMatchers(String servletPath, + Set paths) { + return paths.stream() + .map((path) -> new AntPathRequestMatcher(servletPath + path + "/**")) .collect(Collectors.toList()); } @Override protected boolean matches(HttpServletRequest request, - Supplier context) { + Supplier context) { return this.delegate.matches(request); } @@ -233,29 +245,41 @@ public final class EndpointRequest { * The request matcher used to match against the links endpoint. */ public static final class LinksRequestMatcher - extends ApplicationContextRequestMatcher { + extends ApplicationContextRequestMatcher { private RequestMatcher delegate; private LinksRequestMatcher() { - super(WebEndpointProperties.class); + super(WebApplicationContext.class); } @Override - protected void initialized(Supplier properties) { - this.delegate = createDelegate(properties.get()); + protected void initialized( + Supplier webApplicationContext) { + try { + WebApplicationContext context = webApplicationContext.get(); + WebEndpointProperties properties = context + .getBean(WebEndpointProperties.class); + DispatcherServletPathProvider pathProvider = context + .getBean(DispatcherServletPathProvider.class); + this.delegate = createDelegate(pathProvider.getServletPath(), properties); + } + catch (NoSuchBeanDefinitionException ex) { + this.delegate = EMPTY_MATCHER; + } } - private RequestMatcher createDelegate(WebEndpointProperties properties) { + private RequestMatcher createDelegate(String path, + WebEndpointProperties properties) { if (StringUtils.hasText(properties.getBasePath())) { - return new AntPathRequestMatcher(properties.getBasePath()); + return new AntPathRequestMatcher(path + properties.getBasePath()); } return EMPTY_MATCHER; } @Override protected boolean matches(HttpServletRequest request, - Supplier context) { + Supplier context) { return this.delegate.matches(request); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java index 4a381d628a..92e9940ab1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java @@ -25,6 +25,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration; +import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPathProvider; import org.springframework.boot.web.servlet.error.ErrorAttributes; import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.context.annotation.Bean; @@ -92,4 +93,9 @@ class WebMvcEndpointChildContextConfiguration { return new OrderedRequestContextFilter(); } + @Bean + public DispatcherServletPathProvider childDispatcherServletPathProvider() { + return () -> ""; + } + } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java index a8e81f747a..2600b6fb97 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java @@ -124,4 +124,5 @@ public class HealthEndpointAutoConfigurationTests { } } + } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java index a998f25483..349d577c23 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java @@ -71,8 +71,7 @@ public class SignalFxMetricsExportAutoConfigurationTests { @Test public void autoConfigurationCanBeDisabled() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues( - "management.metrics.export.signalfx.enabled=false") + .withPropertyValues("management.metrics.export.signalfx.enabled=false") .run((context) -> assertThat(context) .doesNotHaveBean(SignalFxMeterRegistry.class) .doesNotHaveBean(SignalFxConfig.class)); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesTests.java index 36f3a1e250..cee0f4b9c1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesTests.java @@ -22,7 +22,6 @@ import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; /** - * * @author Stephane Nicoll */ public class SimplePropertiesTests { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java index bfd49618ff..9c4dd82429 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java @@ -30,6 +30,7 @@ import org.springframework.boot.actuate.endpoint.Operation; import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoint; import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints; +import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPathProvider; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockServletContext; import org.springframework.security.web.util.matcher.RequestMatcher; @@ -71,6 +72,19 @@ public class EndpointRequestTests { assertMatcher(matcher).doesNotMatch("/actuator/baz"); } + @Test + public void toAnyEndpointWhenServletPathNotEmptyShouldMatch() { + RequestMatcher matcher = EndpointRequest.toAnyEndpoint(); + assertMatcher(matcher, "/actuator", "/spring").matches("/spring", + "/actuator/foo"); + assertMatcher(matcher, "/actuator", "/spring").matches("/spring", + "/actuator/bar"); + assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator"); + assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/spring", + "/actuator/baz"); + assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("", "/actuator/foo"); + } + @Test public void toEndpointClassShouldMatchEndpointPath() { RequestMatcher matcher = EndpointRequest.to(FooEndpoint.class); @@ -114,6 +128,14 @@ public class EndpointRequestTests { assertMatcher.doesNotMatch("/"); } + @Test + public void toLinksWhenServletPathNotEmptyShouldNotMatch() { + RequestMatcher matcher = EndpointRequest.toLinks(); + RequestMatcherAssert assertMatcher = assertMatcher(matcher, "/actuator", + "/spring"); + assertMatcher.matches("/spring/actuator"); + } + @Test public void excludeByClassShouldNotMatchExcluded() { RequestMatcher matcher = EndpointRequest.toAnyEndpoint() @@ -179,6 +201,11 @@ public class EndpointRequestTests { return assertMatcher(matcher, mockPathMappedEndpoints(basePath)); } + private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePath, + String servletPath) { + return assertMatcher(matcher, mockPathMappedEndpoints(basePath), servletPath); + } + private PathMappedEndpoints mockPathMappedEndpoints(String basePath) { List> endpoints = new ArrayList<>(); endpoints.add(mockEndpoint("foo", "foo")); @@ -195,6 +222,11 @@ public class EndpointRequestTests { private RequestMatcherAssert assertMatcher(RequestMatcher matcher, PathMappedEndpoints pathMappedEndpoints) { + return assertMatcher(matcher, pathMappedEndpoints, ""); + } + + private RequestMatcherAssert assertMatcher(RequestMatcher matcher, + PathMappedEndpoints pathMappedEndpoints, String servletPath) { StaticWebApplicationContext context = new StaticWebApplicationContext(); context.registerBean(WebEndpointProperties.class); if (pathMappedEndpoints != null) { @@ -205,6 +237,8 @@ public class EndpointRequestTests { properties.setBasePath(pathMappedEndpoints.getBasePath()); } } + DispatcherServletPathProvider pathProvider = () -> servletPath; + context.registerBean(DispatcherServletPathProvider.class, () -> pathProvider); return assertThat(new RequestMatcherAssert(context, matcher)); } @@ -219,8 +253,12 @@ public class EndpointRequestTests { this.matcher = matcher; } - public void matches(String path) { - matches(mockRequest(path)); + public void matches(String servletPath) { + matches(mockRequest(servletPath)); + } + + public void matches(String servletPath, String pathInfo) { + matches(mockRequest(servletPath, pathInfo)); } private void matches(HttpServletRequest request) { @@ -228,8 +266,12 @@ public class EndpointRequestTests { .as("Matches " + getRequestPath(request)).isTrue(); } - public void doesNotMatch(String path) { - doesNotMatch(mockRequest(path)); + public void doesNotMatch(String servletPath) { + doesNotMatch(mockRequest(servletPath)); + } + + public void doesNotMatch(String servletPath, String pathInfo) { + doesNotMatch(mockRequest(servletPath, pathInfo)); } private void doesNotMatch(HttpServletRequest request) { @@ -237,8 +279,8 @@ public class EndpointRequestTests { .as("Does not match " + getRequestPath(request)).isFalse(); } - private MockHttpServletRequest mockRequest(String path) { - return mockRequest(null, path); + private MockHttpServletRequest mockRequest(String servletPath) { + return mockRequest(servletPath, null); } private MockHttpServletRequest mockRequest(String servletPath, String path) { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java index 6f2a7aa28d..6d4dcc8037 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.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. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationTests.java index 28d79548f3..4d67053661 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationTests.java @@ -18,6 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.web.servlet; import org.junit.Test; +import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPathProvider; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter; import org.springframework.context.annotation.Bean; @@ -62,6 +63,15 @@ public class WebMvcEndpointChildContextConfigurationTests { }); } + @Test + public void contextShouldConfigureDispatcherServletPathProviderWithEmptyPath() { + this.contextRunner + .withUserConfiguration(WebMvcEndpointChildContextConfiguration.class) + .run((context) -> assertThat(context + .getBean(DispatcherServletPathProvider.class).getServletPath()) + .isEmpty()); + } + static class ExistingConfig { @Bean diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/beans/BeansEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/beans/BeansEndpoint.java index 41afc71c16..aefaf59ed4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/beans/BeansEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/beans/BeansEndpoint.java @@ -44,7 +44,6 @@ public class BeansEndpoint { /** * Creates a new {@code BeansEndpoint} that will describe the beans in the given * {@code context} and all of its ancestors. - * * @param context the application context * @see ConfigurableApplicationContext#getParent() */ diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java index 0c4e7b68b1..4dd46dc166 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java @@ -335,6 +335,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext } super.serializeAsField(pojo, jgen, provider, writer); } + } /** diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java index 29eb5c651c..a190c5f734 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java @@ -51,4 +51,5 @@ public final class MissingParametersException extends InvalidEndpointRequestExce public Set getMissingParameters() { return this.missingParameters; } + } 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 e681735651..f6f5094570 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 @@ -107,8 +107,8 @@ public class EndpointMBean implements DynamicMBean { return this.responseMapper.mapResponse(result); } catch (InvalidEndpointRequestException ex) { - throw new ReflectionException(new IllegalArgumentException( - ex.getMessage()), ex.getMessage()); + throw new ReflectionException(new IllegalArgumentException(ex.getMessage()), + ex.getMessage()); } catch (Exception ex) { throw new MBeanException(translateIfNecessary(ex), ex.getMessage()); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java index 49aec8cd5d..1f1d3d80c9 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java @@ -210,4 +210,5 @@ class DiscoveredJmxOperation extends AbstractDiscoveredOperation implements JmxO } } + } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMapping.java index 3d759a15a7..2edede05ab 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMapping.java @@ -30,7 +30,6 @@ public class EndpointMapping { /** * Creates a new {@code EndpointMapping} using the given {@code path}. - * * @param path the path */ public EndpointMapping(String path) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredWebEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredWebEndpoint.java index cc997e1b6f..17acb60389 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredWebEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredWebEndpoint.java @@ -44,4 +44,5 @@ class DiscoveredWebEndpoint extends AbstractDiscoveredEndpoint public String getRootPath() { return this.rootPath; } + } 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 a309c3b575..d666810e24 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 @@ -251,6 +251,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping Mono> handle(ServerWebExchange exchange, Map body); + } /** diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java index 80e418eb8e..36879f0692 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.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. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java index 1996e9c36f..6454b3526f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.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. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java index 2982480dfc..9138ef1dd7 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.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. 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 f175315062..c7055c3294 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 @@ -173,6 +173,7 @@ public class MetricsEndpoint { public Set getNames() { return this.names; } + } /** @@ -228,6 +229,7 @@ public class MetricsEndpoint { public Set getValues() { return this.values; } + } /** diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusScrapeEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusScrapeEndpoint.java index e742a50c48..1aba267863 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusScrapeEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusScrapeEndpoint.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. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/DefaultRestTemplateExchangeTagsProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/DefaultRestTemplateExchangeTagsProvider.java index 35eab2381f..f13bd6dfe9 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/DefaultRestTemplateExchangeTagsProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/DefaultRestTemplateExchangeTagsProvider.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. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java index 799bf0103d..14435516d3 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java @@ -61,18 +61,17 @@ public class MetricsWebFilter implements WebFilter { private Publisher filter(ServerWebExchange exchange, Mono call) { long start = System.nanoTime(); ServerHttpResponse response = exchange.getResponse(); - return call.doOnSuccess((done) -> success(exchange, start)) - .doOnError((cause) -> { - if (response.isCommitted()) { - error(exchange, start, cause); - } - else { - response.beforeCommit(() -> { - error(exchange, start, cause); - return Mono.empty(); - }); - } + return call.doOnSuccess((done) -> success(exchange, start)).doOnError((cause) -> { + if (response.isCommitted()) { + error(exchange, start, cause); + } + else { + response.beforeCommit(() -> { + error(exchange, start, cause); + return Mono.empty(); }); + } + }); } private void success(ServerWebExchange exchange, long start) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/MappingDescriptionProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/MappingDescriptionProvider.java index 751549a841..c497c89132 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/MappingDescriptionProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/MappingDescriptionProvider.java @@ -31,7 +31,6 @@ public interface MappingDescriptionProvider { /** * Returns the name of the mappings described by this provider. - * * @return the name of the mappings */ String getMappingName(); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FilterRegistrationMappingDescription.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FilterRegistrationMappingDescription.java index c1115f2df2..3515bfc8e4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FilterRegistrationMappingDescription.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FilterRegistrationMappingDescription.java @@ -40,7 +40,6 @@ public class FilterRegistrationMappingDescription /** * Returns the servlet name mappings for the registered filter. - * * @return the mappings */ public Collection getServletNameMappings() { @@ -49,7 +48,6 @@ public class FilterRegistrationMappingDescription /** * Returns the URL pattern mappings for the registered filter. - * * @return the mappings */ public Collection getUrlPatternMappings() { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/RegistrationMappingDescription.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/RegistrationMappingDescription.java index 1a93161d93..b52abe6f45 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/RegistrationMappingDescription.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/RegistrationMappingDescription.java @@ -40,7 +40,6 @@ public class RegistrationMappingDescription { /** * Returns the name of the registered Filter or Servlet. - * * @return the name */ public String getName() { @@ -49,7 +48,6 @@ public class RegistrationMappingDescription { /** * Returns the class name of the registered Filter or Servlet. - * * @return the class name */ public String getClassName() { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletRegistrationMappingDescription.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletRegistrationMappingDescription.java index c0d12393db..067983e693 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletRegistrationMappingDescription.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/ServletRegistrationMappingDescription.java @@ -41,7 +41,6 @@ public class ServletRegistrationMappingDescription /** * Returns the mappings for the registered servlet. - * * @return the mappings */ public Collection getMappings() { diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java index c79bcd210f..195ee875f6 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java @@ -81,4 +81,5 @@ public class OperationMethodTests { String example(String name) { return name; } + } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/TestJmxOperationResponseMapper.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/TestJmxOperationResponseMapper.java index cb06ec9ed9..b08b98bf6e 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/TestJmxOperationResponseMapper.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/TestJmxOperationResponseMapper.java @@ -32,4 +32,5 @@ class TestJmxOperationResponseMapper implements JmxOperationResponseMapper { public Class mapResponseType(Class responseType) { return responseType; } + } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscovererTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscovererTests.java index b1ea4acc06..e3cd4c7562 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscovererTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscovererTests.java @@ -57,16 +57,17 @@ public class ControllerEndpointDiscovererTests { @Test public void getEndpointsWhenNoEndpointBeansShouldReturnEmptyCollection() { - this.contextRunner.withUserConfiguration(EmptyConfiguration.class).run( - assertDiscoverer((discoverer) -> - assertThat(discoverer.getEndpoints()).isEmpty())); + this.contextRunner.withUserConfiguration(EmptyConfiguration.class) + .run(assertDiscoverer( + (discoverer) -> assertThat(discoverer.getEndpoints()).isEmpty())); } @Test public void getEndpointsShouldIncludeControllerEndpoints() { this.contextRunner.withUserConfiguration(TestControllerEndpoint.class) .run(assertDiscoverer((discoverer) -> { - Collection endpoints = discoverer.getEndpoints(); + Collection endpoints = discoverer + .getEndpoints(); assertThat(endpoints).hasSize(1); ExposableControllerEndpoint endpoint = endpoints.iterator().next(); assertThat(endpoint.getId()).isEqualTo("testcontroller"); @@ -79,10 +80,11 @@ public class ControllerEndpointDiscovererTests { @Test public void getEndpointsShouldDiscoverProxyControllerEndpoints() { this.contextRunner.withUserConfiguration(TestProxyControllerEndpoint.class) - .withConfiguration(AutoConfigurations.of( - ValidationAutoConfiguration.class)) + .withConfiguration( + AutoConfigurations.of(ValidationAutoConfiguration.class)) .run(assertDiscoverer((discoverer) -> { - Collection endpoints = discoverer.getEndpoints(); + Collection endpoints = discoverer + .getEndpoints(); assertThat(endpoints).hasSize(1); ExposableControllerEndpoint endpoint = endpoints.iterator().next(); assertThat(endpoint.getId()).isEqualTo("testcontroller"); @@ -96,7 +98,8 @@ public class ControllerEndpointDiscovererTests { public void getEndpointsShouldIncludeRestControllerEndpoints() { this.contextRunner.withUserConfiguration(TestRestControllerEndpoint.class) .run(assertDiscoverer((discoverer) -> { - Collection endpoints = discoverer.getEndpoints(); + Collection endpoints = discoverer + .getEndpoints(); assertThat(endpoints).hasSize(1); ExposableControllerEndpoint endpoint = endpoints.iterator().next(); assertThat(endpoint.getId()).isEqualTo("testrestcontroller"); @@ -108,10 +111,11 @@ public class ControllerEndpointDiscovererTests { @Test public void getEndpointsShouldDiscoverProxyRestControllerEndpoints() { this.contextRunner.withUserConfiguration(TestProxyRestControllerEndpoint.class) - .withConfiguration(AutoConfigurations.of( - ValidationAutoConfiguration.class)) + .withConfiguration( + AutoConfigurations.of(ValidationAutoConfiguration.class)) .run(assertDiscoverer((discoverer) -> { - Collection endpoints = discoverer.getEndpoints(); + Collection endpoints = discoverer + .getEndpoints(); assertThat(endpoints).hasSize(1); ExposableControllerEndpoint endpoint = endpoints.iterator().next(); assertThat(endpoint.getId()).isEqualTo("testrestcontroller"); @@ -125,7 +129,8 @@ public class ControllerEndpointDiscovererTests { public void getEndpointsShouldNotDiscoverRegularEndpoints() { this.contextRunner.withUserConfiguration(WithRegularEndpointConfiguration.class) .run(assertDiscoverer((discoverer) -> { - Collection endpoints = discoverer.getEndpoints(); + Collection endpoints = discoverer + .getEndpoints(); List ids = endpoints.stream().map(ExposableEndpoint::getId) .collect(Collectors.toList()); assertThat(ids).containsOnly("testcontroller", "testrestcontroller"); @@ -137,7 +142,8 @@ public class ControllerEndpointDiscovererTests { this.contextRunner.withUserConfiguration(TestControllerWithOperation.class) .run(assertDiscoverer((discoverer) -> { this.thrown.expect(IllegalStateException.class); - this.thrown.expectMessage("ControllerEndpoints must not declare operations"); + this.thrown.expectMessage( + "ControllerEndpoints must not declare operations"); discoverer.getEndpoints(); })); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java index f2b0a48c8b..7ae9093cb2 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java @@ -67,15 +67,16 @@ public class ServletEndpointDiscovererTests { @Test public void getEndpointsWhenNoEndpointBeansShouldReturnEmptyCollection() { this.contextRunner.withUserConfiguration(EmptyConfiguration.class) - .run(assertDiscoverer((discoverer) - -> assertThat(discoverer.getEndpoints()).isEmpty())); + .run(assertDiscoverer( + (discoverer) -> assertThat(discoverer.getEndpoints()).isEmpty())); } @Test public void getEndpointsShouldIncludeServletEndpoints() { this.contextRunner.withUserConfiguration(TestServletEndpoint.class) .run(assertDiscoverer((discoverer) -> { - Collection endpoints = discoverer.getEndpoints(); + Collection endpoints = discoverer + .getEndpoints(); assertThat(endpoints).hasSize(1); ExposableServletEndpoint endpoint = endpoints.iterator().next(); assertThat(endpoint.getId()).isEqualTo("testservlet"); @@ -87,9 +88,11 @@ public class ServletEndpointDiscovererTests { @Test public void getEndpointsShouldDiscoverProxyServletEndpoints() { this.contextRunner.withUserConfiguration(TestProxyServletEndpoint.class) - .withConfiguration(AutoConfigurations.of(ValidationAutoConfiguration.class)) + .withConfiguration( + AutoConfigurations.of(ValidationAutoConfiguration.class)) .run(assertDiscoverer((discoverer) -> { - Collection endpoints = discoverer.getEndpoints(); + Collection endpoints = discoverer + .getEndpoints(); assertThat(endpoints).hasSize(1); ExposableServletEndpoint endpoint = endpoints.iterator().next(); assertThat(endpoint.getId()).isEqualTo("testservlet"); @@ -102,7 +105,8 @@ public class ServletEndpointDiscovererTests { public void getEndpointsShouldNotDiscoverRegularEndpoints() { this.contextRunner.withUserConfiguration(WithRegularEndpointConfiguration.class) .run(assertDiscoverer((discoverer) -> { - Collection endpoints = discoverer.getEndpoints(); + Collection endpoints = discoverer + .getEndpoints(); List ids = endpoints.stream().map(ExposableEndpoint::getId) .collect(Collectors.toList()); assertThat(ids).containsOnly("testservlet"); @@ -114,7 +118,8 @@ public class ServletEndpointDiscovererTests { this.contextRunner.withUserConfiguration(TestServletEndpointWithOperation.class) .run(assertDiscoverer((discoverer) -> { this.thrown.expect(IllegalStateException.class); - this.thrown.expectMessage("ServletEndpoints must not declare operations"); + this.thrown.expectMessage( + "ServletEndpoints must not declare operations"); discoverer.getEndpoints(); })); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/ContextFactory.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/ContextFactory.java index a9a344e1ca..c3a14d2ac0 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/ContextFactory.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/ContextFactory.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,4 +27,5 @@ import org.springframework.context.ConfigurableApplicationContext; interface ContextFactory { ConfigurableApplicationContext createContext(List> configurationClasses); + } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilterTests.java index 0ef7533951..45d9acbe3e 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilterTests.java @@ -32,6 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat; /** * Tests for {@link MetricsWebFilter} + * * @author Brian Clozel */ public class MetricsWebFilterTests { diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/HttpExchangeTracerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/HttpExchangeTracerTests.java index 97fe487fef..331fdf29d8 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/HttpExchangeTracerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/HttpExchangeTracerTests.java @@ -331,4 +331,5 @@ public class HttpExchangeTracerTests { } return output.toString(); } + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java index 5d97dab62e..87d55e7199 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java @@ -458,6 +458,7 @@ public class RabbitProperties { public void setCheckoutTimeout(Duration checkoutTimeout) { this.checkoutTimeout = checkoutTimeout; } + } public static class Connection { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java index 8ea3eb0df3..ddf6943ed2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java @@ -75,8 +75,7 @@ public class CacheAutoConfiguration { @Bean public CacheManagerValidator cacheAutoConfigurationValidator( - CacheProperties cacheProperties, - ObjectProvider cacheManager) { + CacheProperties cacheProperties, ObjectProvider cacheManager) { return new CacheManagerValidator(cacheProperties, cacheManager); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerServletWebConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerServletWebConfiguration.java index 1f9301d90f..93d76b1185 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerServletWebConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerServletWebConfiguration.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. @@ -77,4 +77,5 @@ class FreeMarkerServletWebConfiguration extends AbstractFreeMarkerConfiguration public ResourceUrlEncodingFilter resourceUrlEncodingFilter() { return new ResourceUrlEncodingFilter(); } + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/gson/GsonBuilderCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/gson/GsonBuilderCustomizer.java index cecf888ed4..7c138e79c0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/gson/GsonBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/gson/GsonBuilderCustomizer.java @@ -34,4 +34,5 @@ public interface GsonBuilderCustomizer { * @param gsonBuilder the GsonBuilder to customize */ void customize(GsonBuilder gsonBuilder); + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationScanRegistrar.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationScanRegistrar.java index 4b55d41a65..ba7576b144 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationScanRegistrar.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationScanRegistrar.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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBeanCreationFailureAnalyzer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBeanCreationFailureAnalyzer.java index 5415ffef1a..55ebba3be0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBeanCreationFailureAnalyzer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBeanCreationFailureAnalyzer.java @@ -62,8 +62,8 @@ class DataSourceBeanCreationFailureAnalyzer if (!StringUtils.hasText(cause.getProperties().getUrl())) { description.append("'url' attribute is not specified and "); } - description.append( - String.format("no embedded datasource could be configured.%n")); + description + .append(String.format("no embedded datasource could be configured.%n")); description.append(String.format("%nReason: %s%n", cause.getMessage())); return description.toString(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java index d059261efb..6c29005d48 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java @@ -142,6 +142,7 @@ public final class StaticResourceRequest { getDelegateMatchers()); return matcher.matches(exchange); } + } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java index 3025b329c3..45da379fd3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionAutoConfiguration.java @@ -191,6 +191,7 @@ public class SessionAutoConfiguration { // Ignore } } + } /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfiguration.java index f3ac1b415a..2f65e1c146 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfiguration.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,6 +75,7 @@ public class TransactionAutoConfiguration { public TransactionTemplate transactionTemplate() { return new TransactionTemplate(this.transactionManager); } + } @Configuration diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 34930dbff1..2ef354cfa6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -957,6 +957,7 @@ public class ServerProperties { public void setLogLatency(boolean logLatency) { this.logLatency = logLatency; } + } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java index dbec999953..351b08f79e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java @@ -205,6 +205,7 @@ public class WebFluxAutoConfiguration { } } + } /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java index 01c8c14f1b..cd2ac0dd33 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java @@ -88,8 +88,12 @@ public class DispatcherServletAutoConfiguration { private final WebMvcProperties webMvcProperties; - public DispatcherServletConfiguration(WebMvcProperties webMvcProperties) { + private final ServerProperties serverProperties; + + public DispatcherServletConfiguration(WebMvcProperties webMvcProperties, + ServerProperties serverProperties) { this.webMvcProperties = webMvcProperties; + this.serverProperties = serverProperties; } @Bean(name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME) @@ -112,6 +116,12 @@ public class DispatcherServletAutoConfiguration { return resolver; } + @Bean + public DispatcherServletPathProvider mainDispatcherServletPathProvider() { + return () -> DispatcherServletConfiguration.this.serverProperties.getServlet() + .getPath(); + } + } @Configuration diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletPathProvider.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletPathProvider.java new file mode 100644 index 0000000000..8adcee4c1d --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletPathProvider.java @@ -0,0 +1,33 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigure.web.servlet; + +import org.springframework.web.servlet.DispatcherServlet; + +/** + * Interface that provides the path of the {@link DispatcherServlet} in an application + * context. + * + * @author Madhura Bhave + * @since 2.0.2 + */ +@FunctionalInterface +public interface DispatcherServletPathProvider { + + String getServletPath(); + +} 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 7b69c6e8a8..4d8953fa30 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 @@ -752,11 +752,10 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT public void autoConfiguredCacheManagerCanBeSwapped() { this.contextRunner .withUserConfiguration(CacheManagerPostProcessorConfiguration.class) - .withPropertyValues("spring.cache.type=caffeine") - .run((context) -> { + .withPropertyValues("spring.cache.type=caffeine").run((context) -> { getCacheManager(context, SimpleCacheManager.class); - CacheManagerPostProcessor postProcessor = context.getBean( - CacheManagerPostProcessor.class); + CacheManagerPostProcessor postProcessor = context + .getBean(CacheManagerPostProcessor.class); assertThat(postProcessor.cacheManagers).hasSize(1); assertThat(postProcessor.cacheManagers.get(0)) .isInstanceOf(CaffeineCacheManager.class); @@ -1043,14 +1042,12 @@ public class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationT private final List cacheManagers = new ArrayList<>(); @Override - public Object postProcessBeforeInitialization(Object bean, - String beanName) { + public Object postProcessBeforeInitialization(Object bean, String beanName) { return bean; } @Override - public Object postProcessAfterInitialization(Object bean, - String beanName) { + public Object postProcessAfterInitialization(Object bean, String beanName) { if (bean instanceof CacheManager) { this.cacheManagers.add((CacheManager) bean); return new SimpleCacheManager(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/second/SampleAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/second/SampleAutoConfiguration.java index 8096c88122..db5894f0dc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/second/SampleAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/second/SampleAutoConfiguration.java @@ -36,4 +36,3 @@ public class SampleAutoConfiguration { } } - diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java index 7828018422..1404d0cd0e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.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. @@ -158,6 +158,7 @@ public class CassandraDataAutoConfigurationTests { public String convert(Person o) { return null; } + } private static class Person { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseDataAutoConfigurationTests.java index 4b37c2aa14..96d5df9f13 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseDataAutoConfigurationTests.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. @@ -186,6 +186,7 @@ public class CouchbaseDataAutoConfigurationTests { public Boolean convert(CouchbaseProperties value) { return true; } + } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchNodeTemplate.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchNodeTemplate.java index 649f3cb463..26324550c1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchNodeTemplate.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchNodeTemplate.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,6 +76,7 @@ public class ElasticsearchNodeTemplate { Arrays.asList(Netty4Plugin.class)); new File("target/es/node/logs").mkdirs(); } + } public final class ElasticsearchNode { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/gson/GsonAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/gson/GsonAutoConfigurationTests.java index 5785d56c79..2b2a1b3690 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/gson/GsonAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/gson/GsonAutoConfigurationTests.java @@ -291,6 +291,7 @@ public class GsonAutoConfigurationTests { private String data = "nested"; } + } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java index 65fd58ca5c..71eafedf2d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfigurationTests.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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java index 74ae1d9eea..106ab06b9a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java @@ -80,16 +80,16 @@ public class IntegrationAutoConfigurationTests { .withUserConfiguration(CustomIntegrationComponentScanConfiguration.class) .run((context) -> { assertThat(context).hasSingleBean(TestGateway.class); - assertThat(context).doesNotHaveBean( - IntegrationComponentScanConfiguration.class); + assertThat(context) + .doesNotHaveBean(IntegrationComponentScanConfiguration.class); }); } @Test public void noMBeanServerAvailable() { ApplicationContextRunner contextRunnerWithoutJmx = new ApplicationContextRunner() - .withConfiguration(AutoConfigurations.of( - IntegrationAutoConfiguration.class)); + .withConfiguration( + AutoConfigurations.of(IntegrationAutoConfiguration.class)); contextRunnerWithoutJmx.run((context) -> { assertThat(context).hasSingleBean(TestGateway.class); assertThat(context) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java index d15e44249c..17ac223972 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java @@ -232,6 +232,7 @@ public class ActiveMQAutoConfigurationTests { factory.setUserName("foobar"); }; } + } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java index 7054715d10..91a60dbfb0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java @@ -96,4 +96,5 @@ public class ArtemisEmbeddedConfigurationFactoryTests { .getAddressConfigurations(); assertThat(addressConfigurations).hasSize(2); } + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqPropertiesTests.java index 37564a977f..d6f6659747 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqPropertiesTests.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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationTests.java index a687dca531..06cae1be89 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jsonb/JsonbAutoConfigurationTests.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. @@ -55,6 +55,7 @@ public class JsonbAutoConfigurationTests { public void setData(String data) { this.data = data; } + } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationTests.java index 02d8e370e5..77676acd9c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationTests.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. @@ -127,6 +127,7 @@ public class MustacheAutoConfigurationTests { return Mustache.compiler().standardsMode(true) .withLoader(mustacheTemplateLoader); } + } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfigurationTests.java index eb6e4ce21e..1d65a888de 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfigurationTests.java @@ -87,21 +87,24 @@ public class QuartzAutoConfigurationTests { @Test public void withDataSourceUseMemoryByDefault() { - this.contextRunner.withConfiguration(AutoConfigurations.of( - DataSourceAutoConfiguration.class, - DataSourceTransactionManagerAutoConfiguration.class)).run((context) -> { - assertThat(context).hasSingleBean(Scheduler.class); - Scheduler scheduler = context.getBean(Scheduler.class); - assertThat(scheduler.getMetaData().getJobStoreClass()) - .isAssignableFrom(RAMJobStore.class); - }); + this.contextRunner + .withConfiguration( + AutoConfigurations.of(DataSourceAutoConfiguration.class, + DataSourceTransactionManagerAutoConfiguration.class)) + .run((context) -> { + assertThat(context).hasSingleBean(Scheduler.class); + Scheduler scheduler = context.getBean(Scheduler.class); + assertThat(scheduler.getMetaData().getJobStoreClass()) + .isAssignableFrom(RAMJobStore.class); + }); } @Test public void withDataSource() { this.contextRunner.withUserConfiguration(QuartzJobsConfiguration.class) - .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class, - DataSourceTransactionManagerAutoConfiguration.class)) + .withConfiguration( + AutoConfigurations.of(DataSourceAutoConfiguration.class, + DataSourceTransactionManagerAutoConfiguration.class)) .withPropertyValues("spring.quartz.job-store-type=jdbc") .run(assertDataSourceJobStore("dataSource")); } @@ -109,8 +112,8 @@ public class QuartzAutoConfigurationTests { @Test public void withDataSourceNoTransactionManager() { this.contextRunner.withUserConfiguration(QuartzJobsConfiguration.class) - .withConfiguration(AutoConfigurations.of( - DataSourceAutoConfiguration.class)) + .withConfiguration( + AutoConfigurations.of(DataSourceAutoConfiguration.class)) .withPropertyValues("spring.quartz.job-store-type=jdbc") .run(assertDataSourceJobStore("dataSource")); } @@ -131,13 +134,13 @@ public class QuartzAutoConfigurationTests { Scheduler scheduler = context.getBean(Scheduler.class); assertThat(scheduler.getMetaData().getJobStoreClass()) .isAssignableFrom(LocalDataSourceJobStore.class); - JdbcTemplate jdbcTemplate = new JdbcTemplate(context.getBean( - datasourceName, DataSource.class)); + JdbcTemplate jdbcTemplate = new JdbcTemplate( + context.getBean(datasourceName, DataSource.class)); assertThat(jdbcTemplate.queryForObject( "SELECT COUNT(*) FROM QRTZ_JOB_DETAILS", Integer.class)).isEqualTo(2); assertThat(jdbcTemplate.queryForObject( "SELECT COUNT(*) FROM QRTZ_SIMPLE_TRIGGERS", Integer.class)) - .isEqualTo(0); + .isEqualTo(0); }; } @@ -185,8 +188,9 @@ public class QuartzAutoConfigurationTests { @Test public void withQuartzProperties() { - this.contextRunner.withPropertyValues( - "spring.quartz.properties.org.quartz.scheduler.instanceId=FOO") + this.contextRunner + .withPropertyValues( + "spring.quartz.properties.org.quartz.scheduler.instanceId=FOO") .run((context) -> { assertThat(context).hasSingleBean(Scheduler.class); Scheduler scheduler = context.getBean(Scheduler.class); @@ -204,8 +208,6 @@ public class QuartzAutoConfigurationTests { }); } - - @Import(ComponentThatUsesScheduler.class) @Configuration protected static class BaseQuartzConfiguration { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/WebFluxSecurityConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/WebFluxSecurityConfigurationTests.java index 64e58e2a69..c4ab9d517b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/WebFluxSecurityConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/WebFluxSecurityConfigurationTests.java @@ -69,4 +69,5 @@ public class WebFluxSecurityConfigurationTests { } } + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfigurationTests.java index 5323ebed76..ffccb0ee0b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfigurationTests.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. @@ -203,6 +203,7 @@ public class TransactionAutoConfigurationTests { public AnotherServiceImpl anotherService() { return new AnotherServiceImpl(); } + } @Configuration diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java index 561bcc8cb8..1098200144 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/validation/ValidationAutoConfigurationTests.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. @@ -304,6 +304,7 @@ public class ValidationAutoConfigurationTests { interface AnotherSampleService { void doSomething(@Min(42) Integer counter); + } @Validated @@ -313,6 +314,7 @@ public class ValidationAutoConfigurationTests { public void doSomething(Integer counter) { } + } @Configuration @@ -382,6 +384,7 @@ public class ValidationAutoConfigurationTests { } } + } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java index 471aa8797a..e1706642ef 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfigurationTests.java @@ -373,6 +373,7 @@ public class WebFluxAutoConfigurationTests { public CodecCustomizer firstCodecCustomizer() { return mock(CodecCustomizer.class); } + } @Configuration @@ -388,6 +389,7 @@ public class WebFluxAutoConfigurationTests { public ViewResolver anotherViewResolver() { return mock(ViewResolver.class); } + } @Configuration @@ -407,6 +409,7 @@ public class WebFluxAutoConfigurationTests { public HttpHandler httpHandler() { return (serverHttpRequest, serverHttpResponse) -> null; } + } @Configuration 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 deebe758ea..97f7da1e95 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 @@ -311,6 +311,7 @@ public class DefaultErrorWebExceptionHandlerIntegrationTests { public String bodyValidation(@Valid @RequestBody DummyBody body) { return body.getContent(); } + } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfigurationTests.java index 68a62a5bbe..7927fb6e5a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfigurationTests.java @@ -107,6 +107,8 @@ public class DispatcherServletAutoConfigurationTests { assertThat(registration.getUrlMappings().toString()) .isEqualTo("[/spring/*]"); assertThat(registration.getMultipartConfig()).isNull(); + assertThat(context.getBean(DispatcherServletPathProvider.class) + .getServletPath()).isEqualTo("/spring"); }); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MockServletWebServerFactory.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MockServletWebServerFactory.java index 3c15e9bccb..7807b0a586 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MockServletWebServerFactory.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MockServletWebServerFactory.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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/TomcatServletWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/TomcatServletWebServerFactoryCustomizerTests.java index ff46e05316..1dffdc0b32 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/TomcatServletWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/TomcatServletWebServerFactoryCustomizerTests.java @@ -109,4 +109,5 @@ public class TomcatServletWebServerFactoryCustomizerTests { this.customizer.customize(factory); return factory; } + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java index a024aab3f8..c69b711a13 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java @@ -829,12 +829,13 @@ public class WebMvcAutoConfigurationTests { @Test public void contentNegotiationStrategySkipsPathExtension() throws Exception { ContentNegotiationStrategy delegate = mock(ContentNegotiationStrategy.class); - ContentNegotiationStrategy strategy = new WebMvcAutoConfiguration - .OptionalPathExtensionContentNegotiationStrategy(delegate); + ContentNegotiationStrategy strategy = new WebMvcAutoConfiguration.OptionalPathExtensionContentNegotiationStrategy( + delegate); MockHttpServletRequest request = new MockHttpServletRequest(); - request.setAttribute(PathExtensionContentNegotiationStrategy.class - .getName() + ".SKIP", Boolean.TRUE); + request.setAttribute( + PathExtensionContentNegotiationStrategy.class.getName() + ".SKIP", + Boolean.TRUE); ServletWebRequest webRequest = new ServletWebRequest(request); List mediaTypes = strategy.resolveMediaTypes(webRequest); assertThat(mediaTypes).containsOnly(MediaType.ALL); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMappingTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMappingTests.java index 9c485106a2..6d6092ad9f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMappingTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMappingTests.java @@ -68,8 +68,7 @@ public class WelcomePageHandlerMappingTests { .run((context) -> { WelcomePageHandlerMapping handler = context .getBean(WelcomePageHandlerMapping.class); - assertThat(handler.getOrder()) - .isEqualTo(2); + assertThat(handler.getOrder()).isEqualTo(2); }); } diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java index 9be203c8f0..c01ad6d6e9 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java @@ -359,7 +359,8 @@ class ProjectGenerationRequest { return builder.build(); } catch (URISyntaxException ex) { - throw new ReportableException("Invalid service URL (" + ex.getMessage() + ")"); + throw new ReportableException( + "Invalid service URL (" + ex.getMessage() + ")"); } } diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/test/MockClientHttpRequestFactory.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/test/MockClientHttpRequestFactory.java index 664906057a..42ab33fb59 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/test/MockClientHttpRequestFactory.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/test/MockClientHttpRequestFactory.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. diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/elasticsearch/jest/JestClientCustomizationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/elasticsearch/jest/JestClientCustomizationExample.java index fee62a1663..e82f3dcfaa 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/elasticsearch/jest/JestClientCustomizationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/elasticsearch/jest/JestClientCustomizationExample.java @@ -42,4 +42,5 @@ public class JestClientCustomizationExample { } // end::customizer[] + } diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfigurationTests.java index 1d284fcccd..cefd8cdf9f 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/autoconfigure/UserServiceAutoConfigurationTests.java @@ -36,6 +36,7 @@ public class UserServiceAutoConfigurationTests { // tag::runner[] private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(UserServiceAutoConfiguration.class)); + // end::runner[] // tag::test-env[] diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTypeExcludeFilter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTypeExcludeFilter.java index 412d80dd51..d9d722dcd0 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTypeExcludeFilter.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTypeExcludeFilter.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. @@ -69,4 +69,5 @@ class DataNeo4jTypeExcludeFilter extends AnnotationCustomizableTypeExcludeFilter protected Set> getComponentIncludes() { return Collections.emptySet(); } + } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestExecutionListener.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestExecutionListener.java index cfab0a2eb9..105cc79ed7 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestExecutionListener.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestExecutionListener.java @@ -26,8 +26,7 @@ import org.springframework.util.ClassUtils; /** * A {@link TestExecutionListener} for Spring REST Docs that removes the need for a - * {@code @Rule} when using JUnit or manual before and after test calls when using - * TestNG. + * {@code @Rule} when using JUnit or manual before and after test calls when using TestNG. * * @author Andy Wilkinson * @since 1.4.0 diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/ldap/ExampleEntry.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/ldap/ExampleEntry.java index cff33ce8b8..3cd660a79d 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/ldap/ExampleEntry.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/ldap/ExampleEntry.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,4 +39,5 @@ public class ExampleEntry { public void setDn(Name dn) { this.dn = dn; } + } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/ExampleRepository.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/ExampleRepository.java index bf3fb05b26..4d2e9d7a20 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/ExampleRepository.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/ExampleRepository.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. @@ -24,4 +24,5 @@ import org.springframework.data.neo4j.repository.Neo4jRepository; * @author EddĂș MelĂ©ndez */ public interface ExampleRepository extends Neo4jRepository { + } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/FilteredClassLoader.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/FilteredClassLoader.java index d45cba2b4a..d222aa5cda 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/FilteredClassLoader.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/FilteredClassLoader.java @@ -123,4 +123,5 @@ public class FilteredClassLoader extends URLClassLoader { } } + } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java index 198528973e..fcee0a2d28 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java @@ -353,6 +353,7 @@ class ImportsContextCustomizer implements ContextCustomizer { public String toString() { return this.key.toString(); } + } /** diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java index 899f90eeaa..ce6ac24d37 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.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. @@ -123,6 +123,7 @@ public class JsonbTester extends AbstractJsonMarshalTester { Class resourceLoadClass, ResolvableType type, Jsonb marshaller) { return new JsonbTester<>(resourceLoadClass, type, marshaller); } + } } diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java index db2b60eafb..5209045669 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java @@ -419,6 +419,7 @@ public class ApplicationContextAssertTests { } private static class Foo { + } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestMethodConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestMethodConfiguration.java index 3793b857c0..d86d920678 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestMethodConfiguration.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestMethodConfiguration.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. @@ -30,4 +30,5 @@ public class TestMethodConfiguration { public Object method() { return null; } + } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestOrderedClassConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestOrderedClassConfiguration.java index 625fd14ed0..9970517d1b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestOrderedClassConfiguration.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestOrderedClassConfiguration.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. @@ -29,4 +29,5 @@ import java.io.OutputStream; @TestConditionalOnClass(name = "java.io.InputStream", value = OutputStream.class) @TestAutoConfigureOrder(123) public class TestOrderedClassConfiguration { + } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java index c071f48570..c9405a4ef2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ConfigurationMetadata.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. @@ -151,8 +151,8 @@ public class ConfigurationMetadata { } candidates.removeIf((itemMetadata) -> !itemMetadata.hasSameType(metadata)); if (candidates.size() > 1 && metadata.getType() != null) { - candidates.removeIf((itemMetadata) -> - !metadata.getType().equals(itemMetadata.getType())); + candidates.removeIf( + (itemMetadata) -> !metadata.getType().equals(itemMetadata.getType())); } if (candidates.size() == 1) { return candidates.get(0); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java index 36b42bcccf..10113e0daa 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java @@ -742,8 +742,8 @@ public class ConfigurationMetadataAnnotationProcessorTests { "java.lang.String", null, null, null, null, null); writeAdditionalMetadata(property); ConfigurationMetadata metadata = compile(SimpleProperties.class); - assertThat(metadata).has(Metadata.withGroup("simple") - .fromSource(SimpleProperties.class)); + assertThat(metadata) + .has(Metadata.withGroup("simple").fromSource(SimpleProperties.class)); assertThat(metadata).has(Metadata.withProperty("simple", String.class)); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessData.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessData.java index e4945713f9..07abe30e8d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessData.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessData.java @@ -57,8 +57,10 @@ public interface RandomAccessData { * @param length the number of bytes to be read * @return the data * @throws IOException if the data cannot be read - * @throws IndexOutOfBoundsException if offset is beyond the end of the file or subsection - * @throws EOFException if offset plus length is greater than the length of the file or subsection + * @throws IndexOutOfBoundsException if offset is beyond the end of the file or + * subsection + * @throws EOFException if offset plus length is greater than the length of the file + * or subsection */ byte[] read(long offset, long length) throws IOException; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/StringSequence.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/StringSequence.java index 4ef092f9b4..a1989f6083 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/StringSequence.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/StringSequence.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. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java index c9e899f937..b47b2f0956 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java @@ -110,20 +110,23 @@ public class RandomAccessDataFileTests { } @Test - public void readWhenOffsetIsBeyondEndOfSubsectionShouldThrowException() throws Exception { + public void readWhenOffsetIsBeyondEndOfSubsectionShouldThrowException() + throws Exception { this.thrown.expect(IndexOutOfBoundsException.class); RandomAccessData subsection = this.file.getSubsection(0, 10); subsection.read(11, 0); } @Test - public void readWhenOffsetPlusLengthGreaterThanEOFShouldThrowException() throws Exception { + public void readWhenOffsetPlusLengthGreaterThanEOFShouldThrowException() + throws Exception { this.thrown.expect(EOFException.class); this.file.read(256, 1); } @Test - public void readWhenOffsetPlusLengthGreaterThanEndOfSubsectionShouldThrowException() throws Exception { + public void readWhenOffsetPlusLengthGreaterThanEndOfSubsectionShouldThrowException() + throws Exception { this.thrown.expect(EOFException.class); RandomAccessData subsection = this.file.getSubsection(0, 10); subsection.read(10, 1); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/AsciiBytesTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/AsciiBytesTests.java index 059c7d7416..ec90aaee50 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/AsciiBytesTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/AsciiBytesTests.java @@ -199,4 +199,5 @@ public class AsciiBytesTests { private void matchesSameAsString(String input) { assertThat(new AsciiBytes(input).matches(input, NO_SUFFIX)).isTrue(); } + } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java index 9a54d681c1..75ba1d9d9b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java @@ -167,6 +167,7 @@ public final class PropertyMapper { /** * A source that is in the process of being mapped. + * * @param the source type */ public static final class Source { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AggregateBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AggregateBinder.java index 5ce680c39e..8ab8970299 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AggregateBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AggregateBinder.java @@ -91,6 +91,7 @@ abstract class AggregateBinder { /** * Internal class used to supply the aggregate and cache the value. + * * @param The aggregate type */ protected static class AggregateSupplier { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindException.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindException.java index 66318da170..640c8b2134 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindException.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindException.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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java index cf1896a14b..3d369c2a73 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/handler/IgnoreErrorsBindHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/handler/IgnoreErrorsBindHandler.java index df25cdcace..d9a3f7fdbb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/handler/IgnoreErrorsBindHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/handler/IgnoreErrorsBindHandler.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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesPropertySource.java index e91f0f7fe5..772c662b55 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesPropertySource.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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java index 6b3477a2bc..904274de25 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java index 99716bdd59..9a7d36fea4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/origin/OriginTrackedValue.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/origin/OriginTrackedValue.java index cbafdc5046..499be39aac 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/origin/OriginTrackedValue.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/origin/OriginTrackedValue.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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/origin/SystemEnvironmentOrigin.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/origin/SystemEnvironmentOrigin.java index 0b9d4aa570..f939ad1821 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/origin/SystemEnvironmentOrigin.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/origin/SystemEnvironmentOrigin.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. @@ -61,4 +61,5 @@ public class SystemEnvironmentOrigin implements Origin { SystemEnvironmentOrigin other = (SystemEnvironmentOrigin) obj; return ObjectUtils.nullSafeEquals(this.property, other.property); } + } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java index 9f1af2d5c3..81945422ec 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java @@ -367,6 +367,7 @@ public final class LambdaSafe { * The result of a callback which may be a value, {@code null} or absent entirely if * the callback wasn't suitable. Similar in design to {@link Optional} but allows for * {@code null} as a valid value. + * * @param The result type */ public static final class InvocationResult { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java index c090c2366e..e3f9703fbf 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.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. @@ -114,7 +114,8 @@ class SslConnectorCustomizer implements TomcatConnectorCustomizer { try { if (sslStoreProvider.getKeyStore() != null) { protocol.setKeystorePass(""); - protocol.setKeystoreFile(SslStoreProviderUrlStreamHandlerFactory.KEY_STORE_URL); + protocol.setKeystoreFile( + SslStoreProviderUrlStreamHandlerFactory.KEY_STORE_URL); } if (sslStoreProvider.getTrustStore() != null) { protocol.setTruststoreFile( @@ -122,8 +123,7 @@ class SslConnectorCustomizer implements TomcatConnectorCustomizer { } } catch (Exception ex) { - throw new WebServerException("Could not load store: " + ex.getMessage(), - ex); + throw new WebServerException("Could not load store: " + ex.getMessage(), ex); } } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowCompressionConfigurer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowCompressionConfigurer.java index 7111c0b45c..682d95a013 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowCompressionConfigurer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowCompressionConfigurer.java @@ -126,4 +126,5 @@ final class UndertowCompressionConfigurer { } } + } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java index 15707be1fc..5b17450a96 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java @@ -582,6 +582,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac return null; } } + } /** @@ -603,6 +604,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac initializer.onStartup(servletContext); } } + } private static final class LoaderHidingResourceManager implements ResourceManager { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java index 7a8179cdab..6b17e066d0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java @@ -214,4 +214,5 @@ public class ServletRegistrationBean public String getServletName() { return getOrDeduceName(this.servlet); } + } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java index 381fbf4a6c..c44b8bfe22 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactory.java @@ -284,7 +284,6 @@ public abstract class AbstractServletWebServerFactory /** * Converts the given {@code url} into a decoded file path. - * * @param url the url to convert * @return the file path * @deprecated Since 2.0.2 in favor of {@link File#File(java.net.URI)} diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java index 00be808123..f08200a093 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java @@ -758,8 +758,8 @@ public class ConfigFileApplicationListenerTests { assertThat(environment).has(matchingProfile("morespecific")); assertThat(environment).has(matchingProfile("yetmorespecific")); assertThat(environment).doesNotHave(matchingProfile("missing")); - assertThat(this.out.toString()) - .contains("The following profiles are active: includeprofile,specific,morespecific,yetmorespecific"); + assertThat(this.out.toString()).contains( + "The following profiles are active: includeprofile,specific,morespecific,yetmorespecific"); } @Test diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java index 4feb8b450a..3d607b4872 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java @@ -831,6 +831,7 @@ public class ConfigurationPropertiesTests { public NonValidatedJsr303Properties properties() { return new NonValidatedJsr303Properties(); } + } @Configuration @@ -1374,6 +1375,7 @@ public class ConfigurationPropertiesTests { interface InterfaceForValidatedImplementation { String getFoo(); + } @ConfigurationProperties("test") @@ -1687,6 +1689,7 @@ public class ConfigurationPropertiesTests { String[] content = StringUtils.split(source, " "); return new Person(content[0], content[1]); } + } static class GenericPersonConverter implements GenericConverter { @@ -1704,6 +1707,7 @@ public class ConfigurationPropertiesTests { String[] content = StringUtils.split((String) source, " "); return new Person(content[0], content[1]); } + } static class PersonPropertyEditor extends PropertyEditorSupport { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BackCompatibilityBinderIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BackCompatibilityBinderIntegrationTests.java index e5b3eaaadd..a516ee45db 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BackCompatibilityBinderIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BackCompatibilityBinderIntegrationTests.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. @@ -85,4 +85,5 @@ public class BackCompatibilityBinderIntegrationTests { } } + } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/CollectionBinderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/CollectionBinderTests.java index 3ceeff8dd7..575009e313 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/CollectionBinderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/CollectionBinderTests.java @@ -425,6 +425,7 @@ public class CollectionBinderTests { public void setItemsSet(Set itemsSet) { this.itemsSet = itemsSet; } + } public static class ExampleCustomNoDefaultConstructorBean { @@ -490,6 +491,7 @@ public class CollectionBinderTests { public void setValue(String value) { this.value = value; } + } public static class ClonedArrayBean { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/AliasedConfigurationPropertySourceTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/AliasedConfigurationPropertySourceTests.java index b135faaf26..2a52bfbe83 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/AliasedConfigurationPropertySourceTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/AliasedConfigurationPropertySourceTests.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. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySourceTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySourceTests.java index e1c238ce3b..46c0cc377a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySourceTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySourceTests.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. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java index 478cc37a38..e4e4a75470 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java @@ -168,6 +168,7 @@ public class BindFailureAnalyzerTests { public void setListValue(List listValue) { this.listValue = listValue; } + } @ConfigurationProperties("test.foo") diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java index db6632893b..a79f5e7b0e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.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. @@ -221,4 +221,5 @@ public class BindValidationFailureAnalyzerTests { } } + } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessorTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessorTests.java index 7e436377ea..b485853eaa 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessorTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessorTests.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. @@ -135,4 +135,5 @@ public class SpringApplicationJsonEnvironmentPostProcessorTests { assertThat(origin.getPropertyName()).isEqualTo("spring.application.json"); assertThat(this.environment.resolvePlaceholders("${foo:}")).isEqualTo("bar"); } + } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/origin/MockOrigin.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/origin/MockOrigin.java index 90b343f9ee..e628d60c2f 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/origin/MockOrigin.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/origin/MockOrigin.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. diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/origin/SystemEnvironmentOriginTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/origin/SystemEnvironmentOriginTests.java index 99894ff2ea..07e7ed4089 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/origin/SystemEnvironmentOriginTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/origin/SystemEnvironmentOriginTests.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,4 +56,5 @@ public class SystemEnvironmentOriginTests { assertThat(origin.toString()) .isEqualTo("System Environment Property \"FOO_BAR\""); } + } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java index bed4f97859..a81747a3a2 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.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. @@ -64,7 +64,8 @@ public class SslConnectorCustomizerTests { @After public void stop() throws Exception { - ReflectionTestUtils.setField(TomcatURLStreamHandlerFactory.class, "instance", null); + ReflectionTestUtils.setField(TomcatURLStreamHandlerFactory.class, "instance", + null); ReflectionTestUtils.setField(URL.class, "factory", null); this.tomcat.stop(); } @@ -120,50 +121,60 @@ public class SslConnectorCustomizerTests { } @Test - public void customizeWhenSslStoreProviderProvidesOnlyKeyStoreShouldUseDefaultTruststore() throws Exception { + public void customizeWhenSslStoreProviderProvidesOnlyKeyStoreShouldUseDefaultTruststore() + throws Exception { Ssl ssl = new Ssl(); ssl.setKeyPassword("password"); ssl.setTrustStore("src/test/resources/test.jks"); SslStoreProvider sslStoreProvider = mock(SslStoreProvider.class); given(sslStoreProvider.getKeyStore()).willReturn(loadStore()); - SslConnectorCustomizer customizer = new SslConnectorCustomizer(ssl, sslStoreProvider); + SslConnectorCustomizer customizer = new SslConnectorCustomizer(ssl, + sslStoreProvider); Connector connector = this.tomcat.getConnector(); customizer.customize(connector); this.tomcat.start(); SSLHostConfig sslHostConfig = connector.getProtocolHandler() .findSslHostConfigs()[0]; SSLHostConfig sslHostConfigWithDefaults = new SSLHostConfig(); - assertThat(sslHostConfig.getTruststoreFile()).isEqualTo(sslHostConfigWithDefaults.getTruststoreFile()); - assertThat(sslHostConfig.getCertificateKeystoreFile()).isEqualTo(SslStoreProviderUrlStreamHandlerFactory.KEY_STORE_URL); + assertThat(sslHostConfig.getTruststoreFile()) + .isEqualTo(sslHostConfigWithDefaults.getTruststoreFile()); + assertThat(sslHostConfig.getCertificateKeystoreFile()) + .isEqualTo(SslStoreProviderUrlStreamHandlerFactory.KEY_STORE_URL); } @Test - public void customizeWhenSslStoreProviderProvidesOnlyTrustStoreShouldUseDefaultKeystore() throws Exception { + public void customizeWhenSslStoreProviderProvidesOnlyTrustStoreShouldUseDefaultKeystore() + throws Exception { Ssl ssl = new Ssl(); ssl.setKeyPassword("password"); ssl.setKeyStore("src/test/resources/test.jks"); SslStoreProvider sslStoreProvider = mock(SslStoreProvider.class); given(sslStoreProvider.getTrustStore()).willReturn(loadStore()); - SslConnectorCustomizer customizer = new SslConnectorCustomizer(ssl, sslStoreProvider); + SslConnectorCustomizer customizer = new SslConnectorCustomizer(ssl, + sslStoreProvider); Connector connector = this.tomcat.getConnector(); customizer.customize(connector); this.tomcat.start(); SSLHostConfig sslHostConfig = connector.getProtocolHandler() .findSslHostConfigs()[0]; SSLHostConfig sslHostConfigWithDefaults = new SSLHostConfig(); - assertThat(sslHostConfig.getTruststoreFile()).isEqualTo(SslStoreProviderUrlStreamHandlerFactory.TRUST_STORE_URL); - assertThat(sslHostConfig.getCertificateKeystoreFile()).contains(sslHostConfigWithDefaults.getCertificateKeystoreFile()); + assertThat(sslHostConfig.getTruststoreFile()) + .isEqualTo(SslStoreProviderUrlStreamHandlerFactory.TRUST_STORE_URL); + assertThat(sslHostConfig.getCertificateKeystoreFile()) + .contains(sslHostConfigWithDefaults.getCertificateKeystoreFile()); } @Test - public void customizeWhenSslStoreProviderPresentShouldIgnorePasswordFromSsl() throws Exception { + public void customizeWhenSslStoreProviderPresentShouldIgnorePasswordFromSsl() + throws Exception { Ssl ssl = new Ssl(); ssl.setKeyPassword("password"); ssl.setKeyStorePassword("secret"); SslStoreProvider sslStoreProvider = mock(SslStoreProvider.class); given(sslStoreProvider.getTrustStore()).willReturn(loadStore()); given(sslStoreProvider.getKeyStore()).willReturn(loadStore()); - SslConnectorCustomizer customizer = new SslConnectorCustomizer(ssl, sslStoreProvider); + SslConnectorCustomizer customizer = new SslConnectorCustomizer(ssl, + sslStoreProvider); Connector connector = this.tomcat.getConnector(); customizer.customize(connector); this.tomcat.start(); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java index 0e5354999f..6a8fdd357f 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java @@ -221,8 +221,8 @@ public class UndertowServletWebServerFactoryTests @Test public void sslRestrictedProtocolsECDHETLS1Failure() throws Exception { - this.thrown.expect(anyOf(instanceOf(SSLException.class), - instanceOf(SocketException.class))); + this.thrown.expect( + anyOf(instanceOf(SSLException.class), instanceOf(SocketException.class))); testRestrictedSSLProtocolsAndCipherSuites(new String[] { "TLSv1" }, new String[] { "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" }); } @@ -241,8 +241,8 @@ public class UndertowServletWebServerFactoryTests @Test public void sslRestrictedProtocolsRSATLS11Failure() throws Exception { - this.thrown.expect(anyOf(instanceOf(SSLException.class), - instanceOf(SocketException.class))); + this.thrown.expect( + anyOf(instanceOf(SSLException.class), instanceOf(SocketException.class))); testRestrictedSSLProtocolsAndCipherSuites(new String[] { "TLSv1.1" }, new String[] { "TLS_RSA_WITH_AES_128_CBC_SHA256" }); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java index dc757b2adc..8e50f4e14a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java @@ -866,8 +866,8 @@ public abstract class AbstractServletWebServerFactoryTests { this.webServer = factory.getWebServer(); Map configuredMimeMappings = getActualMimeMappings(); Collection expectedMimeMappings = getExpectedMimeMappings(); - configuredMimeMappings.forEach((key, value) -> assertThat(expectedMimeMappings). - contains(new MimeMappings.Mapping(key, value))); + configuredMimeMappings.forEach((key, value) -> assertThat(expectedMimeMappings) + .contains(new MimeMappings.Mapping(key, value))); for (MimeMappings.Mapping mapping : expectedMimeMappings) { assertThat(configuredMimeMappings).containsEntry(mapping.getExtension(), mapping.getMimeType()); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/MockServletWebServerFactory.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/MockServletWebServerFactory.java index cc48f35730..0afb90d27f 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/MockServletWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/MockServletWebServerFactory.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. diff --git a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/HotelSummary.java b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/HotelSummary.java index 903b85ec79..35b4b3e262 100644 --- a/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/HotelSummary.java +++ b/spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/HotelSummary.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 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. diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java index decc89d440..df98eedf8d 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java @@ -104,10 +104,10 @@ class ApplicationBuilder { context.put("bootVersion", Versions.getBootVersion()); context.put("resourcesJarPath", resourcesJar.getAbsolutePath()); try (FileWriter out = new FileWriter(new File(appFolder, "pom.xml")); - FileReader templateReader = new FileReader("src/test/resources/pom-template.xml")) { - Mustache.compiler().escapeHTML(false) - .compile(templateReader) - .execute(context, out); + FileReader templateReader = new FileReader( + "src/test/resources/pom-template.xml")) { + Mustache.compiler().escapeHTML(false).compile(templateReader).execute(context, + out); } } @@ -120,10 +120,10 @@ class ApplicationBuilder { context.put("repository", repository); File settingsXml = new File(appFolder, "settings.xml"); try (FileWriter out = new FileWriter(settingsXml); - FileReader templateReader = new FileReader("src/test/resources/settings-template.xml")) { - Mustache.compiler().escapeHTML(false) - .compile(templateReader) - .execute(context, out); + FileReader templateReader = new FileReader( + "src/test/resources/settings-template.xml")) { + Mustache.compiler().escapeHTML(false).compile(templateReader).execute(context, + out); } return settingsXml; }