Move MultipartAutoConfigurationTests to main code's module

This commit is contained in:
Andy Wilkinson
2025-06-05 12:24:28 +01:00
committed by Phillip Webb
parent 8efbebb9b3
commit baadf28fc3
3 changed files with 16 additions and 10 deletions

View File

@@ -29,7 +29,3 @@ dependencies {
testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5")
}
test {
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
}

View File

@@ -18,8 +18,17 @@ dependencies {
optional("jakarta.servlet:jakarta.servlet-api")
optional("org.springframework.security:spring-security-config")
testImplementation(project(":spring-boot-project:spring-boot-jetty"))
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation(project(":spring-boot-project:spring-boot-undertow"))
testImplementation("org.springframework:spring-webmvc")
testRuntimeOnly("ch.qos.logback:logback-classic")
testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5")
}
tasks.named("test") {
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.web.servlet;
package org.springframework.boot.servlet.autoconfigure;
import java.net.URI;
import java.util.stream.Stream;
@@ -28,8 +28,6 @@ import org.junit.jupiter.params.provider.MethodSource;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory;
import org.springframework.boot.servlet.autoconfigure.MultipartAutoConfiguration;
import org.springframework.boot.servlet.autoconfigure.MultipartProperties;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.boot.testsupport.classpath.ForkedClassPath;
import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories;
@@ -38,7 +36,6 @@ import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.autoconfigure.ServerProperties;
import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext;
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
@@ -267,8 +264,7 @@ class MultipartAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@Import({ TomcatServletWebServerAutoConfiguration.class, DispatcherServletAutoConfiguration.class,
MultipartAutoConfiguration.class })
@Import({ TomcatServletWebServerAutoConfiguration.class, MultipartAutoConfiguration.class })
@EnableConfigurationProperties(MultipartProperties.class)
static class BaseConfiguration {
@@ -279,6 +275,11 @@ class MultipartAutoConfigurationTests {
return properties;
}
@Bean
DispatcherServlet dispatcherServlet() {
return new DispatcherServlet();
}
}
@Configuration(proxyBeanMethods = false)