Skip to content

Commit d650a98

Browse files
wilkinsonaphilwebb
authored andcommitted
Move MultipartAutoConfigurationTests to main code's module
Issue: 46071
1 parent 06b7aeb commit d650a98

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
@@ -46,7 +46,3 @@ dependencies {
4646

4747
testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5")
4848
}
49-
50-
test {
51-
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
52-
}

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

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

38+
testImplementation(project(":spring-boot-project:spring-boot-jetty"))
3839
testImplementation(project(":spring-boot-project:spring-boot-test"))
40+
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
3941
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
42+
testImplementation(project(":spring-boot-project:spring-boot-undertow"))
43+
testImplementation("org.springframework:spring-webmvc")
4044

4145
testRuntimeOnly("ch.qos.logback:logback-classic")
46+
testRuntimeOnly("org.apache.httpcomponents.client5:httpclient5")
47+
}
48+
49+
tasks.named("test") {
50+
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
4251
}
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)