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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user