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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 20 additions & 24 deletions
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

Lines changed: 6 additions & 8 deletions
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

Lines changed: 20 additions & 24 deletions
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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 3 additions & 4 deletions
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

Lines changed: 2 additions & 2 deletions
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")

0 commit comments

Comments
 (0)