From dadfd9a35d38f6cd411b4ffcbed8c60938d0b0e6 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 30 Sep 2025 22:26:50 -0700 Subject: [PATCH] Add classic test starter See gh-46356 See gh-47322 --- .../build.gradle | 103 ++++++++++++++++++ .../spring-boot-dependencies/build.gradle | 2 + settings.gradle | 2 + .../build.gradle | 32 ++++++ 4 files changed, 139 insertions(+) create mode 100644 module/spring-boot-test-classic-modules/build.gradle create mode 100644 starter/spring-boot-starter-test-classic/build.gradle diff --git a/module/spring-boot-test-classic-modules/build.gradle b/module/spring-boot-test-classic-modules/build.gradle new file mode 100644 index 00000000000..8bb5433d7aa --- /dev/null +++ b/module/spring-boot-test-classic-modules/build.gradle @@ -0,0 +1,103 @@ +/* + * Copyright 2012-present 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. + */ + +plugins { + id "java-library" + id "org.springframework.boot.deployed" +} + +description = "Spring Boot Test Classic Modules" + +// NOTE: This module is broken out so that direct starter dependencies are +// closer and will be resolved by Maven without the exclusions + +dependencies { + api(project(":core:spring-boot-test")) { + transitive = false + } + api(project(":core:spring-boot-test-autoconfigure")) { + transitive = false + } + api(project(":module:spring-boot-cache-test")) { + transitive = false + } + api(project(":module:spring-boot-data-cassandra-test")) { + transitive = false + } + api(project(":module:spring-boot-data-couchbase-test")) { + transitive = false + } + api(project(":module:spring-boot-data-elasticsearch-test")) { + transitive = false + } + api(project(":module:spring-boot-data-jdbc-test")) { + transitive = false + } + api(project(":module:spring-boot-data-jpa-test")) { + transitive = false + } + api(project(":module:spring-boot-data-ldap-test")) { + transitive = false + } + api(project(":module:spring-boot-data-mongodb-test")) { + transitive = false + } + api(project(":module:spring-boot-data-neo4j-test")) { + transitive = false + } + api(project(":module:spring-boot-data-r2dbc-test")) { + transitive = false + } + api(project(":module:spring-boot-data-redis-test")) { + transitive = false + } + api(project(":module:spring-boot-graphql-test")) { + transitive = false + } + api(project(":module:spring-boot-jdbc-test")) { + transitive = false + } + api(project(":module:spring-boot-jooq-test")) { + transitive = false + } + api(project(":module:spring-boot-jpa-test")) { + transitive = false + } + api(project(":module:spring-boot-micrometer-metrics-test")) { + transitive = false + } + api(project(":module:spring-boot-micrometer-tracing-test")) { + transitive = false + } + api(project(":module:spring-boot-restclient-test")) { + transitive = false + } + api(project(":module:spring-boot-rsocket-test")) { + transitive = false + } + api(project(":module:spring-boot-security-test")) { + transitive = false + } + api(project(":module:spring-boot-webflux-test")) { + transitive = false + } + api(project(":module:spring-boot-webmvc-test")) { + transitive = false + } + api(project(":module:spring-boot-webservices-test")) { + transitive = false + } +} diff --git a/platform/spring-boot-dependencies/build.gradle b/platform/spring-boot-dependencies/build.gradle index 73fc747cc2d..9c369ce5a27 100644 --- a/platform/spring-boot-dependencies/build.gradle +++ b/platform/spring-boot-dependencies/build.gradle @@ -2226,6 +2226,7 @@ bom { "spring-boot-starter-sql", "spring-boot-starter-sql-test", "spring-boot-starter-test", + "spring-boot-starter-test-classic", "spring-boot-starter-thymeleaf", "spring-boot-starter-thymeleaf-test", "spring-boot-starter-tomcat", @@ -2246,6 +2247,7 @@ bom { "spring-boot-starter-zipkin", "spring-boot-test", "spring-boot-test-autoconfigure", + "spring-boot-test-classic-modules", "spring-boot-testcontainers", "spring-boot-thymeleaf", "spring-boot-tomcat", diff --git a/settings.gradle b/settings.gradle index d97fe742d66..378512d317e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -181,6 +181,7 @@ include "module:spring-boot-session-data-redis" include "module:spring-boot-session-hazelcast" include "module:spring-boot-session-jdbc" include "module:spring-boot-sql" +include "module:spring-boot-test-classic-modules" include "module:spring-boot-thymeleaf" include "module:spring-boot-tomcat" include "module:spring-boot-tx" @@ -342,6 +343,7 @@ include "starter:spring-boot-starter-session-jdbc-test" include "starter:spring-boot-starter-sql" include "starter:spring-boot-starter-sql-test" include "starter:spring-boot-starter-test" +include "starter:spring-boot-starter-test-classic" include "starter:spring-boot-starter-thymeleaf" include "starter:spring-boot-starter-thymeleaf-test" include "starter:spring-boot-starter-tomcat" diff --git a/starter/spring-boot-starter-test-classic/build.gradle b/starter/spring-boot-starter-test-classic/build.gradle new file mode 100644 index 00000000000..a9d3f382362 --- /dev/null +++ b/starter/spring-boot-starter-test-classic/build.gradle @@ -0,0 +1,32 @@ +/* + * Copyright 2012-present 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. + */ + +plugins { + id "org.springframework.boot.starter" +} + +description = "Classic starter for testing Spring Boot applications with libraries including JUnit Jupiter, Hamcrest and Mockito" + +dependencies { + api(project(":starter:spring-boot-starter-test")) + + api(project(":module:spring-boot-test-classic-modules")) +} + +checkRuntimeClasspathForConflicts { + ignore { name -> name.startsWith("mockito-extensions/") } +} +