luigidemasi commented on code in PR #213:
URL: https://github.com/apache/camel-kit/pull/213#discussion_r4740535590


##########
kit/camel-kit-core/src/test/java/org/apache/camel/kit/config/TargetRuntimeProfileTest.java:
##########
@@ -153,6 +153,56 @@ void 
detectsCoreAndRuntimeArtifactMismatchesIndependently() throws Exception {
         }
     }
 
+    @Test
+    void destinationChoiceDeterminesBomSelectionNotSource() throws Exception {
+        // Red Hat source → community Spring Boot destination: must skip Red 
Hat BOM selection, preserve source
+        var redhatSourceCommunitydest = """
+                project.runtime=spring-boot
+                project.camelVersion=4.14.4.redhat-00008
+                
project.applicationBom=com.redhat.camel.springboot.platform:camel-spring-boot-bom:4.14.4.redhat-00010
+                target.runtime=spring-boot
+                target.camelVersion=4.22.1
+                
target.applicationBom=org.apache.camel.springboot:camel-spring-boot-bom:4.22.1
+                
target.catalogBom=org.apache.camel.springboot:camel-catalog-provider-springboot:4.22.1
+                target.springBootVersion=4.1.1
+                camel.catalog.repos=https://example.org/releases
+                """;
+        var profile1 = profile(redhatSourceCommunitydest);
+        // Source preserved
+        assertEquals("4.14.4.redhat-00008", 
profile1.sourceProfile().get().camelVersion());

Review Comment:
   **P1 — Fix the four calls to `sourceProfile()`.** `TargetRuntimeProfile` 
exposes the destination fields. Maven fails during `testCompile` at lines 172, 
174, 195, and 197 because the record has no source accessor. If you want to 
check source preservation here, keep the input `Properties`, pass it to 
`resolve(properties, true)`, and assert its two `project.*` values after the 
call. That keeps the production API intact.
   
   _AI-generated by Codex on behalf of @luigidemasi._



##########
kit/camel-kit-core/src/test/java/org/apache/camel/kit/config/TargetRuntimeProfileTest.java:
##########
@@ -153,6 +153,56 @@ void 
detectsCoreAndRuntimeArtifactMismatchesIndependently() throws Exception {
         }
     }
 
+    @Test
+    void destinationChoiceDeterminesBomSelectionNotSource() throws Exception {
+        // Red Hat source → community Spring Boot destination: must skip Red 
Hat BOM selection, preserve source
+        var redhatSourceCommunitydest = """
+                project.runtime=spring-boot
+                project.camelVersion=4.14.4.redhat-00008
+                
project.applicationBom=com.redhat.camel.springboot.platform:camel-spring-boot-bom:4.14.4.redhat-00010
+                target.runtime=spring-boot
+                target.camelVersion=4.22.1
+                
target.applicationBom=org.apache.camel.springboot:camel-spring-boot-bom:4.22.1
+                
target.catalogBom=org.apache.camel.springboot:camel-catalog-provider-springboot:4.22.1
+                target.springBootVersion=4.1.1
+                camel.catalog.repos=https://example.org/releases
+                """;
+        var profile1 = profile(redhatSourceCommunitydest);

Review Comment:
   **P2 — Exercise the destination choice before the target properties are 
filled in.** Both fixtures already contain the expected `target.applicationBom` 
and `target.catalogBom` when `profile(...)` runs. In a scratch copy with the 
compiler errors fixed, changing both Migrate and Brainstorm to select the Red 
Hat BOM whenever the **source** is Red Hat still passed all 77 focused tests, 
including this one. Please add coverage at the point where those guides make 
the choice. The installed-skill fixture in `MigrationOperationsContractTest` 
can check the condition in each guide. Switching either guide back to the 
source should fail the test.
   
   _AI-generated by Codex on behalf of @luigidemasi._



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to