This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 3a62262f3e1d CAMEL-26479: camel-jbang - camel run --chaos with the
Spring Boot and Quarkus runtimes (#29411)
3a62262f3e1d is described below
commit 3a62262f3e1dfd1c3f5d368897b266ad40133798
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun Nov 8 16:46:41 2026 +0100
CAMEL-26479: camel-jbang - camel run --chaos with the Spring Boot and
Quarkus runtimes (#29411)
camel run --chaos (and dev/debug) now works with the Spring Boot and
Quarkus runtimes, for exported and existing projects: the camel-chaos
dependency is added and the chaos JVM arguments are passed on. The --chaos
option text says Quarkus needs Camel Quarkus on Camel 4.24 or newer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
.../org/apache/camel/catalog/docs/chaos.adoc | 22 +++--
components/camel-chaos/src/main/docs/chaos.adoc | 22 +++--
design/chaos.adoc | 21 +++-
.../modules/ROOT/pages/camel-jbang-running.adoc | 5 +-
.../pages/jbang-commands/camel-jbang-debug.adoc | 2 +-
.../ROOT/pages/jbang-commands/camel-jbang-dev.adoc | 2 +-
.../ROOT/pages/jbang-commands/camel-jbang-run.adoc | 2 +-
.../META-INF/camel-jbang-commands-metadata.json | 6 +-
.../apache/camel/dsl/jbang/core/commands/Run.java | 13 +--
.../core/commands/CommandInputErrorsTest.java | 15 ---
.../src/test/resources/golden/cli-help.txt | 12 +--
.../camel/dsl/jbang/run/MavenRunSupport.java | 47 ++++++++-
.../apache/camel/dsl/jbang/run/QuarkusRunner.java | 4 +
.../camel/dsl/jbang/run/SpringBootRunner.java | 25 +++++
.../camel/dsl/jbang/run/ProjectRunnerTest.java | 108 +++++++++++++++++++++
15 files changed, 243 insertions(+), 63 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/chaos.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/chaos.adoc
index 286d04d81cc3..93db3b57dda1 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/chaos.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/chaos.adoc
@@ -22,17 +22,22 @@ Chaos is for development only. It stays off with profile
`prod`, and does nothin
== Getting it
-* `camel run`: add the dependency with `--chaos` (or `--dep camel:chaos`),
with the default runtime or
-`--runtime=main` (not with Spring Boot or Quarkus). `camel run` uses profile
`dev` by default, which switches chaos
-on. Then add rules while it runs with `camel cmd chaos-add` (see
<<_control_while_it_runs,Control while it runs>>), or
+* `camel run`: add the dependency with `--chaos` (or `--dep camel:chaos`),
with any runtime. `camel run` uses profile
+`dev` by default, which switches chaos on. A Spring Boot application has no
Camel profile `dev`, and a Quarkus one only
+in dev mode, so with `--runtime=spring-boot` and `--runtime=quarkus` the run
switches chaos on with
+`-Dcamel.chaos.enabled=true` on its command line (unless `--profile=prod`);
the project that the run exports does not
+have it. A project of your own (`camel run pom.xml`) also gets chaos added for
the run: plain `camel-chaos` for Spring
+Boot (there is no starter), and the `camel-quarkus-chaos` extension for
Quarkus, which needs a Camel Quarkus release on
+Camel 4.24 (https://github.com/apache/camel-quarkus/issues/9459). Then add
rules while it runs with `camel cmd chaos-add` (see
<<_control_while_it_runs,Control while it runs>>), or
start with the rules of a scenario file with `--chaos=chaos/outage.chaos` (see
<<_scenarios,Scenarios>>).
* A plain `Main` or a test: add the `camel-chaos` dependency and set
`camel.chaos.enabled=true`, for example in a
`CamelTestSupport` test with
`camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(props)`,
where `props` has
`camel.chaos.enabled=true` (and `camel.chaos.seed` for a fixed sequence).
* Spring Boot and Quarkus: the plugin works with any `CamelContext`. It reads
`camel.chaos.*` from the properties
-component, so `camel.chaos.enabled=true` in the application properties
switches it on there too; but the `camel.chaos.*`
-options are camel-main options, and only camel-main checks `camel.chaos.rules`
against the security policy (see below).
+component, so `camel.chaos.enabled=true` in the application properties
switches it on there too. The `camel.chaos.*`
+options are camel-main options; camel-main and Camel Spring Boot check
`camel.chaos.rules` and `camel.chaos.scenario`
+against the security policy (see below).
== Switching it on
@@ -50,9 +55,10 @@ and logs a WARN that it is on. The hooks do nothing until a
rule is added. When
installed (only the lifecycle strategy that made this decision stays, and does
nothing), and `camel.chaos.rules` is
ignored.
-`camel.chaos.rules` and `camel.chaos.scenario` are marked `insecure:dev`: with
camel-main and profile `prod` (which
-sets `camel.security.policy=fail`) an application with rules or a scenario
configured refuses to start. Without
-camel-main this check does not run, and chaos stays off with profile `prod`
anyway. Rules set from Java
+`camel.chaos.rules` and `camel.chaos.scenario` are marked `insecure:dev`: with
camel-main or Camel Spring Boot and
+profile `prod` (which sets `camel.security.policy=fail`) an application with
rules or a scenario configured refuses to
+start. Without a profile they are allowed with a WARN (as with `camel run
--runtime=spring-boot --chaos=<file>`). Where
+this check does not run, chaos stays off with profile `prod` anyway. Rules set
from Java
(`chaosConfig().withRules(...)`) are not checked either, as for every
`insecure:dev` option.
== Options
diff --git a/components/camel-chaos/src/main/docs/chaos.adoc
b/components/camel-chaos/src/main/docs/chaos.adoc
index 286d04d81cc3..93db3b57dda1 100644
--- a/components/camel-chaos/src/main/docs/chaos.adoc
+++ b/components/camel-chaos/src/main/docs/chaos.adoc
@@ -22,17 +22,22 @@ Chaos is for development only. It stays off with profile
`prod`, and does nothin
== Getting it
-* `camel run`: add the dependency with `--chaos` (or `--dep camel:chaos`),
with the default runtime or
-`--runtime=main` (not with Spring Boot or Quarkus). `camel run` uses profile
`dev` by default, which switches chaos
-on. Then add rules while it runs with `camel cmd chaos-add` (see
<<_control_while_it_runs,Control while it runs>>), or
+* `camel run`: add the dependency with `--chaos` (or `--dep camel:chaos`),
with any runtime. `camel run` uses profile
+`dev` by default, which switches chaos on. A Spring Boot application has no
Camel profile `dev`, and a Quarkus one only
+in dev mode, so with `--runtime=spring-boot` and `--runtime=quarkus` the run
switches chaos on with
+`-Dcamel.chaos.enabled=true` on its command line (unless `--profile=prod`);
the project that the run exports does not
+have it. A project of your own (`camel run pom.xml`) also gets chaos added for
the run: plain `camel-chaos` for Spring
+Boot (there is no starter), and the `camel-quarkus-chaos` extension for
Quarkus, which needs a Camel Quarkus release on
+Camel 4.24 (https://github.com/apache/camel-quarkus/issues/9459). Then add
rules while it runs with `camel cmd chaos-add` (see
<<_control_while_it_runs,Control while it runs>>), or
start with the rules of a scenario file with `--chaos=chaos/outage.chaos` (see
<<_scenarios,Scenarios>>).
* A plain `Main` or a test: add the `camel-chaos` dependency and set
`camel.chaos.enabled=true`, for example in a
`CamelTestSupport` test with
`camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(props)`,
where `props` has
`camel.chaos.enabled=true` (and `camel.chaos.seed` for a fixed sequence).
* Spring Boot and Quarkus: the plugin works with any `CamelContext`. It reads
`camel.chaos.*` from the properties
-component, so `camel.chaos.enabled=true` in the application properties
switches it on there too; but the `camel.chaos.*`
-options are camel-main options, and only camel-main checks `camel.chaos.rules`
against the security policy (see below).
+component, so `camel.chaos.enabled=true` in the application properties
switches it on there too. The `camel.chaos.*`
+options are camel-main options; camel-main and Camel Spring Boot check
`camel.chaos.rules` and `camel.chaos.scenario`
+against the security policy (see below).
== Switching it on
@@ -50,9 +55,10 @@ and logs a WARN that it is on. The hooks do nothing until a
rule is added. When
installed (only the lifecycle strategy that made this decision stays, and does
nothing), and `camel.chaos.rules` is
ignored.
-`camel.chaos.rules` and `camel.chaos.scenario` are marked `insecure:dev`: with
camel-main and profile `prod` (which
-sets `camel.security.policy=fail`) an application with rules or a scenario
configured refuses to start. Without
-camel-main this check does not run, and chaos stays off with profile `prod`
anyway. Rules set from Java
+`camel.chaos.rules` and `camel.chaos.scenario` are marked `insecure:dev`: with
camel-main or Camel Spring Boot and
+profile `prod` (which sets `camel.security.policy=fail`) an application with
rules or a scenario configured refuses to
+start. Without a profile they are allowed with a WARN (as with `camel run
--runtime=spring-boot --chaos=<file>`). Where
+this check does not run, chaos stays off with profile `prod` anyway. Rules set
from Java
(`chaosConfig().withRules(...)`) are not checked either, as for every
`insecure:dev` option.
== Options
diff --git a/design/chaos.adoc b/design/chaos.adoc
index e18a62c8ae77..7fc588e9a9de 100644
--- a/design/chaos.adoc
+++ b/design/chaos.adoc
@@ -95,12 +95,23 @@ goes on unchanged.
- `camel run --chaos` adds the `camel:chaos` dependency, as `--observe` adds
`camel:observability-services` in
`Run.java`, with the default runtime and with `--runtime=main` (also for a
Maven project); `--dep camel:chaos` works
- too. With `--runtime=spring-boot` or `quarkus` it is refused for now: the
exported project would need the
- dependency and Camel profile `dev`.
+ too.
+- With `--runtime=spring-boot` (CAMEL-26479) the exported project, or the run
pom of a Spring Boot project, gets plain
+ `camel-chaos`: no starter is needed, as the plugin is found on the classpath
by any `CamelContext`. The exported
+ project has no Camel profile, so the run adds `-Dcamel.chaos.enabled=true`
(and the scenario and report file) to
+ `spring-boot.run.jvmArguments`, unless the profile is `prod`. It is on the
command line of the run, not in the
+ exported `application.properties`, so `camel export` never gives a project
chaos switched on.
+- With `--runtime=quarkus` it is the same: `-Dcamel.chaos.enabled=true` in
`jvm.args`, as `quarkus:run` has no Camel
+ profile `dev` (only `quarkus:dev` gets one). The export takes the
`camel-quarkus-chaos` extension when the Camel
+ Quarkus BOM has it, else plain `camel-chaos`; a Quarkus project of your own
gets the extension. It is not refused,
+ so it works once a Camel Quarkus release is on Camel 4.24 and has the
extension
+ (https://github.com/apache/camel-quarkus/issues/9459, which native mode
needs for the `ServiceLoader`); until
+ then `camel-chaos` 4.24 would meet the older `camel-core` of the Camel
Quarkus release.
- A plain `Main` or a test adds the `camel-chaos` dependency and sets
`camel.chaos.enabled=true`.
-- Spring Boot and Quarkus: the plugin works with any `CamelContext` and
installs the hooks with Camel profile `dev`.
- The options are camel-main only, so rules come from the CLI connector; a
starter or an extension can bind
- `camel.chaos.*` later.
+- Spring Boot and Quarkus: the plugin works with any `CamelContext` and
installs the hooks with Camel profile `dev`
+ or `camel.chaos.enabled=true`. It reads `camel.chaos.*` from the properties
component, so they work as system
+ properties or application properties there too (Camel Spring Boot also
checks the `insecure:dev` ones against the
+ security policy); a starter or an extension can bind them as typed
configuration later.
=== Options
diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-running.adoc
b/docs/user-manual/modules/ROOT/pages/camel-jbang-running.adoc
index f0a14c55d1bf..4a53b844d74c 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang-running.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-running.adoc
@@ -439,8 +439,9 @@ Limitations compared to the `jbang` runtime:
- The deprecated `--health` and `--metrics` options are not supported in a
separate JVM; use `--observe` instead.
- Options that only work in-process are not supported: `--background`,
`--code`, `--open-api`,
`--empty` and `--mcp-stdio`.
-- `--chaos` (and `--chaos=<scenario file>`, `--chaos-report`) works with Camel
Main (it adds `camel-chaos`), but not with
- Spring Boot or Quarkus.
+- `--chaos` (and `--chaos=<scenario file>`, `--chaos-report`) adds
`camel-chaos`; with Spring Boot and Quarkus it is
+ switched on with `-Dcamel.chaos.enabled=true` unless the profile is `prod`.
With Quarkus it needs a Camel Quarkus
+ release on Camel 4.24 or newer.
- Dev mode reloads YAML and XML route files from the original source
directory; Java sources cannot
be live-reloaded (Spring Boot uses dev-tools and Quarkus its dev mode
instead).
- Quarkus versions are locked to a specific Camel version (`camel version list
--runtime=quarkus`)
diff --git
a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-debug.adoc
b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-debug.adoc
index e6ed77f032cf..0e96bb98fe1c 100644
--- a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-debug.adoc
+++ b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-debug.adoc
@@ -26,7 +26,7 @@ camel debug [options]
| `--breakpoint` | To set breakpoint at the given node id (Multiple ids can be
separated by comma). If no breakpoint is set, then the first route is automatic
selected. | | String
| `--camel-spring-boot-version` | To run using a different Camel Spring Boot
version than the default version. | | String
| `--camel-version` | To run using a different Camel version than the default
version. | | String
-| `--chaos` | Add camel-chaos, to turn on faults while running (camel cmd
chaos-add); on with profile dev, never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are added at startup. A run with chaos
ends with exit code 1 when the chaos verdict is FAIL. Not with Spring Boot or
Quarkus | false | boolean
+| `--chaos` | Add camel-chaos, to turn on faults while running (camel cmd
chaos-add); on with profile dev, never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are added at startup. A run with chaos
ends with exit code 1 when the chaos verdict is FAIL. With Quarkus it needs
Camel Quarkus on Camel 4.24 or newer | false | boolean
| `--chaos-report` | Write the chaos report as JSON to this file when the run
ends (with --chaos) | | String
| `--code` | Run the given text or file as Java DSL routes | | String
| `--console` | Developer console on the local HTTP server (port 8080 by
default): /q/dev with the jbang and Camel Main runtimes, /actuator/camel with
Spring Boot, and /q/camel/dev-console with Quarkus | false | boolean
diff --git
a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dev.adoc
b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dev.adoc
index 54ebb84ca7c6..164916e78a37 100644
--- a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dev.adoc
+++ b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-dev.adoc
@@ -24,7 +24,7 @@ camel dev [options]
| `--backlog-trace` | Enables backlog tracing of the routed messages | false |
boolean
| `--camel-spring-boot-version` | To run using a different Camel Spring Boot
version than the default version. | | String
| `--camel-version` | To run using a different Camel version than the default
version. | | String
-| `--chaos` | Add camel-chaos, to turn on faults while running (camel cmd
chaos-add); on with profile dev, never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are added at startup. A run with chaos
ends with exit code 1 when the chaos verdict is FAIL. Not with Spring Boot or
Quarkus | false | boolean
+| `--chaos` | Add camel-chaos, to turn on faults while running (camel cmd
chaos-add); on with profile dev, never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are added at startup. A run with chaos
ends with exit code 1 when the chaos verdict is FAIL. With Quarkus it needs
Camel Quarkus on Camel 4.24 or newer | false | boolean
| `--chaos-report` | Write the chaos report as JSON to this file when the run
ends (with --chaos) | | String
| `--code` | Run the given text or file as Java DSL routes | | String
| `--console` | Developer console on the local HTTP server (port 8080 by
default): /q/dev with the jbang and Camel Main runtimes, /actuator/camel with
Spring Boot, and /q/camel/dev-console with Quarkus | false | boolean
diff --git
a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-run.adoc
b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-run.adoc
index 73eca986b356..7c0e08cc48c8 100644
--- a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-run.adoc
+++ b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-run.adoc
@@ -24,7 +24,7 @@ camel run [options]
| `--backlog-trace` | Enables backlog tracing of the routed messages | false |
boolean
| `--camel-spring-boot-version` | To run using a different Camel Spring Boot
version than the default version. | | String
| `--camel-version` | To run using a different Camel version than the default
version. | | String
-| `--chaos` | Add camel-chaos, to turn on faults while running (camel cmd
chaos-add); on with profile dev, never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are added at startup. A run with chaos
ends with exit code 1 when the chaos verdict is FAIL. Not with Spring Boot or
Quarkus | false | boolean
+| `--chaos` | Add camel-chaos, to turn on faults while running (camel cmd
chaos-add); on with profile dev, never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are added at startup. A run with chaos
ends with exit code 1 when the chaos verdict is FAIL. With Quarkus it needs
Camel Quarkus on Camel 4.24 or newer | false | boolean
| `--chaos-report` | Write the chaos report as JSON to this file when the run
ends (with --chaos) | | String
| `--code` | Run the given text or file as Java DSL routes | | String
| `--console` | Developer console on the local HTTP server (port 8080 by
default): /q/dev with the jbang and Camel Main runtimes, /actuator/camel with
Spring Boot, and /q/camel/dev-console with Quarkus | false | boolean
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
index bd02c83bf98f..0e2630182f09 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
+++
b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
@@ -6,9 +6,9 @@
{ "name": "cmd", "fullName": "cmd", "description": "Performs commands in
the running Camel integrations, such as start\/stop route, or change logging
levels.", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.action.CamelAction", "options": [ {
"names": "-h,--help", "description": "Display the help and sub-commands",
"javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name":
"browse", "fullName": "cmd browse", "description": "Browse pending messages on
endpoints [...]
{ "name": "completion", "fullName": "completion", "description": "Generate
completion script for bash\/zsh", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.Complete", "options": [ { "names":
"-h,--help", "description": "Display the help and sub-commands", "javaType":
"boolean", "type": "boolean" } ] },
{ "name": "config", "fullName": "config", "description": "Get and set user
configuration values", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.config.ConfigCommand", "options": [ {
"names": "-h,--help", "description": "Display the help and sub-commands",
"javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "get",
"fullName": "config get", "description": "Display user configuration value",
"sourceClass": "org.apache.camel.dsl.jbang.core.commands.config. [...]
- { "name": "debug", "fullName": "debug", "description": "Debug local Camel
integration", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Debug",
"options": [ { "names": "--ago", "description": "Use ago instead of yyyy-MM-dd
HH:mm:ss in timestamp.", "javaType": "boolean", "type": "boolean" }, { "names":
"--background", "description": "Run in the background", "defaultValue":
"false", "javaType": "boolean", "type": "boolean" }, { "names":
"--background-wait", "description": "How [...]
+ { "name": "debug", "fullName": "debug", "description": "Debug local Camel
integration", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Debug",
"options": [ { "names": "--ago", "description": "Use ago instead of yyyy-MM-dd
HH:mm:ss in timestamp.", "javaType": "boolean", "type": "boolean" }, { "names":
"--background", "description": "Run in the background", "defaultValue":
"false", "javaType": "boolean", "type": "boolean" }, { "names":
"--background-wait", "description": "How [...]
{ "name": "dependency", "fullName": "dependency", "description": "Displays
all Camel dependencies required to run", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.DependencyCommand", "options": [ {
"names": "-h,--help", "description": "Display the help and sub-commands",
"javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name":
"copy", "fullName": "dependency copy", "description": "Copies all Camel
dependencies required to run to a specific directory", "sourc [...]
- { "name": "dev", "fullName": "dev", "description": "Run in dev mode with
live reload", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Dev",
"options": [ { "names": "--background", "description": "Run in the background",
"defaultValue": "false", "javaType": "boolean", "type": "boolean" }, { "names":
"--background-wait", "description": "How long to wait for the integration in
the background to start, before returning, in millis or as a duration such as
2m (true waits 60 secon [...]
+ { "name": "dev", "fullName": "dev", "description": "Run in dev mode with
live reload", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Dev",
"options": [ { "names": "--background", "description": "Run in the background",
"defaultValue": "false", "javaType": "boolean", "type": "boolean" }, { "names":
"--background-wait", "description": "How long to wait for the integration in
the background to start, before returning, in millis or as a duration such as
2m (true waits 60 secon [...]
{ "name": "dirty", "fullName": "dirty", "description": "Check if there are
dirty files from previous Camel runs that did not terminate gracefully",
"sourceClass": "org.apache.camel.dsl.jbang.core.commands.process.Dirty",
"options": [ { "names": "--clean", "description": "Clean dirty files which are
no longer in use, and the logs of the previous runs of the integrations (camel
log --previous)", "defaultValue": "false", "javaType": "boolean", "type":
"boolean" }, { "names": "-h,--help" [...]
{ "name": "doc", "fullName": "doc", "description": "Shows documentation
for kamelet, component, EIP, and other Camel resources", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.catalog.CatalogDoc", "options": [ {
"names": "--camel-version", "description": "To use a different Camel version
than the default version", "javaType": "java.lang.String", "type": "string" },
{ "names": "--download", "description": "Whether to allow automatic downloading
JAR dependencies (over the int [...]
{ "name": "doctor", "fullName": "doctor", "description": "Checks the
environment and reports potential issues", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.Doctor", "options": [ { "names":
"--json", "description": "Output in JSON Format: the status (OK, WARN or FAIL)
of each check", "javaType": "boolean", "type": "boolean" }, { "names":
"-h,--help", "description": "Display the help and sub-commands", "javaType":
"boolean", "type": "boolean" } ] },
@@ -27,7 +27,7 @@
{ "name": "plugin", "fullName": "plugin", "description": "Manage plugins
that add sub-commands to this CLI", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.plugin.PluginCommand", "options": [ {
"names": "-h,--help", "description": "Display the help and sub-commands",
"javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "add",
"fullName": "plugin add", "description": "Add new plugin", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.plugin.PluginA [...]
{ "name": "ps", "fullName": "ps", "description": "List running Camel
integrations", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.process.ListProcess", "options": [ {
"names": "--duration", "description": "How long to keep watching or following,
in millis or as a duration such as 30s (default: until Enter is pressed)",
"javaType": "long", "type": "integer" }, { "names": "--json", "description":
"Output in JSON Format", "javaType": "boolean", "type": "boolean" }, { "names":
[...]
{ "name": "restart", "fullName": "restart", "description": "Restarts
running Camel integrations (stop + re-launch)", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.process.RestartProcess", "options": [
{ "names": "--timeout", "description": "How long to wait for the integration to
stop, and again to start, in millis or as a duration such as 30s",
"defaultValue": "60000", "javaType": "long", "type": "integer" }, { "names":
"-h,--help", "description": "Display the help and su [...]
- { "name": "run", "fullName": "run", "description": "Run as local Camel
integration", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Run",
"options": [ { "names": "--background", "description": "Run in the background",
"defaultValue": "false", "javaType": "boolean", "type": "boolean" }, { "names":
"--background-wait", "description": "How long to wait for the integration in
the background to start, before returning, in millis or as a duration such as
2m (true waits 60 seconds [...]
+ { "name": "run", "fullName": "run", "description": "Run as local Camel
integration", "sourceClass": "org.apache.camel.dsl.jbang.core.commands.Run",
"options": [ { "names": "--background", "description": "Run in the background",
"defaultValue": "false", "javaType": "boolean", "type": "boolean" }, { "names":
"--background-wait", "description": "How long to wait for the integration in
the background to start, before returning, in millis or as a duration such as
2m (true waits 60 seconds [...]
{ "name": "sbom", "fullName": "sbom", "description": "Generate a CycloneDX
or SPDX SBOM for a specific project", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.SBOMGenerator", "options": [ {
"names": "--build-property", "description": "Maven build properties, ex.
--build-property=prop1=foo", "javaType": "java.util.List", "type": "array" }, {
"names": "--camel-spring-boot-version", "description": "Camel version to use
with Spring Boot", "javaType": "java.lang.String", "type" [...]
{ "name": "script", "fullName": "script", "description": "Run Camel
integration as shell script for terminal scripting", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.Script", "options": [ { "names":
"--logging", "description": "Can be used to turn on logging (logs to file in
<user home>\/.camel directory)", "defaultValue": "false", "javaType":
"boolean", "type": "boolean" }, { "names": "--logging-level", "description":
"Logging level (ERROR, WARN, INFO, DEBUG, TRACE)", "d [...]
{ "name": "semantic", "fullName": "semantic", "description": "List
semantic definitions and expert contracts", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.action.CamelSemantic", "options": [ {
"names": "--expert", "description": "Show the operations and parameter contract
of this expert", "javaType": "java.lang.String", "type": "string" }, { "names":
"--json", "description": "Output a single JSON document", "javaType":
"boolean", "type": "boolean" }, { "names": "--timeou [...]
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index 58d39ba47acd..1e1a83476bad 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -276,7 +276,7 @@ public class Run extends CamelCommand {
description = "Add camel-chaos, to turn on faults while running
(camel cmd chaos-add); on with profile dev,"
+ " never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are"
+ " added at startup. A run with chaos ends with
exit code 1 when the chaos verdict is FAIL."
- + " Not with Spring Boot or Quarkus")
+ + " With Quarkus it needs Camel Quarkus on Camel
4.24 or newer")
boolean chaos;
// the scenario of --chaos=file
@@ -884,10 +884,7 @@ public class Run extends CamelCommand {
if (background) {
throw CliException.usage("Run Camel Quarkus with --background is
not supported");
}
- if (chaos) {
- // the run would have to add camel-chaos to the exported Quarkus
project and switch it on there (follow-up)
- throw CliException.usage("Run Camel Quarkus with --chaos is not
supported (use --runtime=jbang or main)");
- }
+ warnChaosOffWithProfileProd();
return runWithMaven();
}
@@ -895,11 +892,7 @@ public class Run extends CamelCommand {
if (background) {
throw CliException.usage("Run Camel Spring Boot with --background
is not supported");
}
- if (chaos) {
- // the run would have to add camel-chaos to the exported Spring
Boot project and switch it on there
- // (follow-up)
- throw CliException.usage("Run Camel Spring Boot with --chaos is
not supported (use --runtime=jbang or main)");
- }
+ warnChaosOffWithProfileProd();
return runWithMaven();
}
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/CommandInputErrorsTest.java
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/CommandInputErrorsTest.java
index 70555ada9c04..431766650aa0 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/CommandInputErrorsTest.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/CommandInputErrorsTest.java
@@ -239,21 +239,6 @@ class CommandInputErrorsTest {
.extracting(e -> ((CliException)
e).getExitCode()).isEqualTo(CliExitCode.USAGE);
}
- @Test
- void runWithChaosOnSpringBootOrQuarkus() throws Exception {
- // the run does not add camel-chaos to a Spring Boot or Quarkus
project, nor give it profile dev: --chaos must
- // not be silently ignored
- Path file = Files.writeString(dir.resolve("orders.yaml"), "- from:\n
uri: timer:x\n");
-
- assertThatThrownBy(() -> call(new Run(main), file.toString(),
"--runtime=spring-boot", "--chaos"))
- .isInstanceOf(CliException.class)
- .hasMessage("Run Camel Spring Boot with --chaos is not
supported (use --runtime=jbang or main)")
- .extracting(e -> ((CliException)
e).getExitCode()).isEqualTo(CliExitCode.USAGE);
- assertThatThrownBy(() -> call(new Run(main), file.toString(),
"--runtime=quarkus", "--chaos"))
- .isInstanceOf(CliException.class)
- .hasMessage("Run Camel Quarkus with --chaos is not supported
(use --runtime=jbang or main)");
- }
-
private static int call(CamelCommand command, String... args) throws
Exception {
CommandLineTestHelper.parse(command, args);
return command.doCall();
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/test/resources/golden/cli-help.txt
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/golden/cli-help.txt
index 94bfdba79733..b10c2dcffd8c 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/test/resources/golden/cli-help.txt
+++ b/dsl/camel-jbang/camel-jbang-core/src/test/resources/golden/cli-help.txt
@@ -1891,8 +1891,8 @@ Debug local Camel integration
never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are added
at startup. A run with chaos ends with exit code
- 1 when the chaos verdict is FAIL. Not with
- Spring Boot or Quarkus
+ 1 when the chaos verdict is FAIL. With Quarkus
+ it needs Camel Quarkus on Camel 4.24 or newer
--chaos-report=<file> Write the chaos report as JSON to this file when
the run ends (with --chaos)
--local-kamelet-dir=<localKameletDir>
@@ -2880,8 +2880,8 @@ Run in dev mode with live reload
never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are added
at startup. A run with chaos ends with exit code
- 1 when the chaos verdict is FAIL. Not with
- Spring Boot or Quarkus
+ 1 when the chaos verdict is FAIL. With Quarkus
+ it needs Camel Quarkus on Camel 4.24 or newer
--chaos-report=<file> Write the chaos report as JSON to this file when
the run ends (with --chaos)
--local-kamelet-dir=<localKameletDir>
@@ -5032,8 +5032,8 @@ Run as local Camel integration
never with prod. With a scenario file (such as
--chaos=chaos/outage.chaos) its rules are added
at startup. A run with chaos ends with exit code
- 1 when the chaos verdict is FAIL. Not with
- Spring Boot or Quarkus
+ 1 when the chaos verdict is FAIL. With Quarkus
+ it needs Camel Quarkus on Camel 4.24 or newer
--chaos-report=<file> Write the chaos report as JSON to this file when
the run ends (with --chaos)
--local-kamelet-dir=<localKameletDir>
diff --git
a/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/MavenRunSupport.java
b/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/MavenRunSupport.java
index 3e27c04a8d90..e9bc24d83cb0 100644
---
a/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/MavenRunSupport.java
+++
b/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/MavenRunSupport.java
@@ -174,10 +174,36 @@ final class MavenRunSupport {
return args;
}
+ /**
+ * The chaos of a run with Spring Boot or Quarkus ({@code camel run
--chaos}) as JVM arguments:
+ * {@code camel.chaos.enabled=true}, as Spring Boot has no Camel profile
{@code dev} to switch chaos on, and Quarkus
+ * only in dev mode, and the scenario and the report file. Chaos stays off
with profile {@code prod}. They are
+ * arguments of the run only, so the exported project does not have chaos
switched on.
+ */
+ static List<String> projectChaosJvmArgs(RunRequest request) {
+ List<String> args = new ArrayList<>();
+ if (!request.chaos) {
+ return args;
+ }
+ if (!"prod".equalsIgnoreCase(request.profile)) {
+ args.add("-Dcamel.chaos.enabled=true");
+ }
+ // quoted when there is a space, as spring-boot.run.jvmArguments and
jvm.args are parsed as a command line
+ for (String arg : chaosArgs(request)) {
+ args.add(arg.indexOf(' ') != -1 ? quoteValue(arg) : arg);
+ }
+ return args;
+ }
+
+ private static String quoteValue(String arg) {
+ int eq = arg.indexOf('=');
+ return arg.substring(0, eq + 1) + "\"" + arg.substring(eq + 1) + "\"";
+ }
+
/**
* The JVM arguments the exported Quarkus or Spring Boot project is run
with ({@code jvm.args} and
- * {@code spring-boot.run.jvmArguments}): {@code --jvm-args}, the flight
recording and the execution limits. Returns
- * null when there are none.
+ * {@code spring-boot.run.jvmArguments}): {@code --jvm-args}, the flight
recording, the execution limits and chaos.
+ * Returns null when there are none.
*/
static String exportedRunJvmArgs(RunRequest request, Printer printer) {
String args = mergeJvmArgs(request.jvmArgs, jfrJvmArgs(request,
printer));
@@ -185,6 +211,10 @@ final class MavenRunSupport {
if (!limits.isEmpty()) {
args = mergeJvmArgs(args, String.join(" ", limits));
}
+ List<String> chaos = projectChaosJvmArgs(request);
+ if (!chaos.isEmpty()) {
+ args = mergeJvmArgs(args, String.join(" ", chaos));
+ }
return args != null && !args.isBlank() ? args.trim() : null;
}
@@ -355,7 +385,8 @@ final class MavenRunSupport {
eq.dependencies.add("camel:jfr");
}
if (request.chaos) {
- // camel run --chaos with the Camel Main runtime (Spring Boot and
Quarkus refuse it, see Run)
+ // plain camel-chaos with Spring Boot (there is no starter); with
Quarkus the camel-quarkus-chaos extension
+ // once the Camel Quarkus BOM has it (apache/camel-quarkus#9459),
else plain camel-chaos
eq.dependencies.add("camel:chaos");
}
eq.quiet = true;
@@ -378,11 +409,20 @@ final class MavenRunSupport {
* Adds the dependency to the project, unless it has it already.
*/
static void addDependency(Model model, String groupId, String artifactId) {
+ addDependency(model, groupId, artifactId, null);
+ }
+
+ /**
+ * Adds the dependency of the given version (null when the project manages
it) to the project, unless it has it
+ * already.
+ */
+ static void addDependency(Model model, String groupId, String artifactId,
String version) {
boolean found = model.getDependencies().stream().anyMatch(d ->
artifactId.equals(d.getArtifactId()));
if (!found) {
Dependency d = new Dependency();
d.setGroupId(groupId);
d.setArtifactId(artifactId);
+ d.setVersion(version);
model.getDependencies().add(d);
}
}
@@ -451,6 +491,7 @@ final class MavenRunSupport {
if (request.jvmArgs != null && !request.jvmArgs.isBlank()) {
args.add(request.jvmArgs.trim());
}
+ args.addAll(projectChaosJvmArgs(request));
return args;
}
diff --git
a/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/QuarkusRunner.java
b/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/QuarkusRunner.java
index 4a1f6a43ea42..4d5bdbb1317e 100644
---
a/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/QuarkusRunner.java
+++
b/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/QuarkusRunner.java
@@ -149,6 +149,10 @@ final class QuarkusRunner {
if (request.jfrEnabled()) {
addDependency(model, "org.apache.camel.quarkus",
"camel-quarkus-jfr");
}
+ if (request.chaos) {
+ // the extension, which needs a Camel Quarkus on Camel 4.24
(apache/camel-quarkus#9459)
+ addDependency(model, "org.apache.camel.quarkus",
"camel-quarkus-chaos");
+ }
// write temporary pom with cli-connector injected
Path tempPom = writeRunPom(projectDir, model);
diff --git
a/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/SpringBootRunner.java
b/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/SpringBootRunner.java
index 933b53abd607..3640108ba8e8 100644
---
a/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/SpringBootRunner.java
+++
b/dsl/camel-jbang/camel-jbang-run/src/main/java/org/apache/camel/dsl/jbang/run/SpringBootRunner.java
@@ -24,11 +24,13 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
+import org.apache.camel.catalog.DefaultCamelCatalog;
import org.apache.camel.dsl.jbang.run.common.ChildProcess;
import org.apache.camel.dsl.jbang.run.common.MavenCommand;
import org.apache.camel.dsl.jbang.run.common.Printer;
import org.apache.camel.dsl.jbang.run.common.RuntimeType;
import org.apache.camel.dsl.jbang.run.export.ExportRequest;
+import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import static org.apache.camel.dsl.jbang.run.MavenRunSupport.addDependency;
@@ -146,6 +148,10 @@ final class SpringBootRunner {
if (request.jfrEnabled()) {
addDependency(model, "org.apache.camel.springboot",
"camel-jfr-starter");
}
+ if (request.chaos) {
+ // there is no starter: plain camel-chaos, which
camel-spring-boot-bom does not manage
+ addDependency(model, "org.apache.camel", "camel-chaos",
camelVersion(model));
+ }
// write temporary pom with cli-connector injected
Path tempPom = writeRunPom(projectDir, model);
@@ -190,6 +196,25 @@ final class SpringBootRunner {
return new ProcessIntegration(p, cleanup);
}
+ /**
+ * The Camel version of an existing Spring Boot project: the version it
imports camel-spring-boot-bom (or
+ * camel-spring-boot-dependencies) with, as Camel Spring Boot has the
version of Camel, which can be a property of
+ * the project. Without it, the version of this Camel.
+ */
+ static String camelVersion(Model model) {
+ if (model.getDependencyManagement() != null) {
+ for (Dependency d :
model.getDependencyManagement().getDependencies()) {
+ if ("org.apache.camel.springboot".equals(d.getGroupId())
+ && ("camel-spring-boot-bom".equals(d.getArtifactId())
+ ||
"camel-spring-boot-dependencies".equals(d.getArtifactId()))
+ && d.getVersion() != null) {
+ return d.getVersion();
+ }
+ }
+ }
+ return new DefaultCamelCatalog().getCatalogVersion();
+ }
+
/**
* The logback configuration an existing Spring Boot project runs with,
logging to the {@code <name>.log} file so
* the TUI can read the log: a temp file, so the project is not changed
and needs no src/main/resources. Null when
diff --git
a/dsl/camel-jbang/camel-jbang-run/src/test/java/org/apache/camel/dsl/jbang/run/ProjectRunnerTest.java
b/dsl/camel-jbang/camel-jbang-run/src/test/java/org/apache/camel/dsl/jbang/run/ProjectRunnerTest.java
index 5e2d4e88d131..ebbdbd88df80 100644
---
a/dsl/camel-jbang/camel-jbang-run/src/test/java/org/apache/camel/dsl/jbang/run/ProjectRunnerTest.java
+++
b/dsl/camel-jbang/camel-jbang-run/src/test/java/org/apache/camel/dsl/jbang/run/ProjectRunnerTest.java
@@ -24,10 +24,12 @@ import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
+import org.apache.camel.catalog.DefaultCamelCatalog;
import org.apache.camel.dsl.jbang.run.common.ExportHelper;
import org.apache.camel.dsl.jbang.run.common.RuntimeType;
import org.apache.camel.dsl.jbang.run.common.StringPrinter;
import org.apache.camel.dsl.jbang.run.export.DependencyResolver;
+import org.apache.maven.model.Model;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@@ -294,6 +296,112 @@ class ProjectRunnerTest {
}
}
+ @Test
+ void aSpringBootRunWithChaosAddsCamelChaosAndSwitchesItOn() throws
Exception {
+ RunRequest request = request();
+ request.runtime = RuntimeType.springBoot;
+ request.profile = "dev";
+ request.chaos = true;
+ request.chaosScenario = "/work/my chaos/outage.chaos";
+ request.chaosReport = "/work/target/chaos.json";
+
+ RunningIntegration integration = new
ProjectRunner(context).start(request);
+ try {
+ List<String> cmd = started.get(0).command();
+ Path project = Path.of(cmd.get(3)).getParent();
+ // there is no starter: plain camel-chaos
+
assertThat(project.resolve("pom.xml")).content().contains("<artifactId>camel-chaos</artifactId>")
+ .doesNotContain("camel-chaos-starter");
+ // Spring Boot has no Camel profile dev, so chaos is switched on
by the run, quoted where there is a space
+
assertThat(cmd).contains("-Dspring-boot.run.jvmArguments=-Dcamel.chaos.enabled=true"
+ + " -Dcamel.chaos.scenario=\"/work/my
chaos/outage.chaos\""
+ + "
-Dcamel.chaos.reportFile=/work/target/chaos.json");
+ // and not by the exported project
+
assertThat(project.resolve("src/main/resources/application.properties")).content()
+ .doesNotContain("camel.chaos");
+ } finally {
+ integration.stop();
+ }
+ }
+
+ @Test
+ void aSpringBootRunWithChaosAndProfileProdKeepsChaosOff() throws Exception
{
+ RunRequest request = request();
+ request.runtime = RuntimeType.springBoot;
+ request.profile = "prod";
+ request.chaos = true;
+
+ RunningIntegration integration = new
ProjectRunner(context).start(request);
+ try {
+ assertThat(started.get(0).command()).noneMatch(a ->
a.contains("camel.chaos.enabled"));
+ } finally {
+ integration.stop();
+ }
+ }
+
+ @Test
+ void anExistingSpringBootProjectRunsWithChaos() throws Exception {
+ RunRequest request = existingProject(RuntimeType.springBoot);
+ request.profile = "dev";
+ request.chaos = true;
+ Path project = dir.resolve("project");
+ Files.writeString(project.resolve("pom.xml"), """
+ <project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.acme</groupId>
+ <artifactId>orders</artifactId>
+ <version>1.0</version>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-spring-boot-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ </project>
+ """);
+
+ RunningIntegration integration = new
ProjectRunner(context).start(request);
+ try {
+ // camel-spring-boot-bom has the starters, not camel-chaos, which
gets the version the BOM is imported with
+ assertThat(project.resolve("camel-jbang-run-pom.xml")).content()
+ .contains("camel-cli-connector-starter",
"<artifactId>camel-chaos</artifactId>",
+ "<version>${camel.version}</version>");
+
assertThat(started.get(0).command().get(4)).contains("-Dcamel.chaos.enabled=true");
+ } finally {
+ integration.stop();
+ }
+ }
+
+ @Test
+ void anExistingQuarkusProjectRunsWithChaos() throws Exception {
+ RunRequest request = existingProject(RuntimeType.quarkus);
+ request.profile = "dev";
+ request.chaos = true;
+ request.chaosReport = "/work/target/chaos.json";
+
+ RunningIntegration integration = new
ProjectRunner(context).start(request);
+ try {
+ Path project = dir.resolve("project");
+ assertThat(project.resolve("camel-jbang-run-pom.xml")).content()
+ .contains("camel-quarkus-cli-connector",
"<artifactId>camel-quarkus-chaos</artifactId>");
+ // quarkus:run has no Camel profile dev, so chaos is switched on
by the run
+
assertThat(started.get(0).command().get(4)).startsWith("-Djvm.args=")
+ .endsWith(" -Dcamel.chaos.enabled=true
-Dcamel.chaos.reportFile=/work/target/chaos.json");
+ } finally {
+ integration.stop();
+ }
+ }
+
+ @Test
+ void theCamelVersionOfASpringBootProjectWithoutTheBomIsThisCamel() {
+ assertThat(SpringBootRunner.camelVersion(new Model())).isEqualTo(new
DefaultCamelCatalog().getCatalogVersion());
+ }
+
private RunRequest existingProject(RuntimeType runtime) throws Exception {
Path project = dir.resolve("project");
Files.createDirectories(project);