From 424dfc398b37e69a4e61e041091b073f1e098e9f Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 11 Sep 2018 12:46:37 -0700 Subject: [PATCH] Move 'insights.web' properties to 'spring.http' Relocate the 'spring.insights.web.log-request-details' property to 'spring.http.log-request-details'. Closes gh-14313 --- .../http/HttpEncodingProperties.java | 123 -------------- ...ttpMessageConvertersAutoConfiguration.java | 11 +- .../autoconfigure/http/HttpProperties.java | 159 ++++++++++++++++++ .../http/codec/CodecsAutoConfiguration.java | 10 +- .../insight/InsightsProperties.java | 54 ------ .../autoconfigure/insight/package-info.java | 20 --- .../DispatcherServletAutoConfiguration.java | 16 +- .../HttpEncodingAutoConfiguration.java | 16 +- .../appendix-application-properties.adoc | 8 +- .../src/main/asciidoc/using-spring-boot.adoc | 2 +- ...DocsAutoConfigurationIntegrationTests.java | 4 +- 11 files changed, 190 insertions(+), 233 deletions(-) delete mode 100644 spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpEncodingProperties.java create mode 100644 spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpProperties.java delete mode 100644 spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/insight/InsightsProperties.java delete mode 100644 spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/insight/package-info.java diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpEncodingProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpEncodingProperties.java deleted file mode 100644 index 9706a1ddf6..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpEncodingProperties.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.autoconfigure.http; - -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.Locale; -import java.util.Map; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Configuration properties for http encoding. - * - * @author Stephane Nicoll - * @author Brian Clozel - * @since 1.2.0 - */ -@ConfigurationProperties(prefix = "spring.http.encoding") -public class HttpEncodingProperties { - - public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - /** - * Charset of HTTP requests and responses. Added to the "Content-Type" header if not - * set explicitly. - */ - private Charset charset = DEFAULT_CHARSET; - - /** - * Whether to force the encoding to the configured charset on HTTP requests and - * responses. - */ - private Boolean force; - - /** - * Whether to force the encoding to the configured charset on HTTP requests. Defaults - * to true when "force" has not been specified. - */ - private Boolean forceRequest; - - /** - * Whether to force the encoding to the configured charset on HTTP responses. - */ - private Boolean forceResponse; - - /** - * Locale in which to encode mapping. - */ - private Map mapping; - - public Charset getCharset() { - return this.charset; - } - - public void setCharset(Charset charset) { - this.charset = charset; - } - - public boolean isForce() { - return Boolean.TRUE.equals(this.force); - } - - public void setForce(boolean force) { - this.force = force; - } - - public boolean isForceRequest() { - return Boolean.TRUE.equals(this.forceRequest); - } - - public void setForceRequest(boolean forceRequest) { - this.forceRequest = forceRequest; - } - - public boolean isForceResponse() { - return Boolean.TRUE.equals(this.forceResponse); - } - - public void setForceResponse(boolean forceResponse) { - this.forceResponse = forceResponse; - } - - public Map getMapping() { - return this.mapping; - } - - public void setMapping(Map mapping) { - this.mapping = mapping; - } - - public boolean shouldForce(Type type) { - Boolean force = (type != Type.REQUEST) ? this.forceResponse : this.forceRequest; - if (force == null) { - force = this.force; - } - if (force == null) { - force = (type == Type.REQUEST); - } - return force; - } - - public enum Type { - - REQUEST, RESPONSE - - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java index 97aa3e3462..6a50195520 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java @@ -74,21 +74,20 @@ public class HttpMessageConvertersAutoConfiguration { @Configuration @ConditionalOnClass(StringHttpMessageConverter.class) - @EnableConfigurationProperties(HttpEncodingProperties.class) + @EnableConfigurationProperties(HttpProperties.class) protected static class StringHttpMessageConverterConfiguration { - private final HttpEncodingProperties encodingProperties; + private final HttpProperties.Encoding properties; - protected StringHttpMessageConverterConfiguration( - HttpEncodingProperties encodingProperties) { - this.encodingProperties = encodingProperties; + protected StringHttpMessageConverterConfiguration(HttpProperties httpProperties) { + this.properties = httpProperties.getEncoding(); } @Bean @ConditionalOnMissingBean public StringHttpMessageConverter stringHttpMessageConverter() { StringHttpMessageConverter converter = new StringHttpMessageConverter( - this.encodingProperties.getCharset()); + this.properties.getCharset()); converter.setWriteAcceptCharset(false); return converter; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpProperties.java new file mode 100644 index 0000000000..0ec8c88137 --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpProperties.java @@ -0,0 +1,159 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigure.http; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.Locale; +import java.util.Map; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * HTTP properties. + * + * @author Phillip Webb + * @author Stephane Nicoll + * @author Brian Clozel + * @since 2.1.0 + */ +@ConfigurationProperties(prefix = "spring.http") +public class HttpProperties { + + /** + * Whether logging of (potentially sensitive) request details at DEBUG and TRACE level + * is allowed. + */ + private boolean logRequestDetails; + + /** + * HTTP encoding properties. + */ + private Encoding encoding = new Encoding(); + + public boolean isLogRequestDetails() { + return this.logRequestDetails; + } + + public void setLogRequestDetails(boolean logRequestDetails) { + this.logRequestDetails = logRequestDetails; + } + + public Encoding getEncoding() { + return this.encoding; + } + + public void setEncoding(Encoding encoding) { + this.encoding = encoding; + } + + /** + * Configuration properties for http encoding. + */ + public static class Encoding { + + public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + + /** + * Charset of HTTP requests and responses. Added to the "Content-Type" header if + * not set explicitly. + */ + private Charset charset = DEFAULT_CHARSET; + + /** + * Whether to force the encoding to the configured charset on HTTP requests and + * responses. + */ + private Boolean force; + + /** + * Whether to force the encoding to the configured charset on HTTP requests. + * Defaults to true when "force" has not been specified. + */ + private Boolean forceRequest; + + /** + * Whether to force the encoding to the configured charset on HTTP responses. + */ + private Boolean forceResponse; + + /** + * Locale in which to encode mapping. + */ + private Map mapping; + + public Charset getCharset() { + return this.charset; + } + + public void setCharset(Charset charset) { + this.charset = charset; + } + + public boolean isForce() { + return Boolean.TRUE.equals(this.force); + } + + public void setForce(boolean force) { + this.force = force; + } + + public boolean isForceRequest() { + return Boolean.TRUE.equals(this.forceRequest); + } + + public void setForceRequest(boolean forceRequest) { + this.forceRequest = forceRequest; + } + + public boolean isForceResponse() { + return Boolean.TRUE.equals(this.forceResponse); + } + + public void setForceResponse(boolean forceResponse) { + this.forceResponse = forceResponse; + } + + public Map getMapping() { + return this.mapping; + } + + public void setMapping(Map mapping) { + this.mapping = mapping; + } + + public boolean shouldForce(Type type) { + Boolean force = (type != Type.REQUEST) ? this.forceResponse + : this.forceRequest; + if (force == null) { + force = this.force; + } + if (force == null) { + force = (type == Type.REQUEST); + } + return force; + } + + public enum Type { + + REQUEST, RESPONSE + + } + + } + +} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/codec/CodecsAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/codec/CodecsAutoConfiguration.java index 7e6ce073e2..2834f4072c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/codec/CodecsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/codec/CodecsAutoConfiguration.java @@ -22,7 +22,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.insight.InsightsProperties; +import org.springframework.boot.autoconfigure.http.HttpProperties; import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.codec.CodecCustomizer; @@ -67,13 +67,13 @@ public class CodecsAutoConfiguration { } @Configuration - @EnableConfigurationProperties(InsightsProperties.class) + @EnableConfigurationProperties(HttpProperties.class) static class LoggingCodecConfiguration { @Bean - public CodecCustomizer loggingCodecCustomizer(InsightsProperties properties) { - return (configurer) -> configurer.defaultCodecs().enableLoggingRequestDetails( - properties.getWeb().isLogRequestDetails()); + public CodecCustomizer loggingCodecCustomizer(HttpProperties properties) { + return (configurer) -> configurer.defaultCodecs() + .enableLoggingRequestDetails(properties.isLogRequestDetails()); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/insight/InsightsProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/insight/InsightsProperties.java deleted file mode 100644 index 488677e68d..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/insight/InsightsProperties.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.autoconfigure.insight; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Configuration properties for customizing application insights. - * - * @author Brian Clozel - * @since 2.1.0 - */ -@ConfigurationProperties(prefix = "spring.insights") -public class InsightsProperties { - - private final Web web = new Web(); - - public Web getWeb() { - return this.web; - } - - public static class Web { - - /** - * Whether logging of (potentially sensitive) request details at DEBUG and TRACE - * level is allowed. - */ - private boolean logRequestDetails; - - public boolean isLogRequestDetails() { - return this.logRequestDetails; - } - - public void setLogRequestDetails(boolean logRequestDetails) { - this.logRequestDetails = logRequestDetails; - } - - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/insight/package-info.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/insight/package-info.java deleted file mode 100644 index 7e91b5b0f0..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/insight/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Auto-configuration for application insights. - */ -package org.springframework.boot.autoconfigure.insight; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java index 3a2161842b..134b88b7bf 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration.java @@ -36,7 +36,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; -import org.springframework.boot.autoconfigure.insight.InsightsProperties; +import org.springframework.boot.autoconfigure.http.HttpProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @@ -82,17 +82,17 @@ public class DispatcherServletAutoConfiguration { @Configuration @Conditional(DefaultDispatcherServletCondition.class) @ConditionalOnClass(ServletRegistration.class) - @EnableConfigurationProperties({ WebMvcProperties.class, InsightsProperties.class }) + @EnableConfigurationProperties({ HttpProperties.class, WebMvcProperties.class }) protected static class DispatcherServletConfiguration { + private final HttpProperties httpProperties; + private final WebMvcProperties webMvcProperties; - private final InsightsProperties insightsProperties; - - public DispatcherServletConfiguration(WebMvcProperties webMvcProperties, - InsightsProperties insightsProperties) { + public DispatcherServletConfiguration(HttpProperties httpProperties, + WebMvcProperties webMvcProperties) { + this.httpProperties = httpProperties; this.webMvcProperties = webMvcProperties; - this.insightsProperties = insightsProperties; } @Bean(name = DEFAULT_DISPATCHER_SERVLET_BEAN_NAME) @@ -105,7 +105,7 @@ public class DispatcherServletAutoConfiguration { dispatcherServlet.setThrowExceptionIfNoHandlerFound( this.webMvcProperties.isThrowExceptionIfNoHandlerFound()); dispatcherServlet.setEnableLoggingRequestDetails( - this.insightsProperties.getWeb().isLogRequestDetails()); + this.httpProperties.isLogRequestDetails()); return dispatcherServlet; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.java index b24d4473b6..933b5b4c57 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.java @@ -21,8 +21,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.http.HttpEncodingProperties; -import org.springframework.boot.autoconfigure.http.HttpEncodingProperties.Type; +import org.springframework.boot.autoconfigure.http.HttpProperties; +import org.springframework.boot.autoconfigure.http.HttpProperties.Encoding.Type; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter; @@ -41,16 +41,16 @@ import org.springframework.web.filter.CharacterEncodingFilter; * @since 1.2.0 */ @Configuration -@EnableConfigurationProperties(HttpEncodingProperties.class) +@EnableConfigurationProperties(HttpProperties.class) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) @ConditionalOnClass(CharacterEncodingFilter.class) @ConditionalOnProperty(prefix = "spring.http.encoding", value = "enabled", matchIfMissing = true) public class HttpEncodingAutoConfiguration { - private final HttpEncodingProperties properties; + private final HttpProperties.Encoding properties; - public HttpEncodingAutoConfiguration(HttpEncodingProperties properties) { - this.properties = properties; + public HttpEncodingAutoConfiguration(HttpProperties properties) { + this.properties = properties.getEncoding(); } @Bean @@ -71,9 +71,9 @@ public class HttpEncodingAutoConfiguration { private static class LocaleCharsetMappingsCustomizer implements WebServerFactoryCustomizer, Ordered { - private final HttpEncodingProperties properties; + private final HttpProperties.Encoding properties; - LocaleCharsetMappingsCustomizer(HttpEncodingProperties properties) { + LocaleCharsetMappingsCustomizer(HttpProperties.Encoding properties) { this.properties = properties; } diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 648cef76b4..f744fa89c7 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -92,9 +92,6 @@ content into your application. Rather, pick only the properties that you need. # HAZELCAST ({sc-spring-boot-autoconfigure}/hazelcast/HazelcastProperties.{sc-ext}[HazelcastProperties]) spring.hazelcast.config= # The location of the configuration file to use to initialize Hazelcast. - # INSIGHTS ({sc-spring-boot-autoconfigure}/insight/InsightsProperties.{sc-ext}[InsightsProperties]) - spring.insights.web.log-request-details=false # Whether logging of (potentially sensitive) request details at DEBUG and TRACE level is allowed. - # PROJECT INFORMATION ({sc-spring-boot-autoconfigure}/info/ProjectInfoProperties.{sc-ext}[ProjectInfoProperties]) spring.info.build.location=classpath:META-INF/build-info.properties # Location of the generated build-info.properties file. spring.info.git.location=classpath:git.properties # Location of the generated git.properties file. @@ -331,16 +328,15 @@ content into your application. Rather, pick only the properties that you need. # SPRING HATEOAS ({sc-spring-boot-autoconfigure}/hateoas/HateoasProperties.{sc-ext}[HateoasProperties]) spring.hateoas.use-hal-as-default-json-media-type=true # Whether application/hal+json responses should be sent to requests that accept application/json. - # HTTP message conversion + # HTTP ({sc-spring-boot-autoconfigure}/http/HttpEncodingProperties.{sc-ext}[HttpProperties]) spring.http.converters.preferred-json-mapper= # Preferred JSON mapper to use for HTTP message conversion. By default, auto-detected according to the environment. - - # HTTP encoding ({sc-spring-boot-autoconfigure}/http/HttpEncodingProperties.{sc-ext}[HttpEncodingProperties]) spring.http.encoding.charset=UTF-8 # Charset of HTTP requests and responses. Added to the "Content-Type" header if not set explicitly. spring.http.encoding.enabled=true # Whether to enable http encoding support. spring.http.encoding.force= # Whether to force the encoding to the configured charset on HTTP requests and responses. spring.http.encoding.force-request= # Whether to force the encoding to the configured charset on HTTP requests. Defaults to true when "force" has not been specified. spring.http.encoding.force-response= # Whether to force the encoding to the configured charset on HTTP responses. spring.http.encoding.mapping= # Locale in which to encode mapping. + spring.http.log-request-details=false # Whether logging of (potentially sensitive) request details at DEBUG and TRACE level is allowed. # MULTIPART ({sc-spring-boot-autoconfigure}/web/servlet/MultipartProperties.{sc-ext}[MultipartProperties]) spring.servlet.multipart.enabled=true # Whether to enable support of multipart uploads. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc index eb73013e49..1fb979c076 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc @@ -788,7 +788,7 @@ Spring WebFlux applications, developer tools will enable DEBUG logging for the Spring Framework web infrastructure. This will give you information about the incoming request, which handler is processing it, the response outcome, etc. If you wish to log all request details (including potentially sensitive information), you can turn on -the `spring.insights.web.log-request-details` configuration property. +the `spring.http.log-request-details` configuration property. TIP: For a complete list of the properties that are applied by the devtools, see {sc-spring-boot-devtools}/env/DevToolsPropertyDefaultsPostProcessor.{sc-ext}[DevToolsPropertyDefaultsPostProcessor]. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationIntegrationTests.java index 31f93934ee..0a10c84543 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationIntegrationTests.java @@ -52,8 +52,8 @@ public class WebTestClientRestDocsAutoConfigurationIntegrationTests { @Test public void defaultSnippetsAreWritten() throws Exception { - this.webTestClient.get().uri("/").exchange().expectBody() - .consumeWith(document("default-snippets")); + this.webTestClient.get().uri("/").exchange().expectStatus().is2xxSuccessful() + .expectBody().consumeWith(document("default-snippets")); File defaultSnippetsDir = new File("target/generated-snippets/default-snippets"); assertThat(defaultSnippetsDir).exists(); assertThat(new File(defaultSnippetsDir, "curl-request.adoc"))