From b7a9b6c1fb92d27957e4a010dba6b27f9eefe7b0 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Tue, 19 Nov 2024 12:42:40 +0100 Subject: [PATCH] Remove support for Spring Boot 3.2 Closes gh-1643 --- ...adleBuildSystemHelpDocumentCustomizer.java | 13 +-- ...avenBuildSystemHelpDocumentCustomizer.java | 10 +- ...ctiveMQProjectGenerationConfiguration.java | 19 ---- ...ArtemisProjectGenerationConfiguration.java | 3 - .../flyway/FlywayBuildCustomizer.java | 40 +++---- .../FlywayProjectGenerationConfiguration.java | 5 +- .../GraalVmHelpDocumentCustomizer.java | 14 +-- .../ObservabilityHelpDocumentCustomizer.java | 11 +- ...gVectorProjectGenerationConfiguration.java | 29 +---- .../SpringIntegrationModuleRegistry.java | 18 +--- .../TestContainersHelpDocumentCustomizer.java | 16 +-- .../TestcontainersModuleRegistry.java | 36 +++---- ...vaVersionProjectDescriptionCustomizer.java | 2 - ...StartInitializrMetadataUpdateStrategy.java | 2 +- start-site/src/main/resources/application.yml | 101 +++++++----------- .../start/site/SupportedBootVersion.java | 58 ++++++++++ .../extension/AbstractExtensionTests.java | 15 ++- ...uildSystemHelpDocumentCustomizerTests.java | 25 +---- ...uildSystemHelpDocumentCustomizerTests.java | 23 +--- .../KotlinCoroutinesCustomizerTests.java | 3 +- ...MQProjectGenerationConfigurationTests.java | 10 +- ...isProjectGenerationConfigurationTests.java | 11 -- ...raProjectGenerationConfigurationTests.java | 4 +- .../dgs/DgsBuildCustomizerTests.java | 5 +- ...chProjectGenerationConfigurationTests.java | 4 +- .../flyway/FlywayBuildCustomizerTests.java | 38 +++---- .../GraalVmHelpDocumentCustomizerTests.java | 37 +------ ...VmProjectGenerationConfigurationTests.java | 7 +- .../htmx/HtmxBuildCustomizerTests.java | 7 +- .../MyBatisTestBuildCustomizerTests.java | 6 +- ...4jProjectGenerationConfigurationTests.java | 4 +- ...rvabilityActuatorBuildCustomizerTests.java | 8 +- ...ervabilityHelpDocumentCustomizerTests.java | 20 +--- .../okta/OktaHelpDocumentCustomizerTests.java | 6 +- ...leProjectGenerationConfigurationTests.java | 15 ++- ...orProjectGenerationConfigurationTests.java | 13 ++- ...ckProjectGenerationConfigurationTests.java | 7 +- .../SolaceBinderBuildCustomizerTests.java | 23 ++-- ...maProjectGenerationConfigurationTests.java | 7 +- ...seProjectGenerationConfigurationTests.java | 6 +- ...maProjectGenerationConfigurationTests.java | 7 +- ...ntProjectGenerationConfigurationTests.java | 7 +- ...rsProjectGenerationConfigurationTests.java | 6 +- ...teProjectGenerationConfigurationTests.java | 7 +- ...seProjectGenerationConfigurationTests.java | 9 +- ...reProjectGenerationConfigurationTests.java | 22 ++-- ...rsProjectGenerationConfigurationTests.java | 7 +- ...otProjectGenerationConfigurationTests.java | 9 +- ...oudCircuitBreakerBuildCustomizerTests.java | 4 - ...SpringCloudContractConfigurationTests.java | 6 -- ...oudContractGradleBuildCustomizerTests.java | 8 -- ...loudContractMavenBuildCustomizerTests.java | 6 -- ...ringCloudFunctionBuildCustomizerTests.java | 5 - ...udFunctionHelpDocumentCustomizerTests.java | 11 +- ...SpringCloudStreamBuildCustomizerTests.java | 10 -- ...onProjectGenerationConfigurationTests.java | 18 ++-- ...arProjectGenerationConfigurationTests.java | 17 ++- .../SpringShellTestBuildCustomizerTests.java | 5 +- ...rsProjectGenerationConfigurationTests.java | 94 ++++------------ .../VaadinMavenBuildCustomizerTests.java | 3 +- ...inProjectGenerationConfigurationTests.java | 19 ++-- ...JvmVersionHelpDocumentCustomizerTests.java | 10 +- ...sionProjectDescriptionCustomizerTests.java | 24 +++-- .../CacheableMavenVersionResolverTests.java | 12 ++- ...InitializrMetadataUpdateStrategyTests.java | 8 +- .../resources/compose/activemq-classic.yaml | 5 - .../src/test/resources/compose/activemq.yaml | 2 +- .../metadata/springio/spring-boot.json | 51 +++++---- 68 files changed, 418 insertions(+), 655 deletions(-) create mode 100644 start-site/src/test/java/io/spring/start/site/SupportedBootVersion.java delete mode 100644 start-site/src/test/resources/compose/activemq-classic.yaml diff --git a/start-site/src/main/java/io/spring/start/site/extension/build/gradle/GradleBuildSystemHelpDocumentCustomizer.java b/start-site/src/main/java/io/spring/start/site/extension/build/gradle/GradleBuildSystemHelpDocumentCustomizer.java index b645a5cb97..ecf0796c19 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/build/gradle/GradleBuildSystemHelpDocumentCustomizer.java +++ b/start-site/src/main/java/io/spring/start/site/extension/build/gradle/GradleBuildSystemHelpDocumentCustomizer.java @@ -20,8 +20,6 @@ import io.spring.initializr.generator.spring.documentation.HelpDocument; import io.spring.initializr.generator.spring.documentation.HelpDocumentCustomizer; import io.spring.initializr.generator.version.Version; -import io.spring.initializr.generator.version.VersionParser; -import io.spring.initializr.generator.version.VersionRange; /** * A {@link HelpDocumentCustomizer} that adds reference links for Gradle. @@ -33,8 +31,6 @@ class GradleBuildSystemHelpDocumentCustomizer implements HelpDocumentCustomizer private static final String SPRING_BOOT_DOCS_URL = "https://docs.spring.io/spring-boot"; - private static final VersionRange SPRING_BOOT_3_3_0_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0"); - private final Version springBootVersion; GradleBuildSystemHelpDocumentCustomizer(ProjectDescription description) { @@ -50,16 +46,11 @@ public void customize(HelpDocument document) { document.gettingStarted() .addReferenceDocLink(generateReferenceGuideUrl(), "Spring Boot Gradle Plugin Reference Guide"); document.gettingStarted() - .addReferenceDocLink( - String - .format(generateReferenceGuideUrl() + (SPRING_BOOT_3_3_0_OR_LATER.match(this.springBootVersion) - ? "/packaging-oci-image.html" : "#build-image"), this.springBootVersion), - "Create an OCI image"); + .addReferenceDocLink(generateReferenceGuideUrl() + "/packaging-oci-image.html", "Create an OCI image"); } private String generateReferenceGuideUrl() { - String baseUrlFormat = SPRING_BOOT_DOCS_URL + (SPRING_BOOT_3_3_0_OR_LATER.match(this.springBootVersion) - ? "/%s/gradle-plugin" : "/docs/%s/gradle-plugin/reference/html/"); + String baseUrlFormat = SPRING_BOOT_DOCS_URL + "/%s/gradle-plugin"; return baseUrlFormat.formatted(this.springBootVersion); } diff --git a/start-site/src/main/java/io/spring/start/site/extension/build/maven/MavenBuildSystemHelpDocumentCustomizer.java b/start-site/src/main/java/io/spring/start/site/extension/build/maven/MavenBuildSystemHelpDocumentCustomizer.java index e4fe3d8d71..92171bec00 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/build/maven/MavenBuildSystemHelpDocumentCustomizer.java +++ b/start-site/src/main/java/io/spring/start/site/extension/build/maven/MavenBuildSystemHelpDocumentCustomizer.java @@ -20,8 +20,6 @@ import io.spring.initializr.generator.spring.documentation.HelpDocument; import io.spring.initializr.generator.spring.documentation.HelpDocumentCustomizer; import io.spring.initializr.generator.version.Version; -import io.spring.initializr.generator.version.VersionParser; -import io.spring.initializr.generator.version.VersionRange; /** * A {@link HelpDocumentCustomizer} that adds reference links for Apache Maven. @@ -33,8 +31,6 @@ class MavenBuildSystemHelpDocumentCustomizer implements HelpDocumentCustomizer { private static final String SPRING_BOOT_DOCS_URL = "https://docs.spring.io/spring-boot"; - private static final VersionRange SPRING_BOOT_3_3_0_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0"); - private final Version springBootVersion; MavenBuildSystemHelpDocumentCustomizer(ProjectDescription description) { @@ -47,14 +43,12 @@ public void customize(HelpDocument document) { .addReferenceDocLink("https://maven.apache.org/guides/index.html", "Official Apache Maven documentation"); String referenceGuideUrl = generateReferenceGuideUrl(); document.gettingStarted().addReferenceDocLink(referenceGuideUrl, "Spring Boot Maven Plugin Reference Guide"); - String buildImageSection = referenceGuideUrl - + (SPRING_BOOT_3_3_0_OR_LATER.match(this.springBootVersion) ? "/build-image.html" : "#build-image"); + String buildImageSection = referenceGuideUrl + "/build-image.html"; document.gettingStarted().addReferenceDocLink(buildImageSection, "Create an OCI image"); } private String generateReferenceGuideUrl() { - String baseUrlFormat = SPRING_BOOT_DOCS_URL + (SPRING_BOOT_3_3_0_OR_LATER.match(this.springBootVersion) - ? "/%s/maven-plugin" : "/docs/%s/maven-plugin/reference/html/"); + String baseUrlFormat = SPRING_BOOT_DOCS_URL + "/%s/maven-plugin"; return baseUrlFormat.formatted(this.springBootVersion); } diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/activemq/ActiveMQProjectGenerationConfiguration.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/activemq/ActiveMQProjectGenerationConfiguration.java index ac72684c88..cf9f686645 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/activemq/ActiveMQProjectGenerationConfiguration.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/activemq/ActiveMQProjectGenerationConfiguration.java @@ -16,7 +16,6 @@ package io.spring.start.site.extension.dependency.activemq; -import io.spring.initializr.generator.condition.ConditionalOnPlatformVersion; import io.spring.initializr.generator.condition.ConditionalOnRequestedDependency; import io.spring.initializr.generator.project.ProjectGenerationConfiguration; import io.spring.start.site.container.ComposeFileCustomizer; @@ -38,15 +37,6 @@ public class ActiveMQProjectGenerationConfiguration { private static final String TESTCONTAINERS_CLASS_NAME = "org.testcontainers.activemq.ActiveMQContainer"; @Bean - @ConditionalOnPlatformVersion("[3.2.0,3.3.0-M2)") - @ConditionalOnRequestedDependency("testcontainers") - ServiceConnectionsCustomizer activeMQServiceConnectionsCustomizer(DockerServiceResolver serviceResolver) { - return (serviceConnections) -> serviceResolver.doWith("activeMQ", (service) -> serviceConnections - .addServiceConnection(ServiceConnection.ofGenericContainer("activeMQ", service, "symptoma/activemq"))); - } - - @Bean - @ConditionalOnPlatformVersion("3.3.0-M2") @ConditionalOnRequestedDependency("testcontainers") ServiceConnectionsCustomizer activeMQClassicServiceConnectionsCustomizer(DockerServiceResolver serviceResolver) { return (serviceConnections) -> serviceResolver.doWith("activeMQClassic", @@ -55,15 +45,6 @@ ServiceConnectionsCustomizer activeMQClassicServiceConnectionsCustomizer(DockerS } @Bean - @ConditionalOnPlatformVersion("[3.2.0,3.3.0-M2)") - @ConditionalOnRequestedDependency("docker-compose") - ComposeFileCustomizer activeMQComposeFileCustomizer(DockerServiceResolver serviceResolver) { - return (composeFile) -> serviceResolver.doWith("activeMQ", - (service) -> composeFile.services().add("activemq", service)); - } - - @Bean - @ConditionalOnPlatformVersion("3.3.0-M2") @ConditionalOnRequestedDependency("docker-compose") ComposeFileCustomizer activeMQClassicComposeFileCustomizer(DockerServiceResolver serviceResolver) { return (composeFile) -> serviceResolver.doWith("activeMQClassic", diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/activemq/ArtemisProjectGenerationConfiguration.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/activemq/ArtemisProjectGenerationConfiguration.java index d3e21c771d..42c46e53d9 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/activemq/ArtemisProjectGenerationConfiguration.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/activemq/ArtemisProjectGenerationConfiguration.java @@ -16,7 +16,6 @@ package io.spring.start.site.extension.dependency.activemq; -import io.spring.initializr.generator.condition.ConditionalOnPlatformVersion; import io.spring.initializr.generator.condition.ConditionalOnRequestedDependency; import io.spring.initializr.generator.project.ProjectGenerationConfiguration; import io.spring.start.site.container.ComposeFileCustomizer; @@ -38,7 +37,6 @@ public class ArtemisProjectGenerationConfiguration { private static final String TESTCONTAINERS_CLASS_NAME = "org.testcontainers.activemq.ArtemisContainer"; @Bean - @ConditionalOnPlatformVersion("3.3.0-M2") @ConditionalOnRequestedDependency("testcontainers") ServiceConnectionsCustomizer artemisServiceConnectionsCustomizer(DockerServiceResolver serviceResolver) { return (serviceConnections) -> serviceResolver.doWith("artemis", (service) -> serviceConnections @@ -46,7 +44,6 @@ ServiceConnectionsCustomizer artemisServiceConnectionsCustomizer(DockerServiceRe } @Bean - @ConditionalOnPlatformVersion("3.3.0-M2") @ConditionalOnRequestedDependency("docker-compose") ComposeFileCustomizer artemisComposeFileCustomizer(DockerServiceResolver serviceResolver) { return (composeFile) -> serviceResolver.doWith("artemis", diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/flyway/FlywayBuildCustomizer.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/flyway/FlywayBuildCustomizer.java index cd6a14f26c..9f61351ae6 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/flyway/FlywayBuildCustomizer.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/flyway/FlywayBuildCustomizer.java @@ -19,10 +19,7 @@ import io.spring.initializr.generator.buildsystem.Build; import io.spring.initializr.generator.buildsystem.DependencyContainer; import io.spring.initializr.generator.buildsystem.DependencyScope; -import io.spring.initializr.generator.project.ProjectDescription; import io.spring.initializr.generator.spring.build.BuildCustomizer; -import io.spring.initializr.generator.version.VersionParser; -import io.spring.initializr.generator.version.VersionRange; /** * Determine the appropriate Flyway dependency according to the database. @@ -33,14 +30,6 @@ */ class FlywayBuildCustomizer implements BuildCustomizer { - private static final VersionRange SPRING_BOOT_3_3_M3_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0-M3"); - - private final boolean isSpringBoot33OrLater; - - FlywayBuildCustomizer(ProjectDescription projectDescription) { - this.isSpringBoot33OrLater = SPRING_BOOT_3_3_M3_OR_LATER.match(projectDescription.getPlatformVersion()); - } - @Override public void customize(Build build) { DependencyContainer dependencies = build.dependencies(); @@ -53,22 +42,19 @@ public void customize(Build build) { if (dependencies.has("oracle")) { dependencies.add("flyway-oracle", "org.flywaydb", "flyway-database-oracle", DependencyScope.COMPILE); } - if (this.isSpringBoot33OrLater) { - if (dependencies.has("db2")) { - dependencies.add("flyway-database-db2", "org.flywaydb", "flyway-database-db2", DependencyScope.COMPILE); - } - if (dependencies.has("derby")) { - dependencies.add("flyway-database-derby", "org.flywaydb", "flyway-database-derby", - DependencyScope.COMPILE); - } - if (dependencies.has("hsql")) { - dependencies.add("flyway-database-hsqldb", "org.flywaydb", "flyway-database-hsqldb", - DependencyScope.COMPILE); - } - if (dependencies.has("postgresql")) { - dependencies.add("flyway-database-postgresql", "org.flywaydb", "flyway-database-postgresql", - DependencyScope.COMPILE); - } + if (dependencies.has("db2")) { + dependencies.add("flyway-database-db2", "org.flywaydb", "flyway-database-db2", DependencyScope.COMPILE); + } + if (dependencies.has("derby")) { + dependencies.add("flyway-database-derby", "org.flywaydb", "flyway-database-derby", DependencyScope.COMPILE); + } + if (dependencies.has("hsql")) { + dependencies.add("flyway-database-hsqldb", "org.flywaydb", "flyway-database-hsqldb", + DependencyScope.COMPILE); + } + if (dependencies.has("postgresql")) { + dependencies.add("flyway-database-postgresql", "org.flywaydb", "flyway-database-postgresql", + DependencyScope.COMPILE); } } diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/flyway/FlywayProjectGenerationConfiguration.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/flyway/FlywayProjectGenerationConfiguration.java index 0b4a59d389..848f1caf92 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/flyway/FlywayProjectGenerationConfiguration.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/flyway/FlywayProjectGenerationConfiguration.java @@ -17,7 +17,6 @@ package io.spring.start.site.extension.dependency.flyway; import io.spring.initializr.generator.condition.ConditionalOnRequestedDependency; -import io.spring.initializr.generator.project.ProjectDescription; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -37,8 +36,8 @@ FlywayProjectContributor flywayProjectContributor() { } @Bean - FlywayBuildCustomizer flywayBuildCustomizer(ProjectDescription projectDescription) { - return new FlywayBuildCustomizer(projectDescription); + FlywayBuildCustomizer flywayBuildCustomizer() { + return new FlywayBuildCustomizer(); } } diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/graalvm/GraalVmHelpDocumentCustomizer.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/graalvm/GraalVmHelpDocumentCustomizer.java index 9a962a914f..2cf9cf2c30 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/graalvm/GraalVmHelpDocumentCustomizer.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/graalvm/GraalVmHelpDocumentCustomizer.java @@ -28,8 +28,6 @@ import io.spring.initializr.generator.spring.documentation.HelpDocument; import io.spring.initializr.generator.spring.documentation.HelpDocumentCustomizer; import io.spring.initializr.generator.version.Version; -import io.spring.initializr.generator.version.VersionParser; -import io.spring.initializr.generator.version.VersionRange; import io.spring.initializr.metadata.Dependency; import io.spring.initializr.metadata.InitializrMetadata; @@ -40,8 +38,6 @@ */ class GraalVmHelpDocumentCustomizer implements HelpDocumentCustomizer { - private static final VersionRange SPRING_BOOT_3_3_0_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0"); - private final InitializrMetadata metadata; private final ProjectDescription description; @@ -60,16 +56,12 @@ class GraalVmHelpDocumentCustomizer implements HelpDocumentCustomizer { @Override public void customize(HelpDocument document) { document.gettingStarted() - .addReferenceDocLink(String.format(SPRING_BOOT_3_3_0_OR_LATER.match(this.platformVersion) - ? "https://docs.spring.io/spring-boot/%s/reference/packaging/native-image/introducing-graalvm-native-images.html" - : "https://docs.spring.io/spring-boot/docs/%s/reference/html/native-image.html#native-image", + .addReferenceDocLink(String.format( + "https://docs.spring.io/spring-boot/%s/reference/packaging/native-image/introducing-graalvm-native-images.html", this.platformVersion), "GraalVM Native Image Support"); boolean mavenBuild = this.build instanceof MavenBuild; boolean gradleBuild = this.build instanceof GradleBuild; - String url = SPRING_BOOT_3_3_0_OR_LATER.match(this.platformVersion) - ? String.format("https://docs.spring.io/spring-boot/%s/how-to/aot.html", this.platformVersion) - : String.format("https://docs.spring.io/spring-boot/docs/%s/%s/reference/htmlsingle/#aot", - this.platformVersion, (mavenBuild) ? "maven-plugin" : "gradle-plugin"); + String url = String.format("https://docs.spring.io/spring-boot/%s/how-to/aot.html", this.platformVersion); document.gettingStarted().addAdditionalLink(url, "Configure AOT settings in Build Plugin"); Map model = new HashMap<>(); diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/observability/ObservabilityHelpDocumentCustomizer.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/observability/ObservabilityHelpDocumentCustomizer.java index 0b82d7e30b..e772756e22 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/observability/ObservabilityHelpDocumentCustomizer.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/observability/ObservabilityHelpDocumentCustomizer.java @@ -21,8 +21,6 @@ import io.spring.initializr.generator.spring.documentation.HelpDocument; import io.spring.initializr.generator.spring.documentation.HelpDocumentCustomizer; import io.spring.initializr.generator.version.Version; -import io.spring.initializr.generator.version.VersionParser; -import io.spring.initializr.generator.version.VersionRange; /** * {@link HelpDocumentCustomizer} implementation for Observability. @@ -31,8 +29,6 @@ */ public class ObservabilityHelpDocumentCustomizer implements HelpDocumentCustomizer { - private static final VersionRange SPRING_BOOT_3_3_0_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0"); - private final Version platformVersion; private final Build build; @@ -49,11 +45,8 @@ public void customize(HelpDocument document) { .addReferenceDocLink("https://docs.micrometer.io/tracing/reference/index.html", "Distributed Tracing Reference Guide"); document.gettingStarted() - .addReferenceDocLink(String.format(SPRING_BOOT_3_3_0_OR_LATER.match(this.platformVersion) - ? "https://docs.spring.io/spring-boot/%s/reference/actuator/tracing.html" - : "https://docs.spring.io/spring-boot/docs/%s/reference/html/actuator.html#actuator.micrometer-tracing.getting-started", - this.platformVersion), "Getting Started with Distributed Tracing"); - + .addReferenceDocLink("https://docs.spring.io/spring-boot/%s/reference/actuator/tracing.html" + .formatted(this.platformVersion), "Getting Started with Distributed Tracing"); } } diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/postgresql/PgVectorProjectGenerationConfiguration.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/postgresql/PgVectorProjectGenerationConfiguration.java index a8efc0a4a6..261e8521de 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/postgresql/PgVectorProjectGenerationConfiguration.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/postgresql/PgVectorProjectGenerationConfiguration.java @@ -16,14 +16,7 @@ package io.spring.start.site.extension.dependency.postgresql; -import java.util.Map; - import io.spring.initializr.generator.condition.ConditionalOnRequestedDependency; -import io.spring.initializr.generator.project.ProjectDescription; -import io.spring.initializr.generator.version.Version; -import io.spring.initializr.generator.version.VersionParser; -import io.spring.initializr.generator.version.VersionRange; -import io.spring.initializr.versionresolver.MavenVersionResolver; import io.spring.start.site.container.ComposeFileCustomizer; import io.spring.start.site.container.DockerServiceResolver; import io.spring.start.site.container.ServiceConnections.ServiceConnection; @@ -44,29 +37,11 @@ class PgVectorProjectGenerationConfiguration { private static final String TESTCONTAINERS_CLASS_NAME = "org.testcontainers.containers.PostgreSQLContainer"; - private static final VersionRange TESTCONTAINERS_1_19_7_OR_LATER = VersionParser.DEFAULT.parseRange("1.19.7"); - - private final MavenVersionResolver versionResolver; - - private final ProjectDescription description; - - PgVectorProjectGenerationConfiguration(MavenVersionResolver versionResolver, ProjectDescription description) { - this.versionResolver = versionResolver; - this.description = description; - } - @Bean @ConditionalOnRequestedDependency("testcontainers") ServiceConnectionsCustomizer pgvectorServiceConnectionsCustomizer(DockerServiceResolver serviceResolver) { - Map resolve = this.versionResolver.resolveDependencies("org.springframework.boot", - "spring-boot-dependencies", this.description.getPlatformVersion().toString()); - String testcontainersVersion = resolve.get("org.testcontainers:testcontainers"); - return (serviceConnections) -> { - if (TESTCONTAINERS_1_19_7_OR_LATER.match(Version.parse(testcontainersVersion))) { - serviceResolver.doWith("pgvector", (service) -> serviceConnections.addServiceConnection( - ServiceConnection.ofContainer("pgvector", service, TESTCONTAINERS_CLASS_NAME))); - } - }; + return (serviceConnections) -> serviceResolver.doWith("pgvector", (service) -> serviceConnections + .addServiceConnection(ServiceConnection.ofContainer("pgvector", service, TESTCONTAINERS_CLASS_NAME))); } @Bean diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationModuleRegistry.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationModuleRegistry.java index 054f959d39..de0ec93505 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationModuleRegistry.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationModuleRegistry.java @@ -25,8 +25,6 @@ import io.spring.initializr.generator.buildsystem.DependencyScope; import io.spring.initializr.generator.spring.documentation.HelpDocument; import io.spring.initializr.generator.version.Version; -import io.spring.initializr.generator.version.VersionParser; -import io.spring.initializr.generator.version.VersionRange; import io.spring.start.site.support.implicit.ImplicitDependency; import io.spring.start.site.support.implicit.ImplicitDependency.Builder; @@ -40,8 +38,6 @@ */ abstract class SpringIntegrationModuleRegistry { - private static final VersionRange SPRING_BOOT_3_3_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0"); - static Iterable create(Version platformVersion) { List builders = new ArrayList<>(); builders.add(onDependencies("activemq", "artemis").customizeBuild(addDependency("jms")) @@ -66,16 +62,10 @@ static Iterable create(Version platformVersion) { .customizeHelpDocument(addReferenceLink("Mail Module", "mail"))); builders.add(onDependencies("rsocket").customizeBuild(addDependency("rsocket")) .customizeHelpDocument(addReferenceLink("RSocket Module", "rsocket"))); - if (SPRING_BOOT_3_3_OR_LATER.match(platformVersion)) { - builders.add(onDependencies("security") - .customizeBuild(addDependency("spring-security-messaging", "org.springframework.security", - "spring-security-messaging", DependencyScope.COMPILE)) - .customizeHelpDocument(addReferenceLink("Security Module", "security"))); - } - else { - builders.add(onDependencies("security").customizeBuild(addDependency("security")) - .customizeHelpDocument(addReferenceLink("Security Module", "security"))); - } + builders.add(onDependencies("security") + .customizeBuild(addDependency("spring-security-messaging", "org.springframework.security", + "spring-security-messaging", DependencyScope.COMPILE)) + .customizeHelpDocument(addReferenceLink("Security Module", "security"))); builders.add(onDependencies("web").customizeBuild(addDependency("http")) .customizeHelpDocument(addReferenceLink("HTTP Module", "http"))); builders.add(onDependencies("webflux").customizeBuild(addDependency("webflux")) diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestContainersHelpDocumentCustomizer.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestContainersHelpDocumentCustomizer.java index cbe847d9f0..eee58ec883 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestContainersHelpDocumentCustomizer.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestContainersHelpDocumentCustomizer.java @@ -23,8 +23,6 @@ import io.spring.initializr.generator.project.ProjectDescription; import io.spring.initializr.generator.spring.documentation.HelpDocument; import io.spring.initializr.generator.spring.documentation.HelpDocumentCustomizer; -import io.spring.initializr.generator.version.VersionParser; -import io.spring.initializr.generator.version.VersionRange; import io.spring.start.site.container.DockerService; import io.spring.start.site.container.ServiceConnections; import io.spring.start.site.container.ServiceConnections.ServiceConnection; @@ -37,8 +35,6 @@ */ class TestContainersHelpDocumentCustomizer implements HelpDocumentCustomizer { - private static final VersionRange SPRING_BOOT_3_3_0_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0"); - private final ProjectDescription description; private final ServiceConnections serviceConnections; @@ -50,9 +46,7 @@ class TestContainersHelpDocumentCustomizer implements HelpDocumentCustomizer { @Override public void customize(HelpDocument document) { - String referenceDocUrl = (SPRING_BOOT_3_3_0_OR_LATER.match(this.description.getPlatformVersion()) - ? "https://docs.spring.io/spring-boot/%s/reference/testing/testcontainers.html#testing.testcontainers" - : "https://docs.spring.io/spring-boot/docs/%s/reference/html/features.html#features.testing.testcontainers") + String referenceDocUrl = "https://docs.spring.io/spring-boot/%s/reference/testing/testcontainers.html#testing.testcontainers" .formatted(this.description.getPlatformVersion()); document.gettingStarted().addReferenceDocLink(referenceDocUrl, "Spring Boot Testcontainers support"); Map model = new HashMap<>(); @@ -60,11 +54,9 @@ public void customize(HelpDocument document) { .map(ServiceConnection::dockerService) .toList(); model.put("services", dockerServices); - model.put("testcontainersAtDevelopmentTimeLink", (SPRING_BOOT_3_3_0_OR_LATER - .match(this.description.getPlatformVersion()) - ? "https://docs.spring.io/spring-boot/%s/reference/features/dev-services.html#features.dev-services.testcontainers" - : "https://docs.spring.io/spring-boot/docs/%s/reference/html/features.html#features.testing.testcontainers.at-development-time") - .formatted(this.description.getPlatformVersion())); + model.put("testcontainersAtDevelopmentTimeLink", + "https://docs.spring.io/spring-boot/%s/reference/features/dev-services.html#features.dev-services.testcontainers" + .formatted(this.description.getPlatformVersion())); document.addSection("testcontainers", model); } diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java index f3f694d048..858ed5206b 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java @@ -25,8 +25,6 @@ import io.spring.initializr.generator.buildsystem.DependencyScope; import io.spring.initializr.generator.spring.documentation.HelpDocument; import io.spring.initializr.generator.version.Version; -import io.spring.initializr.generator.version.VersionParser; -import io.spring.initializr.generator.version.VersionRange; import io.spring.start.site.support.implicit.ImplicitDependency; import io.spring.start.site.support.implicit.ImplicitDependency.Builder; @@ -39,16 +37,12 @@ */ abstract class TestcontainersModuleRegistry { - private static final VersionRange SPRING_BOOT_3_3_OR_LATER = VersionParser.DEFAULT.parseRange("3.3.0"); - static Iterable create(Version platformVersion) { List builders = new ArrayList<>(); - if (SPRING_BOOT_3_3_OR_LATER.match(platformVersion)) { - builders.add(onDependencies("activemq").customizeBuild(addModule("activemq")) - .customizeHelpDocument(addReferenceLink("ActiveMQ Module", "activemq/"))); - builders.add(onDependencies("artemis").customizeBuild(addModule("activemq")) - .customizeHelpDocument(addReferenceLink("ActiveMQ Module", "activemq/"))); - } + builders.add(onDependencies("activemq").customizeBuild(addModule("activemq")) + .customizeHelpDocument(addReferenceLink("ActiveMQ Module", "activemq/"))); + builders.add(onDependencies("artemis").customizeBuild(addModule("activemq")) + .customizeHelpDocument(addReferenceLink("ActiveMQ Module", "activemq/"))); builders.add(onDependencies("amqp", "amqp-streams").customizeBuild(addModule("rabbitmq")) .customizeHelpDocument(addReferenceLink("RabbitMQ Module", "rabbitmq/"))); builders.add(onDependencies("cloud-gcp", "cloud-gcp-pubsub").customizeBuild(addModule("gcloud")) @@ -89,18 +83,16 @@ static Iterable create(Version platformVersion) { .customizeHelpDocument(addReferenceLink("Solace Module", "solace/"))); builders.add(onDependencies("sqlserver").customizeBuild(addModule("mssqlserver")) .customizeHelpDocument(addReferenceLink("MS SQL Server Module", "databases/mssqlserver/"))); - if (SPRING_BOOT_3_3_OR_LATER.match(platformVersion)) { - builders.add(onDependencies("spring-ai-vectordb-chroma").customizeBuild(addModule("chromadb")) - .customizeHelpDocument(addReferenceLink("Chroma Module", "testcontainers/"))); - builders.add(onDependencies("spring-ai-vectordb-milvus").customizeBuild(addModule("milvus")) - .customizeHelpDocument(addReferenceLink("Milvus Module", "testcontainers/"))); - builders.add(onDependencies("spring-ai-ollama").customizeBuild(addModule("ollama")) - .customizeHelpDocument(addReferenceLink("Ollama Module", "testcontainers/"))); - builders.add(onDependencies("spring-ai-vectordb-qdrant").customizeBuild(addModule("qdrant")) - .customizeHelpDocument(addReferenceLink("Qdrant Module", "testcontainers/"))); - builders.add(onDependencies("spring-ai-vectordb-weaviate").customizeBuild(addModule("weaviate")) - .customizeHelpDocument(addReferenceLink("Weaviate Module", "testcontainers/"))); - } + builders.add(onDependencies("spring-ai-vectordb-chroma").customizeBuild(addModule("chromadb")) + .customizeHelpDocument(addReferenceLink("Chroma Module", "testcontainers/"))); + builders.add(onDependencies("spring-ai-vectordb-milvus").customizeBuild(addModule("milvus")) + .customizeHelpDocument(addReferenceLink("Milvus Module", "testcontainers/"))); + builders.add(onDependencies("spring-ai-ollama").customizeBuild(addModule("ollama")) + .customizeHelpDocument(addReferenceLink("Ollama Module", "testcontainers/"))); + builders.add(onDependencies("spring-ai-vectordb-qdrant").customizeBuild(addModule("qdrant")) + .customizeHelpDocument(addReferenceLink("Qdrant Module", "testcontainers/"))); + builders.add(onDependencies("spring-ai-vectordb-weaviate").customizeBuild(addModule("weaviate")) + .customizeHelpDocument(addReferenceLink("Weaviate Module", "testcontainers/"))); return builders.stream().map(Builder::build).toList(); } diff --git a/start-site/src/main/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizer.java b/start-site/src/main/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizer.java index b238e51822..cfa3104577 100644 --- a/start-site/src/main/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizer.java +++ b/start-site/src/main/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizer.java @@ -23,7 +23,6 @@ import io.spring.initializr.generator.language.kotlin.KotlinLanguage; import io.spring.initializr.generator.project.MutableProjectDescription; import io.spring.initializr.generator.project.ProjectDescriptionCustomizer; -import io.spring.initializr.generator.version.Version; /** * Validate that the requested java version is compatible with the chosen Spring Boot @@ -39,7 +38,6 @@ public class JavaVersionProjectDescriptionCustomizer implements ProjectDescripti @Override public void customize(MutableProjectDescription description) { - Version platformVersion = description.getPlatformVersion(); String javaVersion = description.getLanguage().jvmVersion(); if (UNSUPPORTED_VERSIONS.contains(javaVersion)) { updateTo(description, "17"); diff --git a/start-site/src/main/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategy.java b/start-site/src/main/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategy.java index c3f6763d08..9d56aa50c1 100644 --- a/start-site/src/main/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategy.java +++ b/start-site/src/main/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategy.java @@ -36,7 +36,7 @@ */ public class StartInitializrMetadataUpdateStrategy extends SpringIoInitializrMetadataUpdateStrategy { - private static final Version MINIMUM_BOOT_VERSION = Version.parse("3.2.0"); + private static final Version MINIMUM_BOOT_VERSION = Version.parse("3.3.0"); public StartInitializrMetadataUpdateStrategy(RestTemplate restTemplate, ObjectMapper objectMapper) { super(restTemplate, objectMapper); diff --git a/start-site/src/main/resources/application.yml b/start-site/src/main/resources/application.yml index aea2dfc4f2..0e27ed0a29 100644 --- a/start-site/src/main/resources/application.yml +++ b/start-site/src/main/resources/application.yml @@ -46,8 +46,6 @@ initializr: artifactId: spring-boot-admin-dependencies versionProperty: spring-boot-admin.version mappings: - - compatibilityRange: "[3.2.0,3.3.0-M1)" - version: 3.2.3 - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 3.3.5 netflix-dgs: @@ -55,8 +53,6 @@ initializr: artifactId: graphql-dgs-platform-dependencies versionProperty: netflix-dgs.version mappings: - - compatibilityRange: "[3.2.0,3.3.0-M1)" - version: 8.7.1 - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 9.1.3 sentry: @@ -64,22 +60,20 @@ initializr: artifactId: sentry-bom versionProperty: sentry.version mappings: - - compatibilityRange: "[3.2.0,3.3.0-M1)" + - compatibilityRange: "[3.3.0,3.3.0-M1)" version: 7.14.0 solace-spring-boot: groupId: com.solace.spring.boot artifactId: solace-spring-boot-bom versionProperty: solace-spring-boot.version mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 2.2.0 solace-spring-cloud: groupId: com.solace.spring.cloud artifactId: solace-spring-cloud-bom versionProperty: solace-spring-cloud.version mappings: - - compatibilityRange: "[3.2.0,3.3.0-M1)" - version: 4.1.0 - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 4.5.0 spring-ai: @@ -87,7 +81,7 @@ initializr: artifactId: spring-ai-bom versionProperty: spring-ai.version mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 1.0.0-M4 repositories: spring-milestones spring-cloud: @@ -96,9 +90,9 @@ initializr: versionProperty: spring-cloud.version order: 50 mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 2023.0.3 - - compatibilityRange: "[3.4.0-M1,3.5.0-M1)" + - compatibilityRange: "[3.4.0,3.5.0-M1)" version: 2024.0.0-RC1 repositories: spring-milestones spring-cloud-azure: @@ -106,7 +100,7 @@ initializr: artifactId: spring-cloud-azure-dependencies versionProperty: spring-cloud-azure.version mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 5.18.0 spring-cloud-gcp: groupId: com.google.cloud @@ -114,7 +108,7 @@ initializr: versionProperty: spring-cloud-gcp.version additionalBoms: [ spring-cloud ] mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 5.8.0 spring-cloud-services: groupId: io.pivotal.spring.cloud @@ -122,18 +116,16 @@ initializr: versionProperty: spring-cloud-services.version additionalBoms: [ spring-cloud ] mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 4.1.5 spring-modulith: groupId: org.springframework.modulith artifactId: spring-modulith-bom versionProperty: spring-modulith.version mappings: - - compatibilityRange: "[3.2.0,3.3.0-M1)" - version: 1.1.9 - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 1.2.4 - - compatibilityRange: "[3.4.0-M1,3.5.0-M1)" + - compatibilityRange: "[3.4.0,3.5.0-M1)" version: 1.3.0-M3 repositories: spring-milestones spring-shell: @@ -141,8 +133,6 @@ initializr: artifactId: spring-shell-dependencies versionProperty: spring-shell.version mappings: - - compatibilityRange: "[3.2.0,3.3.0-M1)" - version: 3.2.8 - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 3.3.3 timefold-solver: @@ -150,19 +140,17 @@ initializr: artifactId: timefold-solver-bom versionProperty: timefold-solver.version mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 1.16.0 vaadin: groupId: com.vaadin artifactId: vaadin-bom versionProperty: vaadin.version mappings: - - compatibilityRange: "[3.2.0,3.3.0-M1)" - version: 24.4.17 - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 24.5.5 platform: - compatibilityRange: "3.2.0" + compatibilityRange: "3.3.0" dependencies: - name: Developer Tools content: @@ -219,7 +207,7 @@ initializr: - name: Spring Modulith id: modulith bom: spring-modulith - compatibilityRange: "[3.2.0,3.5.0-M1)" + compatibilityRange: "[3.3.0,3.5.0-M1)" group-id: org.springframework.modulith artifact-id: spring-modulith-starter-core description: Support for building modular monolithic applications. @@ -337,7 +325,7 @@ initializr: artifactId: vaadin-spring-boot-starter description: The full-stack web app platform for Spring. Build views fully in Java with Flow, or in React using Hilla. bom: vaadin - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" links: - rel: guide href: https://spring.io/guides/gs/crud-with-vaadin/ @@ -349,7 +337,7 @@ initializr: groupId: com.netflix.graphql.dgs artifactId: graphql-dgs-spring-graphql-starter description: Build GraphQL applications with Netflix DGS and Spring for GraphQL. - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" bom: netflix-dgs links: - rel: reference @@ -361,7 +349,7 @@ initializr: groupId: io.github.wimdeblauwe artifactId: htmx-spring-boot description: Build modern user interfaces with the simplicity and power of hypertext. - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" version: 3.5.0 links: - rel: reference @@ -452,12 +440,12 @@ initializr: href: https://docs.spring.io/spring-boot/{bootVersion}/reference/data/nosql.html#data.nosql.ldap - name: Okta id: okta - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" description: Okta specific configuration for Spring Security/Spring Boot OAuth2 features. Enable your Spring Boot application to work with Okta via OAuth 2.0/OIDC. groupId: com.okta.spring artifactId: okta-spring-boot-starter mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 3.0.7 links: - rel: guide @@ -524,12 +512,12 @@ initializr: description: R2DBC Homepage - name: MyBatis Framework id: mybatis - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" description: Persistence framework with support for custom SQL, stored procedures and advanced mappings. MyBatis couples objects with stored procedures or SQL statements using a XML descriptor or annotations. groupId: org.mybatis.spring.boot artifactId: mybatis-spring-boot-starter mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 3.0.3 links: - rel: guide @@ -826,9 +814,9 @@ initializr: href: https://rsocket.io/ - name: Apache Camel id: camel - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" mappings: - - compatibilityRange: "[3.2.0,3.4.0-M1)" + - compatibilityRange: "[3.3.0,3.4.0-M1)" version: 4.8.1 description: Apache Camel is an open source integration framework that empowers you to quickly and easily integrate various systems consuming or producing data. groupId: org.apache.camel.springboot @@ -840,7 +828,7 @@ initializr: - name: Solace PubSub+ bom: solace-spring-boot id: solace - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" description: Connect to a Solace PubSub+ Advanced Event Broker to publish, subscribe, request/reply and store/replay messages groupId: com.solace.spring.boot artifactId: solace-spring-boot-starter @@ -895,7 +883,7 @@ initializr: id: spring-shell groupId: org.springframework.shell artifactId: spring-shell-starter - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" description: Build command line applications with spring. bom: spring-shell links: @@ -918,7 +906,6 @@ initializr: groupId: org.springframework.boot artifactId: spring-boot starter: false - compatibilityRange: "3.3.0" links: - rel: reference href: https://docs.spring.io/spring-boot/{bootVersion}/reference/actuator/endpoints.html#actuator.endpoints.sbom @@ -927,7 +914,7 @@ initializr: groupId: de.codecentric artifactId: spring-boot-admin-starter-client description: Required for your application to register with a Codecentric's Spring Boot Admin Server instance. - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" bom: codecentric-spring-boot-admin links: - rel: reference @@ -937,7 +924,7 @@ initializr: groupId: de.codecentric artifactId: spring-boot-admin-starter-server description: A community project to manage and monitor your Spring Boot applications. Provides a UI on top of the Spring Boot Actuator endpoints. - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" bom: codecentric-spring-boot-admin links: - rel: reference @@ -946,7 +933,7 @@ initializr: id: sentry bom: sentry description: Application performance monitoring and error tracking that help software teams see clearer, solve quicker, and learn continuously. - compatibilityRange: "[3.2.0,3.3.0-M1)" + compatibilityRange: "[3.3.0,3.3.0-M1)" groupId: io.sentry artifactId: sentry-spring-boot-starter-jakarta links: @@ -1069,7 +1056,7 @@ initializr: href: https://java.testcontainers.org/ - name: Contract Verifier bom: spring-cloud - compatibilityRange: "[3.2.0,3.5.0-M1)" + compatibilityRange: "[3.3.0,3.5.0-M1)" id: cloud-contract-verifier description: Moves TDD to the level of software architecture by enabling Consumer Driven Contract (CDC) development. groupId: org.springframework.cloud @@ -1080,7 +1067,7 @@ initializr: href: https://docs.spring.io/spring-cloud-contract/reference/ - name: Contract Stub Runner bom: spring-cloud - compatibilityRange: "[3.2.0,3.5.0-M1)" + compatibilityRange: "[3.3.0,3.5.0-M1)" id: cloud-contract-stub-runner description: Stub Runner for HTTP/Messaging based communication. Allows creating WireMock stubs from RestDocs tests. groupId: org.springframework.cloud @@ -1101,7 +1088,7 @@ initializr: href: https://docs.spring.io/spring-boot/{bootVersion}/reference/data/nosql.html#data.nosql.ldap.embedded - name: Spring Cloud bom: spring-cloud - compatibilityRange: "[3.2.0,3.5.0-M1)" + compatibilityRange: "[3.3.0,3.5.0-M1)" content: - name: Cloud Bootstrap id: cloud-starter @@ -1133,7 +1120,7 @@ initializr: href: https://docs.spring.io/spring-cloud-task/reference/ - name: Spring Cloud Config bom: spring-cloud - compatibilityRange: "[3.2.0,3.5.0-M1)" + compatibilityRange: "[3.3.0,3.5.0-M1)" content: - name: Config Client id: cloud-config-client @@ -1180,7 +1167,7 @@ initializr: href: https://docs.spring.io/spring-cloud-consul/reference/ - name: Spring Cloud Discovery bom: spring-cloud - compatibilityRange: "[3.2.0,3.5.0-M1)" + compatibilityRange: "[3.3.0,3.5.0-M1)" content: - name: Eureka Discovery Client id: cloud-eureka @@ -1222,7 +1209,7 @@ initializr: href: https://docs.spring.io/spring-cloud-consul/reference/discovery.html - name: Spring Cloud Routing bom: spring-cloud - compatibilityRange: "[3.2.0,3.5.0-M1)" + compatibilityRange: "[3.3.0,3.5.0-M1)" content: - name: Gateway id: cloud-gateway @@ -1269,7 +1256,7 @@ initializr: href: https://docs.spring.io/spring-cloud-commons/reference/spring-cloud-commons/loadbalancer.html - name: Spring Cloud Circuit Breaker bom: spring-cloud - compatibilityRange: "[3.2.0,3.5.0-M1)" + compatibilityRange: "[3.3.0,3.5.0-M1)" content: - name: Resilience4J id: cloud-resilience4j @@ -1281,7 +1268,7 @@ initializr: href: https://docs.spring.io/spring-cloud-circuitbreaker/reference/spring-cloud-circuitbreaker-resilience4j.html - name: Spring Cloud Messaging bom: spring-cloud - compatibilityRange: "[3.2.0,3.5.0-M1)" + compatibilityRange: "[3.3.0,3.5.0-M1)" content: - name: Cloud Bus id: cloud-bus @@ -1301,7 +1288,7 @@ initializr: href: https://docs.spring.io/spring-cloud-stream/reference/ - name: VMware Tanzu Application Service bom: spring-cloud-services - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" content: - name: Config Client (TAS) id: scs-config-client @@ -1321,7 +1308,7 @@ initializr: href: https://docs.vmware.com/en/Spring-Cloud-Services-for-VMware-Tanzu/index.html - name: Microsoft Azure bom: spring-cloud-azure - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" content: - name: Azure Support id: azure-support @@ -1399,7 +1386,7 @@ initializr: description: Azure Storage Sample - name: Google Cloud bom: spring-cloud-gcp - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" content: - name: Google Cloud Support id: cloud-gcp @@ -1434,7 +1421,7 @@ initializr: - rel: guide href: https://github.com/GoogleCloudPlatform/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample - name: AI - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" content: - name: Anthropic Claude id: spring-ai-anthropic @@ -1732,7 +1719,7 @@ initializr: href: https://docs.spring.io/spring-ai/reference/api/etl-pipeline.html#_pdf_page - name: Timefold Solver id: timefold-solver - compatibilityRange: "[3.2.0,3.4.0-M1)" + compatibilityRange: "[3.3.0,3.4.0-M1)" groupId: ai.timefold.solver artifactId: timefold-solver-spring-boot-starter description: AI solver to optimize operations and scheduling. @@ -1811,18 +1798,12 @@ initializr: id: groovy default: false bootVersions: - - name: 3.3.1 (SNAPSHOT) - id: 3.3.1-SNAPSHOT + - name: 3.4.0 (SNAPSHOT) + id: 3.4.0-SNAPSHOT default: false - name: 3.3.0 id: 3.3.0 default: true - - name: 3.2.7 (SNAPSHOT) - id: 3.2.7-SNAPSHOT - default: false - - name: 3.2.6 - id: 3.2.6 - default: false --- diff --git a/start-site/src/test/java/io/spring/start/site/SupportedBootVersion.java b/start-site/src/test/java/io/spring/start/site/SupportedBootVersion.java new file mode 100644 index 0000000000..e94d47aec4 --- /dev/null +++ b/start-site/src/test/java/io/spring/start/site/SupportedBootVersion.java @@ -0,0 +1,58 @@ +/* + * Copyright 2012-2024 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 io.spring.start.site; + +/** + * Supported Spring Boot versions. + * + * @author Moritz Halbritter + */ +public enum SupportedBootVersion { + + /** + * 3.3.0. + */ + V3_3("3.3.0"), + /** + * 3.4.0. + */ + V3_4("3.4.0"); + + private final String version; + + SupportedBootVersion(String version) { + this.version = version; + } + + public String getVersion() { + return this.version; + } + + @Override + public String toString() { + return getVersion(); + } + + /** + * Returns the latest supported Spring Boot version. + * @return the latest supported Spring Boot version + */ + public static SupportedBootVersion latest() { + return V3_4; + } + +} diff --git a/start-site/src/test/java/io/spring/start/site/extension/AbstractExtensionTests.java b/start-site/src/test/java/io/spring/start/site/extension/AbstractExtensionTests.java index 0a9db9caf0..4bde99c710 100755 --- a/start-site/src/test/java/io/spring/start/site/extension/AbstractExtensionTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/AbstractExtensionTests.java @@ -33,6 +33,7 @@ import io.spring.initializr.web.project.ProjectGenerationResult; import io.spring.initializr.web.project.ProjectRequest; import io.spring.initializr.web.project.WebProjectRequest; +import io.spring.start.site.SupportedBootVersion; import org.assertj.core.api.AssertProvider; import org.springframework.beans.factory.annotation.Autowired; @@ -125,13 +126,25 @@ protected ProjectStructure generateProject(ProjectRequest request) { } /** - * Create a Maven-based {@link ProjectRequest} with the specified dependencies. + * Create a Maven-based {@link ProjectRequest} with the specified dependencies. Uses + * the latest supported Spring Boot version. * @param dependencies the dependency identifiers to add * @return a project request */ protected ProjectRequest createProjectRequest(String... dependencies) { + return createProjectRequest(SupportedBootVersion.latest(), dependencies); + } + + /** + * Create a Maven-based {@link ProjectRequest} with the specified dependencies. + * @param springBootVersion the Spring Boot version to use + * @param dependencies the dependency identifiers to add + * @return a project request + */ + protected ProjectRequest createProjectRequest(SupportedBootVersion springBootVersion, String... dependencies) { WebProjectRequest request = new WebProjectRequest(); request.initialize(this.metadataProvider.get()); + request.setBootVersion(springBootVersion.getVersion()); request.setType("maven-project"); request.getDependencies().addAll(Arrays.asList(dependencies)); return request; diff --git a/start-site/src/test/java/io/spring/start/site/extension/build/gradle/GradleBuildSystemHelpDocumentCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/build/gradle/GradleBuildSystemHelpDocumentCustomizerTests.java index 7b95f58773..d9e2b3860a 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/build/gradle/GradleBuildSystemHelpDocumentCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/build/gradle/GradleBuildSystemHelpDocumentCustomizerTests.java @@ -32,37 +32,22 @@ */ class GradleBuildSystemHelpDocumentCustomizerTests extends AbstractExtensionTests { - private static final String OLD_SPRING_BOOT_VERSION = "3.2.0"; - - private static final String SPRING_BOOT_VERSION = "3.3.0"; - @Test void linksAddedToHelpDocumentForGradleBuild() { - assertHelpDocument("gradle-build", SPRING_BOOT_VERSION).contains( - "* [Official Gradle documentation](https://docs.gradle.org)", - "* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle)", - "* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.0/gradle-plugin)", - "* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.0/gradle-plugin/packaging-oci-image.html)"); - } - - @Test - void linksAddedToHelpDocumentForGradleBuildWithOldSpringBootVersion() { - assertHelpDocument("gradle-build", OLD_SPRING_BOOT_VERSION).contains( - "* [Official Gradle documentation](https://docs.gradle.org)", + assertHelpDocument("gradle-build").contains("* [Official Gradle documentation](https://docs.gradle.org)", "* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle)", - "* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.2.0/gradle-plugin/reference/html/)", - "* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.2.0/gradle-plugin/reference/html/#build-image)"); + "* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/3.4.0/gradle-plugin)", + "* [Create an OCI image](https://docs.spring.io/spring-boot/3.4.0/gradle-plugin/packaging-oci-image.html)"); } @Test void linksNotAddedToHelpDocumentForMavenBuild() { - assertHelpDocument("maven-build", SPRING_BOOT_VERSION).noneMatch((line) -> line.contains("Gradle")); + assertHelpDocument("maven-build").noneMatch((line) -> line.contains("Gradle")); } - private ListAssert assertHelpDocument(String type, String version) { + private ListAssert assertHelpDocument(String type) { ProjectRequest request = createProjectRequest("web"); request.setType(type); - request.setBootVersion(version); return assertThat(helpDocument(request)).lines(); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/build/maven/MavenBuildSystemHelpDocumentCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/build/maven/MavenBuildSystemHelpDocumentCustomizerTests.java index 147116d9b5..71a2df4b89 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/build/maven/MavenBuildSystemHelpDocumentCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/build/maven/MavenBuildSystemHelpDocumentCustomizerTests.java @@ -32,35 +32,22 @@ */ class MavenBuildSystemHelpDocumentCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - - private static final String OLD_SPRING_BOOT_VERSION = "3.2.0"; - @Test void linksAddedToHelpDocumentForMavenBuild() { - assertHelpDocument("maven-build", SPRING_BOOT_VERSION).contains( - "* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)", - "* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.0/maven-plugin)", - "* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.0/maven-plugin/build-image.html)"); - } - - @Test - void linksAddedToHelpDocumentForMavenBuildWithOldSpringBootVersion() { - assertHelpDocument("maven-build", OLD_SPRING_BOOT_VERSION).contains( + assertHelpDocument("maven-build").contains( "* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)", - "* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.2.0/maven-plugin/reference/html/)", - "* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.2.0/maven-plugin/reference/html/#build-image)"); + "* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.4.0/maven-plugin)", + "* [Create an OCI image](https://docs.spring.io/spring-boot/3.4.0/maven-plugin/build-image.html)"); } @Test void linksNotAddedToHelpDocumentForGradleBuild() { - assertHelpDocument("gradle-build", SPRING_BOOT_VERSION).noneMatch((line) -> line.contains("Maven")); + assertHelpDocument("gradle-build").noneMatch((line) -> line.contains("Maven")); } - private ListAssert assertHelpDocument(String type, String version) { + private ListAssert assertHelpDocument(String type) { ProjectRequest request = createProjectRequest("web"); request.setType(type); - request.setBootVersion(version); return assertThat(helpDocument(request)).lines(); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/code/kotlin/KotlinCoroutinesCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/code/kotlin/KotlinCoroutinesCustomizerTests.java index cf126f3767..7e6c2d0381 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/code/kotlin/KotlinCoroutinesCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/code/kotlin/KotlinCoroutinesCustomizerTests.java @@ -33,12 +33,11 @@ class KotlinCoroutinesCustomizerTests extends AbstractExtensionTests { @Test void kotlinCoroutinesIsAdded() { ProjectRequest request = createProjectRequest("webflux"); - request.setBootVersion("3.3.0"); request.setLanguage("kotlin"); ProjectStructure project = generateProject(request); assertThat(project).mavenBuild().hasDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-reactor"); assertThat(helpDocument(request)).contains( - "* [Coroutines section of the Spring Framework Documentation](https://docs.spring.io/spring-framework/reference/6.1.8/languages/kotlin/coroutines.html)"); + "* [Coroutines section of the Spring Framework Documentation](https://docs.spring.io/spring-framework/reference/6.2.0/languages/kotlin/coroutines.html)"); } @Test diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/activemq/ActiveMQProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/activemq/ActiveMQProjectGenerationConfigurationTests.java index 8297c5168f..931f06a201 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/activemq/ActiveMQProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/activemq/ActiveMQProjectGenerationConfigurationTests.java @@ -41,17 +41,9 @@ void dockerComposeWhenDockerComposeIsNotSelectedDoesNotCreateService() { } @Test - void dockerComposeCreatesAppropriateService() { + void dockerComposeCreatesAppropriateServiceWithVersion() { ProjectRequest request = createProjectRequest("docker-compose", "activemq"); - request.setBootVersion("3.2.0"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/activemq.yaml")); } - @Test - void dockerComposeCreatesAppropriateServiceWithVersion33() { - ProjectRequest request = createProjectRequest("docker-compose", "activemq"); - request.setBootVersion("3.3.0"); - assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/activemq-classic.yaml")); - } - } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/activemq/ArtemisProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/activemq/ArtemisProjectGenerationConfigurationTests.java index 008255cedc..b8be8e84ea 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/activemq/ArtemisProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/activemq/ArtemisProjectGenerationConfigurationTests.java @@ -32,27 +32,16 @@ */ class ArtemisProjectGenerationConfigurationTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - @Test void dockerComposeWhenDockerComposeIsNotSelectedDoesNotCreateService() { ProjectRequest request = createProjectRequest("web", "artemis"); - request.setBootVersion(SPRING_BOOT_VERSION); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("compose.yaml")).doesNotExist(); } - @Test - void dockerComposeWhenIncompatibleSpringBootVersionDoesNotCreateService() { - ProjectRequest request = createProjectRequest("docker-compose", "artemis"); - request.setBootVersion("3.2.0"); - assertThat(composeFile(request)).doesNotContain("artemis"); - } - @Test void dockerComposeCreatesAppropriateService() { ProjectRequest request = createProjectRequest("docker-compose", "artemis"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/artemis.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfigurationTests.java index 88ca962b60..f6a1df5b48 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/cassandra/CassandraProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -54,7 +55,8 @@ void createsCassandraServiceWhenReactive() { @Test void createsCassandraServiceWhenSpringAiIsSelected() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-cassandra"); + ProjectRequest request = createProjectRequest(SupportedBootVersion.V3_3, "docker-compose", + "spring-ai-vectordb-cassandra"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/cassandra.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/dgs/DgsBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/dgs/DgsBuildCustomizerTests.java index 0dd86da5b9..65b466e2d4 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/dgs/DgsBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/dgs/DgsBuildCustomizerTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.metadata.Dependency; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,6 +27,8 @@ class DgsBuildCustomizerTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + private Dependency dgsTest; @BeforeEach @@ -37,7 +40,7 @@ void setup() { @Test void shouldAddTestingDependency() { - ProjectRequest request = createProjectRequest("web", "netflix-dgs"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "web", "netflix-dgs"); assertThat(mavenPom(request)).hasDependency(Dependency.createSpringBootStarter("web")) .hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST)) .hasDependency(this.dgsTest) diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/elasticsearch/ElasticsearchProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/elasticsearch/ElasticsearchProjectGenerationConfigurationTests.java index 7bd55b1a60..adabe1284d 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/elasticsearch/ElasticsearchProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/elasticsearch/ElasticsearchProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -48,7 +49,8 @@ void createsElasticsearchService() { @Test void createsElasticsearchServiceWhenSpringAiModuleIsSelected() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-elasticsearch"); + ProjectRequest request = createProjectRequest(SupportedBootVersion.V3_3, "docker-compose", + "spring-ai-vectordb-elasticsearch"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/elasticsearch.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/flyway/FlywayBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/flyway/FlywayBuildCustomizerTests.java index 4fe4f80050..1bb1c66357 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/flyway/FlywayBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/flyway/FlywayBuildCustomizerTests.java @@ -30,105 +30,93 @@ */ class FlywayBuildCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION_3_2 = "3.2.0"; - - private static final String SPRING_BOOT_VERSION_3_3 = "3.3.0"; - @Test void mariadbOnly() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_2, "mariadb"); + ProjectRequest projectRequest = createProject("mariadb"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("mariadb")) .doesNotHaveDependency("org.flywaydb", "flyway-mysql"); } @Test void mysqlOnly() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_2, "mysql"); + ProjectRequest projectRequest = createProject("mysql"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("mysql")) .doesNotHaveDependency("org.flywaydb", "flyway-mysql"); } @Test void sqlserverOnly() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_2, "sqlserver"); + ProjectRequest projectRequest = createProject("sqlserver"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("sqlserver")) .doesNotHaveDependency("org.flywaydb", "flyway-sqlserver"); } @Test void oracleOnly() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_2, "oracle"); + ProjectRequest projectRequest = createProject("oracle"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("oracle")) .doesNotHaveDependency("org.flywaydb", "flyway-database-oracle"); } @Test void mariadbAndFlyway() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_2, "mariadb", "flyway"); + ProjectRequest projectRequest = createProject("mariadb", "flyway"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("mariadb")) .hasDependency("org.flywaydb", "flyway-mysql"); } @Test void mysqlAndFlyway() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_2, "mysql", "flyway"); + ProjectRequest projectRequest = createProject("mysql", "flyway"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("mysql")) .hasDependency("org.flywaydb", "flyway-mysql"); } @Test void sqlserverAndFlyway() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_2, "sqlserver", "flyway"); + ProjectRequest projectRequest = createProject("sqlserver", "flyway"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("sqlserver")) .hasDependency("org.flywaydb", "flyway-sqlserver"); } @Test void oracleAndFlyway() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_2, "oracle", "flyway"); + ProjectRequest projectRequest = createProject("oracle", "flyway"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("oracle")) .hasDependency("org.flywaydb", "flyway-database-oracle"); } - @Test - void db2AndFlywayOnSpringBoot32() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_2, "db2", "flyway"); - assertThat(mavenPom(projectRequest)).hasDependency(getDependency("db2")) - .doesNotHaveDependency("org.flywaydb", "flyway-database-db2"); - } - @Test void db2AndFlyway() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_3, "db2", "flyway"); + ProjectRequest projectRequest = createProject("db2", "flyway"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("db2")) .hasDependency("org.flywaydb", "flyway-database-db2"); } @Test void derbyAndFlyway() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_3, "derby", "flyway"); + ProjectRequest projectRequest = createProject("derby", "flyway"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("derby")) .hasDependency("org.flywaydb", "flyway-database-derby"); } @Test void hsqlAndFlyway() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_3, "hsql", "flyway"); + ProjectRequest projectRequest = createProject("hsql", "flyway"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("hsql")) .hasDependency("org.flywaydb", "flyway-database-hsqldb"); } @Test void hsqlAndPostgres() { - ProjectRequest projectRequest = createProject(SPRING_BOOT_VERSION_3_3, "postgresql", "flyway"); + ProjectRequest projectRequest = createProject("postgresql", "flyway"); assertThat(mavenPom(projectRequest)).hasDependency(getDependency("postgresql")) .hasDependency("org.flywaydb", "flyway-database-postgresql"); } - private ProjectRequest createProject(String springBootVersion, String... styles) { + private ProjectRequest createProject(String... styles) { ProjectRequest projectRequest = createProjectRequest(styles); projectRequest.setLanguage("java"); - projectRequest.setBootVersion(springBootVersion); return projectRequest; } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/graalvm/GraalVmHelpDocumentCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/graalvm/GraalVmHelpDocumentCustomizerTests.java index 5a52066e79..927c5793f9 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/graalvm/GraalVmHelpDocumentCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/graalvm/GraalVmHelpDocumentCustomizerTests.java @@ -26,6 +26,7 @@ import io.spring.initializr.generator.test.io.TextAssert; import io.spring.initializr.generator.version.Version; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -41,56 +42,28 @@ */ class GraalVmHelpDocumentCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - - private static final String OLD_SPRING_BOOT_VERSION = "3.2.0"; - @Autowired private MustacheTemplateRenderer templateRenderer; @Test void mavenBuildAddLinkToMavenAotPlugin() { MutableProjectDescription description = new MutableProjectDescription(); - description.setPlatformVersion(Version.parse(SPRING_BOOT_VERSION)); - HelpDocument document = customize(description, new MavenBuild()); - assertThat(document.gettingStarted().additionalLinks().getItems()).singleElement().satisfies((link) -> { - assertThat(link.getDescription()).isEqualTo("Configure AOT settings in Build Plugin"); - assertThat(link.getHref()).isEqualTo("https://docs.spring.io/spring-boot/3.3.0/how-to/aot.html"); - }); - } - - @Test - void mavenBuildAddLinkToMavenAotPluginWithOldSpringBootVersion() { - MutableProjectDescription description = new MutableProjectDescription(); - description.setPlatformVersion(Version.parse(OLD_SPRING_BOOT_VERSION)); + description.setPlatformVersion(Version.parse(SupportedBootVersion.latest().getVersion())); HelpDocument document = customize(description, new MavenBuild()); assertThat(document.gettingStarted().additionalLinks().getItems()).singleElement().satisfies((link) -> { assertThat(link.getDescription()).isEqualTo("Configure AOT settings in Build Plugin"); - assertThat(link.getHref()) - .isEqualTo("https://docs.spring.io/spring-boot/docs/3.2.0/maven-plugin/reference/htmlsingle/#aot"); + assertThat(link.getHref()).isEqualTo("https://docs.spring.io/spring-boot/3.4.0/how-to/aot.html"); }); } @Test void gradleBuildAddLinkToGradleAotPlugin() { MutableProjectDescription description = new MutableProjectDescription(); - description.setPlatformVersion(Version.parse(SPRING_BOOT_VERSION)); - HelpDocument document = customize(description, new GradleBuild()); - assertThat(document.gettingStarted().additionalLinks().getItems()).singleElement().satisfies((link) -> { - assertThat(link.getDescription()).isEqualTo("Configure AOT settings in Build Plugin"); - assertThat(link.getHref()).isEqualTo("https://docs.spring.io/spring-boot/3.3.0/how-to/aot.html"); - }); - } - - @Test - void gradleBuildAddLinkToGradleAotPluginWithOldSpringBootVersion() { - MutableProjectDescription description = new MutableProjectDescription(); - description.setPlatformVersion(Version.parse(OLD_SPRING_BOOT_VERSION)); + description.setPlatformVersion(Version.parse(SupportedBootVersion.latest().getVersion())); HelpDocument document = customize(description, new GradleBuild()); assertThat(document.gettingStarted().additionalLinks().getItems()).singleElement().satisfies((link) -> { assertThat(link.getDescription()).isEqualTo("Configure AOT settings in Build Plugin"); - assertThat(link.getHref()) - .isEqualTo("https://docs.spring.io/spring-boot/docs/3.2.0/gradle-plugin/reference/htmlsingle/#aot"); + assertThat(link.getHref()).isEqualTo("https://docs.spring.io/spring-boot/3.4.0/how-to/aot.html"); }); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/graalvm/GraalVmProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/graalvm/GraalVmProjectGenerationConfigurationTests.java index 535210101c..ce879c9198 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/graalvm/GraalVmProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/graalvm/GraalVmProjectGenerationConfigurationTests.java @@ -20,6 +20,7 @@ import io.spring.initializr.generator.version.Version; import io.spring.initializr.versionresolver.MavenVersionResolver; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -34,8 +35,6 @@ */ class GraalVmProjectGenerationConfigurationTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - @Test void gradleBuildWithoutNativeDoesNotConfigureNativeBuildTools() { ProjectRequest request = createProjectRequest("web"); @@ -63,9 +62,8 @@ void mavenBuildConfigureNativeBuildtoolsPlugint() { @Test void gradleBuildConfigureNativeBuildToolsPlugin(@Autowired MavenVersionResolver mavenVersionResolver) { String nbtVersion = NativeBuildtoolsVersionResolver.resolve(mavenVersionResolver, - Version.parse(SPRING_BOOT_VERSION)); + Version.parse(SupportedBootVersion.latest().getVersion())); ProjectRequest request = createNativeProjectRequest(); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(gradleBuild(request)).hasPlugin("org.graalvm.buildtools.native", nbtVersion); } @@ -140,7 +138,6 @@ void groovyProjectDoesNotConfigureGraalVm() { private ProjectRequest createNativeProjectRequest(String... dependencies) { ProjectRequest projectRequest = createProjectRequest(dependencies); projectRequest.getDependencies().add(0, "native"); - projectRequest.setBootVersion(SPRING_BOOT_VERSION); return projectRequest; } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/htmx/HtmxBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/htmx/HtmxBuildCustomizerTests.java index ada2bc088d..33426cb95e 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/htmx/HtmxBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/htmx/HtmxBuildCustomizerTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.metadata.Dependency; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -30,6 +31,8 @@ */ class HtmxBuildCustomizerTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + private final Dependency htmx = Dependency.withId("htmx", "io.github.wimdeblauwe", "htmx-spring-boot"); private final Dependency htmxThymeleaf = Dependency.withId("htmx", "io.github.wimdeblauwe", @@ -37,14 +40,14 @@ class HtmxBuildCustomizerTests extends AbstractExtensionTests { @Test void shouldUseHtmxThymleafIfThymeleafIsSelected() { - ProjectRequest request = createProjectRequest("htmx", "thymeleaf"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "htmx", "thymeleaf"); assertThat(mavenPom(request)).doesNotHaveDependency(this.htmx.getGroupId(), this.htmx.getArtifactId()) .hasDependency(this.htmxThymeleaf); } @Test void shouldUsePlainHtmxIfThymeleafIsNotSelected() { - ProjectRequest request = createProjectRequest("htmx"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "htmx"); assertThat(mavenPom(request)) .doesNotHaveDependency(this.htmxThymeleaf.getGroupId(), this.htmxThymeleaf.getArtifactId()) .hasDependency(this.htmx); diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/mybatis/MyBatisTestBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/mybatis/MyBatisTestBuildCustomizerTests.java index c25c843f85..f253ebb021 100755 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/mybatis/MyBatisTestBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/mybatis/MyBatisTestBuildCustomizerTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.metadata.Dependency; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -30,12 +31,11 @@ */ class MyBatisTestBuildCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; @Test void mybatisIsAddedWithSecurity() { - ProjectRequest request = createProjectRequest("mybatis"); - request.setBootVersion(SPRING_BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "mybatis"); assertThat(mavenPom(request)).hasDependency(mybatis()) .hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST)) .hasDependency(mybatisTest()) diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/neo4j/Neo4jProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/neo4j/Neo4jProjectGenerationConfigurationTests.java index 46891f3d4a..05ca1a0f03 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/neo4j/Neo4jProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/neo4j/Neo4jProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -47,7 +48,8 @@ void createsNeo4jService() { @Test void createsNeo4jServiceWhenSpringAiModuleIsSelected() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-neo4j"); + ProjectRequest request = createProjectRequest(SupportedBootVersion.V3_3, "docker-compose", + "spring-ai-vectordb-neo4j"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/neo4j.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/observability/ObservabilityActuatorBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/observability/ObservabilityActuatorBuildCustomizerTests.java index 6c3f6c9feb..eb8b1bde04 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/observability/ObservabilityActuatorBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/observability/ObservabilityActuatorBuildCustomizerTests.java @@ -31,19 +31,15 @@ */ class ObservabilityActuatorBuildCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - @ParameterizedTest @ValueSource(strings = { "datadog", "dynatrace", "influx", "graphite", "new-relic", "otlp-metrics", "prometheus", "distributed-tracing", "zipkin", "wavefront" }) void actuatorIsAddedWithObservabilityEntries(String dependency) { - assertThat(generateProject(SPRING_BOOT_VERSION, dependency)).mavenBuild() - .hasDependency(getDependency("actuator")); + assertThat(generateProject(dependency)).mavenBuild().hasDependency(getDependency("actuator")); } - private ProjectStructure generateProject(String bootVersion, String... dependencies) { + private ProjectStructure generateProject(String... dependencies) { ProjectRequest request = createProjectRequest(dependencies); - request.setBootVersion(bootVersion); request.setType("maven-build"); return generateProject(request); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/observability/ObservabilityHelpDocumentCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/observability/ObservabilityHelpDocumentCustomizerTests.java index 44f9777fdb..b05a038960 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/observability/ObservabilityHelpDocumentCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/observability/ObservabilityHelpDocumentCustomizerTests.java @@ -30,33 +30,21 @@ */ class ObservabilityHelpDocumentCustomizerTests extends AbstractExtensionTests { - private static final String OLD_SPRING_BOOT_VERSION = "3.2.0"; - - private static final String SPRING_BOOT_VERSION = "3.3.0"; - @Test void linksAddedToHelpDocumentForGradleBuild() { - assertHelpDocument(SPRING_BOOT_VERSION, "distributed-tracing").contains( - "* [Distributed Tracing Reference Guide](https://docs.micrometer.io/tracing/reference/index.html)", - "* [Getting Started with Distributed Tracing](https://docs.spring.io/spring-boot/3.3.0/reference/actuator/tracing.html)"); - } - - @Test - void linksAddedToHelpDocumentForGradleBuildWithOldSpringBootVersion() { - assertHelpDocument(OLD_SPRING_BOOT_VERSION, "distributed-tracing").contains( + assertHelpDocument("distributed-tracing").contains( "* [Distributed Tracing Reference Guide](https://docs.micrometer.io/tracing/reference/index.html)", - "* [Getting Started with Distributed Tracing](https://docs.spring.io/spring-boot/docs/3.2.0/reference/html/actuator.html#actuator.micrometer-tracing.getting-started)"); + "* [Getting Started with Distributed Tracing](https://docs.spring.io/spring-boot/3.4.0/reference/actuator/tracing.html)"); } @Test void linksNotAddedToHelpDocumentForBuildWithoutTracing() { - assertHelpDocument(SPRING_BOOT_VERSION).noneMatch((line) -> line.contains("Tracing")); + assertHelpDocument().noneMatch((line) -> line.contains("Tracing")); } - private ListAssert assertHelpDocument(String version, String... dependencies) { + private ListAssert assertHelpDocument(String... dependencies) { ProjectRequest request = createProjectRequest(dependencies); request.setType("gradle-build"); - request.setBootVersion(version); return assertThat(helpDocument(request)).lines(); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/okta/OktaHelpDocumentCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/okta/OktaHelpDocumentCustomizerTests.java index 145284c186..5b4c0bd2a0 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/okta/OktaHelpDocumentCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/okta/OktaHelpDocumentCustomizerTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.io.TextAssert; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -30,7 +31,7 @@ */ class OktaHelpDocumentCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; @Test void oktaSectionWithOktaDependencyIsPresent() { @@ -43,8 +44,7 @@ void oktaSectionWithoutOktaDependencyIsMissing() { } private TextAssert assertHelpDocument(String... dependencies) { - ProjectRequest request = createProjectRequest(dependencies); - request.setBootVersion(SPRING_BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, dependencies); return assertThat(helpDocument(request)); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/oracle/OracleProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/oracle/OracleProjectGenerationConfigurationTests.java index 4ce6787f76..9a1bb34062 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/oracle/OracleProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/oracle/OracleProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -33,8 +34,6 @@ */ class OracleProjectGenerationConfigurationTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.2.0"; - @Test void doesNotGenerateComposeYamlWithoutDockerCompose() { ProjectRequest request = createProjectRequest("web", "oracle"); @@ -43,23 +42,21 @@ void doesNotGenerateComposeYamlWithoutDockerCompose() { } @Test - void createsOracleFreeServiceWithBoot32() { + void createsOracleFreeService() { ProjectRequest request = createProjectRequest("docker-compose", "oracle"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/oracle-free.yaml")); } @Test - void createsOracleFreeServiceWithBoot32AndSpringAi() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-oracle"); - request.setBootVersion(SPRING_BOOT_VERSION); + void createsOracleFreeServiceSpringAi() { + ProjectRequest request = createProjectRequest(SupportedBootVersion.V3_3, "docker-compose", + "spring-ai-vectordb-oracle"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/oracle-free.yaml")); } @Test - void declaresOracleFreeContainerBeanWithBoot32() { + void declaresOracleFreeContainerBean() { ProjectRequest request = createProjectRequest("testcontainers", "oracle"); - request.setBootVersion(SPRING_BOOT_VERSION); request.setLanguage("java"); assertThat(generateProject(request)).textFile("src/test/java/com/example/demo/TestcontainersConfiguration.java") .contains("import org.testcontainers.oracle.OracleContainer;") diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/postgresql/PgVectorProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/postgresql/PgVectorProjectGenerationConfigurationTests.java index a8f8be1041..37ac410633 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/postgresql/PgVectorProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/postgresql/PgVectorProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -33,27 +34,25 @@ */ class PgVectorProjectGenerationConfigurationTests extends AbstractExtensionTests { - private static final String BOOT_VERSION = "3.2.6"; + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; @Test void doesNothingWithoutDockerCompose() { - ProjectRequest request = createProjectRequest("web", "spring-ai-vectordb-pgvector"); - request.setBootVersion(BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "web", "spring-ai-vectordb-pgvector"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("compose.yaml")).doesNotExist(); } @Test void createsPostgresService() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-pgvector"); - request.setBootVersion(BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "docker-compose", "spring-ai-vectordb-pgvector"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/pgvector.yaml")); } @Test void shouldOnlyHavePgVectorIfPostgresAndPgVectorIsSelected() { - ProjectRequest request = createProjectRequest("docker-compose", "postgresql", "spring-ai-vectordb-pgvector"); - request.setBootVersion(BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "docker-compose", "postgresql", + "spring-ai-vectordb-pgvector"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/pgvector.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/redis/RedisStackProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/redis/RedisStackProjectGenerationConfigurationTests.java index 44a283445c..826253c519 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/redis/RedisStackProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/redis/RedisStackProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -32,16 +33,18 @@ */ class RedisStackProjectGenerationConfigurationTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @Test void doesNothingWithoutDockerCompose() { - ProjectRequest request = createProjectRequest("spring-ai-vectordb-redis"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "spring-ai-vectordb-redis"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("compose.yaml")).doesNotExist(); } @Test void createsRedisStackService() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-redis"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "docker-compose", "spring-ai-vectordb-redis"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/redis-stack.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/solace/SolaceBinderBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/solace/SolaceBinderBuildCustomizerTests.java index 6179c263dd..5502381cc0 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/solace/SolaceBinderBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/solace/SolaceBinderBuildCustomizerTests.java @@ -19,6 +19,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.metadata.Dependency; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -31,20 +32,18 @@ */ class SolaceBinderBuildCustomizerTests extends AbstractExtensionTests { - private static final String BOOT_VERSION = "3.2.6"; + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; @Test void binderNotAddedWhenSolaceNotSelected() { ProjectRequest request = createProjectRequest("cloud-stream"); - request.setBootVersion(BOOT_VERSION); ProjectStructure project = generateProject(request); assertNoBinder(project); } @Test void binderNotAddedWhenCloudStreamNotSelected() { - ProjectRequest request = createProjectRequest("solace"); - request.setBootVersion(BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "solace"); ProjectStructure project = generateProject(request); assertNoBinder(project); assertThat(project).mavenBuild().hasDependency(getDependency("solace")); @@ -52,16 +51,14 @@ void binderNotAddedWhenCloudStreamNotSelected() { @Test void binderAddedWhenSolaceAndCloudStreamSelected() { - ProjectRequest request = createProjectRequest("solace", "cloud-stream"); - request.setBootVersion(BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "solace", "cloud-stream"); ProjectStructure project = generateProject(request); assertThat(project).mavenBuild().hasDependency("com.solace.spring.cloud", "spring-cloud-starter-stream-solace"); } @Test void bomAddedWhenSolaceAndCloudStreamSelected() { - ProjectRequest request = createProjectRequest("solace", "cloud-stream"); - request.setBootVersion(BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "solace", "cloud-stream"); ProjectStructure project = generateProject(request); assertThat(project).mavenBuild() .hasBom("com.solace.spring.cloud", "solace-spring-cloud-bom", "${solace-spring-cloud.version}"); @@ -69,18 +66,16 @@ void bomAddedWhenSolaceAndCloudStreamSelected() { @Test void bomPropertyAddedWhenSolaceAndCloudStreamSelected() { - String platformVersion = "3.2.0"; - ProjectRequest request = createProjectRequest("solace", "cloud-stream"); - request.setBootVersion(platformVersion); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "solace", "cloud-stream"); ProjectStructure project = generateProject(request); assertThat(project).mavenBuild() - .hasProperty("solace-spring-cloud.version", getBom("solace-spring-cloud", platformVersion).getVersion()); + .hasProperty("solace-spring-cloud.version", + getBom("solace-spring-cloud", BOOT_VERSION.getVersion()).getVersion()); } @Test void solaceStarterRemovedWhenSolaceAndCloudStreamSelected() { - ProjectRequest request = createProjectRequest("solace", "cloud-stream"); - request.setBootVersion(BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "solace", "cloud-stream"); ProjectStructure project = generateProject(request); Dependency solace = getDependency("solace"); assertThat(project).mavenBuild().doesNotHaveDependency(solace.getGroupId(), solace.getArtifactId()); diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiChromaProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiChromaProjectGenerationConfigurationTests.java index 84549936da..d88c91f0b1 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiChromaProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiChromaProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -32,16 +33,18 @@ */ class SpringAiChromaProjectGenerationConfigurationTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @Test void doesNothingWithoutDockerCompose() { - ProjectRequest request = createProjectRequest("web", "spring-ai-vectordb-chroma"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "web", "spring-ai-vectordb-chroma"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("compose.yaml")).doesNotExist(); } @Test void createsChromaService() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-chroma"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "docker-compose", "spring-ai-vectordb-chroma"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/chroma.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiDockerComposeProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiDockerComposeProjectGenerationConfigurationTests.java index ca0731f232..3e3efb0361 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiDockerComposeProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiDockerComposeProjectGenerationConfigurationTests.java @@ -19,6 +19,7 @@ import java.util.stream.Stream; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -34,6 +35,8 @@ */ class SpringAiDockerComposeProjectGenerationConfigurationTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @ParameterizedTest @MethodSource("supportedDockerComposeSpringAiEntriesBuild") void springAiTestcontainersDependencyIsAdded(String springAiDependency) { @@ -50,9 +53,8 @@ void shouldNotAddSpringAiTestcontainersDependencyIfNoSpringAiDependencyIsSelecte } private ProjectRequest createProject(String... styles) { - ProjectRequest projectRequest = createProjectRequest(styles); + ProjectRequest projectRequest = createProjectRequest(BOOT_VERSION, styles); projectRequest.setLanguage("java"); - projectRequest.setBootVersion("3.3.0"); return projectRequest; } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiOllamaProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiOllamaProjectGenerationConfigurationTests.java index aab0aa859d..e1fa66067a 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiOllamaProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiOllamaProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -32,16 +33,18 @@ */ class SpringAiOllamaProjectGenerationConfigurationTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @Test void doesNothingWithoutDockerCompose() { - ProjectRequest request = createProjectRequest("web", "spring-ai-ollama"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "web", "spring-ai-ollama"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("compose.yaml")).doesNotExist(); } @Test void createsOllamaService() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-ollama"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "docker-compose", "spring-ai-ollama"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/ollama.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiQdrantProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiQdrantProjectGenerationConfigurationTests.java index aea6c230f9..51432ff95d 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiQdrantProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiQdrantProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -32,16 +33,18 @@ */ class SpringAiQdrantProjectGenerationConfigurationTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @Test void doesNothingWithoutDockerCompose() { - ProjectRequest request = createProjectRequest("web", "spring-ai-vectordb-qdrant"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "web", "spring-ai-vectordb-qdrant"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("compose.yaml")).doesNotExist(); } @Test void createsQdrantService() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-qdrant"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "docker-compose", "spring-ai-vectordb-qdrant"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/qdrant.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiTestcontainersProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiTestcontainersProjectGenerationConfigurationTests.java index fe7536aa8b..4851ea8351 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiTestcontainersProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiTestcontainersProjectGenerationConfigurationTests.java @@ -19,6 +19,7 @@ import java.util.stream.Stream; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -34,6 +35,8 @@ */ class SpringAiTestcontainersProjectGenerationConfigurationTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @ParameterizedTest @MethodSource("supportedTestcontainersSpringAiEntriesBuild") void springAiTestcontainersDependencyIsAdded(String springAiDependency) { @@ -55,9 +58,8 @@ static Stream supportedTestcontainersSpringAiEntriesBuild() { } private ProjectRequest createProject(String... styles) { - ProjectRequest projectRequest = createProjectRequest(styles); + ProjectRequest projectRequest = createProjectRequest(BOOT_VERSION, styles); projectRequest.setLanguage("java"); - projectRequest.setBootVersion("3.3.0"); return projectRequest; } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiWeaviateProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiWeaviateProjectGenerationConfigurationTests.java index 8560dd744e..75dac79c68 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiWeaviateProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springai/SpringAiWeaviateProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -32,16 +33,18 @@ */ class SpringAiWeaviateProjectGenerationConfigurationTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @Test void doesNothingWithoutDockerCompose() { - ProjectRequest request = createProjectRequest("web", "spring-ai-vectordb-qdrant"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "web", "spring-ai-vectordb-qdrant"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("compose.yaml")).doesNotExist(); } @Test void createsWeaviateService() { - ProjectRequest request = createProjectRequest("docker-compose", "spring-ai-vectordb-weaviate"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "docker-compose", "spring-ai-vectordb-weaviate"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/weaviate.yaml")); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureDockerComposeProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureDockerComposeProjectGenerationConfigurationTests.java index eead354025..c976bc74ef 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureDockerComposeProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureDockerComposeProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -32,22 +33,24 @@ */ class SpringAzureDockerComposeProjectGenerationConfigurationTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @Test void doesNothingWithoutDockerCompose() { - ProjectRequest request = createProjectRequest("web", "azure-storage"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "web", "azure-storage"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("compose.yaml")).doesNotExist(); } @Test void createsAzuriteService() { - ProjectRequest request = createProjectRequest("docker-compose", "azure-storage"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "docker-compose", "azure-storage"); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/azurite.yaml")); } @Test void springAzureDockerComposeDependencyIsAdded() { - ProjectRequest projectRequest = createProjectRequest("docker-compose", "azure-storage"); + ProjectRequest projectRequest = createProjectRequest(BOOT_VERSION, "docker-compose", "azure-storage"); assertThat(mavenPom(projectRequest)).hasDependency("com.azure.spring", "spring-cloud-azure-docker-compose", null, "runtime"); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureProjectGenerationConfigurationTests.java index f980c5c21c..bda785d2bc 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureProjectGenerationConfigurationTests.java @@ -21,6 +21,7 @@ import io.spring.initializr.generator.test.io.TextAssert; import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -37,12 +38,12 @@ */ class SpringAzureProjectGenerationConfigurationTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; @ParameterizedTest @MethodSource("azureDependencies") void onlyAzureDependency(String dependencyId) { - ProjectStructure project = generateProject(SPRING_BOOT_VERSION, dependencyId); + ProjectStructure project = generateProject(dependencyId); assertThat(project).mavenBuild() .hasBom("com.azure.spring", "spring-cloud-azure-dependencies", "${spring-cloud-azure.version}") .hasDependency(getDependency(dependencyId)) @@ -54,7 +55,7 @@ void onlyAzureDependency(String dependencyId) { @Test void onlyActuator() { - ProjectStructure project = generateProject(SPRING_BOOT_VERSION, "actuator"); + ProjectStructure project = generateProject("actuator"); assertThat(project).mavenBuild() .doesNotHaveBom("com.azure.spring", "spring-cloud-azure-dependencies") .hasDependenciesSize(2) @@ -65,7 +66,7 @@ void onlyActuator() { @ParameterizedTest @MethodSource("azureDependencies") void azureDependencyWithActuator(String dependencyId) { - ProjectStructure project = generateProject(SPRING_BOOT_VERSION, dependencyId, "actuator"); + ProjectStructure project = generateProject(dependencyId, "actuator"); assertThat(project).mavenBuild() .hasBom("com.azure.spring", "spring-cloud-azure-dependencies", "${spring-cloud-azure.version}") .hasDependency(getDependency(dependencyId)) @@ -76,7 +77,7 @@ void azureDependencyWithActuator(String dependencyId) { @Test void onlyIntegration() { - ProjectStructure project = generateProject(SPRING_BOOT_VERSION, "integration"); + ProjectStructure project = generateProject("integration"); assertThat(project).mavenBuild() .doesNotHaveBom("com.azure.spring", "spring-cloud-azure-dependencies") .hasDependenciesSize(3) @@ -87,7 +88,7 @@ void onlyIntegration() { @Test void azureStorageWithIntegration() { - ProjectStructure project = generateProject(SPRING_BOOT_VERSION, "azure-storage", "integration"); + ProjectStructure project = generateProject("azure-storage", "integration"); assertThat(project).mavenBuild() .hasBom("com.azure.spring", "spring-cloud-azure-dependencies", "${spring-cloud-azure.version}") .hasDependency(getDependency("azure-storage")) @@ -99,7 +100,7 @@ void azureStorageWithIntegration() { @Test void azureJdbcWithMysql() { - ProjectStructure project = generateProject(SPRING_BOOT_VERSION, "mysql", "azure-support"); + ProjectStructure project = generateProject("mysql", "azure-support"); assertThat(project).mavenBuild() .hasBom("com.azure.spring", "spring-cloud-azure-dependencies", "${spring-cloud-azure.version}") .hasDependency("com.azure.spring", "spring-cloud-azure-starter-jdbc-mysql"); @@ -109,7 +110,7 @@ void azureJdbcWithMysql() { @Test void azureJdbcWithPostgresql() { - ProjectStructure project = generateProject(SPRING_BOOT_VERSION, "postgresql", "azure-support"); + ProjectStructure project = generateProject("postgresql", "azure-support"); assertThat(project).mavenBuild() .hasBom("com.azure.spring", "spring-cloud-azure-dependencies", "${spring-cloud-azure.version}") .hasDependency("com.azure.spring", "spring-cloud-azure-starter-jdbc-postgresql"); @@ -122,9 +123,8 @@ private static Stream azureDependencies() { Arguments.of("azure-storage"), Arguments.of("azure-support")); } - private ProjectStructure generateProject(String bootVersion, String... dependencies) { - ProjectRequest request = createProjectRequest(dependencies); - request.setBootVersion(bootVersion); + private ProjectStructure generateProject(String... dependencies) { + ProjectRequest request = createProjectRequest(BOOT_VERSION, dependencies); request.setType("maven-build"); return generateProject(request); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureTestcontainersProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureTestcontainersProjectGenerationConfigurationTests.java index 7863ef955c..1f5bffe02c 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureTestcontainersProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springazure/SpringAzureTestcontainersProjectGenerationConfigurationTests.java @@ -17,6 +17,7 @@ package io.spring.start.site.extension.dependency.springazure; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -29,16 +30,18 @@ */ class SpringAzureTestcontainersProjectGenerationConfigurationTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @Test void springAzureTestcontainersDependencyIsAdded() { - ProjectRequest projectRequest = createProjectRequest("testcontainers", "azure-storage"); + ProjectRequest projectRequest = createProjectRequest(BOOT_VERSION, "testcontainers", "azure-storage"); assertThat(mavenPom(projectRequest)).hasDependency("com.azure.spring", "spring-cloud-azure-testcontainers", null, "test"); } @Test void shouldNotAddSpringAzureTestcontainersDependencyIfNoSpringAzureDependencyIsSelected() { - ProjectRequest projectRequest = createProjectRequest("testcontainers", "azure-keyvault"); + ProjectRequest projectRequest = createProjectRequest(BOOT_VERSION, "testcontainers", "azure-keyvault"); assertThat(mavenPom(projectRequest)).doesNotHaveDependency("com.azure.spring", "spring-cloud-azure-testcontainers"); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springboot/SpringBootProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springboot/SpringBootProjectGenerationConfigurationTests.java index d67367e344..13c3fc0d32 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springboot/SpringBootProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springboot/SpringBootProjectGenerationConfigurationTests.java @@ -58,9 +58,8 @@ void dockerComposeSupportHasOptionalScope() { } @Test - void springBoot32DoesNotConfigureJammyBaseBuilder() { + void springBootDoesNotConfigureJammyBaseBuilder() { ProjectRequest request = createProjectRequest(); - request.setBootVersion("3.2.0"); assertThat(mavenPom(request)).doesNotContain(""); } @@ -100,16 +99,14 @@ void mavenWithDockerComposeSupportHasOptionalScope() { } @Test - void springBoot32WithGroovyDslDoesNotConfigureJammyBaseBuilder() { + void springBootWithGroovyDslDoesNotConfigureJammyBaseBuilder() { ProjectRequest request = createProjectRequest(); - request.setBootVersion("3.2.0"); assertThat(gradleBuild(request)).doesNotContain("builder = '"); } @Test - void springBoot32WithKotlinDslDoesNotConfigureJammyBaseBuilder() { + void springBootWithKotlinDslDoesNotConfigureJammyBaseBuilder() { ProjectRequest request = createProjectRequest(); - request.setBootVersion("3.2.0"); assertThat(gradleKotlinDslBuild(request)).doesNotContain("builder.set(\""); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudCircuitBreakerBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudCircuitBreakerBuildCustomizerTests.java index b9ffe3178c..fd58ffdd91 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudCircuitBreakerBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudCircuitBreakerBuildCustomizerTests.java @@ -30,15 +30,12 @@ */ class SpringCloudCircuitBreakerBuildCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - private static final Dependency REACTIVE_CLOUD_CIRCUIT_BREAKER = Dependency.withId("cloud-resilience4j-reactive", "org.springframework.cloud", "spring-cloud-starter-circuitbreaker-reactor-resilience4j"); @Test void replacesCircuitBreakerWithReactiveCircuitBreakerWhenReactiveFacetPresent() { ProjectRequest request = createProjectRequest("webflux", "cloud-resilience4j"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("webflux")) .hasDependency(REACTIVE_CLOUD_CIRCUIT_BREAKER) .doesNotHaveDependency("org.springframework.cloud", "spring-cloud-starter-circuitbreaker-resilience4j") @@ -49,7 +46,6 @@ void replacesCircuitBreakerWithReactiveCircuitBreakerWhenReactiveFacetPresent() @Test void doesNotReplaceCircuitBreakerWithReactiveCircuitBreakerWhenReactiveFacetNotPresent() { ProjectRequest request = createProjectRequest("cloud-resilience4j"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-resilience4j")) .doesNotHaveDependency("org.springframework.cloud", "spring-cloud-starter-circuitbreaker-reactor-resilience4j") diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractConfigurationTests.java index de74a948eb..dcd71a87ae 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractConfigurationTests.java @@ -31,12 +31,9 @@ */ class SpringCloudContractConfigurationTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - @Test void contractsDirectoryWithMavenIsCreatedWithSpringCloudContractVerifier() { ProjectRequest request = createProjectRequest("web", "cloud-contract-verifier"); - request.setBootVersion(SPRING_BOOT_VERSION); request.setType("maven-project"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("src/test/resources/contracts")).exists().isDirectory(); @@ -45,7 +42,6 @@ void contractsDirectoryWithMavenIsCreatedWithSpringCloudContractVerifier() { @Test void contractsDirectoryWithMavenIsNotCreatedIfSpringCloudContractVerifierIsNotRequested() { ProjectRequest request = createProjectRequest("web"); - request.setBootVersion(SPRING_BOOT_VERSION); request.setType("maven-project"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("src/test/resources/contracts")).doesNotExist(); @@ -54,7 +50,6 @@ void contractsDirectoryWithMavenIsNotCreatedIfSpringCloudContractVerifierIsNotRe @Test void contractsDirectoryWithGradleIsCreatedWithSpringCloudContractVerifier() { ProjectRequest request = createProjectRequest("web", "cloud-contract-verifier"); - request.setBootVersion(SPRING_BOOT_VERSION); request.setType("gradle-project"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("src/contractTest/resources/contracts")).exists() @@ -64,7 +59,6 @@ void contractsDirectoryWithGradleIsCreatedWithSpringCloudContractVerifier() { @Test void contractsDirectoryWithGradleIsNotCreatedIfSpringCloudContractVerifierIsNotRequested() { ProjectRequest request = createProjectRequest("web"); - request.setBootVersion(SPRING_BOOT_VERSION); request.setType("gradle-project"); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("src/contractTest/resources/contracts")).doesNotExist(); diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractGradleBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractGradleBuildCustomizerTests.java index 3e87a7d55a..590b711ee7 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractGradleBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractGradleBuildCustomizerTests.java @@ -31,40 +31,33 @@ */ class SpringCloudContractGradleBuildCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - @Test void springCloudContractVerifierPluginAddedWhenSCCDependencyPresent() { ProjectRequest request = createProjectRequest("cloud-contract-verifier"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(gradleBuild(request)).contains("id 'org.springframework.cloud.contract' version '"); } @Test void springCloudContractVerifierPluginNotAddedWhenSCCDependencyAbsent() { ProjectRequest request = createProjectRequest(); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(gradleBuild(request)).doesNotContain("org.springframework.cloud.contract"); } @Test void springCloudContractVerifierPluginContractTestWithJUnit5ByDefault() { ProjectRequest request = createProjectRequest("cloud-contract-verifier"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(gradleBuild(request)).containsSubsequence("tasks.named('contractTest') {", "useJUnitPlatform()"); } @Test void springCloudContractVerifierPluginWithGroovyDslAndWithTestModeSetWhenWebFluxIsPresent() { ProjectRequest request = createProjectRequest("cloud-contract-verifier", "webflux"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(gradleBuild(request)).containsSubsequence("contracts {", "testMode = 'WebTestClient'"); } @Test void springCloudContractVerifierPluginWithKotlinDslAndTestModeSetWhenWebFluxIsPresent() { ProjectRequest request = createProjectRequest("cloud-contract-verifier", "webflux"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(gradleKotlinDslBuild(request)) .contains("import org.springframework.cloud.contract.verifier.config.TestMode") .containsSubsequence("contracts {", "testMode = TestMode.WEBTESTCLIENT"); @@ -73,7 +66,6 @@ void springCloudContractVerifierPluginWithKotlinDslAndTestModeSetWhenWebFluxIsPr @Test void springWebTestClientDependencyAddedWhenWebFluxIsPresent() { ProjectRequest request = createProjectRequest("cloud-contract-verifier", "webflux"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(gradleBuild(request)).contains("testImplementation 'io.rest-assured:spring-web-test-client'"); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractMavenBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractMavenBuildCustomizerTests.java index 3b54637905..f213d9a1c8 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractMavenBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudContractMavenBuildCustomizerTests.java @@ -32,12 +32,9 @@ */ class SpringCloudContractMavenBuildCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - @Test void springCloudContractVerifierPluginAddedWhenSCCDependencyPresent() { ProjectRequest request = createProjectRequest("cloud-contract-verifier"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-contract-verifier")) .hasText("/project/build/plugins/plugin[1]/groupId", "org.springframework.cloud") .hasText("/project/build/plugins/plugin[1]/artifactId", "spring-cloud-contract-maven-plugin") @@ -53,7 +50,6 @@ void springCloudContractVerifierPluginNotAddedWhenSCCDependencyAbsent() { @Test void springCloudContractVerifierPluginForSpringBootWithJUnit5ByDefault() { ProjectRequest request = createProjectRequest("cloud-contract-verifier"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)) .hasText("/project/build/plugins/plugin[1]/artifactId", "spring-cloud-contract-maven-plugin") .hasText("/project/build/plugins/plugin[1]/configuration/testFramework", "JUNIT5"); @@ -62,7 +58,6 @@ void springCloudContractVerifierPluginForSpringBootWithJUnit5ByDefault() { @Test void springCloudContractVerifierPluginWithTestModeSetWhenWebFluxIsPresent() { ProjectRequest request = createProjectRequest("cloud-contract-verifier", "webflux"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)) .hasText("/project/build/plugins/plugin[1]/artifactId", "spring-cloud-contract-maven-plugin") .hasText("/project/build/plugins/plugin[1]/configuration/testMode", "WEBTESTCLIENT"); @@ -71,7 +66,6 @@ void springCloudContractVerifierPluginWithTestModeSetWhenWebFluxIsPresent() { @Test void springWebTestClientDependencyAddedWhenWebFluxIsPresent() { ProjectRequest request = createProjectRequest("cloud-contract-verifier", "webflux"); - request.setBootVersion(SPRING_BOOT_VERSION); Dependency springWebTestClientDep = Dependency.withId("rest-assured-spring-web-test-client", "io.rest-assured", "spring-web-test-client"); springWebTestClientDep.setScope(Dependency.SCOPE_TEST); diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudFunctionBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudFunctionBuildCustomizerTests.java index cdb9c9a60a..8ca22758b4 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudFunctionBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudFunctionBuildCustomizerTests.java @@ -32,15 +32,12 @@ */ class SpringCloudFunctionBuildCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - static final Dependency WEB_ADAPTER = Dependency.withId("cloud-function-web", "org.springframework.cloud", "spring-cloud-function-web"); @Test void functionOnly() { ProjectRequest request = createProjectRequest("cloud-function"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-function")) .hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST)) .hasDependency(Dependency.createSpringBootStarter("")) @@ -52,7 +49,6 @@ void functionOnly() { @Test void web() { ProjectRequest request = createProjectRequest("web", "cloud-function"); - request.setBootVersion(SPRING_BOOT_VERSION); BillOfMaterials bom = getBom("spring-cloud", request.getBootVersion()); assertThat(mavenPom(request)).hasDependency(getDependency("web")) .hasDependency(WEB_ADAPTER) @@ -65,7 +61,6 @@ void web() { @Test void webflux() { ProjectRequest request = createProjectRequest("webflux", "cloud-function"); - request.setBootVersion(SPRING_BOOT_VERSION); BillOfMaterials bom = getBom("spring-cloud", request.getBootVersion()); assertThat(mavenPom(request)).hasDependency(getDependency("webflux")) .hasDependency(WEB_ADAPTER) diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudFunctionHelpDocumentCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudFunctionHelpDocumentCustomizerTests.java index 2b6218da9e..c5e62c9810 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudFunctionHelpDocumentCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudFunctionHelpDocumentCustomizerTests.java @@ -19,6 +19,7 @@ import java.util.Arrays; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -31,14 +32,13 @@ */ class SpringCloudFunctionHelpDocumentCustomizerTests extends AbstractExtensionTests { - private static final String AZURE_SECTION_TITLE = "## Running Spring Cloud Function applications on Microsoft Azure"; + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; - private static final String SPRING_BOOT_VERSION = "3.2.0"; + private static final String AZURE_SECTION_TITLE = "## Running Spring Cloud Function applications on Microsoft Azure"; @Test void functionBuildSetupInfoSectionAddedForMaven() { - ProjectRequest request = createProjectRequest(); - request.setBootVersion(SPRING_BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION); request.setType("maven-build"); request.setDependencies(Arrays.asList("cloud-function", "azure-support")); assertThat(helpDocument(request)).contains(AZURE_SECTION_TITLE); @@ -46,8 +46,7 @@ void functionBuildSetupInfoSectionAddedForMaven() { @Test void functionBuildSetupInfoSectionAddedForGradle() { - ProjectRequest request = createProjectRequest(); - request.setBootVersion(SPRING_BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION); request.setType("gradle-build"); request.setDependencies(Arrays.asList("cloud-function", "azure-support")); assertThat(helpDocument(request)).contains(AZURE_SECTION_TITLE); diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizerTests.java index 715243845f..0d5b7ba54c 100755 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springcloud/SpringCloudStreamBuildCustomizerTests.java @@ -32,8 +32,6 @@ */ class SpringCloudStreamBuildCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - private static final Dependency KAFKA_BINDER = Dependency.withId("cloud-stream-binder-kafka", "org.springframework.cloud", "spring-cloud-stream-binder-kafka"); @@ -52,7 +50,6 @@ class SpringCloudStreamBuildCustomizerTests extends AbstractExtensionTests { @Test void springCloudStreamWithRabbit() { ProjectRequest request = createProjectRequest("cloud-stream", "amqp"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-stream")) .hasDependency(getDependency("amqp")) .hasDependency(RABBIT_BINDER) @@ -64,7 +61,6 @@ void springCloudStreamWithRabbit() { @Test void springCloudStreamWithKafka() { ProjectRequest request = createProjectRequest("cloud-stream", "kafka"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-stream")) .hasDependency(getDependency("kafka")) .hasDependency(KAFKA_BINDER) @@ -76,7 +72,6 @@ void springCloudStreamWithKafka() { @Test void springCloudStreamWithKafkaStreams() { ProjectRequest request = createProjectRequest("cloud-stream", "kafka-streams"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-stream")) .hasDependency(getDependency("kafka-streams")) .hasDependency(KAFKA_STREAMS_BINDER) @@ -88,7 +83,6 @@ void springCloudStreamWithKafkaStreams() { @Test void springCloudStreamWithPulsar() { ProjectRequest request = createProjectRequest("cloud-stream", "pulsar"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-stream")) .hasDependency(getDependency("pulsar")) .hasDependency(PULSAR_BINDER) @@ -98,7 +92,6 @@ void springCloudStreamWithPulsar() { @Test void springCloudStreamWithAllBinders() { ProjectRequest request = createProjectRequest("cloud-stream", "amqp", "kafka", "kafka-streams"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-stream")) .hasDependency(getDependency("amqp")) .hasDependency(getDependency("kafka")) @@ -114,7 +107,6 @@ void springCloudStreamWithAllBinders() { @Test void springCloudBusWithRabbit() { ProjectRequest request = createProjectRequest("cloud-bus", "amqp"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-bus")) .hasDependency(getDependency("amqp")) .hasDependency(RABBIT_BINDER) @@ -125,7 +117,6 @@ void springCloudBusWithRabbit() { @Test void springCloudBusWithKafka() { ProjectRequest request = createProjectRequest("cloud-bus", "amqp"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-bus")) .hasDependency(getDependency("amqp")) .hasDependency(RABBIT_BINDER) @@ -136,7 +127,6 @@ void springCloudBusWithKafka() { @Test void springCloudBusWithAllBinders() { ProjectRequest request = createProjectRequest("cloud-bus", "amqp", "kafka", "kafka-streams"); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(mavenPom(request)).hasDependency(getDependency("cloud-bus")) .hasDependency(getDependency("amqp")) .hasDependency(getDependency("kafka")) diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationProjectGenerationConfigurationTests.java index 5109e0b088..932dfa6d1b 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationProjectGenerationConfigurationTests.java @@ -44,7 +44,7 @@ class SpringIntegrationProjectGenerationConfigurationTests extends AbstractExten void buildWithOnlySpringIntegration() { Dependency integrationTest = integrationDependency("test"); integrationTest.setScope(Dependency.SCOPE_TEST); - assertThat(generateProject("3.2.0", "integration")).mavenBuild() + assertThat(generateProject("integration")).mavenBuild() .hasDependency(getDependency("integration")) .hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST)) .hasDependency(integrationTest); @@ -53,7 +53,7 @@ void buildWithOnlySpringIntegration() { @ParameterizedTest @MethodSource("supportedEntries") void buildWithSupportedEntries(String springBootDependencyId, String integrationModuleId) { - assertThat(generateProject("3.2.0", "integration", springBootDependencyId)).mavenBuild() + assertThat(generateProject("integration", springBootDependencyId)).mavenBuild() .hasDependency(getDependency("integration")) .hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST)) .hasDependency(integrationDependency(integrationModuleId)); @@ -67,10 +67,9 @@ static Stream supportedEntries() { Arguments.arguments("data-r2dbc", "r2dbc"), Arguments.arguments("data-redis", "redis"), Arguments.arguments("data-redis-reactive", "redis"), Arguments.arguments("kafka", "kafka"), Arguments.arguments("kafka-streams", "kafka"), Arguments.arguments("mail", "mail"), - Arguments.arguments("rsocket", "rsocket"), Arguments.arguments("security", "security"), - Arguments.arguments("web", "http"), Arguments.arguments("webflux", "webflux"), - Arguments.arguments("websocket", "websocket"), Arguments.arguments("websocket", "stomp"), - Arguments.arguments("web-services", "ws")); + Arguments.arguments("rsocket", "rsocket"), Arguments.arguments("web", "http"), + Arguments.arguments("webflux", "webflux"), Arguments.arguments("websocket", "websocket"), + Arguments.arguments("websocket", "stomp"), Arguments.arguments("web-services", "ws")); } @ParameterizedTest @@ -108,8 +107,8 @@ void linkToSupportedEntriesWhenTwoMatchesArePresentOnlyAddLinkOnce() { } @Test - void securityAddsSpringSecurityMessagingOnBoot3dot3() { - assertThat(generateProject("3.3.0", "integration", "security")).mavenBuild() + void securityAddsSpringSecurityMessaging() { + assertThat(generateProject("integration", "security")).mavenBuild() .hasDependency("org.springframework.security", "spring-security-messaging") .doesNotHaveDependency("org.springframework.integration", "spring-integration-security"); @@ -121,9 +120,8 @@ private static Dependency integrationDependency(String id) { integrationModule, null, io.spring.initializr.metadata.Dependency.SCOPE_COMPILE); } - private ProjectStructure generateProject(String bootVersion, String... dependencies) { + private ProjectStructure generateProject(String... dependencies) { ProjectRequest request = createProjectRequest(dependencies); - request.setBootVersion(bootVersion); request.setType("maven-build"); return generateProject(request); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springpulsar/SpringPulsarProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springpulsar/SpringPulsarProjectGenerationConfigurationTests.java index 970d329fc4..6695d762a6 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springpulsar/SpringPulsarProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springpulsar/SpringPulsarProjectGenerationConfigurationTests.java @@ -22,6 +22,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.generator.version.Version; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.container.DockerServiceResolver; import io.spring.start.site.container.ServiceConnections; import io.spring.start.site.container.ServiceConnectionsCustomizer; @@ -44,23 +45,19 @@ */ class SpringPulsarProjectGenerationConfigurationTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.2.0"; - @Nested class PulsarDependencyConfigurationTests { @Test - void pulsarBootStarterUsedWhenBoot32Selected() { + void pulsarBootStarterUsed() { ProjectRequest request = createProjectRequest("pulsar"); - request.setBootVersion(SPRING_BOOT_VERSION); ProjectStructure project = generateProject(request); assertThat(project).mavenBuild().hasDependency("org.springframework.boot", "spring-boot-starter-pulsar"); } @Test - void pulsarReactiveBootStarterUsedWhenBoot32Selected() { + void pulsarReactiveBootStarterUsed() { ProjectRequest request = createProjectRequest("pulsar-reactive"); - request.setBootVersion(SPRING_BOOT_VERSION); ProjectStructure project = generateProject(request); assertThat(project).mavenBuild() .hasDependency("org.springframework.boot", "spring-boot-starter-pulsar-reactive"); @@ -74,7 +71,6 @@ class DockerComposeConfigurationTests { @Test void serviceNotCreatedWhenDockerComposeNotSelected() { ProjectRequest request = createProjectRequest("pulsar"); - request.setBootVersion(SPRING_BOOT_VERSION); ProjectStructure structure = generateProject(request); assertThat(structure.getProjectDirectory().resolve("compose.yaml")).doesNotExist(); } @@ -83,7 +79,6 @@ void serviceNotCreatedWhenDockerComposeNotSelected() { @ValueSource(strings = { "pulsar", "pulsar-reactive" }) void serviceCreatedWhenDockerComposeSelectedWithCompatibleBootVersion(String pulsarDependencyId) { ProjectRequest request = createProjectRequest("docker-compose", pulsarDependencyId); - request.setBootVersion(SPRING_BOOT_VERSION); assertThat(composeFile(request)).hasSameContentAs(new ClassPathResource("compose/pulsar.yaml")); } @@ -99,7 +94,7 @@ class ServiceConnectionConfigurationTests { @Test void connectionNotAddedWhenTestcontainersNotSelected() { MutableProjectDescription description = new MutableProjectDescription(); - description.setPlatformVersion(Version.parse(SPRING_BOOT_VERSION)); + description.setPlatformVersion(Version.parse(SupportedBootVersion.latest().getVersion())); description.addDependency("pulsar", mock(Dependency.class)); this.projectTester.configure(description, (context) -> assertThat(context).doesNotHaveBean("pulsarServiceConnectionsCustomizer")); @@ -108,7 +103,7 @@ void connectionNotAddedWhenTestcontainersNotSelected() { @Test void connectionNotAddedWhenPulsarNotSelected() { MutableProjectDescription description = new MutableProjectDescription(); - description.setPlatformVersion(Version.parse(SPRING_BOOT_VERSION)); + description.setPlatformVersion(Version.parse(SupportedBootVersion.latest().getVersion())); description.addDependency("testcontainers", mock(Dependency.class)); this.projectTester.configure(description, (context) -> assertThat(context).doesNotHaveBean("pulsarServiceConnectionsCustomizer")); @@ -118,7 +113,7 @@ void connectionNotAddedWhenPulsarNotSelected() { @ValueSource(strings = { "pulsar", "pulsar-reactive" }) void connectionAddedWhenTestcontainersAndPulsarSelectedWithCompatibleBootVersion(String pulsarDependencyId) { MutableProjectDescription description = new MutableProjectDescription(); - description.setPlatformVersion(Version.parse(SPRING_BOOT_VERSION)); + description.setPlatformVersion(Version.parse(SupportedBootVersion.latest().getVersion())); description.addDependency("testcontainers", mock(Dependency.class)); description.addDependency(pulsarDependencyId, mock(Dependency.class)); this.projectTester.configure(description, diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/springshell/SpringShellTestBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/springshell/SpringShellTestBuildCustomizerTests.java index d0e935cca7..deebee7752 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/springshell/SpringShellTestBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/springshell/SpringShellTestBuildCustomizerTests.java @@ -19,6 +19,7 @@ import io.spring.initializr.metadata.BillOfMaterials; import io.spring.initializr.metadata.Dependency; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -31,9 +32,11 @@ */ class SpringShellTestBuildCustomizerTests extends AbstractExtensionTests { + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; + @Test void shellTestIsAddedWithSpringShell() { - ProjectRequest request = createProjectRequest("spring-shell"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "spring-shell"); BillOfMaterials bom = getBom("spring-shell", request.getBootVersion()); assertThat(mavenPom(request)).hasDependency(getDependency("spring-shell")) .hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST)) diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersProjectGenerationConfigurationTests.java index fbd512cac2..774c0b7595 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersProjectGenerationConfigurationTests.java @@ -22,6 +22,7 @@ import io.spring.initializr.generator.test.project.ProjectStructure; import io.spring.initializr.generator.version.Version; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -42,70 +43,35 @@ */ class TestcontainersProjectGenerationConfigurationTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION_3_3 = "3.3.0"; - - private static final String SPRING_BOOT_VERSION_3_2 = "3.2.0"; - @Test void buildWithOnlyTestContainers() { - assertThat(generateProject(SPRING_BOOT_VERSION_3_3, "testcontainers")).mavenBuild() - .hasDependency(getDependency("testcontainers")); - } - - @ParameterizedTest - @MethodSource("supportedEntriesBuild320") - void buildWithSupportedEntriesForSpringBoot32(String springBootDependencyId, String testcontainersArtifactId) { - assertThat(generateProject(SPRING_BOOT_VERSION_3_2, "testcontainers", springBootDependencyId)).mavenBuild() - .hasDependency(getDependency(springBootDependencyId).resolve(Version.parse(SPRING_BOOT_VERSION_3_2))) - .hasDependency("org.testcontainers", testcontainersArtifactId, null, "test") - .hasDependency(getDependency("testcontainers")); + assertThat(generateProject("testcontainers")).mavenBuild().hasDependency(getDependency("testcontainers")); } @ParameterizedTest @MethodSource("supportedTestcontainersActiveMQEntriesBuild") - void buildWithSpringBoot33AndTestcontainersActiveMQModule(String springBootDependencyId, + void buildWithSpringBootAndTestcontainersActiveMQModule(String springBootDependencyId, String testcontainersArtifactId) { - assertThat(generateProject(SPRING_BOOT_VERSION_3_3, "testcontainers", springBootDependencyId)).mavenBuild() + assertThat(generateProject("testcontainers", springBootDependencyId)).mavenBuild() .doesNotHaveBom("org.testcontainers", "testcontainers-bom") - .hasDependency(getDependency(springBootDependencyId).resolve(Version.parse("3.3.0"))) + .hasDependency(getDependency(springBootDependencyId) + .resolve(Version.parse(SupportedBootVersion.latest().getVersion()))) .hasDependency("org.testcontainers", testcontainersArtifactId, null, "test") .hasDependency(getDependency("testcontainers")); } @ParameterizedTest @MethodSource("supportedTestcontainersSpringAiEntriesBuild") - void buildWithSpringBoot33M3AndTestcontainersSpringAiModule(String springBootDependencyId, + void buildWithSpringBootAndTestcontainersSpringAiModule(String springBootDependencyId, String testcontainersArtifactId) { - assertThat(generateProject(SPRING_BOOT_VERSION_3_3, "testcontainers", springBootDependencyId)).mavenBuild() + assertThat(generateProject("testcontainers", springBootDependencyId)).mavenBuild() .doesNotHaveBom("org.testcontainers", "testcontainers-bom") - .hasDependency(getDependency(springBootDependencyId).resolve(Version.parse("3.3.0"))) + .hasDependency(getDependency(springBootDependencyId) + .resolve(Version.parse(SupportedBootVersion.latest().getVersion()))) .hasDependency("org.testcontainers", testcontainersArtifactId, null, "test") .hasDependency(getDependency("testcontainers")); } - static Stream supportedEntriesBuild320() { - return Stream.of(Arguments.arguments("amqp", "rabbitmq"), Arguments.of("amqp-streams", "rabbitmq"), - Arguments.arguments("cloud-gcp", "gcloud"), Arguments.arguments("cloud-gcp-pubsub", "gcloud"), - Arguments.arguments("data-cassandra", "cassandra"), - Arguments.arguments("data-cassandra-reactive", "cassandra"), - Arguments.arguments("data-couchbase", "couchbase"), - Arguments.arguments("data-couchbase-reactive", "couchbase"), - Arguments.arguments("data-elasticsearch", "elasticsearch"), - Arguments.arguments("data-mongodb", "mongodb"), Arguments.arguments("data-mongodb-reactive", "mongodb"), - Arguments.arguments("data-neo4j", "neo4j"), Arguments.arguments("data-r2dbc", "r2dbc"), - Arguments.arguments("db2", "db2"), Arguments.arguments("kafka", "kafka"), - Arguments.arguments("kafka-streams", "kafka"), Arguments.arguments("mariadb", "mariadb"), - Arguments.arguments("mysql", "mysql"), Arguments.arguments("postgresql", "postgresql"), - Arguments.arguments("oracle", "oracle-free"), Arguments.arguments("pulsar", "pulsar"), - Arguments.arguments("pulsar-reactive", "pulsar"), Arguments.arguments("solace", "solace"), - Arguments.arguments("spring-ai-vectordb-cassandra", "cassandra"), - Arguments.arguments("spring-ai-vectordb-elasticsearch", "elasticsearch"), - Arguments.arguments("spring-ai-vectordb-neo4j", "neo4j"), - Arguments.arguments("spring-ai-vectordb-oracle", "oracle-free"), - Arguments.arguments("spring-ai-vectordb-pgvector", "postgresql"), - Arguments.arguments("sqlserver", "mssqlserver")); - } - static Stream supportedTestcontainersActiveMQEntriesBuild() { return Stream.of(Arguments.arguments("activemq", "activemq"), Arguments.arguments("artemis", "activemq")); } @@ -120,13 +86,13 @@ static Stream supportedTestcontainersSpringAiEntriesBuild() { @ParameterizedTest @MethodSource("supportedEntriesHelpDocument") void linkToSupportedEntriesWhenTestContainerIsPresentIsAdded(String dependencyId, String docHref) { - assertHelpDocument(SPRING_BOOT_VERSION_3_2, "testcontainers", dependencyId).contains(docHref); + assertHelpDocument("testcontainers", dependencyId).contains(docHref); } @ParameterizedTest @MethodSource("supportedEntriesHelpDocument") void linkToSupportedEntriesWhenTestContainerIsNotPresentIsNotAdded(String dependencyId, String docHref) { - assertHelpDocument(SPRING_BOOT_VERSION_3_2, dependencyId).doesNotContain(docHref); + assertHelpDocument(dependencyId).doesNotContain(docHref); } static Stream supportedEntriesHelpDocument() { @@ -163,32 +129,31 @@ static Stream supportedEntriesHelpDocument() { @Test void linkToSupportedEntriesWhenTwoMatchesArePresentOnlyAddLinkOnce() { - assertHelpDocument(SPRING_BOOT_VERSION_3_3, "testcontainers", "data-mongodb", "data-mongodb-reactive") + assertHelpDocument("testcontainers", "data-mongodb", "data-mongodb-reactive") .containsOnlyOnce("https://java.testcontainers.org/modules/databases/mongodb/"); } @Test void buildWithSpringBoot31DoesNotIncludeBom() { - assertThat(generateProject(SPRING_BOOT_VERSION_3_3, "testcontainers")).mavenBuild() + assertThat(generateProject("testcontainers")).mavenBuild() .doesNotHaveBom("org.testcontainers", "testcontainers-bom") .hasDependency(getDependency("testcontainers")); } @Test void buildWithSpringBoot31IncludeSpringBootTestcontainers() { - assertThat(generateProject(SPRING_BOOT_VERSION_3_3, "testcontainers")).mavenBuild() + assertThat(generateProject("testcontainers")).mavenBuild() .hasDependency("org.springframework.boot", "spring-boot-testcontainers", null, "test"); } @Test void buildWithSpringBoot31IncludeTestcontainersSection() { - assertHelpDocument(SPRING_BOOT_VERSION_3_3, "testcontainers").contains("Spring Boot Testcontainers support"); + assertHelpDocument("testcontainers").contains("Spring Boot Testcontainers support"); } @Test void testApplicationWithGroovyAndGenericContainerIsContributed() { ProjectRequest request = createProjectRequest("testcontainers", "data-redis"); - request.setBootVersion(SPRING_BOOT_VERSION_3_3); request.setLanguage("groovy"); assertThat(generateProject(request)) .textFile("src/test/groovy/com/example/demo/TestcontainersConfiguration.groovy") @@ -217,7 +182,6 @@ GenericContainer redisContainer() { @Test void testApplicationWithJavaAndGenericContainerIsContributed() { ProjectRequest request = createProjectRequest("testcontainers", "data-redis"); - request.setBootVersion(SPRING_BOOT_VERSION_3_3); request.setLanguage("java"); assertThat(generateProject(request)).textFile("src/test/java/com/example/demo/TestcontainersConfiguration.java") .isEqualToNormalizingNewlines(""" @@ -245,7 +209,6 @@ GenericContainer redisContainer() { @Test void testApplicationWithKotlinAndGenericContainerIsContributed() { ProjectRequest request = createProjectRequest("testcontainers", "data-redis"); - request.setBootVersion(SPRING_BOOT_VERSION_3_3); request.setLanguage("kotlin"); assertThat(generateProject(request)).textFile("src/test/kotlin/com/example/demo/TestcontainersConfiguration.kt") .isEqualToNormalizingNewlines(""" @@ -273,7 +236,6 @@ fun redisContainer(): GenericContainer<*> { @Test void testApplicationWithGroovyAndSpecificContainerIsContributed() { ProjectRequest request = createProjectRequest("testcontainers", "data-cassandra"); - request.setBootVersion(SPRING_BOOT_VERSION_3_3); request.setLanguage("groovy"); ProjectStructure projectStructure = generateProject(request); assertThat(projectStructure).textFile("src/test/groovy/com/example/demo/TestDemoApplication.groovy") @@ -334,7 +296,6 @@ void contextLoads() { @Test void testApplicationWithJavaAndSpecificContainerIsContributed() { ProjectRequest request = createProjectRequest("testcontainers", "data-cassandra"); - request.setBootVersion(SPRING_BOOT_VERSION_3_3); request.setLanguage("java"); ProjectStructure projectStructure = generateProject(request); assertThat(projectStructure).textFile("src/test/java/com/example/demo/TestDemoApplication.java") @@ -396,7 +357,6 @@ void contextLoads() { @Test void testApplicationWithKotlinAndSpecificContainerIsContributed() { ProjectRequest request = createProjectRequest("testcontainers", "data-cassandra"); - request.setBootVersion(SPRING_BOOT_VERSION_3_3); request.setLanguage("kotlin"); ProjectStructure projectStructure = generateProject(request); assertThat(projectStructure).textFile("src/test/kotlin/com/example/demo/TestDemoApplication.kt") @@ -454,7 +414,7 @@ fun contextLoads() { @Test void shouldAddHelpSection() { - assertHelpDocument(SPRING_BOOT_VERSION_3_3, "testcontainers", "data-mongodb", "postgresql").contains( + assertHelpDocument("testcontainers", "data-mongodb", "postgresql").contains( "https://docs.spring.io/spring-boot/3.3.0/reference/testing/testcontainers.html#testing.testcontainers") .contains( "https://docs.spring.io/spring-boot/3.3.0/reference/features/dev-services.html#features.dev-services.testcontainers") @@ -462,26 +422,14 @@ void shouldAddHelpSection() { .contains("postgres:latest"); } - @Test - void shouldAddHelpSectionWithOldSpringBoot() { - assertHelpDocument(SPRING_BOOT_VERSION_3_2, "testcontainers", "data-mongodb", "postgresql").contains( - "https://docs.spring.io/spring-boot/docs/3.2.0/reference/html/features.html#features.testing.testcontainers") - .contains( - "https://docs.spring.io/spring-boot/docs/3.2.0/reference/html/features.html#features.testing.testcontainers.at-development-time") - .contains("mongo:latest") - .contains("postgres:latest"); - } - - private ProjectStructure generateProject(String platformVersion, String... dependencies) { - ProjectRequest request = createProjectRequest(dependencies); - request.setBootVersion(platformVersion); + private ProjectStructure generateProject(String... dependencies) { + ProjectRequest request = createProjectRequest(SupportedBootVersion.V3_3, dependencies); request.setType("maven-build"); return generateProject(request); } - private TextAssert assertHelpDocument(String platformVersion, String... dependencyIds) { - ProjectRequest request = createProjectRequest(dependencyIds); - request.setBootVersion(platformVersion); + private TextAssert assertHelpDocument(String... dependencyIds) { + ProjectRequest request = createProjectRequest(SupportedBootVersion.V3_3, dependencyIds); return assertThat(helpDocument(request)); } diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/vaadin/VaadinMavenBuildCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/vaadin/VaadinMavenBuildCustomizerTests.java index f9ffe3ea94..48db9ddf45 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/vaadin/VaadinMavenBuildCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/vaadin/VaadinMavenBuildCustomizerTests.java @@ -17,6 +17,7 @@ package io.spring.start.site.extension.dependency.vaadin; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -31,7 +32,7 @@ class VaadinMavenBuildCustomizerTests extends AbstractExtensionTests { @Test void shouldAddProductionProfile() { - ProjectRequest projectRequest = createProjectRequest("vaadin", "web"); + ProjectRequest projectRequest = createProjectRequest(SupportedBootVersion.V3_3, "vaadin", "web"); assertThat(mavenPom(projectRequest)).hasProfile("production").lines().containsSequence( // @formatter:off " ", diff --git a/start-site/src/test/java/io/spring/start/site/extension/dependency/vaadin/VaadinProjectGenerationConfigurationTests.java b/start-site/src/test/java/io/spring/start/site/extension/dependency/vaadin/VaadinProjectGenerationConfigurationTests.java index 639beeec91..89de609587 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/dependency/vaadin/VaadinProjectGenerationConfigurationTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/dependency/vaadin/VaadinProjectGenerationConfigurationTests.java @@ -18,6 +18,7 @@ import io.spring.initializr.generator.version.Version; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; @@ -31,12 +32,11 @@ */ class VaadinProjectGenerationConfigurationTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; + private static final SupportedBootVersion BOOT_VERSION = SupportedBootVersion.V3_3; @Test void mavenBuildWithVaadinAddProductionProfileWithoutProductionModeFlag() { - ProjectRequest request = createProjectRequest("vaadin", "data-jpa"); - request.setBootVersion(SPRING_BOOT_VERSION); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "vaadin", "data-jpa"); assertThat(mavenPom(request)).hasProfile("production").lines().containsSequence( // @formatter:off " ", @@ -84,7 +84,7 @@ void mavenBuildWithoutVaadinDoesNotAddProductionProfile() { @Test void gradleBuildWithVaadinAddPlugin() { - ProjectRequest request = createProjectRequest("vaadin", "data-jpa"); + ProjectRequest request = createProjectRequest(BOOT_VERSION, "vaadin", "data-jpa"); String vaadinVersion = getMetadata().getConfiguration() .getEnv() .getBoms() @@ -101,7 +101,7 @@ void gradleBuildWithoutVaadinDoesNotAddPlugin() { @Test void gitIgnoreWithVaadinIgnoreNodeModules() { - assertThat(generateProject(createProjectRequest("vaadin", "data-jpa"))).textFile(".gitignore") + assertThat(generateProject(createProjectRequest(BOOT_VERSION, "vaadin", "data-jpa"))).textFile(".gitignore") .contains("node_modules"); } @@ -113,7 +113,7 @@ void gitIgnoreWithoutVaadinDoesNotIgnoreNodeModules() { @Test void shouldAddLaunchBrowserProperty() { - assertThat(applicationProperties(createProjectRequest("vaadin"))).lines().contains("vaadin.launch-browser=true"); + assertThat(applicationProperties(createProjectRequest(BOOT_VERSION, "vaadin"))).lines().contains("vaadin.launch-browser=true"); } @Test @@ -121,11 +121,4 @@ void shouldNotAddLaunchBrowserPropertyIfVaadinIsNotSelected() { assertThat(applicationProperties(createProjectRequest("data-jpa"))).lines().doesNotContain("vaadin.launch-browser=true"); } - @Override - protected ProjectRequest createProjectRequest(String... dependencies) { - ProjectRequest request = super.createProjectRequest(dependencies); - request.setBootVersion(SPRING_BOOT_VERSION); - return request; - } - } diff --git a/start-site/src/test/java/io/spring/start/site/extension/description/InvalidJvmVersionHelpDocumentCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/extension/description/InvalidJvmVersionHelpDocumentCustomizerTests.java index 16fb3a8112..b28c7a1295 100644 --- a/start-site/src/test/java/io/spring/start/site/extension/description/InvalidJvmVersionHelpDocumentCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/extension/description/InvalidJvmVersionHelpDocumentCustomizerTests.java @@ -31,11 +31,9 @@ */ class InvalidJvmVersionHelpDocumentCustomizerTests extends AbstractExtensionTests { - private static final String SPRING_BOOT_VERSION = "3.3.0"; - @Test void warningAddedWithUnsupportedCombination() { - assertHelpDocument(SPRING_BOOT_VERSION, "11").lines() + assertHelpDocument("11").lines() .containsSubsequence("# Read Me First", "* The JVM level was changed from '11' to '17', review the [JDK Version Range](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Versions#jdk-version-range) on the wiki for more details."); } @@ -43,7 +41,6 @@ void warningAddedWithUnsupportedCombination() { @Test void warningAddedWithUnsupportedKotlinVersion() { ProjectRequest request = createProjectRequest("web"); - request.setBootVersion(SPRING_BOOT_VERSION); request.setJavaVersion("22"); request.setLanguage(KotlinLanguage.ID); assertHelpDocument(request).lines() @@ -53,17 +50,16 @@ void warningAddedWithUnsupportedKotlinVersion() { @Test void warningNotAddedWithCompatibleVersion() { - assertHelpDocument(SPRING_BOOT_VERSION, "17").doesNotContain("# Read Me First"); + assertHelpDocument("17").doesNotContain("# Read Me First"); } private TextAssert assertHelpDocument(ProjectRequest request) { return assertThat(helpDocument(request)); } - private TextAssert assertHelpDocument(String platformVersion, String jvmVersion) { + private TextAssert assertHelpDocument(String jvmVersion) { ProjectRequest request = createProjectRequest("web"); request.setType("gradle-project"); - request.setBootVersion(platformVersion); request.setJavaVersion(jvmVersion); return assertHelpDocument(request); } diff --git a/start-site/src/test/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizerTests.java b/start-site/src/test/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizerTests.java index ec8a153f85..90901b044e 100755 --- a/start-site/src/test/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizerTests.java +++ b/start-site/src/test/java/io/spring/start/site/project/JavaVersionProjectDescriptionCustomizerTests.java @@ -19,6 +19,7 @@ import java.util.stream.Stream; import io.spring.initializr.web.project.ProjectRequest; +import io.spring.start.site.SupportedBootVersion; import io.spring.start.site.extension.AbstractExtensionTests; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -37,13 +38,14 @@ class JavaVersionProjectDescriptionCustomizerTests extends AbstractExtensionTest @Test void javaUnknownVersionIsLeftAsIs() { - assertThat(mavenPom(javaProject("9999999", "3.3.0"))).hasProperty("java.version", "9999999"); + assertThat(mavenPom(javaProject("9999999", SupportedBootVersion.latest().getVersion()))) + .hasProperty("java.version", "9999999"); } @Test void javaInvalidVersionIsLeftAsIs() { - assertThat(mavenPom(javaProject("${another.version}", "3.3.0"))).hasProperty("java.version", - "${another.version}"); + assertThat(mavenPom(javaProject("${another.version}", SupportedBootVersion.latest().getVersion()))) + .hasProperty("java.version", "${another.version}"); } @ParameterizedTest(name = "{0} - Java {1} - Spring Boot {2}") @@ -63,12 +65,14 @@ void gradleGroovyBuildWithSupportedOptionsDoesNotDowngradeJavaVersion(String lan @Test void java22IsNotSupportedWithKotlin() { - assertThat(mavenPom(kotlinProject("22", "3.2.9"))).hasProperty("java.version", "21"); + assertThat(mavenPom(kotlinProject("22", SupportedBootVersion.latest().getVersion()))) + .hasProperty("java.version", "21"); } @Test void java23IsNotSupportedWithKotlin() { - assertThat(mavenPom(kotlinProject("23", "3.2.9"))).hasProperty("java.version", "21"); + assertThat(mavenPom(kotlinProject("23", SupportedBootVersion.latest().getVersion()))) + .hasProperty("java.version", "21"); } static Stream supportedMavenParameters() { @@ -81,16 +85,18 @@ static Stream supportedGradleGroovyParameters() { } private static Stream supportedJavaParameters() { - return Stream.of(java("17", "3.2.0"), java("21", "3.2.0"), java("23", "3.2.9"), java("17", "3.3.0"), - java("21", "3.3.0"), java("23", "3.3.0")); + return Stream.of(java("17", SupportedBootVersion.latest().getVersion()), + java("21", SupportedBootVersion.latest().getVersion()), + java("23", SupportedBootVersion.latest().getVersion())); } private static Stream supportedKotlinParameters() { - return Stream.of(kotlin("21", "3.2.0"), kotlin("21", "3.3.0")); + return Stream.of(kotlin("21", SupportedBootVersion.latest().getVersion())); } private static Stream supportedGroovyParameters() { - return Stream.of(groovy("21", "3.2.0"), groovy("23", "3.2.9"), groovy("21", "3.3.0-M2"), groovy("23", "3.3.0")); + return Stream.of(groovy("21", SupportedBootVersion.latest().getVersion()), + groovy("23", SupportedBootVersion.latest().getVersion())); } private static Arguments java(String javaVersion, String springBootVersion) { diff --git a/start-site/src/test/java/io/spring/start/site/support/CacheableMavenVersionResolverTests.java b/start-site/src/test/java/io/spring/start/site/support/CacheableMavenVersionResolverTests.java index 6a95af4302..3512b98853 100644 --- a/start-site/src/test/java/io/spring/start/site/support/CacheableMavenVersionResolverTests.java +++ b/start-site/src/test/java/io/spring/start/site/support/CacheableMavenVersionResolverTests.java @@ -19,6 +19,7 @@ import java.util.Map; import io.spring.initializr.versionresolver.MavenVersionResolver; +import io.spring.start.site.SupportedBootVersion; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -63,10 +64,10 @@ void clearCache() { @Test void managedDependenciesAreCached() { Map dependencies = this.versionResolver.resolveDependencies("org.springframework.boot", - "spring-boot-dependencies", "3.2.0"); + "spring-boot-dependencies", SupportedBootVersion.latest().getVersion()); assertThat(dependencies).isNotNull(); - ValueWrapper valueWrapper = this.cache - .get("dependencies-org.springframework.boot:spring-boot-dependencies:3.2.0"); + ValueWrapper valueWrapper = this.cache.get("dependencies-org.springframework.boot:spring-boot-dependencies:%s" + .formatted(SupportedBootVersion.latest().getVersion())); assertThat(valueWrapper).isNotNull(); assertThat(valueWrapper.get()).isInstanceOf(Map.class); } @@ -74,9 +75,10 @@ void managedDependenciesAreCached() { @Test void managedPluginsAreCached() { Map plugins = this.versionResolver.resolvePlugins("org.springframework.boot", - "spring-boot-dependencies", "3.2.0"); + "spring-boot-dependencies", SupportedBootVersion.latest().getVersion()); assertThat(plugins).isNotNull(); - ValueWrapper valueWrapper = this.cache.get("plugins-org.springframework.boot:spring-boot-dependencies:3.2.0"); + ValueWrapper valueWrapper = this.cache.get("plugins-org.springframework.boot:spring-boot-dependencies:%s" + .formatted(SupportedBootVersion.latest().getVersion())); assertThat(valueWrapper).isNotNull(); assertThat(valueWrapper.get()).isInstanceOf(Map.class); } diff --git a/start-site/src/test/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategyTests.java b/start-site/src/test/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategyTests.java index de8b309fc8..6b9f052bcf 100644 --- a/start-site/src/test/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategyTests.java +++ b/start-site/src/test/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategyTests.java @@ -71,10 +71,10 @@ void eolVersionsAreRemoved() { assertThat(updatedMetadata.getBootVersions()).isNotNull(); List updatedBootVersions = updatedMetadata.getBootVersions().getContent(); assertThat(updatedBootVersions).hasSize(4); - assertBootVersion(updatedBootVersions.get(0), "3.3.0 (SNAPSHOT)", false); - assertBootVersion(updatedBootVersions.get(1), "3.3.0 (RC1)", false); - assertBootVersion(updatedBootVersions.get(2), "3.2.7 (SNAPSHOT)", false); - assertBootVersion(updatedBootVersions.get(3), "3.2.6", true); + assertBootVersion(updatedBootVersions.get(0), "3.4.1 (SNAPSHOT)", false); + assertBootVersion(updatedBootVersions.get(1), "3.4.0", true); + assertBootVersion(updatedBootVersions.get(2), "3.3.7 (SNAPSHOT)", false); + assertBootVersion(updatedBootVersions.get(3), "3.3.6", false); } @Test diff --git a/start-site/src/test/resources/compose/activemq-classic.yaml b/start-site/src/test/resources/compose/activemq-classic.yaml deleted file mode 100644 index 269d4e2a2c..0000000000 --- a/start-site/src/test/resources/compose/activemq-classic.yaml +++ /dev/null @@ -1,5 +0,0 @@ -services: - activemq: - image: 'apache/activemq-classic:latest' - ports: - - '61616' diff --git a/start-site/src/test/resources/compose/activemq.yaml b/start-site/src/test/resources/compose/activemq.yaml index 0e7e1de2d8..269d4e2a2c 100644 --- a/start-site/src/test/resources/compose/activemq.yaml +++ b/start-site/src/test/resources/compose/activemq.yaml @@ -1,5 +1,5 @@ services: activemq: - image: 'symptoma/activemq:latest' + image: 'apache/activemq-classic:latest' ports: - '61616' diff --git a/start-site/src/test/resources/metadata/springio/spring-boot.json b/start-site/src/test/resources/metadata/springio/spring-boot.json index 8d3dbcd206..1d73a7b21a 100644 --- a/start-site/src/test/resources/metadata/springio/spring-boot.json +++ b/start-site/src/test/resources/metadata/springio/spring-boot.json @@ -47,9 +47,9 @@ } }, { - "version": "3.3.0-SNAPSHOT", - "apiDocUrl": "https://docs.spring.io/spring-boot/{version}/api/java", - "referenceDocUrl": "https://docs.spring.io/spring-boot/{version}", + "version": "3.3.7-SNAPSHOT", + "apiDocUrl": "https://docs.spring.io/spring-boot/{version}/api/java/index.html", + "referenceDocUrl": "https://docs.spring.io/spring-boot/{version}/index.html", "status": "SNAPSHOT", "current": false, "_links": { @@ -57,44 +57,44 @@ "href": "https://api.spring.io/repositories/spring-snapshots" }, "self": { - "href": "https://api.spring.io/projects/spring-boot/releases/3.3.0-SNAPSHOT" + "href": "https://api.spring.io/projects/spring-boot/releases/3.3.7-SNAPSHOT" } } }, { - "version": "3.3.0-RC1", - "apiDocUrl": "https://docs.spring.io/spring-boot/{version}/api/java", - "referenceDocUrl": "https://docs.spring.io/spring-boot/{version}", - "status": "PRERELEASE", + "version": "3.3.6", + "apiDocUrl": "https://docs.spring.io/spring-boot/{version}/api/java/index.html", + "referenceDocUrl": "https://docs.spring.io/spring-boot/{version}/index.html", + "status": "GENERAL_AVAILABILITY", "current": false, "_links": { "repository": { - "href": "https://api.spring.io/repositories/spring-milestones" + "href": "https://api.spring.io/repositories/spring-releases" }, "self": { - "href": "https://api.spring.io/projects/spring-boot/releases/3.3.0-RC1" + "href": "https://api.spring.io/projects/spring-boot/releases/3.3.6" } } }, { - "version": "3.2.7-SNAPSHOT", + "version": "3.2.12", "apiDocUrl": "https://docs.spring.io/spring-boot/docs/{version}/api/", "referenceDocUrl": "https://docs.spring.io/spring-boot/docs/{version}/reference/html/", - "status": "SNAPSHOT", + "status": "GENERAL_AVAILABILITY", "current": false, "_links": { "repository": { - "href": "https://api.spring.io/repositories/spring-snapshots" + "href": "https://api.spring.io/repositories/spring-releases" }, "self": { - "href": "https://api.spring.io/projects/spring-boot/releases/3.2.7-SNAPSHOT" + "href": "https://api.spring.io/projects/spring-boot/releases/3.2.12" } } }, { - "version": "3.2.6", - "apiDocUrl": "https://docs.spring.io/spring-boot/docs/{version}/api/", - "referenceDocUrl": "https://docs.spring.io/spring-boot/docs/{version}/reference/html/", + "version": "3.4.0", + "apiDocUrl": "https://docs.spring.io/spring-boot/{version}/api/java/index.html", + "referenceDocUrl": "https://docs.spring.io/spring-boot/{version}/index.html", "status": "GENERAL_AVAILABILITY", "current": true, "_links": { @@ -102,7 +102,22 @@ "href": "https://api.spring.io/repositories/spring-releases" }, "self": { - "href": "https://api.spring.io/projects/spring-boot/releases/3.2.6" + "href": "https://api.spring.io/projects/spring-boot/releases/3.4.0" + } + } + }, + { + "version": "3.4.1-SNAPSHOT", + "apiDocUrl": "https://docs.spring.io/spring-boot/{version}/api/java/index.html", + "referenceDocUrl": "https://docs.spring.io/spring-boot/{version}/index.html", + "status": "SNAPSHOT", + "current": false, + "_links": { + "repository": { + "href": "https://api.spring.io/repositories/spring-snapshots" + }, + "self": { + "href": "https://api.spring.io/projects/spring-boot/releases/3.4.1-SNAPSHOT" } } }