diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java index c25045753c8..9ec72e4ac2b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java @@ -115,9 +115,8 @@ public class CloudFoundryActuatorAutoConfiguration { String cloudControllerUrl = environment.getProperty("vcap.application.cf_api"); boolean skipSslValidation = environment.getProperty( "management.cloudfoundry.skip-ssl-validation", Boolean.class, false); - return (cloudControllerUrl == null ? null - : new CloudFoundrySecurityService(restTemplateBuilder, cloudControllerUrl, - skipSslValidation)); + return (cloudControllerUrl == null ? null : new CloudFoundrySecurityService( + restTemplateBuilder, cloudControllerUrl, skipSslValidation)); } private CorsConfiguration getCorsConfiguration() { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java index 8663263fb81..20a989df6c4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java @@ -58,7 +58,8 @@ public class PropertiesMeterFilter implements MeterFilter { public HistogramConfig configure(Meter.Id id, HistogramConfig config) { HistogramConfig.Builder builder = HistogramConfig.builder(); Distribution distribution = this.properties.getDistribution(); - builder.percentilesHistogram(lookup(distribution.getPercentilesHistogram(), id, null)); + builder.percentilesHistogram( + lookup(distribution.getPercentilesHistogram(), id, null)); builder.percentiles(lookup(distribution.getPercentiles(), id, null)); builder.sla(convertSla(id.getType(), lookup(distribution.getSla(), id, null))); return builder.build().merge(config); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java index f6b3ead3420..dd68a9175d0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java @@ -134,8 +134,7 @@ class ServletManagementChildContextConfiguration { accessLogValve.setPrefix(customizePrefix(accessLogValve.getPrefix())); } - private AccessLogValve findAccessLogValve( - TomcatServletWebServerFactory factory) { + private AccessLogValve findAccessLogValve(TomcatServletWebServerFactory factory) { for (Valve engineValve : factory.getEngineValves()) { if (engineValve instanceof AccessLogValve) { return (AccessLogValve) engineValve; @@ -151,8 +150,7 @@ class ServletManagementChildContextConfiguration { @Override public void customize(UndertowServletWebServerFactory factory) { - factory.setAccessLogPrefix( - customizePrefix(factory.getAccessLogPrefix())); + factory.setAccessLogPrefix(customizePrefix(factory.getAccessLogPrefix())); } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java index 1407f2edb9f..f71eeb19497 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java @@ -101,15 +101,13 @@ public class CloudFoundryWebFluxEndpointIntegrationTests { @Test public void responseToOptionsRequestIncludesCorsHeaders() { - load(TestEndpointConfiguration.class, - (client) -> client.options().uri("/cfApplication/test") - .accept(MediaType.APPLICATION_JSON) - .header("Access-Control-Request-Method", "POST") - .header("Origin", "http://example.com").exchange().expectStatus() - .isOk().expectHeader() - .valueEquals("Access-Control-Allow-Origin", "http://example.com") - .expectHeader() - .valueEquals("Access-Control-Allow-Methods", "GET,POST")); + load(TestEndpointConfiguration.class, (client) -> client.options() + .uri("/cfApplication/test").accept(MediaType.APPLICATION_JSON) + .header("Access-Control-Request-Method", "POST") + .header("Origin", "http://example.com").exchange().expectStatus().isOk() + .expectHeader() + .valueEquals("Access-Control-Allow-Origin", "http://example.com") + .expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST")); } @Test @@ -117,21 +115,19 @@ public class CloudFoundryWebFluxEndpointIntegrationTests { given(tokenValidator.validate(any())).willReturn(Mono.empty()); given(securityService.getAccessLevel(any(), eq("app-id"))) .willReturn(Mono.just(AccessLevel.FULL)); - load(TestEndpointConfiguration.class, - (client) -> client.get().uri("/cfApplication") - .accept(MediaType.APPLICATION_JSON) - .header("Authorization", "bearer " + mockAccessToken()).exchange() - .expectStatus().isOk().expectBody().jsonPath("_links.length()") - .isEqualTo(5).jsonPath("_links.self.href").isNotEmpty() - .jsonPath("_links.self.templated").isEqualTo(false) - .jsonPath("_links.info.href").isNotEmpty() - .jsonPath("_links.info.templated").isEqualTo(false) - .jsonPath("_links.env.href").isNotEmpty() - .jsonPath("_links.env.templated").isEqualTo(false) - .jsonPath("_links.test.href").isNotEmpty() - .jsonPath("_links.test.templated").isEqualTo(false) - .jsonPath("_links.test-part.href").isNotEmpty() - .jsonPath("_links.test-part.templated").isEqualTo(true)); + load(TestEndpointConfiguration.class, (client) -> client.get() + .uri("/cfApplication").accept(MediaType.APPLICATION_JSON) + .header("Authorization", "bearer " + mockAccessToken()).exchange() + .expectStatus().isOk().expectBody().jsonPath("_links.length()") + .isEqualTo(5).jsonPath("_links.self.href").isNotEmpty() + .jsonPath("_links.self.templated").isEqualTo(false) + .jsonPath("_links.info.href").isNotEmpty() + .jsonPath("_links.info.templated").isEqualTo(false) + .jsonPath("_links.env.href").isNotEmpty().jsonPath("_links.env.templated") + .isEqualTo(false).jsonPath("_links.test.href").isNotEmpty() + .jsonPath("_links.test.templated").isEqualTo(false) + .jsonPath("_links.test-part.href").isNotEmpty() + .jsonPath("_links.test-part.templated").isEqualTo(true)); } @Test diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java index 4a431425e3a..ee76d8782f3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java @@ -96,10 +96,9 @@ public class ReactiveCloudFoundrySecurityInterceptorTests { .from(MockServerHttpRequest.get("/a") .header(HttpHeaders.AUTHORIZATION, "bearer " + mockAccessToken()) .build()); - StepVerifier.create(this.interceptor.preHandle(request, "/a")) - .consumeErrorWith((ex) -> assertThat( - ((CloudFoundryAuthorizationException) ex).getReason()) - .isEqualTo(Reason.SERVICE_UNAVAILABLE)) + StepVerifier.create(this.interceptor.preHandle(request, "/a")).consumeErrorWith( + (ex) -> assertThat(((CloudFoundryAuthorizationException) ex).getReason()) + .isEqualTo(Reason.SERVICE_UNAVAILABLE)) .verify(); } @@ -109,10 +108,9 @@ public class ReactiveCloudFoundrySecurityInterceptorTests { "my-app-id"); MockServerWebExchange request = MockServerWebExchange.from(MockServerHttpRequest .get("/a").header(HttpHeaders.AUTHORIZATION, mockAccessToken()).build()); - StepVerifier.create(this.interceptor.preHandle(request, "/a")) - .consumeErrorWith((ex) -> assertThat( - ((CloudFoundryAuthorizationException) ex).getReason()) - .isEqualTo(Reason.SERVICE_UNAVAILABLE)) + StepVerifier.create(this.interceptor.preHandle(request, "/a")).consumeErrorWith( + (ex) -> assertThat(((CloudFoundryAuthorizationException) ex).getReason()) + .isEqualTo(Reason.SERVICE_UNAVAILABLE)) .verify(); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java index 97efb0292e5..90ac0c351aa 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryMvcWebEndpointIntegrationTests.java @@ -94,36 +94,32 @@ public class CloudFoundryMvcWebEndpointIntegrationTests { @Test public void responseToOptionsRequestIncludesCorsHeaders() { - load(TestEndpointConfiguration.class, - (client) -> client.options().uri("/cfApplication/test") - .accept(MediaType.APPLICATION_JSON) - .header("Access-Control-Request-Method", "POST") - .header("Origin", "http://example.com").exchange().expectStatus() - .isOk().expectHeader() - .valueEquals("Access-Control-Allow-Origin", "http://example.com") - .expectHeader() - .valueEquals("Access-Control-Allow-Methods", "GET,POST")); + load(TestEndpointConfiguration.class, (client) -> client.options() + .uri("/cfApplication/test").accept(MediaType.APPLICATION_JSON) + .header("Access-Control-Request-Method", "POST") + .header("Origin", "http://example.com").exchange().expectStatus().isOk() + .expectHeader() + .valueEquals("Access-Control-Allow-Origin", "http://example.com") + .expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST")); } @Test public void linksToOtherEndpointsWithFullAccess() { given(securityService.getAccessLevel(any(), eq("app-id"))) .willReturn(AccessLevel.FULL); - load(TestEndpointConfiguration.class, - (client) -> client.get().uri("/cfApplication") - .accept(MediaType.APPLICATION_JSON) - .header("Authorization", "bearer " + mockAccessToken()).exchange() - .expectStatus().isOk().expectBody().jsonPath("_links.length()") - .isEqualTo(5).jsonPath("_links.self.href").isNotEmpty() - .jsonPath("_links.self.templated").isEqualTo(false) - .jsonPath("_links.info.href").isNotEmpty() - .jsonPath("_links.info.templated").isEqualTo(false) - .jsonPath("_links.env.href").isNotEmpty() - .jsonPath("_links.env.templated").isEqualTo(false) - .jsonPath("_links.test.href").isNotEmpty() - .jsonPath("_links.test.templated").isEqualTo(false) - .jsonPath("_links.test-part.href").isNotEmpty() - .jsonPath("_links.test-part.templated").isEqualTo(true)); + load(TestEndpointConfiguration.class, (client) -> client.get() + .uri("/cfApplication").accept(MediaType.APPLICATION_JSON) + .header("Authorization", "bearer " + mockAccessToken()).exchange() + .expectStatus().isOk().expectBody().jsonPath("_links.length()") + .isEqualTo(5).jsonPath("_links.self.href").isNotEmpty() + .jsonPath("_links.self.templated").isEqualTo(false) + .jsonPath("_links.info.href").isNotEmpty() + .jsonPath("_links.info.templated").isEqualTo(false) + .jsonPath("_links.env.href").isNotEmpty().jsonPath("_links.env.templated") + .isEqualTo(false).jsonPath("_links.test.href").isNotEmpty() + .jsonPath("_links.test.templated").isEqualTo(false) + .jsonPath("_links.test-part.href").isNotEmpty() + .jsonPath("_links.test-part.templated").isEqualTo(true)); } @Test diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/context/properties/ConfigurationPropertiesReportEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/context/properties/ConfigurationPropertiesReportEndpointAutoConfigurationTests.java index 5ec5b06a2d1..c32606d39fa 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/context/properties/ConfigurationPropertiesReportEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/context/properties/ConfigurationPropertiesReportEndpointAutoConfigurationTests.java @@ -60,9 +60,8 @@ public class ConfigurationPropertiesReportEndpointAutoConfigurationTests { @Test public void keysToSanitizeCanBeConfiguredViaTheEnvironment() { - this.contextRunner.withUserConfiguration(Config.class) - .withPropertyValues( - "management.endpoint.configprops.keys-to-sanitize: .*pass.*, property") + this.contextRunner.withUserConfiguration(Config.class).withPropertyValues( + "management.endpoint.configprops.keys-to-sanitize: .*pass.*, property") .run(validateTestProperties("******", "******")); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/AuditEventsEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/AuditEventsEndpointDocumentationTests.java index 518c863365e..6dbef202536 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/AuditEventsEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/AuditEventsEndpointDocumentationTests.java @@ -88,9 +88,9 @@ public class AuditEventsEndpointDocumentationTests parameterWithName("principal").description( "Restricts the events to those with the given " + "principal. Optional."), - parameterWithName("type").description( - "Restricts the events to those with the given " - + "type. Optional.")))); + parameterWithName("type").description( + "Restricts the events to those with the given " + + "type. Optional.")))); verify(this.repository).find("alice", now.toInstant(), "logout"); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/BeansEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/BeansEndpointDocumentationTests.java index e1a1e76b2f4..b6a76870326 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/BeansEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/BeansEndpointDocumentationTests.java @@ -49,10 +49,9 @@ public class BeansEndpointDocumentationTests extends MockMvcEndpointDocumentatio @Test public void beans() throws Exception { - List beanFields = Arrays - .asList(fieldWithPath("aliases").description("Names of any aliases."), - fieldWithPath("scope") - .description("Scope of the bean."), + List beanFields = Arrays.asList( + fieldWithPath("aliases").description("Names of any aliases."), + fieldWithPath("scope").description("Scope of the bean."), fieldWithPath("type").description("Fully qualified type of the bean."), fieldWithPath("resource") .description("Resource in which the bean was defined, if any.") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ConditionsReportEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ConditionsReportEndpointDocumentationTests.java index 4bdf8b64ac5..13b653dc3de 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ConditionsReportEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ConditionsReportEndpointDocumentationTests.java @@ -100,8 +100,8 @@ public class ConditionsReportEndpointDocumentationTests this.mockMvc.perform(get("/actuator/conditions")).andExpect(status().isOk()) .andDo(MockMvcRestDocumentation.document("conditions", preprocessResponse( - limit("contexts", getApplicationContext().getId(), - "positiveMatches"), + limit("contexts", getApplicationContext() + .getId(), "positiveMatches"), limit("contexts", getApplicationContext().getId(), "negativeMatches")), responseFields(fieldWithPath("contexts") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/EnvironmentEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/EnvironmentEndpointDocumentationTests.java index 1c44b54bc7a..c6452af10dc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/EnvironmentEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/EnvironmentEndpointDocumentationTests.java @@ -71,12 +71,10 @@ public class EnvironmentEndpointDocumentationTests @Test public void env() throws Exception { - this.mockMvc.perform(get("/actuator/env")).andExpect(status().isOk()) - .andDo(document("env/all", - preprocessResponse(replacePattern( - Pattern.compile( - "org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/"), - ""), filterProperties()), + this.mockMvc.perform(get("/actuator/env")).andExpect(status().isOk()).andDo( + document("env/all", preprocessResponse(replacePattern(Pattern.compile( + "org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/"), + ""), filterProperties()), responseFields(activeProfiles, propertySources, propertySourceName, fieldWithPath("propertySources.[].properties") @@ -94,14 +92,13 @@ public class EnvironmentEndpointDocumentationTests this.mockMvc.perform(get("/actuator/env/com.example.cache.max-size")) .andExpect(status().isOk()) .andDo(document("env/single", - preprocessResponse(replacePattern( - Pattern.compile( - "org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/"), + preprocessResponse(replacePattern(Pattern.compile( + "org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/"), "")), responseFields( fieldWithPath("property").description( "Property from the environment, if found.") - .optional(), + .optional(), fieldWithPath("property.source").description( "Name of the source of the property."), fieldWithPath("property.value") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java index 334e4fe6ea0..4bb89d320a0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java @@ -50,16 +50,14 @@ public class FlywayEndpointDocumentationTests extends MockMvcEndpointDocumentati @Test public void flyway() throws Exception { this.mockMvc.perform(get("/actuator/flyway")).andExpect(status().isOk()) - .andDo(MockMvcRestDocumentation.document("flyway", - responseFields( - fieldWithPath("contexts") - .description("Application contexts keyed by id"), + .andDo(MockMvcRestDocumentation.document("flyway", responseFields( + fieldWithPath("contexts") + .description("Application contexts keyed by id"), fieldWithPath("contexts.*.flywayBeans.*.migrations").description( "Migrations performed by the Flyway instance, keyed by" - + " Flyway bean name.")) - .andWithPrefix( - "contexts.*.flywayBeans.*.migrations.[].", - migrationFieldDescriptors()) + + " Flyway bean name.")).andWithPrefix( + "contexts.*.flywayBeans.*.migrations.[].", + migrationFieldDescriptors()) .and(parentIdField()))); } @@ -84,9 +82,8 @@ public class FlywayEndpointDocumentationTests extends MockMvcEndpointDocumentati "Rank of the applied migration, if any. Later migrations have " + "higher ranks.") .optional(), - fieldWithPath("script") - .description( - "Name of the script used to execute the migration, if any.") + fieldWithPath("script").description( + "Name of the script used to execute the migration, if any.") .optional(), fieldWithPath("state").description("State of the migration. (" + describeEnumValues(MigrationState.class) + ")"), diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java index 43a4821bfac..502e5484fb9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HealthEndpointDocumentationTests.java @@ -52,10 +52,9 @@ public class HealthEndpointDocumentationTests extends MockMvcEndpointDocumentati @Test public void health() throws Exception { this.mockMvc.perform(get("/actuator/health")).andExpect(status().isOk()) - .andDo(document("health", - responseFields( - fieldWithPath("status").description( - "Overall status of the application."), + .andDo(document("health", responseFields( + fieldWithPath("status") + .description("Overall status of the application."), fieldWithPath("details").description( "Details of the health of the application. Presence is controlled by " + "`management.endpoint.health.show-details`)."), diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HttpTraceEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HttpTraceEndpointDocumentationTests.java index 030cde36077..7b91274a97a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HttpTraceEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/HttpTraceEndpointDocumentationTests.java @@ -77,10 +77,9 @@ public class HttpTraceEndpointDocumentationTests () -> UUID.randomUUID().toString()); given(this.repository.findAll()).willReturn(Arrays.asList(trace)); this.mockMvc.perform(get("/actuator/httptrace")).andExpect(status().isOk()) - .andDo(document("httptrace", - responseFields( - fieldWithPath("traces").description( - "An array of traced HTTP request-response exchanges."), + .andDo(document("httptrace", responseFields( + fieldWithPath("traces").description( + "An array of traced HTTP request-response exchanges."), fieldWithPath("traces.[].timestamp").description( "Timestamp of when the traced exchange occurred."), fieldWithPath("traces.[].principal") @@ -90,9 +89,8 @@ public class HttpTraceEndpointDocumentationTests .description("Name of the principal.").optional(), fieldWithPath("traces.[].request.method") .description("HTTP method of the request."), - fieldWithPath("traces.[].request.remoteAddress") - .description( - "Remote address from which the request was received, if known.") + fieldWithPath("traces.[].request.remoteAddress").description( + "Remote address from which the request was received, if known.") .optional().type(JsonFieldType.STRING), fieldWithPath("traces.[].request.uri") .description("URI of the request."), diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/InfoEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/InfoEndpointDocumentationTests.java index 82725e71ee8..f81b81ade95 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/InfoEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/InfoEndpointDocumentationTests.java @@ -53,13 +53,13 @@ public class InfoEndpointDocumentationTests extends MockMvcEndpointDocumentation responseFields(beneathPath("git"), fieldWithPath("branch") .description("Name of the Git branch, if any."), - fieldWithPath("commit") - .description("Details of the Git commit, if any."), - fieldWithPath("commit.time") - .description("Timestamp of the commit, if any.") - .type(JsonFieldType.VARIES), - fieldWithPath("commit.id") - .description("ID of the commit, if any.")), + fieldWithPath("commit").description( + "Details of the Git commit, if any."), + fieldWithPath("commit.time") + .description("Timestamp of the commit, if any.") + .type(JsonFieldType.VARIES), + fieldWithPath("commit.id") + .description("ID of the commit, if any.")), responseFields(beneathPath("build"), fieldWithPath("artifact") .description( @@ -76,9 +76,8 @@ public class InfoEndpointDocumentationTests extends MockMvcEndpointDocumentation .description( "Version of the application, if any.") .optional(), - fieldWithPath("time") - .description( - "Timestamp of when the application was built, if any.") + fieldWithPath("time").description( + "Timestamp of when the application was built, if any.") .type(JsonFieldType.VARIES).optional()))); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LiquibaseEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LiquibaseEndpointDocumentationTests.java index c438a0f7f9d..ebafb761ef9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LiquibaseEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LiquibaseEndpointDocumentationTests.java @@ -57,9 +57,10 @@ public class LiquibaseEndpointDocumentationTests responseFields( fieldWithPath("contexts") .description("Application contexts keyed by id"), - changeSetsField).andWithPrefix( - "contexts.*.liquibaseBeans.*.changeSets[].", - getChangeSetFieldDescriptors()).and(parentIdField()))); + changeSetsField).andWithPrefix( + "contexts.*.liquibaseBeans.*.changeSets[].", + getChangeSetFieldDescriptors()) + .and(parentIdField()))); } private List getChangeSetFieldDescriptors() { @@ -81,8 +82,8 @@ public class LiquibaseEndpointDocumentationTests fieldWithPath("labels") .description("Labels associated with the change set."), fieldWithPath("checksum").description("Checksum of the change set."), - fieldWithPath("orderExecuted").description( - "Order of the execution of the change set."), + fieldWithPath("orderExecuted") + .description("Order of the execution of the change set."), fieldWithPath("tag") .description("Tag associated with the change set, if any.") .optional().type(JsonFieldType.STRING)); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LoggersEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LoggersEndpointDocumentationTests.java index 9d748a0bbd5..c57924a64e5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LoggersEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/LoggersEndpointDocumentationTests.java @@ -67,10 +67,9 @@ public class LoggersEndpointDocumentationTests extends MockMvcEndpointDocumentat new LoggerConfiguration("ROOT", LogLevel.INFO, LogLevel.INFO), new LoggerConfiguration("com.example", LogLevel.DEBUG, LogLevel.DEBUG))); this.mockMvc.perform(get("/actuator/loggers")).andExpect(status().isOk()) - .andDo(MockMvcRestDocumentation.document("loggers/all", - responseFields( - fieldWithPath("levels").description( - "Levels support by the logging system."), + .andDo(MockMvcRestDocumentation.document("loggers/all", responseFields( + fieldWithPath("levels") + .description("Levels support by the logging system."), fieldWithPath("loggers").description("Loggers keyed by name.")) .andWithPrefix("loggers.*.", levelFields))); } @@ -90,13 +89,12 @@ public class LoggersEndpointDocumentationTests extends MockMvcEndpointDocumentat .perform(post("/actuator/loggers/com.example") .content("{\"configuredLevel\":\"debug\"}") .contentType(MediaType.APPLICATION_JSON)) - .andExpect(status().isNoContent()) - .andDo(MockMvcRestDocumentation - .document("loggers/set", + .andExpect(status().isNoContent()).andDo( + MockMvcRestDocumentation.document("loggers/set", requestFields(fieldWithPath("configuredLevel") .description("Level for the logger. May be" + " omitted to clear the level.") - .optional()))); + .optional()))); verify(this.loggingSystem).setLogLevel("com.example", LogLevel.DEBUG); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointReactiveDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointReactiveDocumentationTests.java index c52831c0b39..f84513a901f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointReactiveDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointReactiveDocumentationTests.java @@ -78,13 +78,13 @@ public class MappingsEndpointReactiveDocumentationTests responseFields( beneathPath("contexts.*.mappings.dispatcherHandlers") .withSubsectionId("dispatcher-handlers"), - fieldWithPath("*").description( - "Dispatcher handler mappings, if any, keyed by " - + "dispatcher handler bean name."), - fieldWithPath("*.[].handler") - .description("Handler for the mapping."), - fieldWithPath("*.[].predicate") - .description("Predicate for the mapping.")))); + fieldWithPath("*").description( + "Dispatcher handler mappings, if any, keyed by " + + "dispatcher handler bean name."), + fieldWithPath("*.[].handler") + .description("Handler for the mapping."), + fieldWithPath("*.[].predicate") + .description("Predicate for the mapping.")))); } @Configuration diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointServletDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointServletDocumentationTests.java index 3878f4b4976..9cd7aea9829 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointServletDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointServletDocumentationTests.java @@ -96,13 +96,13 @@ public class MappingsEndpointServletDocumentationTests responseFields( beneathPath("contexts.*.mappings.dispatcherServlets") .withSubsectionId("dispatcher-servlets"), - fieldWithPath("*").description( - "Dispatcher servlet mappings, if any, keyed by " - + "dispatcher servlet bean name."), - fieldWithPath("*.[].handler") - .description("Handler for the mapping."), - fieldWithPath("*.[].predicate") - .description("Predicate for the mapping.")), + fieldWithPath("*").description( + "Dispatcher servlet mappings, if any, keyed by " + + "dispatcher servlet bean name."), + fieldWithPath("*.[].handler") + .description("Handler for the mapping."), + fieldWithPath("*.[].predicate") + .description("Predicate for the mapping.")), responseFields( beneathPath("contexts.*.mappings.servletFilters") .withSubsectionId("servlet-filters"), diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MetricsEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MetricsEndpointDocumentationTests.java index ca0ce123792..604e052db7d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MetricsEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MetricsEndpointDocumentationTests.java @@ -52,11 +52,10 @@ public class MetricsEndpointDocumentationTests extends MockMvcEndpointDocumentat public void metric() throws Exception { this.mockMvc.perform(get("/actuator/metrics/jvm.memory.max")) .andExpect(status().isOk()) - .andDo(document("metrics/metric", - responseFields( - fieldWithPath("name").description("Name of the metric"), - fieldWithPath("measurements") - .description("Measurements of the metric"), + .andDo(document("metrics/metric", responseFields( + fieldWithPath("name").description("Name of the metric"), + fieldWithPath("measurements") + .description("Measurements of the metric"), fieldWithPath("measurements[].statistic") .description("Statistic of the measurement. (" + describeEnumValues(Statistic.class) + ")."), @@ -72,10 +71,8 @@ public class MetricsEndpointDocumentationTests extends MockMvcEndpointDocumentat @Test public void metricWithTags() throws Exception { - this.mockMvc - .perform(get("/actuator/metrics/jvm.memory.max") - .param("tag", "area:nonheap") - .param("tag", "id:Compressed Class Space")) + this.mockMvc.perform(get("/actuator/metrics/jvm.memory.max") + .param("tag", "area:nonheap").param("tag", "id:Compressed Class Space")) .andExpect(status().isOk()) .andDo(document("metrics/metric-with-tags", requestParameters(parameterWithName("tag").description( diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ScheduledTasksEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ScheduledTasksEndpointDocumentationTests.java index 65901ed5462..ae41931373d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ScheduledTasksEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ScheduledTasksEndpointDocumentationTests.java @@ -50,10 +50,9 @@ public class ScheduledTasksEndpointDocumentationTests public void scheduledTasks() throws Exception { this.mockMvc.perform(get("/actuator/scheduledtasks")).andExpect(status().isOk()) .andDo(document("scheduled-tasks", - preprocessResponse(replacePattern( - Pattern.compile( - "org.*\\.ScheduledTasksEndpointDocumentationTests\\$" - + "TestConfiguration"), + preprocessResponse(replacePattern(Pattern.compile( + "org.*\\.ScheduledTasksEndpointDocumentationTests\\$" + + "TestConfiguration"), "com.example.Processor")), responseFields( fieldWithPath("cron").description("Cron tasks, if any."), diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/SessionsEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/SessionsEndpointDocumentationTests.java index 242a9419c0b..08293bde75f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/SessionsEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/SessionsEndpointDocumentationTests.java @@ -67,10 +67,10 @@ public class SessionsEndpointDocumentationTests private static final Session sessionThree = createSession( Instant.now().minusSeconds(60 * 60 * 2), Instant.now().minusSeconds(12)); - private static final List sessionFields = Arrays - .asList(fieldWithPath("id").description("ID of the session."), - fieldWithPath("attributeNames").description( - "Names of the attributes stored in the session."), + private static final List sessionFields = Arrays.asList( + fieldWithPath("id").description("ID of the session."), + fieldWithPath("attributeNames") + .description("Names of the attributes stored in the session."), fieldWithPath("creationTime") .description("Timestamp of when the session was created."), fieldWithPath("lastAccessedTime") diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java index c3435408ccd..f380cdbddc4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.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. @@ -133,11 +133,9 @@ public class EnvironmentEndpoint { String propertyName) { Map propertySources = new LinkedHashMap<>(); PlaceholdersResolver resolver = getResolver(); - getPropertySourcesAsMap() - .forEach((sourceName, source) -> propertySources.put(sourceName, - source.containsProperty(propertyName) - ? describeValueOf(propertyName, source, resolver) - : null)); + getPropertySourcesAsMap().forEach((sourceName, source) -> propertySources + .put(sourceName, source.containsProperty(propertyName) + ? describeValueOf(propertyName, source, resolver) : null)); return propertySources; } 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 4cb378456b9..542c4c5d901 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 @@ -120,10 +120,8 @@ public class MetricsEndpoint { } private void mergeMeasurements(Map samples, Meter meter) { - meter.measure() - .forEach((measurement) -> samples.merge(measurement.getStatistic(), - measurement.getValue(), - mergeFunction(measurement.getStatistic()))); + meter.measure().forEach((measurement) -> samples.merge(measurement.getStatistic(), + measurement.getValue(), mergeFunction(measurement.getStatistic()))); } private BiFunction mergeFunction(Statistic statistic) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java index f995f04da00..20034bd9954 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java @@ -107,13 +107,13 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws ServletException, IOException { + throws ServletException, IOException { filterAndRecordMetrics(request, response, filterChain); } private void filterAndRecordMetrics(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws IOException, ServletException, NestedServletException { + throws IOException, ServletException, NestedServletException { Object handler = null; try { handler = getHandler(request); @@ -150,7 +150,7 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter { private void filterAndRecordMetrics(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain, Object handler) - throws IOException, ServletException, NestedServletException { + throws IOException, ServletException, NestedServletException { TimingContext timingContext = TimingContext.get(request); if (timingContext == null) { timingContext = startAndAttachTimingContext(request, handler); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilter.java index 45aa1d50b25..87d797ca546 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilter.java @@ -75,7 +75,7 @@ public class HttpTraceFilter extends OncePerRequestFilter implements Ordered { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws ServletException, IOException { + throws ServletException, IOException { TraceableHttpServletRequest traceableRequest = new TraceableHttpServletRequest( request); HttpTrace trace = this.tracer.receivedRequest(traceableRequest); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/beans/BeansEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/beans/BeansEndpointTests.java index fe93b0b5548..f7ec9166282 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/beans/BeansEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/beans/BeansEndpointTests.java @@ -100,12 +100,13 @@ public class BeansEndpointTests { new ApplicationContextRunner() .withUserConfiguration(EndpointConfiguration.class).withParent(parent) .run((child) -> { - ApplicationBeans result = child.getBean(BeansEndpoint.class).beans(); - assertThat(result.getContexts().get(parent.getId()).getBeans()) - .containsKey("bean"); - assertThat(result.getContexts().get(child.getId()).getBeans()) - .containsKey("endpoint"); - }); + ApplicationBeans result = child.getBean(BeansEndpoint.class) + .beans(); + assertThat(result.getContexts().get(parent.getId()).getBeans()) + .containsKey("bean"); + assertThat(result.getContexts().get(child.getId()).getBeans()) + .containsKey("endpoint"); + }); }); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointParentTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointParentTests.java index 306bb165c36..6b3fb1d3b5c 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointParentTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointParentTests.java @@ -43,18 +43,20 @@ public class ConfigurationPropertiesReportEndpointParentTests { new ApplicationContextRunner() .withUserConfiguration(ClassConfigurationProperties.class) .withParent(parent).run((child) -> { - ConfigurationPropertiesReportEndpoint endpoint = child - .getBean(ConfigurationPropertiesReportEndpoint.class); - ApplicationConfigurationProperties applicationProperties = endpoint - .configurationProperties(); - assertThat(applicationProperties.getContexts()) - .containsOnlyKeys(child.getId(), parent.getId()); - assertThat(applicationProperties.getContexts().get(child.getId()) - .getBeans().keySet()).containsExactly("someProperties"); - assertThat((applicationProperties.getContexts() - .get(parent.getId()).getBeans().keySet())) - .containsExactly("testProperties"); - }); + ConfigurationPropertiesReportEndpoint endpoint = child + .getBean( + ConfigurationPropertiesReportEndpoint.class); + ApplicationConfigurationProperties applicationProperties = endpoint + .configurationProperties(); + assertThat(applicationProperties.getContexts()) + .containsOnlyKeys(child.getId(), parent.getId()); + assertThat(applicationProperties.getContexts() + .get(child.getId()).getBeans().keySet()) + .containsExactly("someProperties"); + assertThat((applicationProperties.getContexts() + .get(parent.getId()).getBeans().keySet())) + .containsExactly("testProperties"); + }); }); } @@ -66,17 +68,19 @@ public class ConfigurationPropertiesReportEndpointParentTests { .withUserConfiguration( BeanMethodConfigurationProperties.class) .withParent(parent).run((child) -> { - ConfigurationPropertiesReportEndpoint endpoint = child - .getBean(ConfigurationPropertiesReportEndpoint.class); - ApplicationConfigurationProperties applicationProperties = endpoint - .configurationProperties(); - assertThat(applicationProperties.getContexts().get(child.getId()) - .getBeans().keySet()) - .containsExactlyInAnyOrder("otherProperties"); - assertThat((applicationProperties.getContexts() - .get(parent.getId()).getBeans().keySet())) - .containsExactly("testProperties"); - }); + ConfigurationPropertiesReportEndpoint endpoint = child + .getBean( + ConfigurationPropertiesReportEndpoint.class); + ApplicationConfigurationProperties applicationProperties = endpoint + .configurationProperties(); + assertThat(applicationProperties.getContexts() + .get(child.getId()).getBeans().keySet()) + .containsExactlyInAnyOrder( + "otherProperties"); + assertThat((applicationProperties.getContexts() + .get(parent.getId()).getBeans().keySet())) + .containsExactly("testProperties"); + }); }); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java index e0b91c6f1cb..e438c3357af 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyWebEndpointIntegrationTests.java @@ -131,7 +131,7 @@ public class JerseyWebEndpointIntegrationTests extends @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws ServletException, IOException { + throws ServletException, IOException { filterChain.doFilter(new HttpServletRequestWrapper(request) { @Override diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java index e277663e16b..620f4a4308d 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java @@ -66,15 +66,13 @@ public class WebFluxEndpointIntegrationTests @Test public void responseToOptionsRequestIncludesCorsHeaders() { - load(TestEndpointConfiguration.class, - (client) -> client.options().uri("/test") - .accept(MediaType.APPLICATION_JSON) - .header("Access-Control-Request-Method", "POST") - .header("Origin", "http://example.com").exchange().expectStatus() - .isOk().expectHeader() - .valueEquals("Access-Control-Allow-Origin", "http://example.com") - .expectHeader() - .valueEquals("Access-Control-Allow-Methods", "GET,POST")); + load(TestEndpointConfiguration.class, (client) -> client.options().uri("/test") + .accept(MediaType.APPLICATION_JSON) + .header("Access-Control-Request-Method", "POST") + .header("Origin", "http://example.com").exchange().expectStatus().isOk() + .expectHeader() + .valueEquals("Access-Control-Allow-Origin", "http://example.com") + .expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST")); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java index b056702bd2f..5b145125df0 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java @@ -68,15 +68,13 @@ public class MvcWebEndpointIntegrationTests extends @Test public void responseToOptionsRequestIncludesCorsHeaders() { - load(TestEndpointConfiguration.class, - (client) -> client.options().uri("/test") - .accept(MediaType.APPLICATION_JSON) - .header("Access-Control-Request-Method", "POST") - .header("Origin", "http://example.com").exchange().expectStatus() - .isOk().expectHeader() - .valueEquals("Access-Control-Allow-Origin", "http://example.com") - .expectHeader() - .valueEquals("Access-Control-Allow-Methods", "GET,POST")); + load(TestEndpointConfiguration.class, (client) -> client.options().uri("/test") + .accept(MediaType.APPLICATION_JSON) + .header("Access-Control-Request-Method", "POST") + .header("Origin", "http://example.com").exchange().expectStatus().isOk() + .expectHeader() + .valueEquals("Access-Control-Allow-Origin", "http://example.com") + .expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST")); } @Test @@ -147,7 +145,7 @@ public class MvcWebEndpointIntegrationTests extends @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws ServletException, IOException { + throws ServletException, IOException { filterChain.doFilter(new HttpServletRequestWrapper(request) { @Override diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/MetricsEndpointWebIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/MetricsEndpointWebIntegrationTests.java index 3e79318f16d..2cec40eb749 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/MetricsEndpointWebIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/MetricsEndpointWebIntegrationTests.java @@ -70,8 +70,8 @@ public class MetricsEndpointWebIntegrationTests { @Test public void selectByTag() { - client.get() - .uri("/actuator/metrics/jvm.memory.used?tag=id:Compressed%20Class%20Space") + client.get().uri( + "/actuator/metrics/jvm.memory.used?tag=id:Compressed%20Class%20Space") .exchange().expectStatus().isOk().expectBody().jsonPath("$.name") .isEqualTo("jvm.memory.used"); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizerTests.java index 4eb1baefeb5..2371a6e5c48 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/client/MetricsRestTemplateCustomizerTests.java @@ -69,8 +69,8 @@ public class MetricsRestTemplateCustomizerTests { .andRespond(MockRestResponseCreators.withSuccess("OK", MediaType.APPLICATION_JSON)); String result = this.restTemplate.getForObject("/test/{id}", String.class, 123); - assertThat(this.registry.find("http.client.requests") - .meters()).anySatisfy((m) -> assertThat( + assertThat(this.registry.find("http.client.requests").meters()) + .anySatisfy((m) -> assertThat( StreamSupport.stream(m.getId().getTags().spliterator(), false) .map(Tag::getKey)).doesNotContain("bucket")); assertThat(this.registry.get("http.client.requests") diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java index 9806bbde7ea..267cb899a87 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java @@ -497,7 +497,7 @@ public class WebMvcMetricsFilterTests { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws ServletException, IOException { + throws ServletException, IOException { String misbehave = request.getHeader(TEST_MISBEHAVE_HEADER); if (misbehave != null) { response.setStatus(Integer.parseInt(misbehave)); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracerTests.java index 829b161afed..616167e7fd3 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracerTests.java @@ -205,12 +205,11 @@ public class HttpExchangeTracerTests { @Test public void mixedCaseSetCookieHeaderIsNotIncludedByDefault() { HttpTrace trace = new HttpTrace(createRequest()); - new HttpExchangeTracer(EnumSet.of(Include.RESPONSE_HEADERS)) - .sendingResponse(trace, - createResponse(Collections.singletonMap( - mixedCase(HttpHeaders.SET_COOKIE), - Arrays.asList("test=test"))), - null, null); + new HttpExchangeTracer(EnumSet.of(Include.RESPONSE_HEADERS)).sendingResponse( + trace, + createResponse(Collections.singletonMap(mixedCase(HttpHeaders.SET_COOKIE), + Arrays.asList("test=test"))), + null, null); assertThat(trace.getResponse().getHeaders()).isEmpty(); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilterTests.java index d82a35123e1..c173e122ea2 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/servlet/HttpTraceFilterTests.java @@ -76,7 +76,7 @@ public class HttpTraceFilterTests { @Override protected void service(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { + throws ServletException, IOException { req.getSession(true); } @@ -112,7 +112,7 @@ public class HttpTraceFilterTests { @Override protected void service(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { + throws ServletException, IOException { throw new IOException(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java index c0d73e1b9be..d8da05a6c39 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.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. @@ -108,7 +108,7 @@ public class BatchAutoConfiguration { @ConditionalOnMissingBean(JobOperator.class) public SimpleJobOperator jobOperator(JobExplorer jobExplorer, JobLauncher jobLauncher, ListableJobLocator jobRegistry, JobRepository jobRepository) - throws Exception { + throws Exception { SimpleJobOperator factory = new SimpleJobOperator(); factory.setJobExplorer(jobExplorer); factory.setJobLauncher(jobLauncher); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java index a794c2e4009..058dee91ec6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java @@ -230,7 +230,7 @@ final class BeanTypeRegistry implements SmartInitializingSingleton { private Class doGetFactoryBeanGeneric(ConfigurableListableBeanFactory beanFactory, BeanDefinition definition) - throws Exception, ClassNotFoundException, LinkageError { + throws Exception, ClassNotFoundException, LinkageError { if (StringUtils.hasLength(definition.getFactoryBeanName()) && StringUtils.hasLength(definition.getFactoryMethodName())) { return getConfigurationClassFactoryBeanGeneric(beanFactory, definition); @@ -243,7 +243,7 @@ final class BeanTypeRegistry implements SmartInitializingSingleton { private Class getConfigurationClassFactoryBeanGeneric( ConfigurableListableBeanFactory beanFactory, BeanDefinition definition) - throws Exception { + throws Exception { Method method = getFactoryMethod(beanFactory, definition); Class generic = ResolvableType.forMethodReturnType(method) .as(FactoryBean.class).resolveGeneric(); @@ -305,7 +305,7 @@ final class BeanTypeRegistry implements SmartInitializingSingleton { private Class getDirectFactoryBeanGeneric( ConfigurableListableBeanFactory beanFactory, BeanDefinition definition) - throws ClassNotFoundException, LinkageError { + throws ClassNotFoundException, LinkageError { Class factoryBeanClass = ClassUtils.forName(definition.getBeanClassName(), beanFactory.getBeanClassLoader()); Class generic = ResolvableType.forClass(factoryBeanClass).as(FactoryBean.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java index ea17198ea53..cb934c24dd0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.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. @@ -248,7 +248,7 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit private Collection getBeanNamesForType(ListableBeanFactory beanFactory, String type, ClassLoader classLoader, boolean considerHierarchy) - throws LinkageError { + throws LinkageError { try { Set result = new LinkedHashSet<>(); collectBeanNamesForType(result, beanFactory, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.java index c084a7840b4..876d9744e25 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnPropertyCondition.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. @@ -106,7 +106,7 @@ class OnPropertyCondition extends SpringBootCondition { ConditionMessage.forCondition(ConditionalOnProperty.class, spec) .found("different value in property", "different value in properties") - .items(Style.QUOTE, nonMatchingProperties)); + .items(Style.QUOTE, nonMatchingProperties)); } return ConditionOutcome.match(ConditionMessage .forCondition(ConditionalOnProperty.class, spec).because("matched")); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java index 926cd088391..1cdaff70efe 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java @@ -165,9 +165,8 @@ public class FlywayAutoConfiguration { Assert.state(locations.length != 0, "Migration script locations not configured"); boolean exists = hasAtLeastOneLocation(locations); - Assert.state(exists, - () -> "Cannot find migrations location in: " + Arrays.asList( - locations) + Assert.state(exists, () -> "Cannot find migrations location in: " + + Arrays.asList(locations) + " (please add migrations or check your Flyway configuration)"); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java index 60b237138c0..65e8134cd0d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.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. @@ -86,7 +86,7 @@ class ActiveMQConnectionFactoryFactory { private T createConnectionFactoryInstance( Class factoryClass) throws InstantiationException, IllegalAccessException, - InvocationTargetException, NoSuchMethodException { + InvocationTargetException, NoSuchMethodException { String brokerUrl = determineBrokerUrl(); String user = this.properties.getUser(); String password = this.properties.getPassword(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisXAConnectionFactoryConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisXAConnectionFactoryConfiguration.java index 12e9f529a21..15d55b78f60 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisXAConnectionFactoryConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisXAConnectionFactoryConfiguration.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. @@ -47,7 +47,7 @@ class ArtemisXAConnectionFactoryConfiguration { @Bean(name = { "jmsConnectionFactory", "xaJmsConnectionFactory" }) public ConnectionFactory jmsConnectionFactory(ListableBeanFactory beanFactory, ArtemisProperties properties, XAConnectionFactoryWrapper wrapper) - throws Exception { + throws Exception { return wrapper.wrapConnectionFactory( new ArtemisConnectionFactoryFactory(beanFactory, properties) .createConnectionFactory(ActiveMQXAConnectionFactory.class)); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java index fff2408eefe..fea3be4fb6e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java @@ -292,13 +292,13 @@ public class JpaProperties { private void applyNamingStrategies(Map properties, ImplicitNamingStrategy implicitStrategyBean, PhysicalNamingStrategy physicalStrategyBean) { - applyNamingStrategy(properties, - "hibernate.implicit_naming_strategy", implicitStrategyBean != null - ? implicitStrategyBean : this.implicitStrategy, + applyNamingStrategy(properties, "hibernate.implicit_naming_strategy", + implicitStrategyBean != null ? implicitStrategyBean + : this.implicitStrategy, DEFAULT_IMPLICIT_STRATEGY); - applyNamingStrategy(properties, - "hibernate.physical_naming_strategy", physicalStrategyBean != null - ? physicalStrategyBean : this.physicalStrategy, + applyNamingStrategy(properties, "hibernate.physical_naming_strategy", + physicalStrategyBean != null ? physicalStrategyBean + : this.physicalStrategy, DEFAULT_PHYSICAL_STRATEGY); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/WebFluxSecurityConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/WebFluxSecurityConfiguration.java index e2a0a07a9bd..6739d0cea1b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/WebFluxSecurityConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/WebFluxSecurityConfiguration.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,9 +24,9 @@ import org.springframework.security.web.server.WebFilterChainProxy; /** * Switches on {@link EnableWebFluxSecurity} for a reactive web application if this - * annotation has not been added by the user. It delegates - * to Spring Security's content-negotiation mechanism for authentication. This configuration also - * backs off if a bean of type {@link WebFilterChainProxy} has been configured in any other way. + * annotation has not been added by the user. It delegates to Spring Security's + * content-negotiation mechanism for authentication. This configuration also backs off if + * a bean of type {@link WebFilterChainProxy} has been configured in any other way. * * @author Madhura Bhave */ diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/UserDetailsServiceAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/UserDetailsServiceAutoConfiguration.java index 20602c6576e..24feffcfa67 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/UserDetailsServiceAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/UserDetailsServiceAutoConfiguration.java @@ -69,10 +69,8 @@ public class UserDetailsServiceAutoConfiguration { ObjectProvider passwordEncoder) throws Exception { SecurityProperties.User user = properties.getUser(); List roles = user.getRoles(); - return new InMemoryUserDetailsManager( - User.withUsername(user.getName()) - .password(getOrDeducePassword(user, - passwordEncoder.getIfAvailable())) + return new InMemoryUserDetailsManager(User.withUsername(user.getName()) + .password(getOrDeducePassword(user, passwordEncoder.getIfAvailable())) .roles(roles.toArray(new String[roles.size()])).build()); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java index e1b5c2e8ee2..44322ca13af 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java @@ -191,10 +191,10 @@ public abstract class AbstractErrorWebExceptionHandler StringBuilder builder = new StringBuilder(); Object message = error.get("message"); Date timestamp = (Date) error.get("timestamp"); - builder.append("

Whitelabel Error Page

") - .append("

This application has no configured error view, so you are seeing this as a fallback.

") - .append("
").append(timestamp) - .append("
").append("
There was an unexpected error (type=") + builder.append("

Whitelabel Error Page

").append( + "

This application has no configured error view, so you are seeing this as a fallback.

") + .append("
").append(timestamp).append("
") + .append("
There was an unexpected error (type=") .append(htmlEscape(error.get("error"))).append(", status=") .append(htmlEscape(error.get("status"))).append(").
"); if (message != null) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/WebClientCodecCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/WebClientCodecCustomizer.java index 16148074c95..7e22429cc4e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/WebClientCodecCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/WebClientCodecCustomizer.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. @@ -43,7 +43,7 @@ public class WebClientCodecCustomizer implements WebClientCustomizer { .exchangeStrategies(ExchangeStrategies.builder() .codecs((codecs) -> this.codecCustomizers .forEach((customizer) -> customizer.customize(codecs))) - .build()); + .build()); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java index 82a9e18d853..698764f3d69 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java @@ -321,10 +321,9 @@ public class WebMvcAutoConfiguration { CacheControl cacheControl = this.resourceProperties.getCache() .getCachecontrol().toHttpCacheControl(); if (!registry.hasMappingForPattern("/webjars/**")) { - customizeResourceHandlerRegistration( - registry.addResourceHandler("/webjars/**") - .addResourceLocations( - "classpath:/META-INF/resources/webjars/") + customizeResourceHandlerRegistration(registry + .addResourceHandler("/webjars/**") + .addResourceLocations("classpath:/META-INF/resources/webjars/") .setCachePeriod(getSeconds(cachePeriod)) .setCacheControl(cacheControl)); } @@ -334,8 +333,8 @@ public class WebMvcAutoConfiguration { registry.addResourceHandler(staticPathPattern) .addResourceLocations(getResourceLocations( this.resourceProperties.getStaticLocations())) - .setCachePeriod(getSeconds(cachePeriod)) - .setCacheControl(cacheControl)); + .setCachePeriod(getSeconds(cachePeriod)) + .setCacheControl(cacheControl)); } } 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 5cad6d56562..a6ed0d384bc 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 @@ -765,9 +765,9 @@ public class CacheAutoConfigurationTests { "spring.cache.cacheNames[0]=foo", "spring.cache.cacheNames[1]=bar") .run((context) -> - // see customizer - assertThat(getCacheManager(context, JCacheCacheManager.class) - .getCacheNames()).containsOnly("foo", "custom1")); + // see customizer + assertThat(getCacheManager(context, JCacheCacheManager.class).getCacheNames()) + .containsOnly("foo", "custom1")); } finally { Caching.getCachingProvider(cachingProviderClassName).close(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java index 55bd5d6465a..709961f8cf6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfigurationTests.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. @@ -66,8 +66,8 @@ public class ElasticsearchAutoConfigurationTests { public void createTransportClient() { this.context = new AnnotationConfigApplicationContext(); new ElasticsearchNodeTemplate().doWithNode((node) -> { - TestPropertyValues - .of("spring.data.elasticsearch.cluster-nodes:localhost:" + TestPropertyValues.of( + "spring.data.elasticsearch.cluster-nodes:localhost:" + node.getTcpPort(), "spring.data.elasticsearch.properties.path.home:target/es/client") .applyTo(this.context); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java index 16a9f6be789..6ceb8e3e52a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.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. @@ -194,15 +194,17 @@ public class NoSuchBeanDefinitionFailureAnalyzerTests { } private void assertActionMissingType(FailureAnalysis analysis, Class type) { - assertThat(analysis.getAction()).startsWith(String - .format("Consider revisiting the conditions above or defining a bean of type '%s' " - + "in your configuration.", type.getName())); + assertThat(analysis.getAction()).startsWith(String.format( + "Consider revisiting the conditions above or defining a bean of type '%s' " + + "in your configuration.", + type.getName())); } private void assertActionMissingName(FailureAnalysis analysis, String name) { - assertThat(analysis.getAction()).startsWith(String - .format("Consider revisiting the conditions above or defining a bean named '%s' " - + "in your configuration.", name)); + assertThat(analysis.getAction()).startsWith(String.format( + "Consider revisiting the conditions above or defining a bean named '%s' " + + "in your configuration.", + name)); } private void assertBeanMethodDisabled(FailureAnalysis analysis, String description, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationReactiveIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationReactiveIntegrationTests.java index 0a73abda88a..e2572a37bd6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationReactiveIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationReactiveIntegrationTests.java @@ -89,9 +89,8 @@ public class FreeMarkerAutoConfigurationReactiveIntegrationTests { @Test public void customTemplateLoaderPath() { - this.contextRunner - .withPropertyValues( - "spring.freemarker.templateLoaderPath:classpath:/custom-templates/") + this.contextRunner.withPropertyValues( + "spring.freemarker.templateLoaderPath:classpath:/custom-templates/") .run((context) -> { MockServerWebExchange exchange = render(context, "custom"); String result = exchange.getResponse().getBodyAsString().block(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationTests.java index 2f4f243e194..e393ef8d6b4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationTests.java @@ -78,9 +78,8 @@ public class FreeMarkerAutoConfigurationTests { @Test public void nonExistentLocationAndEmptyLocation() { new File("target/test-classes/templates/empty-directory").mkdir(); - this.contextRunner - .withPropertyValues("spring.freemarker.templateLoaderPath:" - + "classpath:/does-not-exist/,classpath:/templates/empty-directory/") + this.contextRunner.withPropertyValues("spring.freemarker.templateLoaderPath:" + + "classpath:/does-not-exist/,classpath:/templates/empty-directory/") .run((context) -> { }); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfigurationTests.java index f23af95fb16..9905a360605 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfigurationTests.java @@ -51,9 +51,8 @@ public class ProjectInfoAutoConfigurationTests { @Test public void gitPropertiesWithNoData() { - this.contextRunner - .withPropertyValues("spring.info.git.location=" - + "classpath:/org/springframework/boot/autoconfigure/info/git-no-data.properties") + this.contextRunner.withPropertyValues("spring.info.git.location=" + + "classpath:/org/springframework/boot/autoconfigure/info/git-no-data.properties") .run((context) -> { GitProperties gitProperties = context.getBean(GitProperties.class); assertThat(gitProperties.getBranch()).isNull(); @@ -87,9 +86,8 @@ public class ProjectInfoAutoConfigurationTests { @Test public void buildPropertiesCustomLocation() { - this.contextRunner - .withPropertyValues("spring.info.build.location=" - + "classpath:/org/springframework/boot/autoconfigure/info/build-info.properties") + this.contextRunner.withPropertyValues("spring.info.build.location=" + + "classpath:/org/springframework/boot/autoconfigure/info/build-info.properties") .run((context) -> { BuildProperties buildProperties = context .getBean(BuildProperties.class); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java index bc51aab84ba..9e7e9754a0e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java @@ -139,9 +139,8 @@ public class JacksonAutoConfigurationTests { @Test public void customDateFormatClass() { - this.contextRunner - .withPropertyValues( - "spring.jackson.date-format:org.springframework.boot.autoconfigure.jackson.JacksonAutoConfigurationTests.MyDateFormat") + this.contextRunner.withPropertyValues( + "spring.jackson.date-format:org.springframework.boot.autoconfigure.jackson.JacksonAutoConfigurationTests.MyDateFormat") .run((context) -> { ObjectMapper mapper = context.getBean(ObjectMapper.class); assertThat(mapper.getDateFormat()).isInstanceOf(MyDateFormat.class); @@ -169,9 +168,8 @@ public class JacksonAutoConfigurationTests { @Test public void customPropertyNamingStrategyClass() { - this.contextRunner - .withPropertyValues( - "spring.jackson.property-naming-strategy:com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy") + this.contextRunner.withPropertyValues( + "spring.jackson.property-naming-strategy:com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy") .run((context) -> { ObjectMapper mapper = context.getBean(ObjectMapper.class); assertThat(mapper.getPropertyNamingStrategy()) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java index 4fcc2fc8b2b..c65f6a2bbff 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.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. @@ -130,21 +130,20 @@ public class JmsAutoConfigurationTests { @Test public void testEnableJmsCreateDefaultContainerFactory() { this.contextRunner.withUserConfiguration(EnableJmsConfiguration.class) - .run((context) -> assertThat(context) - .getBean("jmsListenerContainerFactory", - JmsListenerContainerFactory.class) + .run((context) -> assertThat(context).getBean( + "jmsListenerContainerFactory", JmsListenerContainerFactory.class) .isExactlyInstanceOf(DefaultJmsListenerContainerFactory.class)); } @Test public void testJmsListenerContainerFactoryBackOff() { - this.contextRunner - .withUserConfiguration(TestConfiguration6.class, - EnableJmsConfiguration.class) - .run((context) -> assertThat(context) - .getBean("jmsListenerContainerFactory", - JmsListenerContainerFactory.class) - .isExactlyInstanceOf(SimpleJmsListenerContainerFactory.class)); + this.contextRunner.withUserConfiguration(TestConfiguration6.class, + EnableJmsConfiguration.class).run( + (context) -> assertThat(context) + .getBean("jmsListenerContainerFactory", + JmsListenerContainerFactory.class) + .isExactlyInstanceOf( + SimpleJmsListenerContainerFactory.class)); } @Test @@ -414,9 +413,8 @@ public class JmsAutoConfigurationTests { @Test public void enableJmsAutomatically() { this.contextRunner.withUserConfiguration(NoEnableJmsConfiguration.class) - .run((context) -> assertThat(context) - .hasBean( - JmsListenerConfigUtils.JMS_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME) + .run((context) -> assertThat(context).hasBean( + JmsListenerConfigUtils.JMS_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME) .hasBean( JmsListenerConfigUtils.JMS_LISTENER_ENDPOINT_REGISTRY_BEAN_NAME)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java index 5936f9c10c9..748a65052f4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.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. @@ -214,9 +214,8 @@ public class ArtemisAutoConfigurationTests { @Test public void embeddedServiceWithCustomArtemisConfiguration() { this.contextRunner.withUserConfiguration(CustomArtemisConfiguration.class) - .run((context) -> assertThat(context - .getBean( - org.apache.activemq.artemis.core.config.Configuration.class) + .run((context) -> assertThat(context.getBean( + org.apache.activemq.artemis.core.config.Configuration.class) .getName()).isEqualTo("customFooBar")); } @@ -250,19 +249,22 @@ public class ArtemisAutoConfigurationTests { this.contextRunner .withPropertyValues("spring.artemis.embedded.queues=Queue2") .run((second) -> { - ArtemisProperties firstProperties = first - .getBean(ArtemisProperties.class); - ArtemisProperties secondProperties = second - .getBean(ArtemisProperties.class); - assertThat(firstProperties.getEmbedded().getServerId()) - .isLessThan(secondProperties.getEmbedded().getServerId()); - DestinationChecker firstChecker = new DestinationChecker(first); - firstChecker.checkQueue("Queue1", true); - firstChecker.checkQueue("Queue2", true); - DestinationChecker secondChecker = new DestinationChecker(second); - secondChecker.checkQueue("Queue2", true); - secondChecker.checkQueue("Queue1", true); - }); + ArtemisProperties firstProperties = first + .getBean(ArtemisProperties.class); + ArtemisProperties secondProperties = second + .getBean(ArtemisProperties.class); + assertThat(firstProperties.getEmbedded().getServerId()) + .isLessThan(secondProperties.getEmbedded() + .getServerId()); + DestinationChecker firstChecker = new DestinationChecker( + first); + firstChecker.checkQueue("Queue1", true); + firstChecker.checkQueue("Queue2", true); + DestinationChecker secondChecker = new DestinationChecker( + second); + secondChecker.checkQueue("Queue2", true); + secondChecker.checkQueue("Queue1", true); + }); }); } @@ -279,12 +281,13 @@ public class ArtemisAutoConfigurationTests { // Do not start a specific one "spring.artemis.embedded.enabled=false") .run((secondContext) -> { - DestinationChecker firstChecker = new DestinationChecker(first); - firstChecker.checkQueue("Queue1", true); - DestinationChecker secondChecker = new DestinationChecker( - secondContext); - secondChecker.checkQueue("Queue1", true); - }); + DestinationChecker firstChecker = new DestinationChecker( + first); + firstChecker.checkQueue("Queue1", true); + DestinationChecker secondChecker = new DestinationChecker( + secondContext); + secondChecker.checkQueue("Queue1", true); + }); }); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java index 1cbd52e07e2..b73414c6ab6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java @@ -77,12 +77,11 @@ public class LdapAutoConfigurationTests { @Test public void contextSourceWithExtraCustomization() { - this.contextRunner - .withPropertyValues("spring.ldap.urls:ldap://localhost:123", - "spring.ldap.username:root", "spring.ldap.password:secret", - "spring.ldap.anonymous-read-only:true", - "spring.ldap.base:cn=SpringDevelopers", - "spring.ldap.baseEnvironment.java.naming.security.authentication:DIGEST-MD5") + this.contextRunner.withPropertyValues("spring.ldap.urls:ldap://localhost:123", + "spring.ldap.username:root", "spring.ldap.password:secret", + "spring.ldap.anonymous-read-only:true", + "spring.ldap.base:cn=SpringDevelopers", + "spring.ldap.baseEnvironment.java.naming.security.authentication:DIGEST-MD5") .run((context) -> { LdapContextSource contextSource = context .getBean(LdapContextSource.class); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java index 68758db56d8..1f32072df90 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoReactiveAutoConfigurationTests.java @@ -102,9 +102,8 @@ public class MongoReactiveAutoConfigurationTests { @Test public void customizerOverridesAutoConfig() { - this.contextRunner - .withPropertyValues( - "spring.data.mongodb.uri:mongodb://localhost/test?appname=auto-config") + this.contextRunner.withPropertyValues( + "spring.data.mongodb.uri:mongodb://localhost/test?appname=auto-config") .withUserConfiguration(SimpleCustomizerConfig.class).run((context) -> { assertThat(context).hasSingleBean(MongoClient.class); MongoClient client = context.getBean(MongoClient.class); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java index 133ee66d473..f2cb44a63f7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/CustomHibernateJpaAutoConfigurationTests.java @@ -63,10 +63,9 @@ public class CustomHibernateJpaAutoConfigurationTests { @Test public void namingStrategyDelegatorTakesPrecedence() { - this.contextRunner - .withPropertyValues( - "spring.jpa.properties.hibernate.ejb.naming_strategy_delegator:" - + "org.hibernate.cfg.naming.ImprovedNamingStrategyDelegator") + this.contextRunner.withPropertyValues( + "spring.jpa.properties.hibernate.ejb.naming_strategy_delegator:" + + "org.hibernate.cfg.naming.ImprovedNamingStrategyDelegator") .run((context) -> { JpaProperties bean = context.getBean(JpaProperties.class); Map hibernateProperties = bean.getHibernateProperties( diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java index 33f22a3215e..0d35a46e5a6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java @@ -131,10 +131,9 @@ public class HibernateJpaAutoConfigurationTests @Test public void testLiquibasePlusValidation() { - contextRunner() - .withPropertyValues("spring.datasource.initialization-mode:never", - "spring.liquibase.changeLog:classpath:db/changelog/db.changelog-city.yaml", - "spring.jpa.hibernate.ddl-auto:validate") + contextRunner().withPropertyValues("spring.datasource.initialization-mode:never", + "spring.liquibase.changeLog:classpath:db/changelog/db.changelog-city.yaml", + "spring.jpa.hibernate.ddl-auto:validate") .withConfiguration( AutoConfigurations.of(LiquibaseAutoConfiguration.class)) .run((context) -> assertThat(context).hasNotFailed()); @@ -224,11 +223,10 @@ public class HibernateJpaAutoConfigurationTests @Test public void providerDisablesAutoCommitIsNotConfiguredIfPropertyIsSet() { - contextRunner() - .withPropertyValues( - "spring.datasource.type:" + HikariDataSource.class.getName(), - "spring.datasource.hikari.auto-commit:false", - "spring.jpa.properties.hibernate.connection.provider_disables_autocommit=false") + contextRunner().withPropertyValues( + "spring.datasource.type:" + HikariDataSource.class.getName(), + "spring.datasource.hikari.auto-commit:false", + "spring.jpa.properties.hibernate.connection.provider_disables_autocommit=false") .run((context) -> { Map jpaProperties = context .getBean(LocalContainerEntityManagerFactoryBean.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/JpaPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/JpaPropertiesTests.java index a823ac03dca..a862a23f56b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/JpaPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/JpaPropertiesTests.java @@ -74,10 +74,9 @@ public class JpaPropertiesTests { @Test public void hibernate5CustomNamingStrategies() { - this.contextRunner - .withPropertyValues( - "spring.jpa.hibernate.naming.implicit-strategy:com.example.Implicit", - "spring.jpa.hibernate.naming.physical-strategy:com.example.Physical") + this.contextRunner.withPropertyValues( + "spring.jpa.hibernate.naming.implicit-strategy:com.example.Implicit", + "spring.jpa.hibernate.naming.physical-strategy:com.example.Physical") .run(assertJpaProperties((properties) -> { Map hibernateProperties = properties .getHibernateProperties( @@ -111,10 +110,9 @@ public class JpaPropertiesTests { @Test public void namingStrategyInstancesTakePrecedenceOverNamingStrategyProperties() { - this.contextRunner - .withPropertyValues( - "spring.jpa.hibernate.naming.implicit-strategy:com.example.Implicit", - "spring.jpa.hibernate.naming.physical-strategy:com.example.Physical") + this.contextRunner.withPropertyValues( + "spring.jpa.hibernate.naming.implicit-strategy:com.example.Implicit", + "spring.jpa.hibernate.naming.physical-strategy:com.example.Physical") .run(assertJpaProperties((properties) -> { ImplicitNamingStrategy implicitStrategy = mock( ImplicitNamingStrategy.class); @@ -136,10 +134,9 @@ public class JpaPropertiesTests { @Test public void hibernatePropertiesCustomizerTakePrecedenceOverStrategyInstancesAndNamingStrategyProperties() { - this.contextRunner - .withPropertyValues( - "spring.jpa.hibernate.naming.implicit-strategy:com.example.Implicit", - "spring.jpa.hibernate.naming.physical-strategy:com.example.Physical") + this.contextRunner.withPropertyValues( + "spring.jpa.hibernate.naming.implicit-strategy:com.example.Implicit", + "spring.jpa.hibernate.naming.physical-strategy:com.example.Physical") .run(assertJpaProperties((properties) -> { ImplicitNamingStrategy implicitStrategy = mock( ImplicitNamingStrategy.class); @@ -174,10 +171,9 @@ public class JpaPropertiesTests { @Test public void hibernate5CustomNamingStrategiesViaJpaProperties() { - this.contextRunner - .withPropertyValues( - "spring.jpa.properties.hibernate.implicit_naming_strategy:com.example.Implicit", - "spring.jpa.properties.hibernate.physical_naming_strategy:com.example.Physical") + this.contextRunner.withPropertyValues( + "spring.jpa.properties.hibernate.implicit_naming_strategy:com.example.Implicit", + "spring.jpa.properties.hibernate.physical_naming_strategy:com.example.Physical") .run(assertJpaProperties((properties) -> { Map hibernateProperties = properties .getHibernateProperties( diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2WebSecurityConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2WebSecurityConfigurationTests.java index 1d28ee21a9f..efba0c68e0a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2WebSecurityConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2WebSecurityConfigurationTests.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. @@ -187,9 +187,8 @@ public class OAuth2WebSecurityConfigurationTests { private ClientRegistration getClientRegistration(String id, String userInfoUri) { ClientRegistration.Builder builder = ClientRegistration .withRegistrationId(id); - builder.clientName("foo").clientId("foo") - .clientAuthenticationMethod( - org.springframework.security.oauth2.core.ClientAuthenticationMethod.BASIC) + builder.clientName("foo").clientId("foo").clientAuthenticationMethod( + org.springframework.security.oauth2.core.ClientAuthenticationMethod.BASIC) .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE) .scope("read").clientSecret("secret") .redirectUriTemplate("http://redirect-uri.com") diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfigurationTests.java index 41d713afff2..3c5288e6454 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfigurationTests.java @@ -46,8 +46,8 @@ import static org.mockito.Mockito.mock; public class ReactiveUserDetailsServiceAutoConfigurationTests { private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner() - .withConfiguration( - AutoConfigurations.of(ReactiveUserDetailsServiceAutoConfiguration.class)); + .withConfiguration(AutoConfigurations + .of(ReactiveUserDetailsServiceAutoConfiguration.class)); @Test public void configuresADefaultUser() { @@ -62,7 +62,8 @@ public class ReactiveUserDetailsServiceAutoConfigurationTests { @Test public void doesNotConfigureDefaultUserIfUserDetailsServiceAvailable() { - this.contextRunner.withUserConfiguration(UserConfig.class, TestSecurityConfiguration.class) + this.contextRunner + .withUserConfiguration(UserConfig.class, TestSecurityConfiguration.class) .run((context) -> { ReactiveUserDetailsService userDetailsService = context .getBean(ReactiveUserDetailsService.class); @@ -88,8 +89,7 @@ public class ReactiveUserDetailsServiceAutoConfigurationTests { @Test public void userDetailsServiceWhenPasswordEncoderAbsentAndDefaultPassword() { - this.contextRunner - .withUserConfiguration(TestSecurityConfiguration.class) + this.contextRunner.withUserConfiguration(TestSecurityConfiguration.class) .run(((context) -> { MapReactiveUserDetailsService userDetailsService = context .getBean(MapReactiveUserDetailsService.class); @@ -117,8 +117,7 @@ public class ReactiveUserDetailsServiceAutoConfigurationTests { private void testPasswordEncoding(Class configClass, String providedPassword, String expectedPassword) { - this.contextRunner - .withUserConfiguration(configClass) + this.contextRunner.withUserConfiguration(configClass) .withPropertyValues("spring.security.user.password=" + providedPassword) .run(((context) -> { MapReactiveUserDetailsService userDetailsService = context 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 7de4fb88e8a..e6702f906fd 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 @@ -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. @@ -38,8 +38,11 @@ public class WebFluxSecurityConfigurationTests { @Test public void backsOffWhenWebFilterChainProxyBeanPresent() { - this.contextRunner.withUserConfiguration(WebFilterChainProxyConfiguration.class, WebFluxSecurityConfiguration.class) - .run(context -> assertThat(context).doesNotHaveBean(WebFluxSecurityConfiguration.class)); + this.contextRunner + .withUserConfiguration(WebFilterChainProxyConfiguration.class, + WebFluxSecurityConfiguration.class) + .run(context -> assertThat(context) + .doesNotHaveBean(WebFluxSecurityConfiguration.class)); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityAutoConfigurationTests.java index 820270dee8c..500b55acb42 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityAutoConfigurationTests.java @@ -78,14 +78,15 @@ public class SecurityAutoConfigurationTests { @Test public void testDefaultFilterOrderWithSecurityAdapter() { - this.contextRunner.withConfiguration(AutoConfigurations.of(WebSecurity.class, - SecurityFilterAutoConfiguration.class)).run( - (context) -> assertThat(context - .getBean("securityFilterChainRegistration", - DelegatingFilterProxyRegistrationBean.class) - .getOrder()).isEqualTo( - FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER - - 100)); + this.contextRunner + .withConfiguration(AutoConfigurations.of(WebSecurity.class, + SecurityFilterAutoConfiguration.class)) + .run((context) -> assertThat(context + .getBean("securityFilterChainRegistration", + DelegatingFilterProxyRegistrationBean.class) + .getOrder()).isEqualTo( + FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER + - 100)); } @Test @@ -118,14 +119,15 @@ public class SecurityAutoConfigurationTests { @Test public void testDefaultFilterOrder() { - this.contextRunner.withConfiguration( - AutoConfigurations.of(SecurityFilterAutoConfiguration.class)).run( - (context) -> assertThat(context - .getBean("securityFilterChainRegistration", - DelegatingFilterProxyRegistrationBean.class) - .getOrder()).isEqualTo( - FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER - - 100)); + this.contextRunner + .withConfiguration( + AutoConfigurations.of(SecurityFilterAutoConfiguration.class)) + .run((context) -> assertThat(context + .getBean("securityFilterChainRegistration", + DelegatingFilterProxyRegistrationBean.class) + .getOrder()).isEqualTo( + FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER + - 100)); } @Test @@ -137,7 +139,7 @@ public class SecurityAutoConfigurationTests { (context) -> assertThat(context .getBean("securityFilterChainRegistration", DelegatingFilterProxyRegistrationBean.class) - .getOrder()).isEqualTo(12345)); + .getOrder()).isEqualTo(12345)); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/UserDetailsServiceAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/UserDetailsServiceAutoConfigurationTests.java index 7e3fc32123d..ba4d7c16b9c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/UserDetailsServiceAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/UserDetailsServiceAutoConfigurationTests.java @@ -52,8 +52,8 @@ import static org.mockito.Mockito.mock; public class UserDetailsServiceAutoConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() - .withUserConfiguration(TestSecurityConfiguration.class) - .withConfiguration(AutoConfigurations.of(UserDetailsServiceAutoConfiguration.class)); + .withUserConfiguration(TestSecurityConfiguration.class).withConfiguration( + AutoConfigurations.of(UserDetailsServiceAutoConfiguration.class)); @Rule public OutputCapture outputCapture = new OutputCapture(); @@ -115,7 +115,8 @@ public class UserDetailsServiceAutoConfigurationTests { @Test public void userDetailsServiceWhenPasswordEncoderAbsentAndDefaultPassword() { - this.contextRunner.withUserConfiguration(TestSecurityConfiguration.class).run(((context) -> { + this.contextRunner.withUserConfiguration(TestSecurityConfiguration.class) + .run(((context) -> { InMemoryUserDetailsManager userDetailsService = context .getBean(InMemoryUserDetailsManager.class); String password = userDetailsService.loadUserByUsername("user") @@ -150,8 +151,7 @@ public class UserDetailsServiceAutoConfigurationTests { private void testPasswordEncoding(Class configClass, String providedPassword, String expectedPassword) { - this.contextRunner - .withUserConfiguration(configClass) + this.contextRunner.withUserConfiguration(configClass) .withPropertyValues("spring.security.user.password=" + providedPassword) .run(((context) -> { InMemoryUserDetailsManager userDetailsService = context diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java index a259b0bbf85..fa85bff1486 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.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. @@ -117,10 +117,9 @@ public class SessionAutoConfigurationJdbcTests @Test public void customTableName() { - this.contextRunner - .withPropertyValues("spring.session.store-type=jdbc", - "spring.session.jdbc.table-name=FOO_BAR", - "spring.session.jdbc.schema=classpath:session/custom-schema-h2.sql") + this.contextRunner.withPropertyValues("spring.session.store-type=jdbc", + "spring.session.jdbc.table-name=FOO_BAR", + "spring.session.jdbc.schema=classpath:session/custom-schema-h2.sql") .run((context) -> { JdbcOperationsSessionRepository repository = validateSessionRepository( context, JdbcOperationsSessionRepository.class); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java index c35e95add40..978193ef40a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.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. @@ -202,11 +202,9 @@ public class MultipartAutoConfigurationTests { private void verify404() throws Exception { HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); - ClientHttpRequest request = requestFactory - .createRequest( - new URI("http://localhost:" - + this.context.getWebServer().getPort() + "/"), - HttpMethod.GET); + ClientHttpRequest request = requestFactory.createRequest(new URI( + "http://localhost:" + this.context.getWebServer().getPort() + "/"), + HttpMethod.GET); ClientHttpResponse response = request.execute(); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND); } 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 d9bfb0c3f26..2ccb35640be 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 @@ -880,7 +880,7 @@ public class WebMvcAutoConfigurationTests { @Override protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) - throws Exception { + throws Exception { response.getOutputStream().write("Hello World".getBytes()); } 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 31090a618e0..8d2f7442c11 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 @@ -205,7 +205,7 @@ public class WelcomePageHandlerMappingTests { @Override protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) - throws Exception { + throws Exception { response.getWriter().print(name + " template"); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerIntegrationTests.java index 87559add999..5a06f85e7e2 100755 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerIntegrationTests.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. @@ -259,7 +259,7 @@ public class BasicErrorControllerIntegrationTests { @Override protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) - throws Exception { + throws Exception { response.getWriter().write("ERROR_BEAN"); } }; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java index 881dc9cf32e..1bc0dfc500b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.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. @@ -153,7 +153,7 @@ public class BasicErrorControllerMockMvcTests { @Override protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) - throws Exception { + throws Exception { response.getWriter().write("ERROR_BEAN"); } }; diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java index 5cd08e09c65..78058c4fd16 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.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. @@ -183,7 +183,7 @@ abstract class ArchiveCommand extends OptionParsingCommand { private void writeJar(File file, Class[] compiledClasses, List classpathEntries, List dependencies) - throws FileNotFoundException, IOException, URISyntaxException { + throws FileNotFoundException, IOException, URISyntaxException { final List libraries; try (JarWriter writer = new JarWriter(file)) { addManifest(writer, compiledClasses); diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/CompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/CompilerAutoConfiguration.java index 959349f634e..e8425b2a036 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/CompilerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/CompilerAutoConfiguration.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. @@ -89,7 +89,7 @@ public abstract class CompilerAutoConfiguration { */ public void apply(GroovyClassLoader loader, GroovyCompilerConfiguration configuration, GeneratorContext generatorContext, SourceUnit source, ClassNode classNode) - throws CompilationFailedException { + throws CompilationFailedException { } } diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSecurityCompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSecurityCompilerAutoConfiguration.java index afe63df6b65..9d8fde7c398 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSecurityCompilerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringSecurityCompilerAutoConfiguration.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. @@ -38,9 +38,8 @@ public class SpringSecurityCompilerAutoConfiguration extends CompilerAutoConfigu @Override public void applyDependencies(DependencyCustomizer dependencies) { - dependencies - .ifAnyMissingClasses( - "org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity") + dependencies.ifAnyMissingClasses( + "org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity") .add("spring-boot-starter-security"); } diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringTestCompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringTestCompilerAutoConfiguration.java index c8c0ecbfa74..8903bed5eca 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringTestCompilerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringTestCompilerAutoConfiguration.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. @@ -53,7 +53,7 @@ public class SpringTestCompilerAutoConfiguration extends CompilerAutoConfigurati @Override public void apply(GroovyClassLoader loader, GroovyCompilerConfiguration configuration, GeneratorContext generatorContext, SourceUnit source, ClassNode classNode) - throws CompilationFailedException { + throws CompilationFailedException { if (!AstUtils.hasAtLeastOneAnnotation(classNode, "RunWith")) { AnnotationNode runWith = new AnnotationNode(ClassHelper.make("RunWith")); runWith.addMember("value", diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringWebsocketCompilerAutoConfiguration.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringWebsocketCompilerAutoConfiguration.java index 584e81c3190..92103efe6d3 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringWebsocketCompilerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringWebsocketCompilerAutoConfiguration.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. @@ -38,9 +38,8 @@ public class SpringWebsocketCompilerAutoConfiguration extends CompilerAutoConfig @Override public void applyDependencies(DependencyCustomizer dependencies) { - dependencies - .ifAnyMissingClasses( - "org.springframework.web.socket.config.annotation.EnableWebSocket") + dependencies.ifAnyMissingClasses( + "org.springframework.web.socket.config.annotation.EnableWebSocket") .add("spring-boot-starter-websocket").add("spring-messaging"); } diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngine.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngine.java index 181a97d3033..e92dec0a78e 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngine.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngine.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. @@ -93,9 +93,8 @@ public class AetherGrapeEngine implements GrapeEngine { private ProgressReporter getProgressReporter(DefaultRepositorySystemSession session, boolean quiet) { - String progressReporter = (quiet ? "none" - : System.getProperty( - "org.springframework.boot.cli.compiler.grape.ProgressReporter")); + String progressReporter = (quiet ? "none" : System.getProperty( + "org.springframework.boot.cli.compiler.grape.ProgressReporter")); if ("detail".equals(progressReporter) || Boolean.getBoolean("groovy.grape.report.downloads")) { return new DetailedProgressReporter(session, System.out); diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/DependencyResolutionContext.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/DependencyResolutionContext.java index 69baed55951..ff0570b442e 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/DependencyResolutionContext.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/DependencyResolutionContext.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. @@ -105,9 +105,8 @@ public class DependencyResolutionContext { aetherDependency); } this.dependencyManagement = this.dependencyManagement == null - ? dependencyManagement - : new CompositeDependencyManagement(dependencyManagement, - this.dependencyManagement); + ? dependencyManagement : new CompositeDependencyManagement( + dependencyManagement, this.dependencyManagement); this.artifactCoordinatesResolver = new DependencyManagementArtifactCoordinatesResolver( this.dependencyManagement); } diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java index d3e9ff25a0e..cca372998ec 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.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. @@ -47,8 +47,8 @@ public abstract class GroovyTemplate { } public static String template(TemplateEngine engine, String name, - Map model) throws IOException, CompilationFailedException, - ClassNotFoundException { + Map model) + throws IOException, CompilationFailedException, ClassNotFoundException { Writable writable = getTemplate(engine, name).make(model); StringWriter result = new StringWriter(); writable.writeTo(result); diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/RepositoryConfigurationFactoryTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/RepositoryConfigurationFactoryTests.java index 974bd6683ce..0e90115cc27 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/RepositoryConfigurationFactoryTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/RepositoryConfigurationFactoryTests.java @@ -60,8 +60,8 @@ public class RepositoryConfigurationFactoryTests { @Test public void activeByDefaultProfileRepositories() { - TestPropertyValues - .of("user.home:src/test/resources/maven-settings/active-profile-repositories") + TestPropertyValues.of( + "user.home:src/test/resources/maven-settings/active-profile-repositories") .applyToSystemProperties(() -> { List repositoryConfiguration = RepositoryConfigurationFactory .createDefaultRepositoryConfiguration(); @@ -74,10 +74,9 @@ public class RepositoryConfigurationFactoryTests { @Test public void activeByPropertyProfileRepositories() { - TestPropertyValues - .of("user.home:src/test/resources/maven-settings/active-profile-repositories", - "foo:bar") - .applyToSystemProperties(() -> { + TestPropertyValues.of( + "user.home:src/test/resources/maven-settings/active-profile-repositories", + "foo:bar").applyToSystemProperties(() -> { List repositoryConfiguration = RepositoryConfigurationFactory .createDefaultRepositoryConfiguration(); assertRepositoryConfiguration(repositoryConfiguration, "central", @@ -89,10 +88,9 @@ public class RepositoryConfigurationFactoryTests { @Test public void interpolationProfileRepositories() { - TestPropertyValues - .of("user.home:src/test/resources/maven-settings/active-profile-repositories", - "interpolate:true") - .applyToSystemProperties(() -> { + TestPropertyValues.of( + "user.home:src/test/resources/maven-settings/active-profile-repositories", + "interpolate:true").applyToSystemProperties(() -> { List repositoryConfiguration = RepositoryConfigurationFactory .createDefaultRepositoryConfiguration(); assertRepositoryConfiguration(repositoryConfiguration, "central", diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java index 5e3e98a89fb..4f6f1f915c3 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java @@ -165,8 +165,7 @@ public class LocalDevToolsAutoConfiguration { private final OptionalLiveReloadServer liveReloadServer; - LiveReloadServerEventListener( - OptionalLiveReloadServer liveReloadServer) { + LiveReloadServerEventListener(OptionalLiveReloadServer liveReloadServer) { this.liveReloadServer = liveReloadServer; } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/web/client/RestTemplateProxyCustomizationExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/web/client/RestTemplateProxyCustomizationExample.java index b548eb2e722..b51aeb3b01f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/web/client/RestTemplateProxyCustomizationExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/web/client/RestTemplateProxyCustomizationExample.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. @@ -50,7 +50,7 @@ public class RestTemplateProxyCustomizationExample { @Override public HttpHost determineProxy(HttpHost target, HttpRequest request, HttpContext context) - throws HttpException { + throws HttpException { if (target.getHostName().equals("192.168.0.5")) { return null; } diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/autoconfigure/UserServiceAutoConfigurationTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/autoconfigure/UserServiceAutoConfigurationTests.java index 8fe267d8751..20507cb2502 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/autoconfigure/UserServiceAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/autoconfigure/UserServiceAutoConfigurationTests.java @@ -35,7 +35,7 @@ public class UserServiceAutoConfigurationTests { // tag::runner[] private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(UserServiceAutoConfiguration.class)); - // end::runner[] + // end::runner[] // tag::test-env[] @Test diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java index 4b9db4c7328..3207ad95fdb 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/AnnotationCustomizableTypeExcludeFilter.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. @@ -93,7 +93,7 @@ public abstract class AnnotationCustomizableTypeExcludeFilter extends TypeExclud @SuppressWarnings("unchecked") protected final boolean isTypeOrAnnotated(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory, Class type) - throws IOException { + throws IOException { AnnotationTypeFilter annotationFilter = new AnnotationTypeFilter( (Class) type); AssignableTypeFilter typeFilter = new AssignableTypeFilter(type); diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsRestAssuredBuilderCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsRestAssuredBuilderCustomizer.java index 1e996279bc4..dddbe68892e 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsRestAssuredBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsRestAssuredBuilderCustomizer.java @@ -43,9 +43,8 @@ class RestDocsRestAssuredBuilderCustomizer implements InitializingBean { public void afterPropertiesSet() throws Exception { PropertyMapper map = PropertyMapper.get(); String host = this.properties.getUriHost(); - map.from(this.properties::getUriScheme) - .when((scheme) -> StringUtils.hasText(scheme) - && StringUtils.hasText(host)) + map.from(this.properties::getUriScheme).when( + (scheme) -> StringUtils.hasText(scheme) && StringUtils.hasText(host)) .to((scheme) -> this.delegate.baseUri(scheme + "://" + host)); map.from(this.properties::getUriPort).whenNonNull().to(this.delegate::port); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcSecurityAutoConfiguration.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcSecurityAutoConfiguration.java index 2997b40edda..87b007be4dd 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcSecurityAutoConfiguration.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcSecurityAutoConfiguration.java @@ -30,7 +30,8 @@ import org.springframework.context.annotation.Import; */ @Configuration @ConditionalOnProperty(prefix = "spring.test.mockmvc", name = "secure", havingValue = "true", matchIfMissing = true) -@Import({ SecurityAutoConfiguration.class, UserDetailsServiceAutoConfiguration.class, MockMvcSecurityConfiguration.class }) +@Import({ SecurityAutoConfiguration.class, UserDetailsServiceAutoConfiguration.class, + MockMvcSecurityConfiguration.class }) public class MockMvcSecurityAutoConfiguration { } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfigurationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfigurationTests.java index 1ab50dcb73e..dc991ac900f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfigurationTests.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. @@ -58,13 +58,13 @@ public class TestDatabaseAutoConfigurationTests { this.contextRunner .withUserConfiguration(ExistingDataSourceConfiguration.class) .run((secondContext) -> { - DataSource anotherDatasource = secondContext - .getBean(DataSource.class); - JdbcTemplate anotherJdbcTemplate = new JdbcTemplate( - anotherDatasource); - anotherJdbcTemplate - .execute("create table example (id int, name varchar);"); - }); + DataSource anotherDatasource = secondContext + .getBean(DataSource.class); + JdbcTemplate anotherJdbcTemplate = new JdbcTemplate( + anotherDatasource); + anotherJdbcTemplate.execute( + "create table example (id int, name varchar);"); + }); }); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/app/ExampleJsonComponent.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/app/ExampleJsonComponent.java index a3e28a1bd52..f4ae8f60637 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/app/ExampleJsonComponent.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/app/ExampleJsonComponent.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. @@ -53,7 +53,7 @@ public class ExampleJsonComponent { @Override protected ExampleCustomObject deserializeObject(JsonParser jsonParser, DeserializationContext context, ObjectCodec codec, JsonNode tree) - throws IOException { + throws IOException { return new ExampleCustomObject( nullSafeValue(tree.get("value"), String.class)); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java index 73d77449785..b683c7d8ca6 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java @@ -363,7 +363,7 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda @Override public PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, final Object bean, String beanName) - throws BeansException { + throws BeansException { ReflectionUtils.doWithFields(bean.getClass(), (field) -> postProcessField(bean, field)); return pvs; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java index 2a5ebc994d3..89d9cbe6733 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java @@ -500,7 +500,7 @@ public class TestRestTemplate { */ public ResponseEntity postForEntity(String url, Object request, Class responseType, Map urlVariables) - throws RestClientException { + throws RestClientException { return this.restTemplate.postForEntity(url, request, responseType, urlVariables); } @@ -743,7 +743,7 @@ public class TestRestTemplate { */ public ResponseEntity exchange(String url, HttpMethod method, HttpEntity requestEntity, Class responseType, Object... urlVariables) - throws RestClientException { + throws RestClientException { return this.restTemplate.exchange(url, method, requestEntity, responseType, urlVariables); } @@ -788,7 +788,7 @@ public class TestRestTemplate { */ public ResponseEntity exchange(URI url, HttpMethod method, HttpEntity requestEntity, Class responseType) - throws RestClientException { + throws RestClientException { return this.restTemplate.exchange(applyRootUriIfNecessary(url), method, requestEntity, responseType); } @@ -871,7 +871,7 @@ public class TestRestTemplate { */ public ResponseEntity exchange(URI url, HttpMethod method, HttpEntity requestEntity, ParameterizedTypeReference responseType) - throws RestClientException { + throws RestClientException { return this.restTemplate.exchange(applyRootUriIfNecessary(url), method, requestEntity, responseType); } @@ -939,7 +939,7 @@ public class TestRestTemplate { */ public T execute(String url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor responseExtractor, Object... urlVariables) - throws RestClientException { + throws RestClientException { return this.restTemplate.execute(url, method, requestCallback, responseExtractor, urlVariables); } @@ -963,7 +963,7 @@ public class TestRestTemplate { */ public T execute(String url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor responseExtractor, Map urlVariables) - throws RestClientException { + throws RestClientException { return this.restTemplate.execute(url, method, requestCallback, responseExtractor, urlVariables); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java index cdcf036c162..b6ee562b884 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java @@ -52,8 +52,8 @@ import java.util.List; * Each stringer may be used to encode a single top level value. Instances of this class * are not thread safe. Although this class is nonfinal, it was not designed for * inheritance and should not be subclassed. In particular, self-use by overrideable - * methods is not specified. See Effective Java Item 17, - * "Design and Document or inheritance or else prohibit it" for further information. + * methods is not specified. See Effective Java Item 17, "Design and Document or + * inheritance or else prohibit it" for further information. */ public class JSONStringer { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java index 15c90e26270..f2b1a7d8181 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java @@ -54,8 +54,8 @@ package org.springframework.boot.configurationprocessor.json; * Each tokener may be used to parse a single JSON string. Instances of this class are not * thread safe. Although this class is nonfinal, it was not designed for inheritance and * should not be subclassed. In particular, self-use by overrideable methods is not - * specified. See Effective Java Item 17, - * "Design and Document or inheritance or else prohibit it" for further information. + * specified. See Effective Java Item 17, "Design and Document or inheritance or + * else prohibit it" for further information. */ public class JSONTokener { 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 a1622ebd8e8..d7fcc5781d0 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 @@ -349,10 +349,10 @@ public class ConfigurationMetadataAnnotationProcessorTests { .fromSource( org.springframework.boot.configurationsample.method.DeprecatedClassMethodConfig.Foo.class) .withDeprecation(null, null)); - assertThat(metadata).has( - Metadata.withProperty("foo.flag", Boolean.class).withDefaultValue(false) - .fromSource( - org.springframework.boot.configurationsample.method.DeprecatedClassMethodConfig.Foo.class) + assertThat(metadata).has(Metadata.withProperty("foo.flag", Boolean.class) + .withDefaultValue(false) + .fromSource( + org.springframework.boot.configurationsample.method.DeprecatedClassMethodConfig.Foo.class) .withDeprecation(null, null)); } @@ -419,18 +419,14 @@ public class ConfigurationMetadataAnnotationProcessorTests { ConfigurationMetadata metadata = compile(ClassWithNestedProperties.class); assertThat(metadata).has(Metadata.withGroup("nestedChildProps") .fromSource(ClassWithNestedProperties.NestedChildClass.class)); - assertThat(metadata) - .has(Metadata - .withProperty("nestedChildProps.child-class-property", - Integer.class) - .fromSource(ClassWithNestedProperties.NestedChildClass.class) - .withDefaultValue(20)); - assertThat(metadata) - .has(Metadata - .withProperty("nestedChildProps.parent-class-property", - Integer.class) - .fromSource(ClassWithNestedProperties.NestedChildClass.class) - .withDefaultValue(10)); + assertThat(metadata).has(Metadata + .withProperty("nestedChildProps.child-class-property", Integer.class) + .fromSource(ClassWithNestedProperties.NestedChildClass.class) + .withDefaultValue(20)); + assertThat(metadata).has(Metadata + .withProperty("nestedChildProps.parent-class-property", Integer.class) + .fromSource(ClassWithNestedProperties.NestedChildClass.class) + .withDefaultValue(10)); } @Test @@ -830,14 +826,11 @@ public class ConfigurationMetadataAnnotationProcessorTests { @Test public void mergingOfHintWithProvider() throws Exception { - writeAdditionalHints( - new ItemHint("simple.theName", - Collections - .emptyList(), - Arrays.asList( - new ItemHint.ValueProvider("first", - Collections.singletonMap("target", "org.foo")), - new ItemHint.ValueProvider("second", null)))); + writeAdditionalHints(new ItemHint("simple.theName", Collections.emptyList(), + Arrays.asList( + new ItemHint.ValueProvider("first", + Collections.singletonMap("target", "org.foo")), + new ItemHint.ValueProvider("second", null)))); ConfigurationMetadata metadata = compile(SimpleProperties.class); assertThat(metadata).has(Metadata.withProperty("simple.the-name", String.class) .fromSource(SimpleProperties.class) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/EnabledEndpoint.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/EnabledEndpoint.java index 2cbd24c9052..00de8bd680c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/EnabledEndpoint.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/EnabledEndpoint.java @@ -32,7 +32,7 @@ public class EnabledEndpoint { } @ReadOperation - public String retrieve(String parameter, Integer anotherParameter) { + public String retrieve(String parameter, Integer anotherParameter) { return "not a main read operation"; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java index cbe347be07a..af2f4077259 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java @@ -177,8 +177,8 @@ final class JavaPluginAction implements PluginApplicationAction { SourceSet sourceSet) { String locations = StringUtils .collectionToCommaDelimitedString(sourceSet.getResources().getSrcDirs()); - compile.getOptions().getCompilerArgs() - .add("-Aorg.springframework.boot.configurationprocessor.additionalMetadataLocations=" + compile.getOptions().getCompilerArgs().add( + "-Aorg.springframework.boot.configurationprocessor.additionalMetadataLocations=" + locations); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfo.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfo.java index 57b402af210..415fa3350f2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfo.java @@ -57,7 +57,8 @@ public class BuildInfo extends ConventionTask { new File(getDestinationDir(), "build-info.properties")) .writeBuildProperties(new ProjectDetails( this.properties.getGroup(), - this.properties.getArtifact() == null ? "unspecified" + this.properties.getArtifact() == null + ? "unspecified" : this.properties.getArtifact(), this.properties.getVersion(), this.properties.getName(), coerceToStringValues( diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java index af851011eff..5b0b77ae393 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootWar.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. @@ -50,8 +50,8 @@ public class BootWar extends War implements BootArchive { */ public BootWar() { getWebInf().into("lib-provided", - (copySpec) -> copySpec - .from((Callable>) () -> this.providedClasspath == null + (copySpec) -> copySpec.from( + (Callable>) () -> this.providedClasspath == null ? Collections.emptyList() : this.providedClasspath)); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java index 8ba0219bc20..03b1bcdc633 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.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. @@ -40,8 +40,8 @@ public class IntegratingWithActuatorDocumentationTests { @Test public void basicBuildInfo() throws IOException { - this.gradleBuild - .script("src/main/gradle/integrating-with-actuator/build-info-basic.gradle") + this.gradleBuild.script( + "src/main/gradle/integrating-with-actuator/build-info-basic.gradle") .build("bootBuildInfo"); assertThat(new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties")).isFile(); @@ -49,8 +49,8 @@ public class IntegratingWithActuatorDocumentationTests { @Test public void buildInfoCustomValues() throws IOException { - this.gradleBuild - .script("src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle") + this.gradleBuild.script( + "src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle") .build("bootBuildInfo"); File file = new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties"); @@ -64,8 +64,8 @@ public class IntegratingWithActuatorDocumentationTests { @Test public void buildInfoAdditional() throws IOException { - this.gradleBuild - .script("src/main/gradle/integrating-with-actuator/build-info-additional.gradle") + this.gradleBuild.script( + "src/main/gradle/integrating-with-actuator/build-info-additional.gradle") .build("bootBuildInfo"); File file = new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java index c0209fc6ff9..e380bf789e1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.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. @@ -148,8 +148,8 @@ public class PackagingDocumentationTests { @Test public void bootJarLaunchScriptProperties() throws IOException { - this.gradleBuild - .script("src/main/gradle/packaging/boot-jar-launch-script-properties.gradle") + this.gradleBuild.script( + "src/main/gradle/packaging/boot-jar-launch-script-properties.gradle") .build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java index 3e9ce04df17..32a0155b47e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.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. @@ -45,8 +45,8 @@ public class RunningDocumentationTests { @Test public void applicationPluginMainClassName() throws IOException { - assertThat(this.gradleBuild - .script("src/main/gradle/running/application-plugin-main-class-name.gradle") + assertThat(this.gradleBuild.script( + "src/main/gradle/running/application-plugin-main-class-name.gradle") .build("configuredMainClass").getOutput()) .contains("com.example.ExampleApplication"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java index 22696fe22c4..c167722dca3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java @@ -108,7 +108,7 @@ public class JarFile extends java.util.jar.JarFile { private JarFile(RandomAccessDataFile rootFile, String pathFromRoot, RandomAccessData data, JarEntryFilter filter, JarFileType type) - throws IOException { + throws IOException { super(rootFile.getFile()); this.rootFile = rootFile; this.pathFromRoot = pathFromRoot; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/JarFileArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/JarFileArchiveTests.java index e54ec46b828..8a3350c6cbb 100755 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/JarFileArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/JarFileArchiveTests.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. @@ -125,11 +125,9 @@ public class JarFileArchiveTests { File nested = new File(this.archive .getNestedArchive(getEntriesMap(this.archive).get("nested.jar")).getUrl() .toURI()); - File anotherNested = new File( - this.archive - .getNestedArchive( - getEntriesMap(this.archive).get("another-nested.jar")) - .getUrl().toURI()); + File anotherNested = new File(this.archive + .getNestedArchive(getEntriesMap(this.archive).get("another-nested.jar")) + .getUrl().toURI()); assertThat(nested.getParent()).isEqualTo(anotherNested.getParent()); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinder.java index f119d84372b..8484e31ae7d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinder.java @@ -73,7 +73,8 @@ class ConfigurationPropertiesBinder { * @param targetType the resolvable type for the target * @throws ConfigurationPropertiesBindingException if the binding failed */ - void bind(Object target, ConfigurationProperties annotation, ResolvableType targetType) { + void bind(Object target, ConfigurationProperties annotation, + ResolvableType targetType) { Validator validator = determineValidator(target); BindHandler handler = getBindHandler(annotation, validator); Bindable bindable = Bindable.of(targetType).withExistingValue(target); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java index fd26a16be7a..458cada31cc 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.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. @@ -128,9 +128,9 @@ public class ConfigurationPropertiesBindingPostProcessor if (environmentPropertySources == null) { return appliedPropertySources; } - return new CompositePropertySources( - new FilteredPropertySources(appliedPropertySources, - PropertySourcesPlaceholderConfigurer.ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME), + return new CompositePropertySources(new FilteredPropertySources( + appliedPropertySources, + PropertySourcesPlaceholderConfigurer.ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME), environmentPropertySources); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java index 998139e7c9d..32f5d04f8aa 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java @@ -235,7 +235,7 @@ public class Binder { private Object bindObject(ConfigurationPropertyName name, Bindable target, BindHandler handler, Context context, boolean allowRecursiveBinding) - throws Exception { + throws Exception { ConfigurationProperty property = findProperty(name, context); if (property == null && containsNoDescendantOf(context.streamSources(), name)) { return null; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java index 58dbfc354cf..273c41a0173 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java @@ -38,8 +38,8 @@ class CollectionBinder extends IndexedElementsBinder> { @Override protected Object bindAggregate(ConfigurationPropertyName name, Bindable target, AggregateElementBinder elementBinder) { - Class collectionType = (target.getValue() == null ? target.getType().resolve(Object.class) - : List.class); + Class collectionType = (target.getValue() == null + ? target.getType().resolve(Object.class) : List.class); ResolvableType aggregateType = forClassWithGenerics(List.class, target.getType().asCollection().getGenerics()); ResolvableType elementType = target.getType().asCollection().getGeneric(); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java index bf5a7157aea..67018bd3fb0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.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,17 +127,23 @@ class JavaBeanBinder implements BeanBinder { int parameterCount = method.getParameterCount(); if (name.startsWith("get") && parameterCount == 0) { name = Introspector.decapitalize(name.substring(3)); - this.properties.computeIfAbsent(name, n -> new BeanProperty(n, this.resolvableType)) + this.properties + .computeIfAbsent(name, + n -> new BeanProperty(n, this.resolvableType)) .addGetter(method); } else if (name.startsWith("is") && parameterCount == 0) { name = Introspector.decapitalize(name.substring(2)); - this.properties.computeIfAbsent(name, n -> new BeanProperty(n, this.resolvableType)) + this.properties + .computeIfAbsent(name, + n -> new BeanProperty(n, this.resolvableType)) .addGetter(method); } else if (name.startsWith("set") && parameterCount == 1) { name = Introspector.decapitalize(name.substring(3)); - this.properties.computeIfAbsent(name, n -> new BeanProperty(n, this.resolvableType)) + this.properties + .computeIfAbsent(name, + n -> new BeanProperty(n, this.resolvableType)) .addSetter(method); } } @@ -271,10 +277,12 @@ class JavaBeanBinder implements BeanBinder { public ResolvableType getType() { if (this.setter != null) { MethodParameter methodParameter = new MethodParameter(this.setter, 0); - return ResolvableType.forMethodParameter(methodParameter, this.declaringClassType); + return ResolvableType.forMethodParameter(methodParameter, + this.declaringClassType); } MethodParameter methodParameter = new MethodParameter(this.getter, -1); - return ResolvableType.forMethodParameter(methodParameter, this.declaringClassType); + return ResolvableType.forMethodParameter(methodParameter, + this.declaringClassType); } public Annotation[] getAnnotations() { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java index 27808dcca48..7d672a418b3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java @@ -53,8 +53,8 @@ class MapBinder extends AggregateBinder> { @Override protected Object bindAggregate(ConfigurationPropertyName name, Bindable target, AggregateElementBinder elementBinder) { - Map map = CollectionFactory.createMap( - (target.getValue() == null ? target.getType().resolve(Object.class) : Map.class), 0); + Map map = CollectionFactory.createMap((target.getValue() == null + ? target.getType().resolve(Object.class) : Map.class), 0); Bindable resolvedTarget = resolveTarget(target); boolean hasDescendants = getContext().streamSources().anyMatch((source) -> source .containsDescendantOf(name) == ConfigurationPropertyState.PRESENT); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonObjectDeserializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonObjectDeserializer.java index e31ba419ada..74b70a09ac7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonObjectDeserializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonObjectDeserializer.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. @@ -73,7 +73,7 @@ public abstract class JsonObjectDeserializer */ protected abstract T deserializeObject(JsonParser jsonParser, DeserializationContext context, ObjectCodec codec, JsonNode tree) - throws IOException; + throws IOException; /** * Helper method to extract a value from the given {@code jsonNode} or return 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 77a808196c2..5001793555a 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 @@ -49,9 +49,8 @@ public final class LambdaSafe { static { CLASS_GET_MODULE = ReflectionUtils.findMethod(Class.class, "getModule"); - MODULE_GET_NAME = (CLASS_GET_MODULE == null ? null - : ReflectionUtils.findMethod(CLASS_GET_MODULE.getReturnType(), - "getName")); + MODULE_GET_NAME = (CLASS_GET_MODULE == null ? null : ReflectionUtils + .findMethod(CLASS_GET_MODULE.getReturnType(), "getName")); } private LambdaSafe() { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java index e0c2927ebf7..918bd58411d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/AnnotationConfigReactiveWebApplicationContext.java @@ -248,7 +248,7 @@ public class AnnotationConfigReactiveWebApplicationContext private void registerConfigLocations(AnnotatedBeanDefinitionReader reader, ClassPathBeanDefinitionScanner scanner, String[] configLocations) - throws LinkageError { + throws LinkageError { for (String configLocation : configLocations) { try { register(reader, configLocation); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java index 61bfd002bf3..7dac7991ad4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/filter/ApplicationContextHeaderFilter.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. @@ -50,7 +50,7 @@ public class ApplicationContextHeaderFilter extends OncePerRequestFilter { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws ServletException, IOException { + throws ServletException, IOException { response.addHeader(HEADER_NAME, this.applicationContext.getId()); filterChain.doFilter(request, response); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java index 26be629d01e..32cc70391d6 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java @@ -86,7 +86,7 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) - throws ServletException, IOException { + throws ServletException, IOException { ErrorPageFilter.this.doFilter(request, response, chain); } @@ -134,7 +134,7 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry { private void handleErrorStatus(HttpServletRequest request, HttpServletResponse response, int status, String message) - throws ServletException, IOException { + throws ServletException, IOException { if (response.isCommitted()) { handleCommittedResponse(request, null); return; @@ -151,7 +151,7 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry { private void handleException(HttpServletRequest request, HttpServletResponse response, ErrorWrapperResponse wrapped, Throwable ex) - throws IOException, ServletException { + throws IOException, ServletException { Class type = ex.getClass(); String errorPath = getErrorPath(type); if (errorPath == null) { @@ -168,7 +168,7 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry { private void forwardToErrorPage(String path, HttpServletRequest request, HttpServletResponse response, Throwable ex) - throws ServletException, IOException { + throws ServletException, IOException { if (logger.isErrorEnabled()) { String message = "Forwarding to error page from request " + getDescription(request) + " due to exception [" + ex.getMessage() diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinderBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinderBuilderTests.java index f7c1809915e..aed5ca8388c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinderBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinderBuilderTests.java @@ -128,8 +128,10 @@ public class ConfigurationPropertiesBinderBuilderTests { } private void bind(ConfigurationPropertiesBinder binder, Object target) { - binder.bind(target, AnnotationUtils.findAnnotation(target.getClass(), - ConfigurationProperties.class), ResolvableType.forType(target.getClass())); + binder.bind(target, + AnnotationUtils.findAnnotation(target.getClass(), + ConfigurationProperties.class), + ResolvableType.forType(target.getClass())); } @ConfigurationProperties(prefix = "test") diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinderTests.java index 1c67f9e6cac..d6c401a75b3 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinderTests.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. @@ -269,8 +269,10 @@ public class ConfigurationPropertiesBinderTests { } private void bind(ConfigurationPropertiesBinder binder, Object target) { - binder.bind(target, AnnotationUtils.findAnnotation(target.getClass(), - ConfigurationProperties.class), ResolvableType.forType(target.getClass())); + binder.bind(target, + AnnotationUtils.findAnnotation(target.getClass(), + ConfigurationProperties.class), + ResolvableType.forType(target.getClass())); } @ConfigurationProperties(value = "person", ignoreUnknownFields = false) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java index 6dd0247f670..e7cd3001083 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.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. @@ -362,7 +362,6 @@ public class BinderTests { private T bar; - public T getBar() { return this.bar; } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonComponent.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonComponent.java index 9757c94e0cf..b1fb937af12 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonComponent.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/NameAndAgeJsonComponent.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. @@ -49,7 +49,7 @@ public class NameAndAgeJsonComponent { @Override protected NameAndAge deserializeObject(JsonParser jsonParser, DeserializationContext context, ObjectCodec codec, JsonNode tree) - throws IOException { + throws IOException { String name = nullSafeValue(tree.get("name"), String.class); Integer age = nullSafeValue(tree.get("age"), Integer.class); return new NameAndAge(name, age); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RootUriTemplateHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RootUriTemplateHandlerTests.java index 5706aeb7f16..32da0826624 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RootUriTemplateHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RootUriTemplateHandlerTests.java @@ -61,7 +61,8 @@ public class RootUriTemplateHandlerTests { this.uri = new URI("http://example.com/hello"); this.handler = new RootUriTemplateHandler("http://example.com", this.delegate); given(this.delegate.expand(anyString(), any(Map.class))).willReturn(this.uri); - given(this.delegate.expand(anyString(), any(Object[].class))).willReturn(this.uri); + given(this.delegate.expand(anyString(), any(Object[].class))) + .willReturn(this.uri); } @Test 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 bd422f11130..ccbbc60e371 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 @@ -1129,13 +1129,13 @@ public abstract class AbstractServletWebServerFactoryTests { protected String getResponse(String url, HttpComponentsClientHttpRequestFactory requestFactory, String... headers) - throws IOException, URISyntaxException { + throws IOException, URISyntaxException { return getResponse(url, HttpMethod.GET, requestFactory, headers); } protected String getResponse(String url, HttpMethod method, HttpComponentsClientHttpRequestFactory requestFactory, String... headers) - throws IOException, URISyntaxException { + throws IOException, URISyntaxException { try (ClientHttpResponse response = getClientResponse(url, method, requestFactory, headers)) { return StreamUtils.copyToString(response.getBody(), StandardCharsets.UTF_8); @@ -1163,7 +1163,7 @@ public abstract class AbstractServletWebServerFactoryTests { protected ClientHttpResponse getClientResponse(String url, HttpMethod method, HttpComponentsClientHttpRequestFactory requestFactory, String... headers) - throws IOException, URISyntaxException { + throws IOException, URISyntaxException { ClientHttpRequest request = requestFactory.createRequest(new URI(url), method); request.getHeaders().add("Cookie", "JSESSIONID=" + "123"); for (String header : headers) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestServlet.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestServlet.java index 0ff470116b9..6ddfca70c2a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestServlet.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/testcomponents/TestServlet.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,9 +30,8 @@ public class TestServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.getWriter() - .print(((String) req.getServletContext() - .getAttribute("listenerAttribute")) + " " + resp.getWriter().print( + ((String) req.getServletContext().getAttribute("listenerAttribute")) + " " + req.getAttribute("filterAttribute")); resp.getWriter().flush(); } diff --git a/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java index 3c7ad802155..a05c62f1214 100644 --- a/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.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. @@ -66,8 +66,8 @@ public class SampleDataRestApplicationTests { @Test public void findByNameAndCountry() throws Exception { - this.mvc.perform( - get("/api/cities/search/findByNameAndCountryAllIgnoringCase?name=Melbourne&country=Australia")) + this.mvc.perform(get( + "/api/cities/search/findByNameAndCountryAllIgnoringCase?name=Melbourne&country=Australia")) .andExpect(status().isOk()) .andExpect(jsonPath("state", equalTo("Victoria"))) .andExpect(jsonPath("name", equalTo("Melbourne"))); @@ -76,8 +76,8 @@ public class SampleDataRestApplicationTests { @Test public void findByContaining() throws Exception { - this.mvc.perform( - get("/api/cities/search/findByNameContainingAndCountryContainingAllIgnoringCase?name=&country=UK")) + this.mvc.perform(get( + "/api/cities/search/findByNameContainingAndCountryContainingAllIgnoringCase?name=&country=UK")) .andExpect(status().isOk()) .andExpect(jsonPath("_embedded.cities", hasSize(3))); } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/com/example/DevToolsTestApplication.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/com/example/DevToolsTestApplication.java index 98f989b0700..51876ad3c88 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/com/example/DevToolsTestApplication.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/com/example/DevToolsTestApplication.java @@ -25,8 +25,7 @@ public class DevToolsTestApplication { public static void main(String[] args) { new SpringApplicationBuilder(DevToolsTestApplication.class) - .listeners(new WebServerPortFileWriter("target/server.port")) - .run(args); + .listeners(new WebServerPortFileWriter("target/server.port")).run(args); } } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/com/example/ResourceHandlingApplication.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/com/example/ResourceHandlingApplication.java index e78b09fd1c1..ec69ee146f0 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/com/example/ResourceHandlingApplication.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/com/example/ResourceHandlingApplication.java @@ -41,8 +41,7 @@ public class ResourceHandlingApplication { public static void main(String[] args) { new SpringApplicationBuilder(ResourceHandlingApplication.class) .properties("server.port:0") - .listeners(new WebServerPortFileWriter("target/server.port")) - .run(args); + .listeners(new WebServerPortFileWriter("target/server.port")).run(args); } @Bean