Restructure web auto-configuration

Restructure `org.springframework.boot.autoconfigure.web` to better align
with the new package structure in `spring-boot`.

Auto-configuration is now split into client, servlet and reactive
sub-packages. In addition a new `http` package now handles common
HTTP concerns.

Fixes gh-8616
This commit is contained in:
Phillip Webb
2017-03-14 18:06:53 -07:00
parent 33e54ed723
commit b76ca0bf8f
166 changed files with 634 additions and 536 deletions

View File

@@ -16,8 +16,13 @@
package org.springframework.boot.test.context;
import java.net.URL;
import javax.servlet.ServletContext;
import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -28,6 +33,7 @@ import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.WebApplicationContext;
@@ -59,6 +65,14 @@ public abstract class AbstractSpringBootTestWebServerWebEnvironmentTests {
@Autowired
private TestRestTemplate restTemplate;
@BeforeClass
@AfterClass
public static void uninstallUrlStreamHandlerFactory() {
ReflectionTestUtils.setField(TomcatURLStreamHandlerFactory.class, "instance",
null);
ReflectionTestUtils.setField(URL.class, "factory", null);
}
public WebApplicationContext getContext() {
return this.context;
}