Skip to content

Commit 76a450d

Browse files
committed
Format with Eclipse Oxygen SR2
1 parent b4f4dd3 commit 76a450d

File tree

126 files changed

+556
-611
lines changed

Some content is hidden

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

126 files changed

+556
-611
lines changed

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,8 @@ private CloudFoundrySecurityService getCloudFoundrySecurityService(
115115
String cloudControllerUrl = environment.getProperty("vcap.application.cf_api");
116116
boolean skipSslValidation = environment.getProperty(
117117
"management.cloudfoundry.skip-ssl-validation", Boolean.class, false);
118-
return (cloudControllerUrl == null ? null
119-
: new CloudFoundrySecurityService(restTemplateBuilder, cloudControllerUrl,
120-
skipSslValidation));
118+
return (cloudControllerUrl == null ? null : new CloudFoundrySecurityService(
119+
restTemplateBuilder, cloudControllerUrl, skipSslValidation));
121120
}
122121

123122
private CorsConfiguration getCorsConfiguration() {

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public MeterFilterReply accept(Meter.Id id) {
5858
public HistogramConfig configure(Meter.Id id, HistogramConfig config) {
5959
HistogramConfig.Builder builder = HistogramConfig.builder();
6060
Distribution distribution = this.properties.getDistribution();
61-
builder.percentilesHistogram(lookup(distribution.getPercentilesHistogram(), id, null));
61+
builder.percentilesHistogram(
62+
lookup(distribution.getPercentilesHistogram(), id, null));
6263
builder.percentiles(lookup(distribution.getPercentiles(), id, null));
6364
builder.sla(convertSla(id.getType(), lookup(distribution.getSla(), id, null)));
6465
return builder.build().merge(config);

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ public void customize(TomcatServletWebServerFactory factory) {
134134
accessLogValve.setPrefix(customizePrefix(accessLogValve.getPrefix()));
135135
}
136136

137-
private AccessLogValve findAccessLogValve(
138-
TomcatServletWebServerFactory factory) {
137+
private AccessLogValve findAccessLogValve(TomcatServletWebServerFactory factory) {
139138
for (Valve engineValve : factory.getEngineValves()) {
140139
if (engineValve instanceof AccessLogValve) {
141140
return (AccessLogValve) engineValve;
@@ -151,8 +150,7 @@ static class UndertowAccessLogCustomizer extends AccessLogCustomizer
151150

152151
@Override
153152
public void customize(UndertowServletWebServerFactory factory) {
154-
factory.setAccessLogPrefix(
155-
customizePrefix(factory.getAccessLogPrefix()));
153+
factory.setAccessLogPrefix(customizePrefix(factory.getAccessLogPrefix()));
156154
}
157155

158156
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java

+20-24
Original file line numberDiff line numberDiff line change
@@ -101,37 +101,33 @@ public void operationWithSecurityInterceptorSuccess() {
101101

102102
@Test
103103
public void responseToOptionsRequestIncludesCorsHeaders() {
104-
load(TestEndpointConfiguration.class,
105-
(client) -> client.options().uri("/cfApplication/test")
106-
.accept(MediaType.APPLICATION_JSON)
107-
.header("Access-Control-Request-Method", "POST")
108-
.header("Origin", "http://example.com").exchange().expectStatus()
109-
.isOk().expectHeader()
110-
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
111-
.expectHeader()
112-
.valueEquals("Access-Control-Allow-Methods", "GET,POST"));
104+
load(TestEndpointConfiguration.class, (client) -> client.options()
105+
.uri("/cfApplication/test").accept(MediaType.APPLICATION_JSON)
106+
.header("Access-Control-Request-Method", "POST")
107+
.header("Origin", "http://example.com").exchange().expectStatus().isOk()
108+
.expectHeader()
109+
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
110+
.expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST"));
113111
}
114112

115113
@Test
116114
public void linksToOtherEndpointsWithFullAccess() {
117115
given(tokenValidator.validate(any())).willReturn(Mono.empty());
118116
given(securityService.getAccessLevel(any(), eq("app-id")))
119117
.willReturn(Mono.just(AccessLevel.FULL));
120-
load(TestEndpointConfiguration.class,
121-
(client) -> client.get().uri("/cfApplication")
122-
.accept(MediaType.APPLICATION_JSON)
123-
.header("Authorization", "bearer " + mockAccessToken()).exchange()
124-
.expectStatus().isOk().expectBody().jsonPath("_links.length()")
125-
.isEqualTo(5).jsonPath("_links.self.href").isNotEmpty()
126-
.jsonPath("_links.self.templated").isEqualTo(false)
127-
.jsonPath("_links.info.href").isNotEmpty()
128-
.jsonPath("_links.info.templated").isEqualTo(false)
129-
.jsonPath("_links.env.href").isNotEmpty()
130-
.jsonPath("_links.env.templated").isEqualTo(false)
131-
.jsonPath("_links.test.href").isNotEmpty()
132-
.jsonPath("_links.test.templated").isEqualTo(false)
133-
.jsonPath("_links.test-part.href").isNotEmpty()
134-
.jsonPath("_links.test-part.templated").isEqualTo(true));
118+
load(TestEndpointConfiguration.class, (client) -> client.get()
119+
.uri("/cfApplication").accept(MediaType.APPLICATION_JSON)
120+
.header("Authorization", "bearer " + mockAccessToken()).exchange()
121+
.expectStatus().isOk().expectBody().jsonPath("_links.length()")
122+
.isEqualTo(5).jsonPath("_links.self.href").isNotEmpty()
123+
.jsonPath("_links.self.templated").isEqualTo(false)
124+
.jsonPath("_links.info.href").isNotEmpty()
125+
.jsonPath("_links.info.templated").isEqualTo(false)
126+
.jsonPath("_links.env.href").isNotEmpty().jsonPath("_links.env.templated")
127+
.isEqualTo(false).jsonPath("_links.test.href").isNotEmpty()
128+
.jsonPath("_links.test.templated").isEqualTo(false)
129+
.jsonPath("_links.test-part.href").isNotEmpty()
130+
.jsonPath("_links.test-part.templated").isEqualTo(true));
135131
}
136132

137133
@Test

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,9 @@ public void preHandleWhenApplicationIdIsNullShouldReturnError() {
9696
.from(MockServerHttpRequest.get("/a")
9797
.header(HttpHeaders.AUTHORIZATION, "bearer " + mockAccessToken())
9898
.build());
99-
StepVerifier.create(this.interceptor.preHandle(request, "/a"))
100-
.consumeErrorWith((ex) -> assertThat(
101-
((CloudFoundryAuthorizationException) ex).getReason())
102-
.isEqualTo(Reason.SERVICE_UNAVAILABLE))
99+
StepVerifier.create(this.interceptor.preHandle(request, "/a")).consumeErrorWith(
100+
(ex) -> assertThat(((CloudFoundryAuthorizationException) ex).getReason())
101+
.isEqualTo(Reason.SERVICE_UNAVAILABLE))
103102
.verify();
104103
}
105104

@@ -109,10 +108,9 @@ public void preHandleWhenCloudFoundrySecurityServiceIsNullShouldReturnError() {
109108
"my-app-id");
110109
MockServerWebExchange request = MockServerWebExchange.from(MockServerHttpRequest
111110
.get("/a").header(HttpHeaders.AUTHORIZATION, mockAccessToken()).build());
112-
StepVerifier.create(this.interceptor.preHandle(request, "/a"))
113-
.consumeErrorWith((ex) -> assertThat(
114-
((CloudFoundryAuthorizationException) ex).getReason())
115-
.isEqualTo(Reason.SERVICE_UNAVAILABLE))
111+
StepVerifier.create(this.interceptor.preHandle(request, "/a")).consumeErrorWith(
112+
(ex) -> assertThat(((CloudFoundryAuthorizationException) ex).getReason())
113+
.isEqualTo(Reason.SERVICE_UNAVAILABLE))
116114
.verify();
117115
}
118116

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java

+20-24
Original file line numberDiff line numberDiff line change
@@ -94,36 +94,32 @@ public void operationWithSecurityInterceptorSuccess() {
9494

9595
@Test
9696
public void responseToOptionsRequestIncludesCorsHeaders() {
97-
load(TestEndpointConfiguration.class,
98-
(client) -> client.options().uri("/cfApplication/test")
99-
.accept(MediaType.APPLICATION_JSON)
100-
.header("Access-Control-Request-Method", "POST")
101-
.header("Origin", "http://example.com").exchange().expectStatus()
102-
.isOk().expectHeader()
103-
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
104-
.expectHeader()
105-
.valueEquals("Access-Control-Allow-Methods", "GET,POST"));
97+
load(TestEndpointConfiguration.class, (client) -> client.options()
98+
.uri("/cfApplication/test").accept(MediaType.APPLICATION_JSON)
99+
.header("Access-Control-Request-Method", "POST")
100+
.header("Origin", "http://example.com").exchange().expectStatus().isOk()
101+
.expectHeader()
102+
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
103+
.expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST"));
106104
}
107105

108106
@Test
109107
public void linksToOtherEndpointsWithFullAccess() {
110108
given(securityService.getAccessLevel(any(), eq("app-id")))
111109
.willReturn(AccessLevel.FULL);
112-
load(TestEndpointConfiguration.class,
113-
(client) -> client.get().uri("/cfApplication")
114-
.accept(MediaType.APPLICATION_JSON)
115-
.header("Authorization", "bearer " + mockAccessToken()).exchange()
116-
.expectStatus().isOk().expectBody().jsonPath("_links.length()")
117-
.isEqualTo(5).jsonPath("_links.self.href").isNotEmpty()
118-
.jsonPath("_links.self.templated").isEqualTo(false)
119-
.jsonPath("_links.info.href").isNotEmpty()
120-
.jsonPath("_links.info.templated").isEqualTo(false)
121-
.jsonPath("_links.env.href").isNotEmpty()
122-
.jsonPath("_links.env.templated").isEqualTo(false)
123-
.jsonPath("_links.test.href").isNotEmpty()
124-
.jsonPath("_links.test.templated").isEqualTo(false)
125-
.jsonPath("_links.test-part.href").isNotEmpty()
126-
.jsonPath("_links.test-part.templated").isEqualTo(true));
110+
load(TestEndpointConfiguration.class, (client) -> client.get()
111+
.uri("/cfApplication").accept(MediaType.APPLICATION_JSON)
112+
.header("Authorization", "bearer " + mockAccessToken()).exchange()
113+
.expectStatus().isOk().expectBody().jsonPath("_links.length()")
114+
.isEqualTo(5).jsonPath("_links.self.href").isNotEmpty()
115+
.jsonPath("_links.self.templated").isEqualTo(false)
116+
.jsonPath("_links.info.href").isNotEmpty()
117+
.jsonPath("_links.info.templated").isEqualTo(false)
118+
.jsonPath("_links.env.href").isNotEmpty().jsonPath("_links.env.templated")
119+
.isEqualTo(false).jsonPath("_links.test.href").isNotEmpty()
120+
.jsonPath("_links.test.templated").isEqualTo(false)
121+
.jsonPath("_links.test-part.href").isNotEmpty()
122+
.jsonPath("_links.test-part.templated").isEqualTo(true));
127123
}
128124

129125
@Test

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/context/properties/ConfigurationPropertiesReportEndpointAutoConfigurationTests.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ public void runWhenEnabledPropertyIsFalseShouldNotHaveEndpointBean() {
6060

6161
@Test
6262
public void keysToSanitizeCanBeConfiguredViaTheEnvironment() {
63-
this.contextRunner.withUserConfiguration(Config.class)
64-
.withPropertyValues(
65-
"management.endpoint.configprops.keys-to-sanitize: .*pass.*, property")
63+
this.contextRunner.withUserConfiguration(Config.class).withPropertyValues(
64+
"management.endpoint.configprops.keys-to-sanitize: .*pass.*, property")
6665
.run(validateTestProperties("******", "******"));
6766
}
6867

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/AuditEventsEndpointDocumentationTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ public void filteredAuditEvents() throws Exception {
8888
parameterWithName("principal").description(
8989
"Restricts the events to those with the given "
9090
+ "principal. Optional."),
91-
parameterWithName("type").description(
92-
"Restricts the events to those with the given "
93-
+ "type. Optional."))));
91+
parameterWithName("type").description(
92+
"Restricts the events to those with the given "
93+
+ "type. Optional."))));
9494
verify(this.repository).find("alice", now.toInstant(), "logout");
9595
}
9696

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/BeansEndpointDocumentationTests.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ public class BeansEndpointDocumentationTests extends MockMvcEndpointDocumentatio
4949

5050
@Test
5151
public void beans() throws Exception {
52-
List<FieldDescriptor> beanFields = Arrays
53-
.asList(fieldWithPath("aliases").description("Names of any aliases."),
54-
fieldWithPath("scope")
55-
.description("Scope of the bean."),
52+
List<FieldDescriptor> beanFields = Arrays.asList(
53+
fieldWithPath("aliases").description("Names of any aliases."),
54+
fieldWithPath("scope").description("Scope of the bean."),
5655
fieldWithPath("type").description("Fully qualified type of the bean."),
5756
fieldWithPath("resource")
5857
.description("Resource in which the bean was defined, if any.")

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ConditionsReportEndpointDocumentationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public void conditions() throws Exception {
100100
this.mockMvc.perform(get("/actuator/conditions")).andExpect(status().isOk())
101101
.andDo(MockMvcRestDocumentation.document("conditions",
102102
preprocessResponse(
103-
limit("contexts", getApplicationContext().getId(),
104-
"positiveMatches"),
103+
limit("contexts", getApplicationContext()
104+
.getId(), "positiveMatches"),
105105
limit("contexts", getApplicationContext().getId(),
106106
"negativeMatches")),
107107
responseFields(fieldWithPath("contexts")

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/EnvironmentEndpointDocumentationTests.java

+7-10
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ public class EnvironmentEndpointDocumentationTests
7171

7272
@Test
7373
public void env() throws Exception {
74-
this.mockMvc.perform(get("/actuator/env")).andExpect(status().isOk())
75-
.andDo(document("env/all",
76-
preprocessResponse(replacePattern(
77-
Pattern.compile(
78-
"org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/"),
79-
""), filterProperties()),
74+
this.mockMvc.perform(get("/actuator/env")).andExpect(status().isOk()).andDo(
75+
document("env/all", preprocessResponse(replacePattern(Pattern.compile(
76+
"org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/"),
77+
""), filterProperties()),
8078
responseFields(activeProfiles, propertySources,
8179
propertySourceName,
8280
fieldWithPath("propertySources.[].properties")
@@ -94,14 +92,13 @@ public void singlePropertyFromEnv() throws Exception {
9492
this.mockMvc.perform(get("/actuator/env/com.example.cache.max-size"))
9593
.andExpect(status().isOk())
9694
.andDo(document("env/single",
97-
preprocessResponse(replacePattern(
98-
Pattern.compile(
99-
"org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/"),
95+
preprocessResponse(replacePattern(Pattern.compile(
96+
"org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/"),
10097
"")),
10198
responseFields(
10299
fieldWithPath("property").description(
103100
"Property from the environment, if found.")
104-
.optional(),
101+
.optional(),
105102
fieldWithPath("property.source").description(
106103
"Name of the source of the property."),
107104
fieldWithPath("property.value")

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java

+8-11
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,14 @@ public class FlywayEndpointDocumentationTests extends MockMvcEndpointDocumentati
5050
@Test
5151
public void flyway() throws Exception {
5252
this.mockMvc.perform(get("/actuator/flyway")).andExpect(status().isOk())
53-
.andDo(MockMvcRestDocumentation.document("flyway",
54-
responseFields(
55-
fieldWithPath("contexts")
56-
.description("Application contexts keyed by id"),
53+
.andDo(MockMvcRestDocumentation.document("flyway", responseFields(
54+
fieldWithPath("contexts")
55+
.description("Application contexts keyed by id"),
5756
fieldWithPath("contexts.*.flywayBeans.*.migrations").description(
5857
"Migrations performed by the Flyway instance, keyed by"
59-
+ " Flyway bean name."))
60-
.andWithPrefix(
61-
"contexts.*.flywayBeans.*.migrations.[].",
62-
migrationFieldDescriptors())
58+
+ " Flyway bean name.")).andWithPrefix(
59+
"contexts.*.flywayBeans.*.migrations.[].",
60+
migrationFieldDescriptors())
6361
.and(parentIdField())));
6462
}
6563

@@ -84,9 +82,8 @@ private List<FieldDescriptor> migrationFieldDescriptors() {
8482
"Rank of the applied migration, if any. Later migrations have "
8583
+ "higher ranks.")
8684
.optional(),
87-
fieldWithPath("script")
88-
.description(
89-
"Name of the script used to execute the migration, if any.")
85+
fieldWithPath("script").description(
86+
"Name of the script used to execute the migration, if any.")
9087
.optional(),
9188
fieldWithPath("state").description("State of the migration. ("
9289
+ describeEnumValues(MigrationState.class) + ")"),

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ public class HealthEndpointDocumentationTests extends MockMvcEndpointDocumentati
5252
@Test
5353
public void health() throws Exception {
5454
this.mockMvc.perform(get("/actuator/health")).andExpect(status().isOk())
55-
.andDo(document("health",
56-
responseFields(
57-
fieldWithPath("status").description(
58-
"Overall status of the application."),
55+
.andDo(document("health", responseFields(
56+
fieldWithPath("status")
57+
.description("Overall status of the application."),
5958
fieldWithPath("details").description(
6059
"Details of the health of the application. Presence is controlled by "
6160
+ "`management.endpoint.health.show-details`)."),

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HttpTraceEndpointDocumentationTests.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ public void traces() throws Exception {
7777
() -> UUID.randomUUID().toString());
7878
given(this.repository.findAll()).willReturn(Arrays.asList(trace));
7979
this.mockMvc.perform(get("/actuator/httptrace")).andExpect(status().isOk())
80-
.andDo(document("httptrace",
81-
responseFields(
82-
fieldWithPath("traces").description(
83-
"An array of traced HTTP request-response exchanges."),
80+
.andDo(document("httptrace", responseFields(
81+
fieldWithPath("traces").description(
82+
"An array of traced HTTP request-response exchanges."),
8483
fieldWithPath("traces.[].timestamp").description(
8584
"Timestamp of when the traced exchange occurred."),
8685
fieldWithPath("traces.[].principal")
@@ -90,9 +89,8 @@ public void traces() throws Exception {
9089
.description("Name of the principal.").optional(),
9190
fieldWithPath("traces.[].request.method")
9291
.description("HTTP method of the request."),
93-
fieldWithPath("traces.[].request.remoteAddress")
94-
.description(
95-
"Remote address from which the request was received, if known.")
92+
fieldWithPath("traces.[].request.remoteAddress").description(
93+
"Remote address from which the request was received, if known.")
9694
.optional().type(JsonFieldType.STRING),
9795
fieldWithPath("traces.[].request.uri")
9896
.description("URI of the request."),

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/InfoEndpointDocumentationTests.java

+9-10
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ public void info() throws Exception {
5353
responseFields(beneathPath("git"),
5454
fieldWithPath("branch")
5555
.description("Name of the Git branch, if any."),
56-
fieldWithPath("commit")
57-
.description("Details of the Git commit, if any."),
58-
fieldWithPath("commit.time")
59-
.description("Timestamp of the commit, if any.")
60-
.type(JsonFieldType.VARIES),
61-
fieldWithPath("commit.id")
62-
.description("ID of the commit, if any.")),
56+
fieldWithPath("commit").description(
57+
"Details of the Git commit, if any."),
58+
fieldWithPath("commit.time")
59+
.description("Timestamp of the commit, if any.")
60+
.type(JsonFieldType.VARIES),
61+
fieldWithPath("commit.id")
62+
.description("ID of the commit, if any.")),
6363
responseFields(beneathPath("build"),
6464
fieldWithPath("artifact")
6565
.description(
@@ -76,9 +76,8 @@ public void info() throws Exception {
7676
.description(
7777
"Version of the application, if any.")
7878
.optional(),
79-
fieldWithPath("time")
80-
.description(
81-
"Timestamp of when the application was built, if any.")
79+
fieldWithPath("time").description(
80+
"Timestamp of when the application was built, if any.")
8281
.type(JsonFieldType.VARIES).optional())));
8382
}
8483

0 commit comments

Comments
 (0)