From 4104566ca22a80d39cdc379d0aa2e22eb28042b4 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 12 May 2017 15:21:50 +0100 Subject: [PATCH] Remove restartWithKeepAlive as it appears to be testing the container The restartWithKeepAlive test really appears to be testing functionality in the container, rather than our configuration of the container. It's also not clear what role, if any, keep-alive is playing as it's not explicitly configured in the test. --- .../AbstractServletWebServerFactoryTests.java | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java b/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java index b9ba4e30dea..0f4e798dbab 100644 --- a/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java @@ -44,7 +44,6 @@ import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.zip.GZIPInputStream; @@ -98,13 +97,11 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpRequest; import org.springframework.http.client.ClientHttpResponse; -import org.springframework.http.client.HttpComponentsAsyncClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.util.FileCopyUtils; import org.springframework.util.SocketUtils; import org.springframework.util.StreamUtils; -import org.springframework.util.concurrent.ListenableFuture; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.notNullValue; @@ -200,28 +197,6 @@ public abstract class AbstractServletWebServerFactoryTests { "Unexpected response on port " + port + " : " + response); } - @Test - public void restartWithKeepAlive() throws Exception { - AbstractServletWebServerFactory factory = getFactory(); - this.webServer = factory.getWebServer(exampleServletRegistration()); - this.webServer.start(); - HttpComponentsAsyncClientHttpRequestFactory clientHttpRequestFactory = new HttpComponentsAsyncClientHttpRequestFactory(); - ListenableFuture response1 = clientHttpRequestFactory - .createAsyncRequest(new URI(getLocalUrl("/hello")), HttpMethod.GET) - .executeAsync(); - assertThat(response1.get(10, TimeUnit.SECONDS).getRawStatusCode()).isEqualTo(200); - - this.webServer.stop(); - this.webServer = factory.getWebServer(exampleServletRegistration()); - this.webServer.start(); - - ListenableFuture response2 = clientHttpRequestFactory - .createAsyncRequest(new URI(getLocalUrl("/hello")), HttpMethod.GET) - .executeAsync(); - assertThat(response2.get(10, TimeUnit.SECONDS).getRawStatusCode()).isEqualTo(200); - clientHttpRequestFactory.destroy(); - } - @Test public void startServletAndFilter() throws Exception { AbstractServletWebServerFactory factory = getFactory();