This is an automated email from the ASF dual-hosted git repository.

jiriondrusek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-upgrade-recipes.git

commit 29fec1bfd2116afecb5b3a82588b0e08d7df15d5
Author: Jiri Ondrusek <[email protected]>
AuthorDate: Thu Aug 28 16:29:42 2025 +0200

    Recipe for 4.10lts
---
 .../main/resources/META-INF/rewrite/latest.yaml    |  4 +-
 camel-upgrade-recipes/pom.xml                      | 12 +---
 .../META-INF/rewrite/{latest.yaml => 4.10LTS.yaml} | 20 +++----
 .../main/resources/META-INF/rewrite/latest.yaml    | 10 ++--
 ...st.java => AbstractCamelUpdateVersionTest.java} | 13 ++--
 .../camel410lts/CamelUpdate410LTSVersionTest.java  | 32 ++++++++++
 .../latest/CamelUpdateLatestVersionTest.java       | 69 ++--------------------
 .../upgrade/suites/CamelUpdate410LtsTestSuite.java | 22 +++++++
 pom.xml                                            |  1 +
 9 files changed, 84 insertions(+), 99 deletions(-)

diff --git 
a/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
 
b/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
index a931813..341dde9 100644
--- 
a/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
+++ 
b/camel-spring-boot-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
@@ -17,9 +17,9 @@
 ---
 type: specs.openrewrite.org/v1beta/recipe
 name: org.apache.camel.upgrade.CamelSpringBootMigrationRecipe
-displayName: Migrate to Apache Camel Spring Boot @camel-version@
+displayName: Migrate to Apache Camel Spring Boot @camel-latest-version@
 description: >- 
-  Migrate applications to Apache Camel Spring Boot @camel-version@ and Spring 
Boot @spring-boot-version@
+  Migrate applications to Apache Camel Spring Boot @camel-latest-version@ and 
Spring Boot @spring-boot-version@
 recipeList:
   - org.apache.camel.upgrade.camel414.CamelMigrationRecipe
   - org.apache.camel.upgrade.camel413.CamelMigrationRecipe
diff --git a/camel-upgrade-recipes/pom.xml b/camel-upgrade-recipes/pom.xml
index 8ab7360..435a1ca 100644
--- a/camel-upgrade-recipes/pom.xml
+++ b/camel-upgrade-recipes/pom.xml
@@ -125,17 +125,9 @@
         <dependency>
             <groupId>org.junit.platform</groupId>
             <artifactId>junit-platform-suite</artifactId>
-            <version>1.13.0-RC1</version>
+            <version>1.13.4</version>
             <scope>test</scope>
         </dependency>
-
-<!--        <dependency>-->
-<!--            <groupId>org.junit.platform</groupId>-->
-<!--            <artifactId>junit-platform-runner</artifactId>-->
-<!--            <version>1.13.0-RC1</version>-->
-<!--            <scope>test</scope>-->
-<!--        </dependency>-->
-
     </dependencies>
 
     <build>
@@ -159,7 +151,7 @@
                         <include>**/*Suite.java</include>
                     </includes>
                     <systemPropertyVariables>
-                        <camel-version>${camel-version}</camel-version>
+                        
<camel-latest-version>${camel-latest-version}</camel-latest-version>
                         
<camel4.10-lts-version>${camel4.10-lts-version}</camel4.10-lts-version>
                     </systemPropertyVariables>
                 </configuration>
diff --git 
a/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml 
b/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/4.10LTS.yaml
similarity index 75%
copy from camel-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
copy to camel-upgrade-recipes/src/main/resources/META-INF/rewrite/4.10LTS.yaml
index b332f78..a5bc69d 100644
--- a/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
+++ b/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/4.10LTS.yaml
@@ -16,14 +16,10 @@
 #
 ---
 type: specs.openrewrite.org/v1beta/recipe
-name: org.apache.camel.upgrade.CamelMigrationRecipe
-displayName: Migrate to @camel-version@
-description: Migrates Apache Camel application to @camel-version@.
+name: org.apache.camel.upgrade.Camel410LTSMigrationRecipe
+displayName: Migrate to @camel4.10-lts-version@
+description: Migrates Apache Camel application to @camel4.10-lts-version@.
 recipeList:
-  - org.apache.camel.upgrade.camel414.CamelMigrationRecipe
-  - org.apache.camel.upgrade.camel413.CamelMigrationRecipe
-  - org.apache.camel.upgrade.camel412.CamelMigrationRecipe
-  - org.apache.camel.upgrade.camel411.CamelMigrationRecipe
   - org.apache.camel.upgrade.camel410.CamelMigrationRecipe
   - org.apache.camel.upgrade.camel49.CamelMigrationRecipe
   - org.apache.camel.upgrade.camel47.CamelMigrationRecipe
@@ -34,15 +30,19 @@ recipeList:
   - org.apache.camel.upgrade.UpgradeToJava17
   - org.apache.camel.upgrade.JavaVersion17
   - org.apache.camel.upgrade.UpdatePropertiesAndYamlKeys
+# 4.10.3 to 4.10.4 java dsl - 
https://camel.apache.org/manual/camel-4x-upgrade-guide-4_10.html#_java_dsl
+  - org.apache.camel.upgrade.camel412.Java412Recipes
+  - org.apache.camel.upgrade.camel412.xmlDslBearer
+  - org.apache.camel.upgrade.camel412.yamlDslBearer
   - org.openrewrite.maven.UpgradeDependencyVersion:
       groupId: 'org.apache.camel'
       artifactId: '*'
-      newVersion: @camel-version@
+      newVersion: @camel4.10-lts-version@
   - org.openrewrite.maven.UpgradePluginVersion:
       groupId: 'org.apache.camel'
       artifactId: '*'
-      newVersion: @camel-version@
+      newVersion: @camel4.10-lts-version@
   - org.openrewrite.maven.UpgradeParentVersion:
       groupId: 'org.apache.camel'
       artifactId: '*'
-      newVersion: @camel-version@
\ No newline at end of file
+      newVersion: @camel4.10-lts-version@
diff --git 
a/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml 
b/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
index b332f78..37f80b6 100644
--- a/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
+++ b/camel-upgrade-recipes/src/main/resources/META-INF/rewrite/latest.yaml
@@ -17,8 +17,8 @@
 ---
 type: specs.openrewrite.org/v1beta/recipe
 name: org.apache.camel.upgrade.CamelMigrationRecipe
-displayName: Migrate to @camel-version@
-description: Migrates Apache Camel application to @camel-version@.
+displayName: Migrate to @camel-latest-version@
+description: Migrates Apache Camel application to @camel-latest-version@.
 recipeList:
   - org.apache.camel.upgrade.camel414.CamelMigrationRecipe
   - org.apache.camel.upgrade.camel413.CamelMigrationRecipe
@@ -37,12 +37,12 @@ recipeList:
   - org.openrewrite.maven.UpgradeDependencyVersion:
       groupId: 'org.apache.camel'
       artifactId: '*'
-      newVersion: @camel-version@
+      newVersion: @camel-latest-version@
   - org.openrewrite.maven.UpgradePluginVersion:
       groupId: 'org.apache.camel'
       artifactId: '*'
-      newVersion: @camel-version@
+      newVersion: @camel-latest-version@
   - org.openrewrite.maven.UpgradeParentVersion:
       groupId: 'org.apache.camel'
       artifactId: '*'
-      newVersion: @camel-version@
\ No newline at end of file
+      newVersion: @camel-latest-version@
\ No newline at end of file
diff --git 
a/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/latest/CamelUpdateLatestVersionTest.java
 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/AbstractCamelUpdateVersionTest.java
similarity index 86%
copy from 
camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/latest/CamelUpdateLatestVersionTest.java
copy to 
camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/AbstractCamelUpdateVersionTest.java
index 3625a91..30b5319 100644
--- 
a/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/latest/CamelUpdateLatestVersionTest.java
+++ 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/AbstractCamelUpdateVersionTest.java
@@ -14,23 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.upgrade.latest;
+package org.apache.camel.upgrade;
 
-import org.apache.camel.upgrade.CamelTestUtil;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 import org.openrewrite.test.RecipeSpec;
 import org.openrewrite.test.RewriteTest;
 import org.openrewrite.test.TypeValidation;
 
 import static org.openrewrite.maven.Assertions.pomXml;
 
-@EnabledIfSystemProperty(named = CamelTestUtil.PROPERTY_USE_RECIPE, matches = 
"org.apache.camel.upgrade.CamelMigrationRecipe")
-//class has to stay public, because test is extended in project quarkus-updates
-public class CamelUpdateLatestVersionTest implements RewriteTest {
+public abstract class AbstractCamelUpdateVersionTest implements RewriteTest {
+
+    protected abstract String targetVersion();
 
     @Override
     public void defaults(RecipeSpec spec) {
+        //recipe does not matter, because it  us executed via latest or lts 
recipe
         CamelTestUtil.recipe(spec, CamelTestUtil.CamelVersion.v4_9)
           
.parser(CamelTestUtil.parserFromClasspath(CamelTestUtil.CamelVersion.v4_10, 
"camel-core-model", "camel-api"))
           .typeValidationOptions(TypeValidation.none());
@@ -64,7 +63,7 @@ public class CamelUpdateLatestVersionTest implements 
RewriteTest {
                    </dependency>
                  </dependencies>
             </project>
-            """.formatted(System.getProperty("camel-version"));
+            """.formatted(targetVersion());
         //language=xml
         rewriteRun(pomXml(
           """
diff --git 
a/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/camel410lts/CamelUpdate410LTSVersionTest.java
 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/camel410lts/CamelUpdate410LTSVersionTest.java
new file mode 100644
index 0000000..8837d61
--- /dev/null
+++ 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/camel410lts/CamelUpdate410LTSVersionTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.upgrade.camel410lts;
+
+import org.apache.camel.upgrade.AbstractCamelUpdateVersionTest;
+import org.apache.camel.upgrade.CamelTestUtil;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
+
+//class has to stay public, because test is extended in project quarkus-updates
+@EnabledIfSystemProperty(named = CamelTestUtil.PROPERTY_USE_RECIPE, matches = 
"org.apache.camel.upgrade.Camel410LTSMigrationRecipe")
+public class CamelUpdate410LTSVersionTest  extends 
AbstractCamelUpdateVersionTest {
+
+
+    @Override
+    protected String targetVersion() {
+        return System.getProperty("camel4.10-lts-version");
+    }
+}
diff --git 
a/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/latest/CamelUpdateLatestVersionTest.java
 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/latest/CamelUpdateLatestVersionTest.java
index 3625a91..9bfa7fa 100644
--- 
a/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/latest/CamelUpdateLatestVersionTest.java
+++ 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/latest/CamelUpdateLatestVersionTest.java
@@ -16,78 +16,17 @@
  */
 package org.apache.camel.upgrade.latest;
 
+import org.apache.camel.upgrade.AbstractCamelUpdateVersionTest;
 import org.apache.camel.upgrade.CamelTestUtil;
-import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
-import org.openrewrite.test.RecipeSpec;
-import org.openrewrite.test.RewriteTest;
-import org.openrewrite.test.TypeValidation;
-
-import static org.openrewrite.maven.Assertions.pomXml;
 
 @EnabledIfSystemProperty(named = CamelTestUtil.PROPERTY_USE_RECIPE, matches = 
"org.apache.camel.upgrade.CamelMigrationRecipe")
 //class has to stay public, because test is extended in project quarkus-updates
-public class CamelUpdateLatestVersionTest implements RewriteTest {
+public class CamelUpdateLatestVersionTest extends 
AbstractCamelUpdateVersionTest {
 
     @Override
-    public void defaults(RecipeSpec spec) {
-        CamelTestUtil.recipe(spec, CamelTestUtil.CamelVersion.v4_9)
-          
.parser(CamelTestUtil.parserFromClasspath(CamelTestUtil.CamelVersion.v4_10, 
"camel-core-model", "camel-api"))
-          .typeValidationOptions(TypeValidation.none());
+    protected String targetVersion() {
+        return System.getProperty("camel-latest-version");
     }
 
-     /**
-     * Check that the version is pom is upgraded to the latest 4.10lts version
-     */
-    @Test
-    void finalVersion() {
-
-        String result =
-                """
-            <project>
-               <modelVersion>4.0.0</modelVersion>
-
-               <artifactId>test</artifactId>
-               <groupId>org.apache.camel.test</groupId>
-               <version>1.0.0</version>
-
-               <properties>
-                  <camel.version>%s</camel.version>
-                  <maven.compiler.release>17</maven.compiler.release>
-               </properties>
-      
-               <dependencies>
-                   <dependency>
-                       <groupId>org.apache.camel</groupId>
-                       <artifactId>camel-api</artifactId>
-                       <version>${camel.version}</version>
-                   </dependency>
-                 </dependencies>
-            </project>
-            """.formatted(System.getProperty("camel-version"));
-        //language=xml
-        rewriteRun(pomXml(
-          """
-            <project>
-               <modelVersion>4.0.0</modelVersion>
-
-               <artifactId>test</artifactId>
-               <groupId>org.apache.camel.test</groupId>
-               <version>1.0.0</version>
-
-               <properties>
-                  <camel.version>4.10.0</camel.version>
-               </properties>
-            
-               <dependencies>
-                   <dependency>
-                       <groupId>org.apache.camel</groupId>
-                       <artifactId>camel-api</artifactId>
-                       <version>${camel.version}</version>
-                   </dependency>
-                 </dependencies>
-            </project>
-            """,
-                result));
-    }
 }
diff --git 
a/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/suites/CamelUpdate410LtsTestSuite.java
 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/suites/CamelUpdate410LtsTestSuite.java
new file mode 100644
index 0000000..aa2bbc8
--- /dev/null
+++ 
b/camel-upgrade-recipes/src/test/java/org/apache/camel/upgrade/suites/CamelUpdate410LtsTestSuite.java
@@ -0,0 +1,22 @@
+package org.apache.camel.upgrade.suites;
+
+import org.apache.camel.upgrade.*;
+import org.junit.platform.suite.api.*;
+
+@SelectClasses({CamelUpdate45Test.class, CamelUpdate46Test.class, 
CamelUpdate47Test.class, CamelUpdate49Test.class, CamelUpdate410Test.class})
+@SelectMethod("org.apache.camel.upgrade.CamelUpdate412Test#javaDslChoice") 
//test for 4.10.3 to 4.10.4 java dsl - 
https://camel.apache.org/manual/camel-4x-upgrade-guide-4_10.html#_java_dsl
+@SelectPackages({"org.apache.camel.upgrade.camel40", 
"org.apache.camel.upgrade.camel44", "org.apache.camel.upgrade.camel410lts"})
+@Suite
+@SuiteDisplayName("4.10LTS")
+public class CamelUpdate410LtsTestSuite {
+
+    @BeforeSuite
+    public static void beforeSuite() {
+        System.setProperty(CamelTestUtil.PROPERTY_USE_RECIPE, 
"org.apache.camel.upgrade.Camel410LTSMigrationRecipe");
+    }
+
+    @AfterSuite
+    public static void afterSuite() {
+        System.clearProperty(CamelTestUtil.PROPERTY_USE_RECIPE);
+    }
+}
diff --git a/pom.xml b/pom.xml
index c6edc79..3ca1823 100644
--- a/pom.xml
+++ b/pom.xml
@@ -103,6 +103,7 @@
         <camel4.12-version>4.12.0</camel4.12-version>
 
         <camel4.10-lts-version>4.10.6</camel4.10-lts-version>
+        <camel-latest-version>4.14.0</camel-latest-version>
 
         <camel-version>${project.version}</camel-version>
         
<camel-spring-boot-version>${project.version}</camel-spring-boot-version>

Reply via email to