Skip to content

Commit e606818

Browse files
committed
Move MultipartAutoConfigurationTests to main code's module
1 parent ce41f3c commit e606818

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

spring-boot-project/spring-boot-autoconfigure-all/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,3 @@ dependencies {
2929

3030
testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5")
3131
}
32-
33-
test {
34-
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
35-
}

spring-boot-project/spring-boot-servlet/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@ dependencies {
1818
optional("jakarta.servlet:jakarta.servlet-api")
1919
optional("org.springframework.security:spring-security-config")
2020

21+
testImplementation(project(":spring-boot-project:spring-boot-jetty"))
2122
testImplementation(project(":spring-boot-project:spring-boot-test"))
23+
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
2224
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
25+
testImplementation(project(":spring-boot-project:spring-boot-undertow"))
26+
testImplementation("org.springframework:spring-webmvc")
2327

2428
testRuntimeOnly("ch.qos.logback:logback-classic")
29+
testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5")
30+
}
31+
32+
tasks.named("test") {
33+
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
2534
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.web.servlet;
17+
package org.springframework.boot.servlet.autoconfigure;
1818

1919
import java.net.URI;
2020
import java.util.stream.Stream;
@@ -28,8 +28,6 @@
2828

2929
import org.springframework.boot.context.properties.EnableConfigurationProperties;
3030
import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory;
31-
import org.springframework.boot.servlet.autoconfigure.MultipartAutoConfiguration;
32-
import org.springframework.boot.servlet.autoconfigure.MultipartProperties;
3331
import org.springframework.boot.test.util.TestPropertyValues;
3432
import org.springframework.boot.testsupport.classpath.ForkedClassPath;
3533
import org.springframework.boot.testsupport.web.servlet.DirtiesUrlFactories;
@@ -38,7 +36,6 @@
3836
import org.springframework.boot.undertow.servlet.UndertowServletWebServerFactory;
3937
import org.springframework.boot.web.server.autoconfigure.ServerProperties;
4038
import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext;
41-
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
4239
import org.springframework.context.annotation.Bean;
4340
import org.springframework.context.annotation.Configuration;
4441
import org.springframework.context.annotation.Import;
@@ -267,8 +264,7 @@ WebController controller() {
267264
}
268265

269266
@Configuration(proxyBeanMethods = false)
270-
@Import({ TomcatServletWebServerAutoConfiguration.class, DispatcherServletAutoConfiguration.class,
271-
MultipartAutoConfiguration.class })
267+
@Import({ TomcatServletWebServerAutoConfiguration.class, MultipartAutoConfiguration.class })
272268
@EnableConfigurationProperties(MultipartProperties.class)
273269
static class BaseConfiguration {
274270

@@ -279,6 +275,11 @@ ServerProperties serverProperties() {
279275
return properties;
280276
}
281277

278+
@Bean
279+
DispatcherServlet dispatcherServlet() {
280+
return new DispatcherServlet();
281+
}
282+
282283
}
283284

284285
@Configuration(proxyBeanMethods = false)

0 commit comments

Comments
 (0)