Skip to content

Commit 5de46c3

Browse files
committed
Polish
1 parent a0f4071 commit 5de46c3

File tree

60 files changed

+131
-113
lines changed

Some content is hidden

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

60 files changed

+131
-113
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/kafka/KafkaHealthIndicatorAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* {@link EnableAutoConfiguration Auto-configuration} for {@link KafkaHealthIndicator}.
4141
*
4242
* @author Juan Rada
43+
* @since 2.0.0
4344
*/
4445
@Configuration
4546
@ConditionalOnClass(KafkaAdmin.class)
@@ -55,7 +56,7 @@ public class KafkaHealthIndicatorAutoConfiguration
5556

5657
private final KafkaHealthIndicatorProperties properties;
5758

58-
KafkaHealthIndicatorAutoConfiguration(Map<String, KafkaAdmin> admins,
59+
public KafkaHealthIndicatorAutoConfiguration(Map<String, KafkaAdmin> admins,
5960
KafkaHealthIndicatorProperties properties) {
6061
this.admins = admins;
6162
this.properties = properties;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ void configure(MeterRegistry registry) {
6262
if (registry instanceof CompositeMeterRegistry) {
6363
return;
6464
}
65-
// Customizers must be applied before binders, as they may add custom tags or
66-
// alter timer or summary configuration.
65+
// Customizers must be applied before binders, as they may add custom
66+
// tags or alter timer or summary configuration.
6767
customize(registry);
6868
addFilters(registry);
6969
addBinders(registry);

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasProperties.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/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasPropertiesConfigAdapter.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/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaPropertiesConfigAdapter.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/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusPropertiesConfigAdapter.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/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/PropertiesConfigAdapter.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/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/StepRegistryProperties.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/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/StepRegistryPropertiesConfigAdapter.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/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesConfigAdapter.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/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdPropertiesConfigAdapter.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/kafka/KafkaHealthIndicatorAutoConfigurationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ public void runWhenDisabledShouldNotCreateIndicator() {
5353
.doesNotHaveBean(KafkaHealthIndicator.class)
5454
.hasSingleBean(ApplicationHealthIndicator.class));
5555
}
56+
5657
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/kafka/KafkaHealthIndicator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* {@link HealthIndicator} for Kafka cluster.
3939
*
4040
* @author Juan Rada
41+
* @since 2.0.0
4142
*/
4243
public class KafkaHealthIndicator extends AbstractHealthIndicator {
4344

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,10 @@ private void filterAndRecordMetrics(HttpServletRequest request,
128128

129129
private Object getHandler(HttpServletRequest request) throws Exception {
130130
HttpServletRequest wrapper = new UnmodifiableAttributesRequestWrapper(request);
131-
for (HandlerMapping handlerMapping : getMappingIntrospector()
132-
.getHandlerMappings()) {
133-
HandlerExecutionChain chain = handlerMapping.getHandler(wrapper);
131+
for (HandlerMapping mapping : getMappingIntrospector().getHandlerMappings()) {
132+
HandlerExecutionChain chain = mapping.getHandler(wrapper);
134133
if (chain != null) {
135-
if (handlerMapping instanceof MatchableHandlerMapping) {
134+
if (mapping instanceof MatchableHandlerMapping) {
136135
return chain.getHandler();
137136
}
138137
return null;
@@ -294,8 +293,8 @@ private UnmodifiableAttributesRequestWrapper(HttpServletRequest request) {
294293

295294
@Override
296295
public void setAttribute(String name, Object value) {
297-
298296
}
297+
299298
}
300299

301300
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,32 @@ public Filter securityFilter() {
132132
protected void doFilterInternal(HttpServletRequest request,
133133
HttpServletResponse response, FilterChain filterChain)
134134
throws ServletException, IOException {
135-
filterChain.doFilter(new HttpServletRequestWrapper(request) {
135+
filterChain.doFilter(new MockPrincipalWrapper(request), response);
136+
}
136137

137-
@Override
138-
public Principal getUserPrincipal() {
138+
};
139+
}
139140

140-
return new Principal() {
141+
}
141142

142-
@Override
143-
public String getName() {
144-
return "Alice";
145-
}
143+
private static class MockPrincipalWrapper extends HttpServletRequestWrapper {
146144

147-
};
145+
public MockPrincipalWrapper(HttpServletRequest request) {
146+
super(request);
147+
}
148148

149-
}
149+
@Override
150+
public Principal getUserPrincipal() {
151+
return new MockPrincipal();
152+
}
150153

151-
}, response);
152-
}
154+
}
153155

154-
};
156+
private static class MockPrincipal implements Principal {
155157

158+
@Override
159+
public String getName() {
160+
return "Alice";
156161
}
157162

158163
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,24 +152,34 @@ public WebFilter webFilter() {
152152
@Override
153153
public Mono<Void> filter(ServerWebExchange exchange,
154154
WebFilterChain chain) {
155-
return chain.filter(new ServerWebExchangeDecorator(exchange) {
155+
return chain.filter(
156+
new MockPrincipalServerWebExchangeDecorator(exchange));
157+
}
156158

157-
@Override
158-
public Mono<Principal> getPrincipal() {
159-
return Mono.just(new Principal() {
159+
};
160+
}
160161

161-
@Override
162-
public String getName() {
163-
return "Alice";
164-
}
162+
}
165163

166-
});
167-
}
164+
private static class MockPrincipalServerWebExchangeDecorator
165+
extends ServerWebExchangeDecorator {
168166

169-
});
170-
}
167+
protected MockPrincipalServerWebExchangeDecorator(ServerWebExchange delegate) {
168+
super(delegate);
169+
}
171170

172-
};
171+
@Override
172+
public Mono<Principal> getPrincipal() {
173+
return Mono.just(new MockPrincipal());
174+
}
175+
176+
}
177+
178+
private static class MockPrincipal implements Principal {
179+
180+
@Override
181+
public String getName() {
182+
return "Alice";
173183
}
174184

175185
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,27 +146,32 @@ public Filter securityFilter() {
146146
protected void doFilterInternal(HttpServletRequest request,
147147
HttpServletResponse response, FilterChain filterChain)
148148
throws ServletException, IOException {
149-
filterChain.doFilter(new HttpServletRequestWrapper(request) {
149+
filterChain.doFilter(new MockPrincipalWrapper(request), response);
150+
}
150151

151-
@Override
152-
public Principal getUserPrincipal() {
152+
};
153+
}
153154

154-
return new Principal() {
155+
}
155156

156-
@Override
157-
public String getName() {
158-
return "Alice";
159-
}
157+
private static class MockPrincipalWrapper extends HttpServletRequestWrapper {
160158

161-
};
159+
public MockPrincipalWrapper(HttpServletRequest request) {
160+
super(request);
161+
}
162162

163-
}
163+
@Override
164+
public Principal getUserPrincipal() {
165+
return new MockPrincipal();
166+
}
164167

165-
}, response);
166-
}
168+
}
167169

168-
};
170+
private static class MockPrincipal implements Principal {
169171

172+
@Override
173+
public String getName() {
174+
return "Alice";
170175
}
171176

172177
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveSecurityAutoConfiguration.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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfiguration.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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveSecurityAutoConfigurationTests.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-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6152,6 +6152,8 @@ NOTE: While Spring's test framework caches application contexts between tests an
61526152
a context for tests sharing the same configuration, the use of `@MockBean` or `@SpyBean`
61536153
influences the cache key, which will most likely increase the number of contexts.
61546154

6155+
6156+
61556157
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-tests]]
61566158
==== Auto-configured Tests
61576159
Spring Boot's auto-configuration system works well for applications but can sometimes be

spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/ExitCodeApplication.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-docs/src/main/java/org/springframework/boot/docs/autoconfigure/UserService.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-docs/src/main/java/org/springframework/boot/docs/builder/SpringApplicationBuilderExample.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-docs/src/main/java/org/springframework/boot/docs/cloudfoundry/CloudFoundryIgnorePathsExample.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-docs/src/main/java/org/springframework/boot/docs/context/EnvironmentPostProcessorExample.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-docs/src/main/java/org/springframework/boot/docs/elasticsearch/HibernateSearchElasticsearchExample.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-docs/src/main/java/org/springframework/boot/docs/elasticsearch/jest/JestClientCustomizationExample.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-docs/src/main/java/org/springframework/boot/docs/jdbc/BasicDataSourceExample.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-docs/src/main/java/org/springframework/boot/docs/jdbc/CompleteTwoDataSourcesExample.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-docs/src/main/java/org/springframework/boot/docs/jdbc/ConfigurableDataSourceExample.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-docs/src/main/java/org/springframework/boot/docs/jdbc/SimpleDataSourceExample.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-docs/src/main/java/org/springframework/boot/docs/jdbc/SimpleTwoDataSourcesExample.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-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/restassured/AdvancedConfigurationExample.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-docs/src/main/java/org/springframework/boot/docs/test/autoconfigure/restdocs/restassured/UserDocumentationTests.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.

0 commit comments

Comments
 (0)