From cbf82c4793f42d796f6ea01e719d64dd9c8b6558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Sat, 28 Mar 2015 10:23:13 +0100 Subject: [PATCH 1/2] Fix typo in gradle plugin documentation (cherry-picked from commit 99f1c7b) --- spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc b/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc index f82328ef80..8eba25cd2d 100644 --- a/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc +++ b/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc @@ -441,7 +441,7 @@ want the other Boot features but not this one) to locate the archive to repackage. |`customConfiguration` -|The name of the custom configuration whuch is used to populate the nested lib directory +|The name of the custom configuration which is used to populate the nested lib directory (without specifying this you get all compile and runtime dependencies). |=== From e3f203a8a5895b9437ba95e4a11b28aa920480b3 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 30 Mar 2015 10:22:54 -0700 Subject: [PATCH 2/2] Polish --- .../boot/autoconfigure/web/ServerProperties.java | 6 ++++-- .../autoconfigure/web/ServerPropertiesTests.java | 4 ++-- .../boot/context/web/ErrorPageFilterTests.java | 14 -------------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index fa171d6718..17a9c0acc1 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -477,6 +477,7 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord } factory.addConnectorCustomizers(new TomcatConnectorCustomizer() { + @Override public void customize(Connector connector) { ProtocolHandler handler = connector.getProtocolHandler(); @@ -489,14 +490,15 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord } private String coerceCompression(String compression) { - if (Boolean.toString(true).equals(compression)) { + if ("true".equalsIgnoreCase(compression)) { return "on"; } - else if (Boolean.toString(false).equals(compression)) { + if ("false".equalsIgnoreCase(compression)) { return "off"; } return compression; } + }); if (this.accessLogEnabled) { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index 5ce1f3d812..016965c72b 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -205,13 +205,13 @@ public class ServerPropertiesTests { @Test public void disableTomcatCompressionWithYaml() throws Exception { // YAML interprets "off" as false, check that it's mapped back to off - assertThat("off", is(equalTo(configureCompression("false")))); + assertThat("off", is(equalTo(configureCompression("faLSe")))); } @Test public void enableTomcatCompressionWithYaml() throws Exception { // YAML interprets "on" as true, check that it's mapped back to on - assertThat("on", is(equalTo(configureCompression("true")))); + assertThat("on", is(equalTo(configureCompression("trUE")))); } @Test diff --git a/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java b/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java index 3e1af18dbf..2e5d18e485 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/web/ErrorPageFilterTests.java @@ -325,9 +325,7 @@ public class ErrorPageFilterTests { @Test public void responseIsNotCommitedWhenRequestIsAsync() throws Exception { this.request.setAsyncStarted(true); - this.filter.doFilter(this.request, this.response, this.chain); - assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request)); assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getResponse(), equalTo((ServletResponse) this.response)); @@ -347,9 +345,7 @@ public class ErrorPageFilterTests { throw new RuntimeException("BAD"); } }; - this.filter.doFilter(this.request, this.response, this.chain); - assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request)); assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getResponse(), equalTo((ServletResponse) this.response)); @@ -368,9 +364,7 @@ public class ErrorPageFilterTests { ((HttpServletResponse) response).sendError(400, "BAD"); } }; - this.filter.doFilter(this.request, this.response, this.chain); - assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request)); assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getResponse(), equalTo((ServletResponse) this.response)); @@ -380,9 +374,7 @@ public class ErrorPageFilterTests { @Test public void responseIsNotCommitedDuringAsyncDispatch() throws Exception { setUpAsyncDispatch(); - this.filter.doFilter(this.request, this.response, this.chain); - assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request)); assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getResponse(), equalTo((ServletResponse) this.response)); @@ -402,9 +394,7 @@ public class ErrorPageFilterTests { throw new RuntimeException("BAD"); } }; - this.filter.doFilter(this.request, this.response, this.chain); - assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request)); assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getResponse(), equalTo((ServletResponse) this.response)); @@ -424,9 +414,7 @@ public class ErrorPageFilterTests { ((HttpServletResponse) response).sendError(400, "BAD"); } }; - this.filter.doFilter(this.request, this.response, this.chain); - assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request)); assertThat(((HttpServletResponseWrapper) this.chain.getResponse()).getResponse(), equalTo((ServletResponse) this.response)); @@ -439,9 +427,7 @@ public class ErrorPageFilterTests { HttpServletResponse committedResponse = mock(HttpServletResponse.class); given(committedResponse.isCommitted()).willReturn(true); given(committedResponse.getStatus()).willReturn(200); - this.filter.doFilter(this.request, committedResponse, this.chain); - verify(committedResponse, times(0)).flushBuffer(); }