diff --git a/settings.gradle b/settings.gradle index 7351afd18f..79026270f1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -142,6 +142,7 @@ include "spring-boot-project:spring-boot-tools:spring-boot-test-support-docker" include "spring-boot-project:spring-boot-tx" include "spring-boot-project:spring-boot-undertow" include "spring-boot-project:spring-boot-validation" +include "spring-boot-project:spring-boot-web-server" include "spring-boot-project:spring-boot-webflux" include "spring-boot-project:spring-boot-webmvc" include "spring-boot-project:spring-boot-webservices" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index 34b31aca8c..605bb69af0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -169,7 +169,7 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-hateoas")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation("io.micrometer:micrometer-observation-test") testImplementation("io.opentelemetry:opentelemetry-exporter-common") testImplementation("io.projectreactor:reactor-test") diff --git a/spring-boot-project/spring-boot-all/build.gradle b/spring-boot-project/spring-boot-all/build.gradle index cb35422678..0c5ff16ef5 100644 --- a/spring-boot-project/spring-boot-all/build.gradle +++ b/spring-boot-project/spring-boot-all/build.gradle @@ -74,7 +74,6 @@ dependencies { } testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) testImplementation("com.ibm.db2:jcc") testImplementation("com.sun.xml.messaging.saaj:saaj-impl") testImplementation("io.projectreactor:reactor-test") diff --git a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle index 698fdd1914..15e2e9afb1 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle @@ -158,7 +158,7 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-undertow")) testImplementation(project(":spring-boot-project:spring-boot-mustache")) testImplementation(project(":spring-boot-project:spring-boot-thymeleaf")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) testImplementation("ch.qos.logback:logback-classic") testImplementation("commons-fileupload:commons-fileupload") diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle index 5394b55461..99cf7fb933 100644 --- a/spring-boot-project/spring-boot-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -11,6 +11,7 @@ description = "Spring Boot AutoConfigure" dependencies { api(project(":spring-boot-project:spring-boot")) + api(project(":spring-boot-project:spring-boot-web-server")) optional("com.github.ben-manes.caffeine:caffeine") optional("org.aspectj:aspectjweaver") @@ -18,8 +19,6 @@ dependencies { optional("jakarta.servlet:jakarta.servlet-api") optional("javax.money:money-api") optional("org.springframework:spring-web") - optional("org.springframework:spring-web") - optional("org.springframework:spring-web") optional("org.springframework.data:spring-data-commons") testFixturesCompileOnly(project(":spring-boot-project:spring-boot-test")) @@ -27,11 +26,14 @@ dependencies { testFixturesCompileOnly("javax.cache:cache-api") testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-api") testFixturesCompileOnly("jakarta.websocket:jakarta.websocket-client-api") + testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation("ch.qos.logback:logback-classic") testImplementation("com.fasterxml.jackson.core:jackson-databind") testImplementation("io.projectreactor:reactor-core") diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 99f2dc1fc1..f53d76120a 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -2114,6 +2114,7 @@ bom { "spring-boot-tx", "spring-boot-undertow", "spring-boot-validation", + "spring-boot-web-server", "spring-boot-webflux", "spring-boot-webmvc", "spring-boot-websocket" diff --git a/spring-boot-project/spring-boot-jetty/build.gradle b/spring-boot-project/spring-boot-jetty/build.gradle index 70834ca9f2..ccb3c73075 100644 --- a/spring-boot-project/spring-boot-jetty/build.gradle +++ b/spring-boot-project/spring-boot-jetty/build.gradle @@ -9,7 +9,7 @@ plugins { description = "Spring Boot Jetty" dependencies { - api(project(":spring-boot-project:spring-boot")) + api(project(":spring-boot-project:spring-boot-web-server")) api("org.eclipse.jetty.ee10:jetty-ee10-servlets") api("org.eclipse.jetty.ee10:jetty-ee10-webapp") @@ -23,7 +23,7 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) testImplementation("org.apache.httpcomponents.client5:httpclient5") diff --git a/spring-boot-project/spring-boot-reactor-netty/build.gradle b/spring-boot-project/spring-boot-reactor-netty/build.gradle index 9704b8a618..567d1c9b6d 100644 --- a/spring-boot-project/spring-boot-reactor-netty/build.gradle +++ b/spring-boot-project/spring-boot-reactor-netty/build.gradle @@ -9,7 +9,7 @@ plugins { description = "Spring Boot Reactor Netty" dependencies { - api(project(":spring-boot-project:spring-boot")) + api(project(":spring-boot-project:spring-boot-web-server")) api("io.projectreactor.netty:reactor-netty-http") api("org.springframework:spring-web") @@ -20,7 +20,7 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) testImplementation("io.projectreactor:reactor-test") testImplementation("org.springframework:spring-webflux") diff --git a/spring-boot-project/spring-boot-session-data-mongodb/build.gradle b/spring-boot-project/spring-boot-session-data-mongodb/build.gradle index 727870c551..b930d4bb48 100644 --- a/spring-boot-project/spring-boot-session-data-mongodb/build.gradle +++ b/spring-boot-project/spring-boot-session-data-mongodb/build.gradle @@ -21,7 +21,9 @@ dependencies { dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) + dockerTestImplementation(project(":spring-boot-project:spring-boot-webflux")) dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-session"))) dockerTestImplementation("org.mongodb:mongodb-driver-reactivestreams") dockerTestImplementation("org.mongodb:mongodb-driver-sync") diff --git a/spring-boot-project/spring-boot-session-data-redis/build.gradle b/spring-boot-project/spring-boot-session-data-redis/build.gradle index 8dad8eb350..4bbdbb1cf5 100644 --- a/spring-boot-project/spring-boot-session-data-redis/build.gradle +++ b/spring-boot-project/spring-boot-session-data-redis/build.gradle @@ -21,7 +21,9 @@ dependencies { dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) + dockerTestImplementation(project(":spring-boot-project:spring-boot-webflux")) dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-session"))) dockerTestImplementation("com.redis:testcontainers-redis") dockerTestImplementation("org.testcontainers:junit-jupiter") diff --git a/spring-boot-project/spring-boot-session/build.gradle b/spring-boot-project/spring-boot-session/build.gradle index 0715024f15..641d91f40a 100644 --- a/spring-boot-project/spring-boot-session/build.gradle +++ b/spring-boot-project/spring-boot-session/build.gradle @@ -21,6 +21,7 @@ dependencies { testFixturesImplementation(project(":spring-boot-project:spring-boot-test")) testFixturesImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testFixturesImplementation("io.projectreactor:reactor-core") testImplementation(project(":spring-boot-project:spring-boot-test")) @@ -28,6 +29,7 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation(project(":spring-boot-project:spring-boot-webflux")) testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testRuntimeOnly("ch.qos.logback:logback-classic") } diff --git a/spring-boot-project/spring-boot-test/build.gradle b/spring-boot-project/spring-boot-test/build.gradle index acc46f434a..5bcc4324f9 100644 --- a/spring-boot-project/spring-boot-test/build.gradle +++ b/spring-boot-project/spring-boot-test/build.gradle @@ -12,6 +12,7 @@ dependencies { api(project(":spring-boot-project:spring-boot")) api("org.springframework:spring-test") + optional(project(":spring-boot-project:spring-boot-web-server")) optional("com.fasterxml.jackson.core:jackson-databind") optional("com.google.code.gson:gson") optional("com.jayway.jsonpath:json-path") diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java index 84d9b215b2..4d98fcc962 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTest.java @@ -31,7 +31,6 @@ import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.WebApplicationType; import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; -import org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AliasFor; @@ -155,8 +154,8 @@ public @interface SpringBootTest { RANDOM_PORT(true), /** - * Creates a (reactive) web application context without defining any - * {@code server.port=0} {@link Environment} property. + * Creates a web application context (reactive or servlet based) without defining + * any {@code server.port=0} {@link Environment} property. */ DEFINED_PORT(true), @@ -174,8 +173,8 @@ public @interface SpringBootTest { } /** - * Return if the environment uses an {@link ServletWebServerApplicationContext}. - * @return if an {@link ServletWebServerApplicationContext} is used. + * Return if the environment uses an embedded web server. + * @return if an embedded web server is used */ public boolean isEmbedded() { return this.embedded; diff --git a/spring-boot-project/spring-boot-tomcat/build.gradle b/spring-boot-project/spring-boot-tomcat/build.gradle index 9749ec7283..37f3e02692 100644 --- a/spring-boot-project/spring-boot-tomcat/build.gradle +++ b/spring-boot-project/spring-boot-tomcat/build.gradle @@ -15,7 +15,7 @@ configurations { } dependencies { - api(project(":spring-boot-project:spring-boot")) + api(project(":spring-boot-project:spring-boot-web-server")) api("org.apache.tomcat.embed:tomcat-embed-core") { exclude group: "org.apache.tomcat", module: "tomcat-annotations-api" } @@ -31,7 +31,7 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) testImplementation("org.apache.httpcomponents.client5:httpclient5") diff --git a/spring-boot-project/spring-boot-tx/src/test/java/org/springframework/boot/transaction/autoconfigure/TransactionManagerCustomizationAutoConfigurationTests.java b/spring-boot-project/spring-boot-tx/src/test/java/org/springframework/boot/transaction/autoconfigure/TransactionManagerCustomizationAutoConfigurationTests.java index 717d4ef42e..8176120039 100644 --- a/spring-boot-project/spring-boot-tx/src/test/java/org/springframework/boot/transaction/autoconfigure/TransactionManagerCustomizationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-tx/src/test/java/org/springframework/boot/transaction/autoconfigure/TransactionManagerCustomizationAutoConfigurationTests.java @@ -40,7 +40,7 @@ class TransactionManagerCustomizationAutoConfigurationTests { @Test void autoConfiguresTransactionManagerCustomizers() { - this.contextRunner.run((context) -> { + this.contextRunner.withPropertyValues("spring.transaction.default-timeout=30s").run((context) -> { TransactionManagerCustomizers customizers = context.getBean(TransactionManagerCustomizers.class); assertThat(customizers).extracting("customizers") .asInstanceOf(InstanceOfAssertFactories.LIST) diff --git a/spring-boot-project/spring-boot-undertow/build.gradle b/spring-boot-project/spring-boot-undertow/build.gradle index 8d0828026c..b6bd82808e 100644 --- a/spring-boot-project/spring-boot-undertow/build.gradle +++ b/spring-boot-project/spring-boot-undertow/build.gradle @@ -9,7 +9,7 @@ plugins { description = "Spring Boot Undertow" dependencies { - api(project(":spring-boot-project:spring-boot")) + api(project(":spring-boot-project:spring-boot-web-server")) api("io.undertow:undertow-servlet") optional(project(":spring-boot-project:spring-boot-autoconfigure")) @@ -18,7 +18,7 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) testImplementation("org.apache.httpcomponents.client5:httpclient5") testImplementation("org.apache.tomcat.embed:tomcat-embed-jasper") diff --git a/spring-boot-project/spring-boot-web-server/build.gradle b/spring-boot-project/spring-boot-web-server/build.gradle new file mode 100644 index 0000000000..7feb89d3ad --- /dev/null +++ b/spring-boot-project/spring-boot-web-server/build.gradle @@ -0,0 +1,36 @@ +plugins { + id "java-library" + id "java-test-fixtures" + id "org.springframework.boot.deployed" + id "org.springframework.boot.optional-dependencies" +} + +description = "Spring Boot Web Server" + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api("org.springframework:spring-web") + + optional("io.projectreactor:reactor-core") + optional("jakarta.servlet:jakarta.servlet-api") + optional("org.springframework:spring-test") + + testFixturesCompileOnly(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testFixturesCompileOnly("io.projectreactor:reactor-test") + testFixturesCompileOnly("io.projectreactor.netty:reactor-netty-http") + testFixturesCompileOnly("org.apache.httpcomponents.client5:httpclient5") + testFixturesCompileOnly("org.apache.tomcat.embed:tomcat-embed-jasper") + testFixturesCompileOnly("org.eclipse.jetty.http2:jetty-http2-client") + testFixturesCompileOnly("org.eclipse.jetty.http2:jetty-http2-client-transport") + testFixturesCompileOnly("jakarta.servlet:jakarta.servlet-api") + testFixturesCompileOnly("org.mockito:mockito-core") + testFixturesCompileOnly("org.springframework:spring-tx") + testFixturesCompileOnly("org.springframework:spring-webflux") + + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation("org.apache.tomcat.embed:tomcat-embed-core") + testImplementation("org.springframework:spring-webmvc") + + testRuntimeOnly("ch.qos.logback:logback-classic") +} diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/AbstractConfigurableWebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Compression.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Compression.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Compression.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/ConfigurableWebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Cookie.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Cookie.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Cookie.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Cookie.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownCallback.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/GracefulShutdownCallback.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownCallback.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/GracefulShutdownCallback.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/GracefulShutdownResult.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Http2.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Http2.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Http2.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Http2.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/MimeMappings.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/MimeMappings.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/MimeMappings.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/PortInUseException.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/PortInUseException.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/PortInUseException.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/PortInUseException.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/PortInUseFailureAnalyzer.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Shutdown.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Shutdown.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Shutdown.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Shutdown.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Ssl.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Ssl.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/Ssl.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/Ssl.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServer.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServer.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServer.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServer.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerException.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerException.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerException.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerException.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessor.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessor.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessor.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessor.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerSslBundle.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerSslBundle.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerSslBundle.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/WebServerSslBundle.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/ConfigurableWebServerApplicationContext.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanException.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzer.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/ServerPortInfoApplicationContextInitializer.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerApplicationContext.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerGracefulShutdownLifecycle.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerInitializedEvent.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/WebServerPortFileWriter.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/package-info.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/package-info.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/context/package-info.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/package-info.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/package-info.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/package-info.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/package-info.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/package-info.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/ConfigurableReactiveWebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/ConfigurableReactiveWebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/ConfigurableReactiveWebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/ConfigurableReactiveWebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/ReactiveWebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/ReactiveWebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/ReactiveWebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/ReactiveWebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContext.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironment.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContext.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerInitializedEvent.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerManager.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/WebServerStartStopLifecycle.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/context/package-info.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/package-info.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/package-info.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/reactive/package-info.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/reactive/package-info.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ConfigurableServletWebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ContextPath.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ContextPath.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ContextPath.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ContextPath.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplier.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplier.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplier.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplier.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/DocumentRoot.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/DocumentRoot.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/DocumentRoot.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/DocumentRoot.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/Jsp.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/Jsp.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/Jsp.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/Jsp.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletContextInitializers.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/ServletWebServerSettings.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/Session.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/Session.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/Session.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/Session.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/SessionStoreDirectory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/SessionStoreDirectory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/SessionStoreDirectory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/SessionStoreDirectory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/StaticResourceJars.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/StaticResourceJars.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/StaticResourceJars.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/StaticResourceJars.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistrar.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistry.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistry.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistry.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/WebListenerRegistry.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContext.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentHandler.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentRegisteringPostProcessor.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScan.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrar.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContext.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextFactory.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/ServletWebServerInitializedEvent.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebApplicationContextServletContextAwareProcessor.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebFilterHandler.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebListenerHandler.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebServerStartStopLifecycle.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/WebServletHandler.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContext.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/context/package-info.java diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/package-info.java b/spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/package-info.java similarity index 100% rename from spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/servlet/package-info.java rename to spring-boot-project/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/servlet/package-info.java diff --git a/spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000000..2629b89411 --- /dev/null +++ b/spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring.factories @@ -0,0 +1,13 @@ +# Application Context Factories +org.springframework.boot.ApplicationContextFactory=\ +org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContextFactory,\ +org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContextFactory + +# Application Context Initializers +org.springframework.context.ApplicationContextInitializer=\ +org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer + +# Failure Analyzers +org.springframework.boot.diagnostics.FailureAnalyzer=\ +org.springframework.boot.web.server.PortInUseFailureAnalyzer,\ +org.springframework.boot.web.server.context.MissingWebServerFactoryBeanFailureAnalyzer diff --git a/spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring/aot.factories b/spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring/aot.factories new file mode 100644 index 0000000000..93ff207da2 --- /dev/null +++ b/spring-boot-project/spring-boot-web-server/src/main/resources/META-INF/spring/aot.factories @@ -0,0 +1,2 @@ +org.springframework.aot.hint.RuntimeHintsRegistrar=\ +org.springframework.boot.web.server.MimeMappings$MimeMappingsRuntimeHints diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/CompressionTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/CompressionTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/CompressionTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/CompressionTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/MimeMappingsTests.java diff --git a/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/SpringApplicationWebServerTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/SpringApplicationWebServerTests.java new file mode 100644 index 0000000000..a9721ae2df --- /dev/null +++ b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/SpringApplicationWebServerTests.java @@ -0,0 +1,188 @@ +/* + * Copyright 2012-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.web.server; + +import java.util.Iterator; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.WebApplicationType; +import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; +import org.springframework.boot.testsupport.classpath.resources.WithResource; +import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; +import org.springframework.boot.web.context.reactive.StandardReactiveWebEnvironment; +import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; +import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; +import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; +import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.context.ApplicationListener; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.PropertySource; +import org.springframework.http.server.reactive.HttpHandler; +import org.springframework.test.context.support.TestPropertySourceUtils; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.StandardServletEnvironment; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link SpringApplication} with a {@link WebServer}. + * + * @author Andy wilkinson + */ +class SpringApplicationWebServerTests { + + private String headlessProperty; + + private ConfigurableApplicationContext context; + + @BeforeEach + void storeAndClearHeadlessProperty() { + this.headlessProperty = System.getProperty("java.awt.headless"); + System.clearProperty("java.awt.headless"); + } + + @AfterEach + void reinstateHeadlessProperty() { + if (this.headlessProperty == null) { + System.clearProperty("java.awt.headless"); + } + else { + System.setProperty("java.awt.headless", this.headlessProperty); + } + } + + @AfterEach + void cleanUp() { + if (this.context != null) { + this.context.close(); + } + System.clearProperty("spring.main.banner-mode"); + } + + @Test + void defaultApplicationContextForWeb() { + SpringApplication application = new SpringApplication(ExampleWebConfig.class); + application.setWebApplicationType(WebApplicationType.SERVLET); + this.context = application.run(); + assertThat(this.context).isInstanceOf(AnnotationConfigServletWebServerApplicationContext.class); + } + + @Test + void defaultApplicationContextForReactiveWeb() { + SpringApplication application = new SpringApplication(ExampleReactiveWebConfig.class); + application.setWebApplicationType(WebApplicationType.REACTIVE); + this.context = application.run(); + assertThat(this.context).isInstanceOf(AnnotationConfigReactiveWebServerApplicationContext.class); + } + + @Test + void environmentForWeb() { + SpringApplication application = new SpringApplication(ExampleWebConfig.class); + application.setWebApplicationType(WebApplicationType.SERVLET); + this.context = application.run(); + assertThat(this.context.getEnvironment()).isInstanceOf(StandardServletEnvironment.class); + assertThat(this.context.getEnvironment().getClass().getName()).endsWith("ApplicationServletEnvironment"); + } + + @Test + void environmentForReactiveWeb() { + SpringApplication application = new SpringApplication(ExampleReactiveWebConfig.class); + application.setWebApplicationType(WebApplicationType.REACTIVE); + this.context = application.run(); + assertThat(this.context.getEnvironment()).isInstanceOf(StandardReactiveWebEnvironment.class); + assertThat(this.context.getEnvironment().getClass().getName()).endsWith("ApplicationReactiveWebEnvironment"); + } + + @Test + void webApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() { + ConfigurableApplicationContext context = new SpringApplication(ExampleWebConfig.class) + .run("--spring.main.web-application-type=servlet"); + assertThat(context).isInstanceOf(WebApplicationContext.class); + assertThat(context.getEnvironment()).isInstanceOf(StandardServletEnvironment.class); + assertThat(context.getEnvironment().getClass().getName()).endsWith("ApplicationServletEnvironment"); + } + + @Test + void reactiveApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() { + ConfigurableApplicationContext context = new SpringApplication(ExampleReactiveWebConfig.class) + .run("--spring.main.web-application-type=reactive"); + assertThat(context).isInstanceOf(ReactiveWebApplicationContext.class); + assertThat(context.getEnvironment()).isInstanceOf(StandardReactiveWebEnvironment.class); + assertThat(context.getEnvironment().getClass().getName()).endsWith("ApplicationReactiveWebEnvironment"); + } + + @Test + @WithResource(name = "application-withwebapplicationtype.properties", + content = "spring.main.web-application-type=reactive") + void environmentIsConvertedIfTypeDoesNotMatch() { + ConfigurableApplicationContext context = new SpringApplication(ExampleReactiveWebConfig.class) + .run("--spring.profiles.active=withwebapplicationtype"); + assertThat(context).isInstanceOf(ReactiveWebApplicationContext.class); + assertThat(context.getEnvironment()).isInstanceOf(StandardReactiveWebEnvironment.class); + assertThat(context.getEnvironment().getClass().getName()).endsWith("ApplicationReactiveWebEnvironment"); + } + + @Test + void webApplicationSwitchedOffInListener() { + SpringApplication application = new SpringApplication(ExampleWebConfig.class); + application.addListeners((ApplicationListener) (event) -> { + assertThat(event.getEnvironment().getClass().getName()).endsWith("ApplicationServletEnvironment"); + TestPropertySourceUtils.addInlinedPropertiesToEnvironment(event.getEnvironment(), "foo=bar"); + event.getSpringApplication().setWebApplicationType(WebApplicationType.NONE); + }); + this.context = application.run(); + assertThat(this.context.getEnvironment()).isNotInstanceOf(StandardServletEnvironment.class); + assertThat(this.context.getEnvironment().getProperty("foo")).isEqualTo("bar"); + Iterator> iterator = this.context.getEnvironment().getPropertySources().iterator(); + assertThat(iterator.next().getName()).isEqualTo("configurationProperties"); + assertThat(iterator.next().getName()) + .isEqualTo(TestPropertySourceUtils.INLINED_PROPERTIES_PROPERTY_SOURCE_NAME); + } + + @Configuration(proxyBeanMethods = false) + static class ExampleWebConfig { + + @Bean + MockServletWebServerFactory webServer() { + return new MockServletWebServerFactory(); + } + + } + + @Configuration(proxyBeanMethods = false) + static class ExampleReactiveWebConfig { + + @Bean + MockReactiveWebServerFactory webServerFactory() { + return new MockReactiveWebServerFactory(); + } + + @Bean + HttpHandler httpHandler() { + return (serverHttpRequest, serverHttpResponse) -> Mono.empty(); + } + + } + +} diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerSslBundleTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/MissingWebServerFactoryBeanFailureAnalyzerTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerApplicationContextTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/AnnotationConfigReactiveWebServerApplicationContextTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/ApplicationReactiveWebEnvironmentTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/ReactiveWebServerApplicationContextTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/reactive/context/config/ExampleReactiveWebServerApplicationConfiguration.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplierTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplierTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplierTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/CookieSameSiteSupplierTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/DocumentRootTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/DocumentRootTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/DocumentRootTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/DocumentRootTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/StaticResourceJarsTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/StaticResourceJarsTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/StaticResourceJarsTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/StaticResourceJarsTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/AnnotationConfigServletWebServerApplicationContextTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ApplicationServletEnvironmentTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ApplicationServletEnvironmentTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ApplicationServletEnvironmentTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ApplicationServletEnvironmentTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrarTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrarTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrarTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanRegistrarTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebFilterHandlerTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/WebFilterHandlerTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebFilterHandlerTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/WebFilterHandlerTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebListenerHandlerTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/WebListenerHandlerTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebListenerHandlerTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/WebListenerHandlerTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebServletHandlerTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/WebServletHandlerTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/WebServletHandlerTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/WebServletHandlerTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContextTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContextTests.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/XmlServletWebServerApplicationContextTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/config/ExampleServletWebServerApplicationConfiguration.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/filter/TestFilter.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/filter/TestFilter.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/filter/TestFilter.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/filter/TestFilter.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/listener/TestListener.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/listener/TestListener.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/listener/TestListener.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/listener/TestListener.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestMultipartServlet.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestMultipartServlet.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestMultipartServlet.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestMultipartServlet.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestServlet.java b/spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestServlet.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestServlet.java rename to spring-boot-project/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/testcomponents/servlet/TestServlet.java diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs1/dsa.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs1/dsa.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs1/dsa.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs1/dsa.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs1/rsa-aes-256-cbc.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs1/rsa-aes-256-cbc.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs1/rsa-aes-256-cbc.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs1/rsa-aes-256-cbc.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs1/rsa.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs1/rsa.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs1/rsa.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs1/rsa.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP256r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP256r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP256r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP256r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP256t1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP256t1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP256t1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP256t1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP320r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP320r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP320r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP320r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP320t1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP320t1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP320t1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP320t1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP384r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP384r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP384r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP384r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP384t1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP384t1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP384t1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP384t1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP512r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP512r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP512r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP512r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP512t1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP512t1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP512t1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/brainpoolP512t1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/dsa-aes-128-cbc.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/dsa-aes-128-cbc.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/dsa-aes-128-cbc.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/dsa-aes-128-cbc.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/dsa.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/dsa.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/dsa.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/dsa.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/ed25519-aes-256-cbc.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/ed25519-aes-256-cbc.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/ed25519-aes-256-cbc.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/ed25519-aes-256-cbc.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/ed25519.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/ed25519.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/ed25519.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/ed25519.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/ed448.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/ed448.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/ed448.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/ed448.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/prime256v1-aes-256-cbc.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/prime256v1-aes-256-cbc.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/prime256v1-aes-256-cbc.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/prime256v1-aes-256-cbc.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/prime256v1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/prime256v1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/prime256v1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/prime256v1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-aes-256-cbc.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-aes-256-cbc.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-aes-256-cbc.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-aes-256-cbc.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-des-ede3-cbc.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-des-ede3-cbc.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-des-ede3-cbc.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-des-ede3-cbc.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-pss.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-pss.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-pss.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-pss.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-scrypt.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-scrypt.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-scrypt.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa-scrypt.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/rsa.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp224r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp224r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp224r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp224r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp256k1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp256k1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp256k1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp256k1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp256r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp256r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp256r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp256r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp384r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp384r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp384r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp384r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp521r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp521r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/secp521r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/secp521r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/x25519.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/x25519.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/x25519.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/x25519.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/x448-aes-256-cbc.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/x448-aes-256-cbc.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/x448-aes-256-cbc.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/x448-aes-256-cbc.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/x448.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/x448.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/pkcs8/x448.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/pkcs8/x448.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP256r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP256r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP256r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP256r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP256t1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP256t1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP256t1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP256t1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP320r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP320r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP320r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP320r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP320t1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP320t1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP320t1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP320t1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP384r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP384r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP384r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP384r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP384t1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP384t1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP384t1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP384t1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP512r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP512r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP512r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP512r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP512t1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP512t1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP512t1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/brainpoolP512t1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/prime256v1-aes-128-cbc.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/prime256v1-aes-128-cbc.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/prime256v1-aes-128-cbc.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/prime256v1-aes-128-cbc.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/prime256v1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/prime256v1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/prime256v1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/prime256v1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp224r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp224r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp224r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp224r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp256k1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp256k1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp256k1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp256k1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp256r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp256r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp256r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp256r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp384r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp384r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp384r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp384r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp521r1.key b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp521r1.key similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/sec1/secp521r1.key rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/sec1/secp521r1.key diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/servlet/context/exampleEmbeddedWebApplicationConfiguration.xml b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/servlet/context/exampleEmbeddedWebApplicationConfiguration.xml similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/servlet/context/exampleEmbeddedWebApplicationConfiguration.xml rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/servlet/context/exampleEmbeddedWebApplicationConfiguration.xml diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test-cert-chain.pem b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test-cert-chain.pem similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test-cert-chain.pem rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test-cert-chain.pem diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test-cert.pem b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test-cert.pem similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test-cert.pem rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test-cert.pem diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test-key.pem b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test-key.pem similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test-key.pem rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test-key.pem diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test.jks b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test.jks similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test.jks rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test.jks diff --git a/spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test.p12 b/spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test.p12 similarity index 100% rename from spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/web/server/test.p12 rename to spring-boot-project/spring-boot-web-server/src/test/resources/org/springframework/boot/web/server/test.p12 diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactoryTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactoryTests.java rename to spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/reactive/AbstractReactiveWebServerFactoryTests.java diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/reactive/MockReactiveWebServer.java b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/reactive/MockReactiveWebServer.java similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/reactive/MockReactiveWebServer.java rename to spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/reactive/MockReactiveWebServer.java diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/reactive/MockReactiveWebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/reactive/MockReactiveWebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/reactive/MockReactiveWebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/reactive/MockReactiveWebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerFactoryTests.java b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerFactoryTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerFactoryTests.java rename to spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerFactoryTests.java diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerServletContextListenerTests.java b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerServletContextListenerTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerServletContextListenerTests.java rename to spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/servlet/AbstractServletWebServerServletContextListenerTests.java diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServer.java b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServer.java similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServer.java rename to spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServer.java diff --git a/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServerFactory.java b/spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServerFactory.java similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServerFactory.java rename to spring-boot-project/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/servlet/MockServletWebServerFactory.java diff --git a/spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test-cert.pem b/spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test-cert.pem similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test-cert.pem rename to spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test-cert.pem diff --git a/spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test-key.pem b/spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test-key.pem similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test-key.pem rename to spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test-key.pem diff --git a/spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test.jks b/spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test.jks similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test.jks rename to spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test.jks diff --git a/spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test.p12 b/spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test.p12 similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test.p12 rename to spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/reactive/test.p12 diff --git a/spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test-cert.pem b/spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test-cert.pem similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test-cert.pem rename to spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test-cert.pem diff --git a/spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test-key.pem b/spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test-key.pem similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test-key.pem rename to spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test-key.pem diff --git a/spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test.jks b/spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test.jks similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test.jks rename to spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test.jks diff --git a/spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test.p12 b/spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test.p12 similarity index 100% rename from spring-boot-project/spring-boot/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test.p12 rename to spring-boot-project/spring-boot-web-server/src/testFixtures/resources/org/springframework/boot/web/server/servlet/test.p12 diff --git a/spring-boot-project/spring-boot-webflux/build.gradle b/spring-boot-project/spring-boot-webflux/build.gradle index 8f973c3598..2b9110f568 100644 --- a/spring-boot-project/spring-boot-webflux/build.gradle +++ b/spring-boot-project/spring-boot-webflux/build.gradle @@ -13,6 +13,7 @@ dependencies { api("org.springframework:spring-webflux") implementation(project(":spring-boot-project:spring-boot-http-codec")) + implementation(project(":spring-boot-project:spring-boot-web-server")) optional(project(":spring-boot-project:spring-boot-autoconfigure")) optional(project(":spring-boot-project:spring-boot-validation")) @@ -21,7 +22,7 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-reactor-netty")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation("org.aspectj:aspectjweaver") testRuntimeOnly("ch.qos.logback:logback-classic") diff --git a/spring-boot-project/spring-boot-webmvc/build.gradle b/spring-boot-project/spring-boot-webmvc/build.gradle index 0c94e5d14f..191fc3bf60 100644 --- a/spring-boot-project/spring-boot-webmvc/build.gradle +++ b/spring-boot-project/spring-boot-webmvc/build.gradle @@ -24,7 +24,7 @@ dependencies { 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(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation("jakarta.servlet:jakarta.servlet-api") testImplementation("org.aspectj:aspectjweaver") diff --git a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/BasicErrorController.java b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/BasicErrorController.java index 1baa3c9f8e..65898f38ca 100644 --- a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/BasicErrorController.java +++ b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/BasicErrorController.java @@ -26,7 +26,7 @@ import jakarta.servlet.http.HttpServletResponse; import org.springframework.boot.autoconfigure.web.ErrorProperties; import org.springframework.boot.web.error.ErrorAttributeOptions; import org.springframework.boot.web.error.ErrorAttributeOptions.Include; -import org.springframework.boot.web.server.servlet.ConfigurableServletWebServerFactory; +import org.springframework.boot.web.error.ErrorPageRegistrar; import org.springframework.boot.webmvc.error.ErrorAttributes; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -41,8 +41,9 @@ import org.springframework.web.servlet.ModelAndView; /** * Basic global error {@link Controller @Controller}, rendering {@link ErrorAttributes}. * More specific errors can be handled either using Spring MVC abstractions (e.g. - * {@code @ExceptionHandler}) or by adding servlet - * {@link ConfigurableServletWebServerFactory#setErrorPages server error pages}. + * {@code @ExceptionHandler}) or by + * {@link ErrorPageRegistrar#registerErrorPages(org.springframework.boot.web.error.ErrorPageRegistry) + * registering error pages}. * * @author Dave Syer * @author Phillip Webb diff --git a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java index e13b4c1ca0..b3e5802e86 100644 --- a/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-webmvc/src/main/java/org/springframework/boot/webmvc/autoconfigure/error/ErrorMvcAutoConfiguration.java @@ -51,7 +51,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.web.error.ErrorPage; import org.springframework.boot.web.error.ErrorPageRegistrar; import org.springframework.boot.web.error.ErrorPageRegistry; -import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath; import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration; import org.springframework.boot.webmvc.autoconfigure.WebMvcProperties; @@ -253,7 +252,7 @@ public class ErrorMvcAutoConfiguration { } /** - * {@link WebServerFactoryCustomizer} that configures the server's error pages. + * {@link ErrorPageRegistrar} that configures the server's error pages. */ static class ErrorPageCustomizer implements ErrorPageRegistrar, Ordered { diff --git a/spring-boot-project/spring-boot/build.gradle b/spring-boot-project/spring-boot/build.gradle index e6b7c81d1f..1c3a316616 100644 --- a/spring-boot-project/spring-boot/build.gradle +++ b/spring-boot-project/spring-boot/build.gradle @@ -38,16 +38,6 @@ dependencies { optional("org.yaml:snakeyaml") testFixturesCompileOnly(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testFixturesCompileOnly("io.projectreactor:reactor-test") - testFixturesCompileOnly("io.projectreactor.netty:reactor-netty-http") - testFixturesCompileOnly("org.apache.httpcomponents.client5:httpclient5") - testFixturesCompileOnly("org.apache.tomcat.embed:tomcat-embed-jasper") - testFixturesCompileOnly("org.eclipse.jetty.http2:jetty-http2-client") - testFixturesCompileOnly("org.eclipse.jetty.http2:jetty-http2-client-transport") - testFixturesCompileOnly("jakarta.servlet:jakarta.servlet-api") - testFixturesCompileOnly("org.mockito:mockito-core") - testFixturesCompileOnly("org.springframework:spring-tx") - testFixturesCompileOnly("org.springframework:spring-web") testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation("io.projectreactor:reactor-test") diff --git a/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories index 9e442ab7a0..d2e42f9273 100644 --- a/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot/src/main/resources/META-INF/spring.factories @@ -21,11 +21,6 @@ org.springframework.boot.context.config.ConfigTreeConfigDataLoader,\ org.springframework.boot.context.config.StandardConfigDataLoader,\ org.springframework.boot.context.config.SystemEnvironmentConfigDataLoader -# Application Context Factories -org.springframework.boot.ApplicationContextFactory=\ -org.springframework.boot.web.server.reactive.context.ReactiveWebServerApplicationContextFactory,\ -org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContextFactory - # Run Listeners org.springframework.boot.SpringApplicationRunListener=\ org.springframework.boot.context.event.EventPublishingRunListener @@ -38,8 +33,7 @@ org.springframework.boot.diagnostics.FailureAnalyzers org.springframework.context.ApplicationContextInitializer=\ org.springframework.boot.context.ConfigurationWarningsApplicationContextInitializer,\ org.springframework.boot.context.ContextIdApplicationContextInitializer,\ -org.springframework.boot.io.ProtocolResolverApplicationContextInitializer,\ -org.springframework.boot.web.server.context.ServerPortInfoApplicationContextInitializer +org.springframework.boot.io.ProtocolResolverApplicationContextInitializer # Application Listeners org.springframework.context.ApplicationListener=\ @@ -77,9 +71,7 @@ org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzer,\ org.springframework.boot.diagnostics.analyzer.NoUniqueBeanDefinitionFailureAnalyzer,\ org.springframework.boot.diagnostics.analyzer.PatternParseFailureAnalyzer,\ org.springframework.boot.diagnostics.analyzer.UnboundConfigurationPropertyFailureAnalyzer,\ -org.springframework.boot.diagnostics.analyzer.ValidationExceptionFailureAnalyzer,\ -org.springframework.boot.web.server.PortInUseFailureAnalyzer,\ -org.springframework.boot.web.server.context.MissingWebServerFactoryBeanFailureAnalyzer +org.springframework.boot.diagnostics.analyzer.ValidationExceptionFailureAnalyzer # Failure Analysis Reporters org.springframework.boot.diagnostics.FailureAnalysisReporter=\ diff --git a/spring-boot-project/spring-boot/src/main/resources/META-INF/spring/aot.factories b/spring-boot-project/spring-boot/src/main/resources/META-INF/spring/aot.factories index 9685b80543..a39a187175 100644 --- a/spring-boot-project/spring-boot/src/main/resources/META-INF/spring/aot.factories +++ b/spring-boot-project/spring-boot/src/main/resources/META-INF/spring/aot.factories @@ -11,8 +11,7 @@ org.springframework.boot.logging.java.JavaLoggingSystemRuntimeHints,\ org.springframework.boot.logging.logback.LogbackRuntimeHints,\ org.springframework.boot.logging.structured.ElasticCommonSchemaProperties$ElasticCommonSchemaPropertiesRuntimeHints,\ org.springframework.boot.logging.structured.GraylogExtendedLogFormatProperties$GraylogExtendedLogFormatPropertiesRuntimeHints,\ -org.springframework.boot.logging.structured.StructuredLoggingJsonProperties$StructuredLoggingJsonPropertiesRuntimeHints,\ -org.springframework.boot.web.server.MimeMappings$MimeMappingsRuntimeHints +org.springframework.boot.logging.structured.StructuredLoggingJsonProperties$StructuredLoggingJsonPropertiesRuntimeHints org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=\ org.springframework.boot.context.properties.ConfigurationPropertiesBeanFactoryInitializationAotProcessor,\ diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index 2a3e176afc..e3529d4022 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -20,7 +20,6 @@ import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -41,7 +40,6 @@ import org.mockito.ArgumentMatcher; import org.mockito.ArgumentMatchers; import org.mockito.InOrder; import org.mockito.Mockito; -import reactor.core.publisher.Mono; import org.springframework.aot.AotDetector; import org.springframework.beans.factory.BeanCreationException; @@ -50,6 +48,7 @@ import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.UnsatisfiedDependencyException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.support.BeanDefinitionOverrideException; import org.springframework.beans.factory.support.BeanDefinitionRegistry; @@ -77,11 +76,6 @@ import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.testsupport.system.CapturedOutput; import org.springframework.boot.testsupport.system.OutputCaptureExtension; import org.springframework.boot.web.context.reactive.ReactiveWebApplicationContext; -import org.springframework.boot.web.context.reactive.StandardReactiveWebEnvironment; -import org.springframework.boot.web.server.reactive.MockReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; -import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextException; @@ -117,16 +111,13 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.core.metrics.ApplicationStartup; import org.springframework.core.metrics.StartupStep; -import org.springframework.http.server.reactive.HttpHandler; import org.springframework.mock.env.MockEnvironment; -import org.springframework.test.context.support.TestPropertySourceUtils; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.util.StringUtils; import org.springframework.web.context.ConfigurableWebEnvironment; import org.springframework.web.context.WebApplicationContext; -import org.springframework.web.context.support.StandardServletEnvironment; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -430,40 +421,6 @@ class SpringApplicationTests { assertThat(this.context).isInstanceOf(AnnotationConfigApplicationContext.class); } - @Test - void defaultApplicationContextForWeb() { - SpringApplication application = new SpringApplication(ExampleWebConfig.class); - application.setWebApplicationType(WebApplicationType.SERVLET); - this.context = application.run(); - assertThat(this.context).isInstanceOf(AnnotationConfigServletWebServerApplicationContext.class); - } - - @Test - void defaultApplicationContextForReactiveWeb() { - SpringApplication application = new SpringApplication(ExampleReactiveWebConfig.class); - application.setWebApplicationType(WebApplicationType.REACTIVE); - this.context = application.run(); - assertThat(this.context).isInstanceOf(AnnotationConfigReactiveWebServerApplicationContext.class); - } - - @Test - void environmentForWeb() { - SpringApplication application = new SpringApplication(ExampleWebConfig.class); - application.setWebApplicationType(WebApplicationType.SERVLET); - this.context = application.run(); - assertThat(this.context.getEnvironment()).isInstanceOf(StandardServletEnvironment.class); - assertThat(this.context.getEnvironment().getClass().getName()).endsWith("ApplicationServletEnvironment"); - } - - @Test - void environmentForReactiveWeb() { - SpringApplication application = new SpringApplication(ExampleReactiveWebConfig.class); - application.setWebApplicationType(WebApplicationType.REACTIVE); - this.context = application.run(); - assertThat(this.context.getEnvironment()).isInstanceOf(StandardReactiveWebEnvironment.class); - assertThat(this.context.getEnvironment().getClass().getName()).endsWith("ApplicationReactiveWebEnvironment"); - } - @Test void customEnvironment() { TestSpringApplication application = new TestSpringApplication(ExampleConfig.class); @@ -487,26 +444,14 @@ class SpringApplicationTests { @Test void customResourceLoaderFromConstructor() { ResourceLoader resourceLoader = new DefaultResourceLoader(); - TestSpringApplication application = new TestSpringApplication(resourceLoader, ExampleWebConfig.class); + TestSpringApplication application = new TestSpringApplication(resourceLoader, ExampleConfig.class); this.context = application.run(); then(application.getLoader()).should().setResourceLoader(resourceLoader); } @Test void customBeanNameGenerator() { - TestSpringApplication application = new TestSpringApplication(ExampleWebConfig.class); - BeanNameGenerator beanNameGenerator = new DefaultBeanNameGenerator(); - application.setBeanNameGenerator(beanNameGenerator); - this.context = application.run(); - then(application.getLoader()).should().setBeanNameGenerator(beanNameGenerator); - Object actualGenerator = this.context.getBean(AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR); - assertThat(actualGenerator).isSameAs(beanNameGenerator); - } - - @Test - void customBeanNameGeneratorWithNonWebApplication() { - TestSpringApplication application = new TestSpringApplication(ExampleWebConfig.class); - application.setWebApplicationType(WebApplicationType.NONE); + TestSpringApplication application = new TestSpringApplication(ExampleConfig.class); BeanNameGenerator beanNameGenerator = new DefaultBeanNameGenerator(); application.setBeanNameGenerator(beanNameGenerator); this.context = application.run(); @@ -838,13 +783,13 @@ class SpringApplicationTests { @Test void run() { - this.context = SpringApplication.run(ExampleWebConfig.class); + this.context = SpringApplication.run(ExampleConfig.class); assertThat(this.context).isNotNull(); } @Test void runComponents() { - this.context = SpringApplication.run(new Class[] { ExampleWebConfig.class, Object.class }, new String[0]); + this.context = SpringApplication.run(new Class[] { ExampleConfig.class, Object.class }, new String[0]); assertThat(this.context).isNotNull(); } @@ -1024,7 +969,7 @@ class SpringApplicationTests { @Test void applicationListenerFromApplicationIsCalledWhenContextFailsRefreshBeforeListenerRegistration() { ApplicationListener listener = mock(ApplicationListener.class); - SpringApplication application = new SpringApplication(ExampleConfig.class); + SpringApplication application = new SpringApplication(BrokenBeanFactoryPostProcessing.class); application.addListeners(listener); assertThatExceptionOfType(ApplicationContextException.class).isThrownBy(application::run); verifyRegisteredListenerFailedFromApplicationEvents(listener); @@ -1055,7 +1000,7 @@ class SpringApplicationTests { @Test void applicationListenerFromContextIsCalledWhenContextFailsRefreshBeforeListenerRegistration() { final ApplicationListener listener = mock(ApplicationListener.class); - SpringApplication application = new SpringApplication(ExampleConfig.class); + SpringApplication application = new SpringApplication(BrokenBeanFactoryPostProcessing.class); application.addInitializers((applicationContext) -> applicationContext.addApplicationListener(listener)); assertThatExceptionOfType(ApplicationContextException.class).isThrownBy(application::run); then(listener).should().onApplicationEvent(isA(ApplicationFailedEvent.class)); @@ -1110,23 +1055,6 @@ class SpringApplicationTests { assertThat(args.containsOption("debug")).isTrue(); } - @Test - void webApplicationSwitchedOffInListener() { - TestSpringApplication application = new TestSpringApplication(ExampleConfig.class); - application.addListeners((ApplicationListener) (event) -> { - assertThat(event.getEnvironment().getClass().getName()).endsWith("ApplicationServletEnvironment"); - TestPropertySourceUtils.addInlinedPropertiesToEnvironment(event.getEnvironment(), "foo=bar"); - event.getSpringApplication().setWebApplicationType(WebApplicationType.NONE); - }); - this.context = application.run(); - assertThat(this.context.getEnvironment()).isNotInstanceOf(StandardServletEnvironment.class); - assertThat(this.context.getEnvironment().getProperty("foo")).isEqualTo("bar"); - Iterator> iterator = this.context.getEnvironment().getPropertySources().iterator(); - assertThat(iterator.next().getName()).isEqualTo("configurationProperties"); - assertThat(iterator.next().getName()) - .isEqualTo(TestPropertySourceUtils.INLINED_PROPERTIES_PROPERTY_SOURCE_NAME); - } - @Test void nonWebApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() { ConfigurableApplicationContext context = new SpringApplication(ExampleConfig.class) @@ -1135,35 +1063,6 @@ class SpringApplicationTests { assertThat(context.getEnvironment()).isNotInstanceOfAny(ConfigurableWebEnvironment.class); } - @Test - void webApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() { - ConfigurableApplicationContext context = new SpringApplication(ExampleWebConfig.class) - .run("--spring.main.web-application-type=servlet"); - assertThat(context).isInstanceOf(WebApplicationContext.class); - assertThat(context.getEnvironment()).isInstanceOf(StandardServletEnvironment.class); - assertThat(context.getEnvironment().getClass().getName()).endsWith("ApplicationServletEnvironment"); - } - - @Test - void reactiveApplicationConfiguredViaAPropertyHasTheCorrectTypeOfContextAndEnvironment() { - ConfigurableApplicationContext context = new SpringApplication(ExampleReactiveWebConfig.class) - .run("--spring.main.web-application-type=reactive"); - assertThat(context).isInstanceOf(ReactiveWebApplicationContext.class); - assertThat(context.getEnvironment()).isInstanceOf(StandardReactiveWebEnvironment.class); - assertThat(context.getEnvironment().getClass().getName()).endsWith("ApplicationReactiveWebEnvironment"); - } - - @Test - @WithResource(name = "application-withwebapplicationtype.yml", - content = "spring.main.web-application-type: reactive") - void environmentIsConvertedIfTypeDoesNotMatch() { - ConfigurableApplicationContext context = new SpringApplication(ExampleReactiveWebConfig.class) - .run("--spring.profiles.active=withwebapplicationtype"); - assertThat(context).isInstanceOf(ReactiveWebApplicationContext.class); - assertThat(context.getEnvironment()).isInstanceOf(StandardReactiveWebEnvironment.class); - assertThat(context.getEnvironment().getClass().getName()).endsWith("ApplicationReactiveWebEnvironment"); - } - @Test void failureResultsInSingleStackTrace(CapturedOutput output) throws Exception { ThreadGroup group = new ThreadGroup("main"); @@ -1715,6 +1614,18 @@ class SpringApplicationTests { } + @Configuration(proxyBeanMethods = false) + static class BrokenBeanFactoryPostProcessing { + + @Bean + static BeanFactoryPostProcessor brokenBeanFactoryPostProcessor() { + return (beanFactory) -> { + throw new ApplicationContextException("broken"); + }; + } + + } + @Configuration(proxyBeanMethods = false) static class ListenerConfig { @@ -1735,31 +1646,6 @@ class SpringApplicationTests { } - @Configuration(proxyBeanMethods = false) - static class ExampleWebConfig { - - @Bean - MockServletWebServerFactory webServer() { - return new MockServletWebServerFactory(); - } - - } - - @Configuration(proxyBeanMethods = false) - static class ExampleReactiveWebConfig { - - @Bean - MockReactiveWebServerFactory webServerFactory() { - return new MockReactiveWebServerFactory(); - } - - @Bean - HttpHandler httpHandler() { - return (serverHttpRequest, serverHttpResponse) -> Mono.empty(); - } - - } - @Configuration(proxyBeanMethods = false) static class FailingConfig { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java index f86f3ca78b..f48b354512 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java @@ -274,7 +274,7 @@ class SpringApplicationBuilderTests { SpringApplicationBuilder application = new SpringApplicationBuilder(ExampleConfig.class) .web(WebApplicationType.NONE); this.context = application.run(); - assertThat(application.application().getInitializers()).hasSize(4); + assertThat(application.application().getInitializers()).hasSize(3); } @Test @@ -283,7 +283,7 @@ class SpringApplicationBuilderTests { .child(ChildConfig.class) .web(WebApplicationType.NONE); this.context = application.run(); - assertThat(application.application().getInitializers()).hasSize(5); + assertThat(application.application().getInitializers()).hasSize(4); } @Test @@ -293,7 +293,7 @@ class SpringApplicationBuilderTests { .initializers((ConfigurableApplicationContext applicationContext) -> { }); this.context = application.run(); - assertThat(application.application().getInitializers()).hasSize(5); + assertThat(application.application().getInitializers()).hasSize(4); } @Test diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersIntegrationTests.java index 014fc66607..61fca865a2 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersIntegrationTests.java @@ -24,8 +24,8 @@ import org.springframework.boot.WebApplicationType; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.testsupport.system.CapturedOutput; import org.springframework.boot.testsupport.system.OutputCaptureExtension; -import org.springframework.boot.web.server.PortInUseException; import org.springframework.context.annotation.Configuration; +import org.springframework.web.util.pattern.PathPatternParser; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatException; @@ -50,7 +50,7 @@ class FailureAnalyzersIntegrationTests { @PostConstruct void fail() { - throw new PortInUseException(8080); + new PathPatternParser().parse("{ }"); } } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java index 4ff6e4648e..0c11f9e180 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationIntegrationTests.java @@ -16,17 +16,26 @@ package org.springframework.boot.web.servlet; +import java.util.Collections; + import jakarta.servlet.Filter; +import jakarta.servlet.FilterRegistration.Dynamic; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; -import org.springframework.boot.web.server.servlet.context.AnnotationConfigServletWebServerApplicationContext; +import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext; +import org.springframework.boot.web.context.servlet.WebApplicationContextInitializer; import org.springframework.boot.web.servlet.mock.MockFilter; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.BDDMockito.given; +import static org.mockito.BDDMockito.then; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; /** * Integration tests for {@link Filter} registration. @@ -35,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat; */ class FilterRegistrationIntegrationTests { - private AnnotationConfigServletWebServerApplicationContext context; + private AnnotationConfigServletWebApplicationContext context; @AfterEach void cleanUp() { @@ -47,28 +56,31 @@ class FilterRegistrationIntegrationTests { @Test void normalFiltersAreRegistered() { load(FilterConfiguration.class); - assertThat(this.context.getServletContext().getFilterRegistrations()).hasSize(1); + then(this.context.getServletContext()).should() + .addFilter("myFilter", this.context.getBean("myFilter", MockFilter.class)); } @Test void scopedTargetFiltersAreNotRegistered() { load(ScopedTargetFilterConfiguration.class); - assertThat(this.context.getServletContext().getFilterRegistrations()).isEmpty(); + then(this.context.getServletContext()).should(times(0)).addFilter(any(String.class), any(Filter.class)); } private void load(Class configuration) { - this.context = new AnnotationConfigServletWebServerApplicationContext(ContainerConfiguration.class, - configuration); - } - - @Configuration(proxyBeanMethods = false) - static class ContainerConfiguration { - - @Bean - MockServletWebServerFactory webServerFactory() { - return new MockServletWebServerFactory(); + ServletContext servletContext = mock(ServletContext.class); + given(servletContext.addFilter(any(), any(Filter.class))).willReturn(mock(Dynamic.class)); + given(servletContext.getInitParameterNames()).willReturn(Collections.emptyEnumeration()); + given(servletContext.getAttributeNames()).willReturn(Collections.emptyEnumeration()); + this.context = new AnnotationConfigServletWebApplicationContext(); + this.context.setServletContext(servletContext); + this.context.register(configuration); + this.context.refresh(); + try { + new WebApplicationContextInitializer(this.context).initialize(servletContext); + } + catch (ServletException ex) { + throw new RuntimeException(ex); } - } @Configuration(proxyBeanMethods = false) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java index 35c98ff335..c220d8db1b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java @@ -21,7 +21,6 @@ import java.util.EnumSet; import java.util.Map; import java.util.Vector; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicReference; import jakarta.servlet.DispatcherType; import jakarta.servlet.Filter; @@ -41,13 +40,9 @@ import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEven import org.springframework.boot.context.logging.LoggingApplicationListener; import org.springframework.boot.testsupport.system.CapturedOutput; import org.springframework.boot.testsupport.system.OutputCaptureExtension; -import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.servlet.MockServletWebServerFactory; -import org.springframework.boot.web.server.servlet.ServletWebServerFactory; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.ApplicationListener; import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.core.Ordered; @@ -127,65 +122,44 @@ class SpringBootServletInitializerTests { @Test void errorPageFilterRegistrationCanBeDisabled() { - AtomicReference> errorPageFilterBeans = new AtomicReference<>(); - WebServer webServer = new MockServletWebServerFactory().getWebServer((servletContext) -> { - try (AbstractApplicationContext context = (AbstractApplicationContext) new WithErrorPageFilterNotRegistered() - .createRootApplicationContext(servletContext)) { - errorPageFilterBeans.set(context.getBeansOfType(ErrorPageFilter.class)); - } - }); - try { - webServer.start(); - assertThat(errorPageFilterBeans.get()).isEmpty(); - } - finally { - webServer.stop(); + try (AbstractApplicationContext context = (AbstractApplicationContext) new WithErrorPageFilterNotRegistered() + .createRootApplicationContext(this.servletContext)) { + Map errorPageFilterBeans = context.getBeansOfType(ErrorPageFilter.class); + assertThat(errorPageFilterBeans).isEmpty(); } } @Test @SuppressWarnings("rawtypes") void errorPageFilterIsRegisteredWithNearHighestPrecedence() { - AtomicReference> registrationsReference = new AtomicReference<>(); - WebServer webServer = new MockServletWebServerFactory().getWebServer((servletContext) -> { - try (AbstractApplicationContext context = (AbstractApplicationContext) new WithErrorPageFilter() - .createRootApplicationContext(servletContext)) { - registrationsReference.set(context.getBeansOfType(FilterRegistrationBean.class)); - } - }); - try { - webServer.start(); - Map registrations = registrationsReference.get(); + ServletContext servletContext = mock(ServletContext.class); + given(servletContext.addFilter(any(), any(Filter.class))).willReturn(mock(Dynamic.class)); + given(servletContext.getInitParameterNames()).willReturn(Collections.emptyEnumeration()); + given(servletContext.getAttributeNames()).willReturn(Collections.emptyEnumeration()); + try (AbstractApplicationContext context = (AbstractApplicationContext) new WithErrorPageFilter() + .createRootApplicationContext(servletContext)) { + Map registrations = context.getBeansOfType(FilterRegistrationBean.class); assertThat(registrations).hasSize(1); FilterRegistrationBean errorPageFilterRegistration = registrations.get("errorPageFilterRegistration"); assertThat(errorPageFilterRegistration.getOrder()).isEqualTo(Ordered.HIGHEST_PRECEDENCE + 1); } - finally { - webServer.stop(); - } } @Test @SuppressWarnings("rawtypes") void errorPageFilterIsRegisteredForRequestAndAsyncDispatch() { - AtomicReference> registrationsReference = new AtomicReference<>(); - WebServer webServer = new MockServletWebServerFactory().getWebServer((servletContext) -> { - try (AbstractApplicationContext context = (AbstractApplicationContext) new WithErrorPageFilter() - .createRootApplicationContext(servletContext)) { - registrationsReference.set(context.getBeansOfType(FilterRegistrationBean.class)); - } - }); - try { - webServer.start(); - Map registrations = registrationsReference.get(); + ServletContext servletContext = mock(ServletContext.class); + given(servletContext.addFilter(any(), any(Filter.class))).willReturn(mock(Dynamic.class)); + given(servletContext.getInitParameterNames()).willReturn(Collections.emptyEnumeration()); + given(servletContext.getAttributeNames()).willReturn(Collections.emptyEnumeration()); + try (AbstractApplicationContext context = (AbstractApplicationContext) new WithErrorPageFilter() + .createRootApplicationContext(servletContext)) { + Map registrations = context.getBeansOfType(FilterRegistrationBean.class); assertThat(registrations).hasSize(1); FilterRegistrationBean errorPageFilterRegistration = registrations.get("errorPageFilterRegistration"); assertThat(errorPageFilterRegistration).hasFieldOrPropertyWithValue("dispatcherTypes", EnumSet.of(DispatcherType.ASYNC, DispatcherType.REQUEST)); } - finally { - webServer.stop(); - } } @Test @@ -332,11 +306,6 @@ class SpringBootServletInitializerTests { @Configuration(proxyBeanMethods = false) static class ExecutableWar extends SpringBootServletInitializer { - @Bean - ServletWebServerFactory webServerFactory() { - return new MockServletWebServerFactory(); - } - } @Configuration(proxyBeanMethods = false) diff --git a/spring-boot-project/spring-boot/src/test/kotlin/org/springframework/boot/SpringApplicationExtensionsTests.kt b/spring-boot-project/spring-boot/src/test/kotlin/org/springframework/boot/SpringApplicationExtensionsTests.kt index 91515ed720..0f98b13499 100644 --- a/spring-boot-project/spring-boot/src/test/kotlin/org/springframework/boot/SpringApplicationExtensionsTests.kt +++ b/spring-boot-project/spring-boot/src/test/kotlin/org/springframework/boot/SpringApplicationExtensionsTests.kt @@ -21,8 +21,6 @@ import org.junit.jupiter.api.Test import org.springframework.beans.factory.getBean import org.springframework.boot.kotlinsample.TestKotlinApplication -import org.springframework.boot.web.servlet.mock.MockFilter -import org.springframework.boot.web.server.servlet.MockServletWebServerFactory import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.core.env.StandardEnvironment @@ -36,14 +34,14 @@ class SpringApplicationExtensionsTests { @Test fun `Kotlin runApplication() top level function`() { - val context = runApplication() + val context = runApplication() assertThat(context).isNotNull() } @Test fun `Kotlin runApplication() top level function with a custom environment`() { val environment = StandardEnvironment() - val context = runApplication { + val context = runApplication { setEnvironment(environment) } assertThat(context).isNotNull() @@ -52,7 +50,7 @@ class SpringApplicationExtensionsTests { @Test fun `Kotlin runApplication(arg1, arg2) top level function`() { - val context = runApplication("--debug", "spring", "boot") + val context = runApplication("--debug", "spring", "boot") val args = context.getBean() assertThat(args.nonOptionArgs.toTypedArray()).containsExactly("spring", "boot") assertThat(args.containsOption("debug")).isTrue() @@ -61,7 +59,7 @@ class SpringApplicationExtensionsTests { @Test fun `Kotlin runApplication(arg1, arg2) top level function with a custom environment`() { val environment = StandardEnvironment() - val context = runApplication("--debug", "spring", "boot") { + val context = runApplication("--debug", "spring", "boot") { setEnvironment(environment) } val args = context.getBean() @@ -72,44 +70,52 @@ class SpringApplicationExtensionsTests { @Test fun `Kotlin fromApplication() top level function`() { - val context = fromApplication().with(ExampleWebConfig::class).run().applicationContext - assertThat(context.getBean()).isNotNull() + val context = fromApplication().with(ExampleConfig::class).run().applicationContext + assertThat(context.getBean()).isNotNull() } @Test fun `Kotlin fromApplication() top level function with multiple sources`() { val context = fromApplication() - .with(ExampleWebConfig::class, ExampleFilterConfig::class).run().applicationContext - assertThat(context.getBean()).isNotNull() - assertThat(context.getBean()).isNotNull() + .with(ExampleConfig::class, AnotherExampleConfig::class).run().applicationContext + assertThat(context.getBean()).isNotNull() + assertThat(context.getBean()).isNotNull() } @Test fun `Kotlin fromApplication() top level function when no main`() { - assertThatIllegalStateException().isThrownBy { fromApplication().run() } + assertThatIllegalStateException().isThrownBy { fromApplication().run() } .withMessage("Unable to use 'fromApplication' with " + - "org.springframework.boot.SpringApplicationExtensionsTests.ExampleWebConfig") + "org.springframework.boot.SpringApplicationExtensionsTests.ExampleConfig") } @Configuration(proxyBeanMethods = false) - internal open class ExampleWebConfig { + internal open class ExampleConfig { @Bean - open fun webServer(): MockServletWebServerFactory { - return MockServletWebServerFactory() + open fun exampleBean(): ExampleBean { + return ExampleBean() } } @Configuration(proxyBeanMethods = false) - internal open class ExampleFilterConfig { + internal open class AnotherExampleConfig { @Bean - open fun filter(): MockFilter { - return MockFilter() + open fun anotherExampleBean(): AnotherExampleBean { + return AnotherExampleBean() } } + class ExampleBean { + + } + + class AnotherExampleBean { + + } + } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/AbstractApplicationEnvironmentTests.java b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/AbstractApplicationEnvironmentTests.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/AbstractApplicationEnvironmentTests.java rename to spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/AbstractApplicationEnvironmentTests.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockFilter.java b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/servlet/mock/MockFilter.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockFilter.java rename to spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/servlet/mock/MockFilter.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockServlet.java b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/servlet/mock/MockServlet.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/MockServlet.java rename to spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/servlet/mock/MockServlet.java diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/package-info.java b/spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/servlet/mock/package-info.java similarity index 100% rename from spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/mock/package-info.java rename to spring-boot-project/spring-boot/src/testFixtures/java/org/springframework/boot/web/servlet/mock/package-info.java