Skip to content

Commit 7d19aa6

Browse files
committed
Merge branch '2.0.x'
2 parents cd8ab4d + 6de479f commit 7d19aa6

File tree

125 files changed

+312
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+312
-210
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public Object handle(HttpServletRequest request, Map<String, String> body) {
134134
}
135135
return this.delegate.handle(request, body);
136136
}
137+
137138
}
138139

139140
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
*
3232
* @author Phillip Webb
3333
* @author Andy Wilkinson
34-
*
3534
* @since 2.0.0
3635
*/
3736
@Configuration

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
import org.springframework.boot.util.LambdaSafe;
2929

3030
/**
31-
* Configurer to apply {@link MeterRegistryCustomizer customizers},
32-
* {@link MeterFilter filters}, {@link MeterBinder binders} and {@link Metrics#addRegistry
33-
* global registration} to {@link MeterRegistry meter registries}. This configurer
34-
* intentionally skips {@link CompositeMeterRegistry} with the assumptions that the
35-
* registries it contains are beans and will be customized directly.
31+
* Configurer to apply {@link MeterRegistryCustomizer customizers}, {@link MeterFilter
32+
* filters}, {@link MeterBinder binders} and {@link Metrics#addRegistry global
33+
* registration} to {@link MeterRegistry meter registries}. This configurer intentionally
34+
* skips {@link CompositeMeterRegistry} with the assumptions that the registries it
35+
* contains are beans and will be customized directly.
3636
*
3737
* @author Jon Schneider
3838
* @author Phillip Webb

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,35 +165,40 @@ public EndpointRequestMatcher excludingLinks() {
165165
}
166166

167167
@Override
168-
protected void initialized(Supplier<WebApplicationContext> webApplicationContext) {
168+
protected void initialized(
169+
Supplier<WebApplicationContext> webApplicationContext) {
169170
this.delegate = createDelegate(webApplicationContext);
170171
}
171172

172173
private RequestMatcher createDelegate(
173174
Supplier<WebApplicationContext> webApplicationContext) {
174175
try {
175176
WebApplicationContext context = webApplicationContext.get();
176-
PathMappedEndpoints pathMappedEndpoints = context.getBean(PathMappedEndpoints.class);
177-
DispatcherServletPathProvider pathProvider = context.getBean(DispatcherServletPathProvider.class);
177+
PathMappedEndpoints pathMappedEndpoints = context
178+
.getBean(PathMappedEndpoints.class);
179+
DispatcherServletPathProvider pathProvider = context
180+
.getBean(DispatcherServletPathProvider.class);
178181
return createDelegate(pathMappedEndpoints, pathProvider.getServletPath());
179182
}
180183
catch (NoSuchBeanDefinitionException ex) {
181184
return EMPTY_MATCHER;
182185
}
183186
}
184187

185-
private RequestMatcher createDelegate(PathMappedEndpoints pathMappedEndpoints, String servletPath) {
188+
private RequestMatcher createDelegate(PathMappedEndpoints pathMappedEndpoints,
189+
String servletPath) {
186190
Set<String> paths = new LinkedHashSet<>();
187191
if (this.includes.isEmpty()) {
188192
paths.addAll(pathMappedEndpoints.getAllPaths());
189193
}
190194
streamPaths(this.includes, pathMappedEndpoints).forEach(paths::add);
191195
streamPaths(this.excludes, pathMappedEndpoints).forEach(paths::remove);
192-
List<RequestMatcher> delegateMatchers = getDelegateMatchers(servletPath, paths);
196+
List<RequestMatcher> delegateMatchers = getDelegateMatchers(servletPath,
197+
paths);
193198
if (this.includeLinks
194199
&& StringUtils.hasText(pathMappedEndpoints.getBasePath())) {
195-
delegateMatchers.add(
196-
new AntPathRequestMatcher(servletPath + pathMappedEndpoints.getBasePath()));
200+
delegateMatchers.add(new AntPathRequestMatcher(
201+
servletPath + pathMappedEndpoints.getBasePath()));
197202
}
198203
return new OrRequestMatcher(delegateMatchers);
199204
}
@@ -221,8 +226,10 @@ private String getEndpointId(Class<?> source) {
221226
return annotation.id();
222227
}
223228

224-
private List<RequestMatcher> getDelegateMatchers(String servletPath, Set<String> paths) {
225-
return paths.stream().map((path) -> new AntPathRequestMatcher(servletPath + path + "/**"))
229+
private List<RequestMatcher> getDelegateMatchers(String servletPath,
230+
Set<String> paths) {
231+
return paths.stream()
232+
.map((path) -> new AntPathRequestMatcher(servletPath + path + "/**"))
226233
.collect(Collectors.toList());
227234
}
228235

@@ -247,19 +254,23 @@ private LinksRequestMatcher() {
247254
}
248255

249256
@Override
250-
protected void initialized(Supplier<WebApplicationContext> webApplicationContext) {
257+
protected void initialized(
258+
Supplier<WebApplicationContext> webApplicationContext) {
251259
try {
252260
WebApplicationContext context = webApplicationContext.get();
253-
WebEndpointProperties properties = context.getBean(WebEndpointProperties.class);
254-
DispatcherServletPathProvider pathProvider = context.getBean(DispatcherServletPathProvider.class);
261+
WebEndpointProperties properties = context
262+
.getBean(WebEndpointProperties.class);
263+
DispatcherServletPathProvider pathProvider = context
264+
.getBean(DispatcherServletPathProvider.class);
255265
this.delegate = createDelegate(pathProvider.getServletPath(), properties);
256266
}
257267
catch (NoSuchBeanDefinitionException ex) {
258268
this.delegate = EMPTY_MATCHER;
259269
}
260270
}
261271

262-
private RequestMatcher createDelegate(String path, WebEndpointProperties properties) {
272+
private RequestMatcher createDelegate(String path,
273+
WebEndpointProperties properties) {
263274
if (StringUtils.hasText(properties.getBasePath())) {
264275
return new AntPathRequestMatcher(path + properties.getBasePath());
265276
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,5 @@ public ReactiveHealthIndicator reactiveHealthIndicator() {
124124
}
125125

126126
}
127+
127128
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public void autoConfiguresWithAnAccessToken() {
7171
@Test
7272
public void autoConfigurationCanBeDisabled() {
7373
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
74-
.withPropertyValues(
75-
"management.metrics.export.signalfx.enabled=false")
74+
.withPropertyValues("management.metrics.export.signalfx.enabled=false")
7675
.run((context) -> assertThat(context)
7776
.doesNotHaveBean(SignalFxMeterRegistry.class)
7877
.doesNotHaveBean(SignalFxConfig.class));

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import static org.assertj.core.api.Assertions.assertThat;
2323

2424
/**
25-
*
2625
* @author Stephane Nicoll
2726
*/
2827
public class SimplePropertiesTests {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ public void toAnyEndpointShouldNotMatchOtherPath() {
7575
@Test
7676
public void toAnyEndpointWhenServletPathNotEmptyShouldMatch() {
7777
RequestMatcher matcher = EndpointRequest.toAnyEndpoint();
78-
assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator/foo");
79-
assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator/bar");
78+
assertMatcher(matcher, "/actuator", "/spring").matches("/spring",
79+
"/actuator/foo");
80+
assertMatcher(matcher, "/actuator", "/spring").matches("/spring",
81+
"/actuator/bar");
8082
assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator");
81-
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/spring", "/actuator/baz");
83+
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/spring",
84+
"/actuator/baz");
8285
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("", "/actuator/foo");
8386
}
8487

@@ -128,7 +131,8 @@ public void toLinksWhenBasePathEmptyShouldNotMatch() {
128131
@Test
129132
public void toLinksWhenServletPathNotEmptyShouldNotMatch() {
130133
RequestMatcher matcher = EndpointRequest.toLinks();
131-
RequestMatcherAssert assertMatcher = assertMatcher(matcher, "/actuator", "/spring");
134+
RequestMatcherAssert assertMatcher = assertMatcher(matcher, "/actuator",
135+
"/spring");
132136
assertMatcher.matches("/spring/actuator");
133137
}
134138

@@ -197,7 +201,8 @@ private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePa
197201
return assertMatcher(matcher, mockPathMappedEndpoints(basePath));
198202
}
199203

200-
private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePath, String servletPath) {
204+
private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePath,
205+
String servletPath) {
201206
return assertMatcher(matcher, mockPathMappedEndpoints(basePath), servletPath);
202207
}
203208

@@ -232,7 +237,8 @@ private RequestMatcherAssert assertMatcher(RequestMatcher matcher,
232237
properties.setBasePath(pathMappedEndpoints.getBasePath());
233238
}
234239
}
235-
context.registerBean(DispatcherServletPathProvider.class, () -> () -> servletPath);
240+
DispatcherServletPathProvider pathProvider = () -> servletPath;
241+
context.registerBean(DispatcherServletPathProvider.class, () -> pathProvider);
236242
return assertThat(new RequestMatcherAssert(context, matcher));
237243
}
238244

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ public void contextShouldNotConfigureRequestContextFilterWhenRequestContextListe
6565

6666
@Test
6767
public void contextShouldConfigureDispatcherServletPathProviderWithEmptyPath() {
68-
this.contextRunner.withUserConfiguration(WebMvcEndpointChildContextConfiguration.class)
69-
.run((context) -> assertThat(context.getBean(DispatcherServletPathProvider.class)
70-
.getServletPath()).isEmpty());
68+
this.contextRunner
69+
.withUserConfiguration(WebMvcEndpointChildContextConfiguration.class)
70+
.run((context) -> assertThat(context
71+
.getBean(DispatcherServletPathProvider.class).getServletPath())
72+
.isEmpty());
7173
}
7274

7375
static class ExistingConfig {

0 commit comments

Comments
 (0)