Christoph Deppisch created CAMEL-26918:
------------------------------------------

             Summary: Camel export with test plugin should detect all required 
test dependencies from Citrus YAML sources
                 Key: CAMEL-26918
                 URL: https://issues.apache.org/jira/browse/CAMEL-26918
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Christoph Deppisch


When {{camel export}} includes Citrus YAML tests via the test plugin 
({{TestPluginExporter}}), the exported Maven project's pom may be missing 
test-scoped dependencies that the Citrus tests require at runtime.

The {{TestPluginExporter}} currently includes:
- A hardcoded set of default Citrus modules (citrus-base, citrus-junit-jupiter, 
citrus-http, citrus-yaml, citrus-xml, citrus-groovy, and all validation modules)
- Additional dependencies declared in {{test/jbang.properties}} under 
{{run.deps}}

However, if a Citrus YAML test references endpoints or infrastructure that 
require additional modules (e.g. citrus-kafka, citrus-camel, 
citrus-testcontainers, or camel-test-infra-kafka) and these are not listed in 
{{jbang.properties}}, they are silently omitted from the exported pom. The 
exported project then fails at test execution time with 
{{ClassNotFoundException}}.

*Example:* A test suite that validates a Kafka route needs citrus-kafka and 
camel-test-infra-kafka, but neither is in the default set nor automatically 
detected from the test files.

*Steps to reproduce:*
# Create a Citrus YAML test that uses Kafka endpoints and Camel infra services
# Make sure to activate the Camel CLI test plugin
# Run {{camel export --runtime=quarkus}} with the test plugin
# Run {{mvn verify -DskipITs=false}} in the exported project
# Build fails with missing classes (e.g. {{KafkaInfraService}}, Citrus Kafka 
endpoint classes)

*Workaround:* Manually add the missing dependencies to the exported pom, or 
declare all required dependencies in {{test/jbang.properties}} under 
{{run.deps}}.

*Possible approach:* Scan the Citrus YAML test files during export to detect 
which endpoint types are used (e.g. kafka, camel, sql) and automatically 
include the corresponding Citrus modules and Camel test-infra dependencies.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to