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

davsclaus pushed a commit to branch CAMEL-26564
in repository https://gitbox.apache.org/repos/asf/camel.git

commit dbbc8f5cc90472cc3616c5899de2b3ac856ea0ae
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 4 08:38:30 2026 +0100

    CAMEL-26564: camel-jbang - check a Citrus test against the test schema of 
the Citrus catalog
    
    The AI tools checked a Citrus test (test/<name>.citrus.it.yaml) for its YAML
    syntax only. In the local-model benchmark (test-citrus-orders) a model wrote
    Citrus YAML of its own: an http action with uri, method and expectStatus, 
and
    log and assert-log actions. camel_write_file wrote it, and camel test run 
then
    failed with "Unable to find property 'http' on class:
    org.citrusframework.yaml.TestActions". Steps 1 and 2 of the example failed 
in
    14 of 14 runs.
    
    Now camel_write_file, camel_edit_file and camel_validate_source check a 
Citrus
    test against the JSON schema of a test from the Citrus catalog
    (org.citrusframework:citrus-catalog-schema), for the Citrus version the CLI 
is
    built with. An invalid test is refused like an invalid route.
    
    - The schema is read from the classpath, else from the local Maven 
repository,
      or it is downloaded once. The test plugin and the MCP server now have the
      catalog jar, so the MCP server checks a test offline. Without the schema, 
a
      test is checked for its YAML syntax only, and the answer says so. A test 
is
      never refused because the schema is missing.
    - Each item of an action list must be one Citrus test action. This includes
      the actions of a container, such as sequential, parallel or catch, which 
the
      schema does not check.
    - Each problem names its line: the keys an action does not take, with the 
keys
      it takes; an action Citrus does not have, with "did you mean" or what to
      write for log; a body written as text, which is body: {data: ...}.
    - A refused test points to the sample tests of the examples.
    - A number where Citrus takes text (status: 201) is accepted, as Citrus
      converts it when it reads the test.
    
    The Citrus version comes from the build (citrus-version), in a java 
template.
    YamlValidator.filterOneOfNoise is public, so the check uses it for the 
errors
    of a oneOf. The page of the MCP server says how a Citrus test is checked.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_016Y4dDi5iQNgtHrDdz2NpwF
---
 .../modules/ROOT/pages/camel-jbang-mcp.adoc        |   6 +
 dsl/camel-jbang/camel-jbang-core/pom.xml           |   8 +
 .../jbang/core/common/CitrusCatalogVersion.java    |  27 +
 .../dsl/jbang/core/commands/ai/AuthoringTools.java |  28 +-
 .../jbang/core/commands/ai/CitrusTestChecks.java   | 679 +++++++++++++++++++++
 .../jbang/core/commands/ai/SourceValidator.java    |  14 +-
 .../core/commands/ai/AuthoringToolsCitrusTest.java | 103 +++-
 .../core/commands/ai/CitrusTestChecksTest.java     | 337 ++++++++++
 .../citrus-orders/body-as-text.citrus.it.yaml      |  66 ++
 .../resources/citrus-orders/cut-off.citrus.it.yaml |  72 +++
 .../citrus-orders/http-of-its-own.citrus.it.yaml   |  46 ++
 .../request-and-response.citrus.it.yaml            |  55 ++
 .../resources/citrus-orders/step1.citrus.it.yaml   |  52 ++
 .../resources/citrus-orders/step2.citrus.it.yaml   |  69 +++
 .../resources/citrus-orders/step3.citrus.it.yaml   |  86 +++
 dsl/camel-jbang/camel-jbang-mcp/pom.xml            |   8 +
 dsl/camel-jbang/camel-jbang-plugin-test/pom.xml    |   6 +
 .../camel/dsl/yaml/validator/YamlValidator.java    |   5 +-
 18 files changed, 1648 insertions(+), 19 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-mcp.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-jbang-mcp.adoc
index 98be74672942..fa7473b102fd 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang-mcp.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-mcp.adoc
@@ -398,6 +398,12 @@ passed as the file name, is answered with the argument the 
source goes in.
   Takes the content, or reads the file from the project directory. With 
`camelVersion` (or the version of the
   selected integration in the TUI) the catalog and the YAML DSL schema of that 
Camel version answer, the schema
   read from its `camel-yaml-dsl` jar; without it the CLI's own, with nothing 
to download.
+  A Citrus test (`test/<name>.citrus.it.yaml`, run with `camel test run`) is 
not a route: it is checked against the
+  test schema of the Citrus catalog, 
`org.citrusframework:citrus-catalog-schema` of the Citrus version of the CLI.
+  The server has the catalog, so the check works offline. An action Citrus 
does not have, such as `log`, and a key an
+  action does not take are errors with their line, and `camel_write_file` and 
`camel_edit_file` refuse such a test
+  as they refuse an invalid route. Where the schema cannot be had, the test is 
checked for its YAML syntax only, and
+  the answer says so.
 
 | `camel_get_files`
 | The source files of a project directory, subdirectories included (`target`, 
`.git` and the like skipped). The
diff --git a/dsl/camel-jbang/camel-jbang-core/pom.xml 
b/dsl/camel-jbang/camel-jbang-core/pom.xml
index d87c1d528a73..0360570bf76d 100644
--- a/dsl/camel-jbang/camel-jbang-core/pom.xml
+++ b/dsl/camel-jbang/camel-jbang-core/pom.xml
@@ -257,6 +257,14 @@
             <artifactId>camel-jq</artifactId>
             <scope>test</scope>
         </dependency>
+        <!-- the test schema a Citrus test is checked against; on the 
classpath of the tests, so it is not downloaded
+             (the test plugin brings it to the CLI) -->
+        <dependency>
+            <groupId>org.citrusframework</groupId>
+            <artifactId>citrus-catalog-schema</artifactId>
+            <version>${citrus-version}</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>io.modelcontextprotocol.sdk</groupId>
             <artifactId>mcp-core</artifactId>
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java-templates/org/apache/camel/dsl/jbang/core/common/CitrusCatalogVersion.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java-templates/org/apache/camel/dsl/jbang/core/common/CitrusCatalogVersion.java
new file mode 100644
index 000000000000..c8d252695ea7
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java-templates/org/apache/camel/dsl/jbang/core/common/CitrusCatalogVersion.java
@@ -0,0 +1,27 @@
+/*
+ * 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.dsl.jbang.core.common;
+
+/**
+ * The Citrus version the CLI is built with: camel test run runs the tests 
with it, and the AI tools check a Citrus test
+ * against the test schema of its catalog 
(org.citrusframework:citrus-catalog-schema).
+ */
+public final class CitrusCatalogVersion {
+
+    public static final String CITRUS_VERSION = "${citrus-version}";
+
+}
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/AuthoringTools.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/AuthoringTools.java
index 884a3e7093c4..a6c5940ed218 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/AuthoringTools.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/AuthoringTools.java
@@ -662,9 +662,11 @@ public final class AuthoringTools {
             }
         }
         if (!errors.isEmpty()) {
-            result.put("message", errors.size() + " problem(s) found; fix them 
before writing the file");
+            result.put("message", errors.size() + " problem(s) found; fix them 
before writing the file"
+                                  + (SourceValidator.isCitrusTest(file) ? ". " 
+ CITRUS_SAMPLES : ""));
         } else if (SourceValidator.isCitrusTest(file)) {
-            result.put("message", "The YAML is valid. " + 
citrusTestNote(file));
+            result.put("message", (CitrusTestChecks.hasSchema() ? "The test is 
valid. " : "The YAML is valid. ")
+                                  + citrusTestNote(file));
         } else {
             result.put("message", "The source is valid");
         }
@@ -672,12 +674,24 @@ public final class AuthoringTools {
     }
 
     /**
-     * What the tools say of a Citrus test: it is not a route, so only its 
YAML syntax is checked, and there is no
-     * reload to wait for or to report (camel run --dev --source-dir loads no 
routes from it); camel test run runs it.
+     * Where a model finds a Citrus test that runs, said when its own test is 
refused: a local model wrote Citrus YAML
+     * of its own (test-citrus-orders of the local-model benchmark).
+     */
+    static final String CITRUS_SAMPLES
+            = "A sample Citrus test is the test/ file of an example: 
camel_catalog_examples with filter citrus lists them.";
+
+    /**
+     * What the tools say of a Citrus test: it is not a route, so it is 
checked against the test schema of Citrus (or
+     * for its YAML syntax only, when the schema cannot be had), and there is 
no reload to wait for or to report (camel
+     * run --dev --source-dir loads no routes from it); camel test run runs it.
      */
     static String citrusTestNote(String file) {
-        return "A Citrus test is not a route: only its YAML syntax is checked, 
and no integration loads it. Run it with"
-               + " camel test run " + file + " in the project directory.";
+        String checked = CitrusTestChecks.hasSchema()
+                ? "it is checked against the test schema of Citrus " + 
CitrusTestChecks.version()
+                : "only its YAML syntax is checked, as the test schema of 
Citrus " + CitrusTestChecks.version()
+                  + " could not be loaded (" + 
CitrusTestChecks.schemaProblem() + ")";
+        return "A Citrus test is not a route: " + checked + ", and no 
integration loads it. Run it with camel test run "
+               + file + " in the project directory.";
     }
 
     /** The line of a validation message, "Line N: ...", or 0. */
@@ -1734,7 +1748,7 @@ public final class AuthoringTools {
                 result.put("file", file);
                 result.put("errors", new JsonArray(errors));
                 result.put("message", "The file was not written: the content 
has validation errors. Fix them and"
-                                      + " call camel_write_file again.");
+                                      + " call camel_write_file again." + 
(citrusTest ? " " + CITRUS_SAMPLES : ""));
                 int times = refusedAgain(path, content);
                 if (times > 1) {
                     // the same content again: a model that does not see the 
problem in its own lines writes them
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/CitrusTestChecks.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/CitrusTestChecks.java
new file mode 100644
index 000000000000..29d2e21bf8f3
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/CitrusTestChecks.java
@@ -0,0 +1,679 @@
+/*
+ * 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.dsl.jbang.core.commands.ai;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringJoiner;
+import java.util.function.BiConsumer;
+import java.util.function.Predicate;
+import java.util.regex.Pattern;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
+import com.networknt.schema.Error;
+import com.networknt.schema.Schema;
+import com.networknt.schema.SchemaLocation;
+import com.networknt.schema.SchemaRegistry;
+import com.networknt.schema.SchemaRegistryConfig;
+import com.networknt.schema.SpecificationVersion;
+import org.apache.camel.dsl.jbang.core.common.CitrusCatalogVersion;
+import org.apache.camel.dsl.yaml.validator.YamlPointerLines;
+import org.apache.camel.dsl.yaml.validator.YamlValidator;
+import org.apache.camel.main.download.MavenDependencyDownloader;
+import org.apache.camel.tooling.maven.MavenArtifact;
+import org.snakeyaml.engine.v2.nodes.MappingNode;
+import org.snakeyaml.engine.v2.nodes.Node;
+import org.snakeyaml.engine.v2.nodes.NodeTuple;
+import org.snakeyaml.engine.v2.nodes.ScalarNode;
+import org.snakeyaml.engine.v2.nodes.SequenceNode;
+
+/**
+ * Checks a Citrus test, such as test/orders.citrus.it.yaml, against the JSON 
schema of a test from the Citrus catalog
+ * ({@code org.citrusframework:citrus-catalog-schema}) of the Citrus version 
camel test run uses. A local model wrote
+ * Citrus YAML of its own (an http: action with uri:, method: and 
expectStatus:, log: and assert-log: actions), the YAML
+ * check let it through, and camel test run then failed with "Unable to find 
property 'http' on class:
+ * org.citrusframework.yaml.TestActions" (test-citrus-orders of the 
local-model benchmark).
+ * <p/>
+ * The schema is read from the classpath, where the test plugin brings the 
catalog, or else from the catalog jar, which
+ * is downloaded once. Without the schema, offline say, a test is checked for 
its YAML syntax only.
+ */
+public final class CitrusTestChecks {
+
+    private static final String SCHEMA_GROUP = "org.citrusframework";
+    private static final String SCHEMA_ARTIFACT = "citrus-catalog-schema";
+    private static final String SCHEMA_DIR = 
"org/citrusframework/schema/citrus/";
+    private static final String SCHEMA_FILE = "citrus-testcase.json";
+    private static final String TEST_ACTIONS = "#/definitions/TestActions";
+    /** The items of the action lists of a container (sequential, 
parallel...), which the schema takes as any object. */
+    private static final String NESTED_ACTION = 
"#/definitions/TestActionBuilder";
+
+    private static final ObjectMapper YAML = new ObjectMapper(new 
YAMLFactory());
+    private static final ObjectMapper JSON = new ObjectMapper();
+    private static final Pattern INTEGER = Pattern.compile("[-+]?\\d+");
+    /** The words SnakeYAML, which Citrus reads a test with, takes as a 
boolean. */
+    private static final Set<String> BOOLEAN_WORDS = Set.of("true", "false", 
"yes", "no", "on", "off");
+
+    private static volatile TestSchema schema;
+
+    private CitrusTestChecks() {
+    }
+
+    /**
+     * The test schema of a Citrus version, or why there is none.
+     *
+     * @param version the Citrus version
+     * @param model   the schema document; null when there is no schema
+     * @param test    the schema of a test
+     * @param action  the schema of one action, for the actions of a container
+     * @param actions the names of the actions (echo, http, camel, 
sequential...)
+     * @param lists   the paths to the actions of a test (actions/[], 
finally/[]), "[]" for the items of a list
+     * @param nested  the paths to the actions of each container (sequential: 
actions/[]; waitFor: action)
+     * @param problem why there is no schema, or null
+     */
+    record TestSchema(String version, JsonNode model, Schema test, Schema 
action, Set<String> actions,
+            List<List<String>> lists, Map<String, List<List<String>>> nested, 
String problem) {
+    }
+
+    /**
+     * The problems of a Citrus test, each starting with "Line N: ": what the 
test schema says, and the actions that are
+     * not Citrus test actions, which the schema lets through. Empty when the 
test is valid, when its YAML does not
+     * parse (the YAML check says where), and when there is no schema.
+     */
+    public static List<String> validate(String content) {
+        if (content == null || content.isBlank()) {
+            return List.of();
+        }
+        TestSchema s = schema();
+        if (s.model() == null) {
+            return List.of();
+        }
+        JsonNode tree;
+        try {
+            tree = YAML.readTree(content);
+        } catch (IOException e) {
+            return List.of();
+        }
+        if (tree == null || tree.isMissingNode()) {
+            return List.of();
+        }
+        return new Check(s, content, tree).problems();
+    }
+
+    /** Whether a test is checked against the test schema; false when it is 
checked for its YAML syntax only. */
+    public static boolean hasSchema() {
+        return schema().model() != null;
+    }
+
+    /** The Citrus version whose test schema checks the tests. */
+    public static String version() {
+        return schema().version();
+    }
+
+    /** Why there is no test schema, such as a catalog that cannot be 
downloaded; null when there is one. */
+    public static String schemaProblem() {
+        return schema().problem();
+    }
+
+    /** The test schema of the Citrus version of the CLI, read once. */
+    static TestSchema schema() {
+        TestSchema s = schema;
+        if (s == null) {
+            synchronized (CitrusTestChecks.class) {
+                s = schema;
+                if (s == null) {
+                    s = load(CitrusCatalogVersion.CITRUS_VERSION);
+                    schema = s;
+                }
+            }
+        }
+        return s;
+    }
+
+    /** Uses the given schema document, or none for null, instead of the one 
of the catalog; for tests. */
+    static void setTestSchema(String json) {
+        try {
+            schema = json != null
+                    ? of(CitrusCatalogVersion.CITRUS_VERSION, json)
+                    : new TestSchema(
+                            CitrusCatalogVersion.CITRUS_VERSION, null, null, 
null, Set.of(), List.of(), Map.of(),
+                            "no schema (test)");
+        } catch (Exception e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+
+    /** Reads the schema of the catalog again when it is next needed; for 
tests. */
+    static void reset() {
+        schema = null;
+    }
+
+    /**
+     * The schema of the version, or one with the problem: a test is never 
refused because the schema cannot be had, and
+     * a download that failed is not tried again for each test.
+     */
+    private static TestSchema load(String version) {
+        try {
+            return of(version, read(version));
+        } catch (Exception e) {
+            String msg = e.getMessage() != null ? 
e.getMessage().lines().findFirst().orElse("") : "";
+            return new TestSchema(
+                    version, null, null, null, Set.of(), List.of(), Map.of(),
+                    msg.isBlank() ? e.getClass().getSimpleName() : msg);
+        }
+    }
+
+    /**
+     * The test schema from the classpath (camel-launcher has the test 
plugin), else from the catalog jar of the version
+     * in the local Maven repository (where the test plugin put it when it was 
downloaded), or downloaded.
+     */
+    private static String read(String version) throws Exception {
+        String entry = SCHEMA_DIR + version + "/" + SCHEMA_FILE;
+        try (InputStream is = 
CitrusTestChecks.class.getClassLoader().getResourceAsStream(entry)) {
+            if (is != null) {
+                return new String(is.readAllBytes(), StandardCharsets.UTF_8);
+            }
+        }
+        String gav = SCHEMA_GROUP + ":" + SCHEMA_ARTIFACT + ":" + version;
+        MavenDependencyDownloader downloader = new MavenDependencyDownloader();
+        downloader.setDownload(true);
+        try {
+            downloader.start();
+            MavenArtifact ma = downloader.downloadArtifact(SCHEMA_GROUP, 
SCHEMA_ARTIFACT, version);
+            if (ma == null || ma.getFile() == null) {
+                throw new IOException("cannot download " + gav);
+            }
+            try (ZipFile jar = new ZipFile(ma.getFile())) {
+                ZipEntry ze = jar.getEntry(entry);
+                if (ze == null) {
+                    throw new IOException(gav + " has no " + entry);
+                }
+                try (InputStream is = jar.getInputStream(ze)) {
+                    return new String(is.readAllBytes(), 
StandardCharsets.UTF_8);
+                }
+            }
+        } finally {
+            downloader.stop();
+            downloader.close();
+        }
+    }
+
+    /** The schemas of a test and of one action, and what the checks of the 
actions need, from the schema document. */
+    static TestSchema of(String version, String json) throws IOException {
+        JsonNode model = JSON.readTree(json);
+        Set<String> actions = new LinkedHashSet<>();
+        
model.at("/definitions/TestActions/properties").fieldNames().forEachRemaining(actions::add);
+        if (actions.isEmpty()) {
+            throw new IOException("the schema has no test actions");
+        }
+        var config = 
SchemaRegistryConfig.builder().locale(Locale.ENGLISH).build();
+        var registry = 
SchemaRegistry.withDefaultDialect(SpecificationVersion.DRAFT_7,
+                builder -> builder.schemaRegistryConfig(config));
+        Schema test = registry.getSchema(SchemaLocation.of(SCHEMA_FILE), 
model);
+        // one action: the definitions of the test schema, with an action as 
the root
+        ObjectNode one = JSON.createObjectNode();
+        one.set("$schema", model.get("$schema"));
+        one.set("definitions", model.get("definitions"));
+        one.putArray("allOf").addObject().put("$ref", TEST_ACTIONS);
+        Schema action = 
registry.getSchema(SchemaLocation.of("citrus-testaction.json"), one);
+        List<List<String>> lists = new ArrayList<>();
+        refPaths(model, new ArrayList<>(), TEST_ACTIONS::equals, lists, 0);
+        Map<String, List<List<String>>> nested = new LinkedHashMap<>();
+        for (String name : actions) {
+            List<List<String>> paths = new ArrayList<>();
+            refPaths(model.at("/definitions/TestActions/properties/" + name), 
new ArrayList<>(),
+                    ref -> ref.startsWith(NESTED_ACTION), paths, 0);
+            if (!paths.isEmpty()) {
+                nested.put(name, paths);
+            }
+        }
+        return new TestSchema(version, model, test, action, actions, lists, 
nested, null);
+    }
+
+    /**
+     * The paths of keys from a node of the schema to each reference the 
predicate accepts, "[]" for the items of a
+     * list: actions/[] for the actions of sequential, assertFault/when for 
the action of the assertFault of soap.
+     */
+    private static void refPaths(
+            JsonNode node, List<String> path, Predicate<String> ref, 
List<List<String>> answer, int depth) {
+        if (node == null || !node.isObject() || depth > 10) {
+            return;
+        }
+        JsonNode r = node.get("$ref");
+        if (r != null && r.isTextual() && ref.test(r.asText())) {
+            if (!answer.contains(path)) {
+                answer.add(List.copyOf(path));
+            }
+            return;
+        }
+        node.path("properties").properties().forEach(e -> {
+            path.add(e.getKey());
+            refPaths(e.getValue(), path, ref, answer, depth + 1);
+            path.remove(path.size() - 1);
+        });
+        if (node.has("items")) {
+            path.add("[]");
+            refPaths(node.get("items"), path, ref, answer, depth + 1);
+            path.remove(path.size() - 1);
+        }
+        for (String composition : new String[] { "allOf", "anyOf", "oneOf" }) {
+            for (JsonNode entry : node.path(composition)) {
+                refPaths(entry, path, ref, answer, depth + 1);
+            }
+        }
+    }
+
+    /**
+     * A scalar of another type than the schema says, which Citrus converts as 
it reads the test: SnakeYAML sets a
+     * number or a boolean as text where the property is a string (status: 
201), and parses a quoted number or boolean.
+     */
+    static boolean convertedScalar(Error error) {
+        JsonNode value = error.getInstanceNode();
+        if (!"type".equals(error.getKeyword()) || value == null) {
+            return false;
+        }
+        if (value.isNumber() || value.isBoolean()) {
+            return expects(error, "string");
+        }
+        if (value.isTextual()) {
+            String text = value.asText().trim();
+            if (expects(error, "integer")) {
+                return INTEGER.matcher(text).matches();
+            }
+            if (expects(error, "number")) {
+                try {
+                    Double.parseDouble(text);
+                    return true;
+                } catch (NumberFormatException e) {
+                    return false;
+                }
+            }
+            return expects(error, "boolean") && 
BOOLEAN_WORDS.contains(text.toLowerCase(Locale.ROOT));
+        }
+        return false;
+    }
+
+    /** Whether the type error is about a value of the type: "type" may be one 
type or a list of them. */
+    private static boolean expects(Error error, String type) {
+        JsonNode node = error.getSchemaNode();
+        if (node != null && node.isArray()) {
+            for (JsonNode t : node) {
+                if (type.equals(t.asText())) {
+                    return true;
+                }
+            }
+            return false;
+        }
+        return node != null && type.equals(node.asText());
+    }
+
+    /** The checks of one test: its tree for the schema, its YAML nodes for 
the lines and the keys of the actions. */
+    private static final class Check {
+
+        private final TestSchema schema;
+        private final JsonNode tree;
+        private final Node root;
+        /** The action of each action item, by its pointer (/actions/0: http), 
for the path a message names. */
+        private final Map<String, String> items = new LinkedHashMap<>();
+        /** The pointers where an action is expected: the items of the action 
lists. */
+        private final Set<String> slots = new HashSet<>();
+        private final List<Problem> problems = new ArrayList<>();
+
+        private record Problem(int line, String text) {
+        }
+
+        Check(TestSchema schema, String content, JsonNode tree) {
+            this.schema = schema;
+            this.tree = tree;
+            this.root = YamlPointerLines.root(content);
+        }
+
+        List<String> problems() {
+            // the actions first, also those of a container (sequential, 
parallel...), which the schema takes as any
+            // object: that each item is one Citrus test action, and what the 
actions of a container have
+            for (List<String> path : schema.lists()) {
+                forEachAction(root, path, 0, "", (item, at) -> 
checkAction(item, at, false));
+            }
+            describe(schema.test().validate(tree), "");
+            List<String> answer = new ArrayList<>();
+            problems.stream()
+                    .sorted(Comparator.comparingInt(Problem::line))
+                    .map(p -> p.line() > 0 ? "Line " + p.line() + ": " + 
p.text() : p.text())
+                    .distinct()
+                    .forEach(answer::add);
+            return answer;
+        }
+
+        /** Calls the visitor for each node the path of keys leads to from the 
node ("[]" for each item of a list). */
+        private void forEachAction(Node node, List<String> path, int index, 
String pointer, BiConsumer<Node, String> visitor) {
+            if (index == path.size()) {
+                slots.add(pointer);
+                visitor.accept(node, pointer);
+                return;
+            }
+            String key = path.get(index);
+            if ("[]".equals(key)) {
+                if (node instanceof SequenceNode seq) {
+                    for (int i = 0; i < seq.getValue().size(); i++) {
+                        forEachAction(seq.getValue().get(i), path, index + 1, 
pointer + "/" + i, visitor);
+                    }
+                }
+            } else if (node instanceof MappingNode map) {
+                // the last of a key given twice, as the YAML is read
+                Node value = null;
+                for (NodeTuple t : map.getValue()) {
+                    if (key.equals(scalar(t.getKeyNode()))) {
+                        value = t.getValueNode();
+                    }
+                }
+                if (value != null) {
+                    forEachAction(value, path, index + 1, pointer + "/" + 
escape(key), visitor);
+                }
+            }
+        }
+
+        /**
+         * An item of an action list names one Citrus test action, as - echo: 
{message: "..."}. The schema lets any
+         * other key through, and two actions in one item (a - left out) are 
one action to Citrus, which runs the last.
+         */
+        private void checkAction(Node item, String at, boolean nested) {
+            if (!(item instanceof MappingNode map)) {
+                // the schema says what it is instead of a map
+                return;
+            }
+            List<NodeTuple> keys = map.getValue();
+            if (keys.isEmpty()) {
+                add(line(item), "the list item has no action: write the action 
as its key, such as - echo: {message:"
+                                + " \"...\"}");
+                return;
+            }
+            boolean known = true;
+            for (NodeTuple t : keys) {
+                String name = scalar(t.getKeyNode());
+                if (name == null || !schema.actions().contains(name)) {
+                    known = false;
+                    add(line(t.getKeyNode()), 
notAnAction(String.valueOf(name)));
+                }
+            }
+            if (!known) {
+                return;
+            }
+            if (keys.size() > 1) {
+                List<String> names = keys.stream().map(t -> 
scalar(t.getKeyNode())).toList();
+                String what = names.stream().distinct().count() == 1
+                        ? names.get(0) + " is given " + (names.size() == 2 ? 
"twice" : names.size() + " times")
+                        : and(names) + " are " + (names.size() == 2 ? "two" : 
names.size()) + " actions";
+                add(line(keys.get(1).getKeyNode()), what + " in one list item, 
and Citrus runs only one of them: start"
+                                                    + " each action with - on 
a line of its own");
+                return;
+            }
+            String name = scalar(keys.get(0).getKeyNode());
+            items.put(at, name);
+            JsonNode action = tree.at(at);
+            if (nested && !action.isMissingNode()) {
+                describe(schema.action().validate(action), at);
+            }
+            for (List<String> path : schema.nested().getOrDefault(name, 
List.of())) {
+                forEachAction(keys.get(0).getValueNode(), path, 0, at + "/" + 
escape(name),
+                        (n, p) -> checkAction(n, p, true));
+            }
+        }
+
+        /** What is said of a key that is not a Citrus test action. */
+        private String notAnAction(String name) {
+            String answer = name + " is not a Citrus test action";
+            // assert-log, create-variables: the actions are written in camel 
case
+            String camel = camelCase(name);
+            String closest = schema.actions().contains(camel)
+                    ? camel : QuickFixes.closest(camel, new 
ArrayList<>(schema.actions()));
+            if (closest != null && !closest.equals(name)) {
+                return answer + " (did you mean " + closest + "?)";
+            }
+            if (camelCaseWords(name).contains("log") && 
schema.actions().contains("echo")
+                    && schema.actions().contains("camel")) {
+                // log:, assert-log: or assertLog: in 8 of the 11 tests a 
local model wrote (test-citrus-orders)
+                String cli = 
schema.model().at("/definitions/TestActions/properties/camel/properties/cli").isMissingNode()
+                        ? "jbang" : "cli";
+                return answer + ": echo: {message: \"...\"} writes a message 
to the test log, and camel: {" + cli
+                       + ": {verify: {integration: \"<name>\", logMessage: 
\"...\"}}} checks that the integration"
+                       + " logged a line";
+            }
+            return answer + "; the actions are " + String.join(", ", 
schema.actions());
+        }
+
+        /**
+         * The schema errors in words: what the noise of the branches of a 
oneOf leaves, without the type errors of the
+         * values Citrus converts, and the keys an object does not take in one 
message, with the keys it takes.
+         *
+         * @param raw    the errors of the validation
+         * @param prefix the pointer of the node the validation was of, "" for 
the test
+         */
+        private void describe(List<Error> raw, String prefix) {
+            List<Error> errors = new 
ArrayList<>(YamlValidator.filterOneOfNoise(new ArrayList<>(raw)));
+            errors.removeIf(CitrusTestChecks::convertedScalar);
+            // a oneOf that fails for an error in the branch of its key 
(sendRequest for its POST): that error says it
+            List<Error> all = List.copyOf(errors);
+            errors.removeIf(e -> isComposition(e)
+                    && all.stream().anyMatch(o -> 
location(o).startsWith(location(e) + "/")));
+            Map<String, List<Error>> unknown = new LinkedHashMap<>();
+            for (Error e : errors) {
+                if ("additionalProperties".equals(e.getKeyword()) && 
e.getProperty() != null) {
+                    unknown.computeIfAbsent(prefix + location(e), k -> new 
ArrayList<>()).add(e);
+                }
+            }
+            for (Error e : errors) {
+                String at = prefix + location(e);
+                if ("additionalProperties".equals(e.getKeyword()) && 
e.getProperty() != null) {
+                    continue;
+                }
+                if ("required".equals(e.getKeyword()) && 
unknown.containsKey(at)) {
+                    // a key misspelled: the unknown key says it, the missing 
one would only repeat it
+                    continue;
+                }
+                add(YamlPointerLines.line(root, at, e.getMessage()), 
describe(e, at));
+            }
+            unknown.forEach((at, list) -> {
+                List<String> keys = 
list.stream().map(Error::getProperty).distinct().toList();
+                add(YamlPointerLines.line(root, at, "property '" + keys.get(0) 
+ "'"), unknownKeys(at, keys, list.get(0)));
+            });
+        }
+
+        private String describe(Error e, String at) {
+            String what = where(at);
+            String message = e.getMessage();
+            if ("type".equals(e.getKeyword()) && slots.contains(at)) {
+                return message + ": an action is a map with the action as its 
key, such as - echo: {message: \"...\"}";
+            }
+            if ("type".equals(e.getKeyword()) && expects(e, "object")) {
+                Set<String> keys = keysAt(e);
+                if (!keys.isEmpty() && what.isEmpty()) {
+                    // a list, as a Camel route file is
+                    return message + ": a Citrus test is a map with the keys " 
+ String.join(", ", keys);
+                }
+                if (!keys.isEmpty()) {
+                    return what + ": " + message + "; " + name(what) + " takes 
" + String.join(", ", keys);
+                }
+            }
+            if ("enum".equals(e.getKeyword()) && e.getSchemaNode() != null && 
e.getInstanceNode() != null) {
+                List<String> choices = new ArrayList<>();
+                e.getSchemaNode().forEach(c -> choices.add(c.asText()));
+                String value = e.getInstanceNode().asText();
+                String closest = QuickFixes.closest(value, choices);
+                return (what.isEmpty() ? "" : what + ": ") + value + " is not 
one of " + String.join(", ", choices)
+                       + (closest != null ? " (did you mean " + closest + "?)" 
: "");
+            }
+            if ("oneOf".equals(e.getKeyword()) && e.getSchemaNode() != null && 
e.getInstanceNode() != null) {
+                // the keys of which an object takes one (body: data, resource 
or script), given together
+                List<String> keys = new ArrayList<>();
+                e.getSchemaNode().forEach(branch -> {
+                    if (branch.path("required").size() == 1) {
+                        keys.add(branch.path("required").get(0).asText());
+                    }
+                });
+                List<String> given = 
keys.stream().filter(e.getInstanceNode()::has).toList();
+                if (given.size() > 1) {
+                    return (what.isEmpty() ? "" : what + ": ") + and(given) + 
" are given together, and "
+                           + name(what) + " takes only one of " + 
String.join(", ", keys);
+                }
+            }
+            return what.isEmpty() ? message : what + ": " + message;
+        }
+
+        /** The keys an object does not take, with the keys it takes, and the 
closest one of each when it is clear. */
+        private String unknownKeys(String at, List<String> keys, Error error) {
+            Set<String> takes = keysAt(error);
+            List<String> named = new ArrayList<>();
+            for (String key : keys) {
+                String closest = QuickFixes.closest(key, new 
ArrayList<>(takes));
+                named.add(closest != null ? key + " (did you mean " + closest 
+ "?)" : key);
+            }
+            String what = where(at);
+            // the keys of the action itself (http: {uri: ...}), or of a node 
in it (http.sendRequest)
+            String of = what.isEmpty() ? "a Citrus test"
+                    : items.containsKey(at.substring(0, Math.max(0, 
at.lastIndexOf('/')))) ? "the " + what + " action"
+                    : what;
+            return and(named) + (keys.size() == 1 ? " is not a key of " : " 
are not keys of ") + of
+                   + (takes.isEmpty() ? "" : ", which takes " + String.join(", 
", takes));
+        }
+
+        /**
+         * The keys the object takes that the schema location of an error is 
at (the location of the
+         * additionalProperties or the type of the object): its properties and 
those of its branches.
+         */
+        private Set<String> keysAt(Error error) {
+            String location = String.valueOf(error.getSchemaLocation());
+            int hash = location.indexOf('#');
+            String pointer = hash >= 0 ? location.substring(hash + 1) : "";
+            pointer = pointer.substring(0, Math.max(0, 
pointer.lastIndexOf('/')));
+            Set<String> answer = new LinkedHashSet<>();
+            collectKeys(schema.model().at(pointer), answer, 0);
+            return answer;
+        }
+
+        private void collectKeys(JsonNode node, Set<String> answer, int depth) 
{
+            if (node == null || node.isMissingNode() || depth > 4) {
+                return;
+            }
+            node.path("properties").fieldNames().forEachRemaining(answer::add);
+            JsonNode ref = node.get("$ref");
+            if (ref != null && ref.isTextual() && 
ref.asText().startsWith("#")) {
+                collectKeys(schema.model().at(ref.asText().substring(1)), 
answer, depth + 1);
+            }
+            for (String composition : new String[] { "allOf", "anyOf", "oneOf" 
}) {
+                for (JsonNode entry : node.path(composition)) {
+                    if (!entry.has("not")) {
+                        collectKeys(entry, answer, depth + 1);
+                    }
+                }
+            }
+        }
+
+        /**
+         * The keys from the action down to the node, such as 
http.sendRequest.POST.body, or from the top of the test
+         * for a node that is in no action (variables); empty for the test 
itself.
+         */
+        private String where(String pointer) {
+            String base = "";
+            for (String item : items.keySet()) {
+                if ((pointer.equals(item) || pointer.startsWith(item + "/")) 
&& item.length() > base.length()) {
+                    base = item;
+                }
+            }
+            StringJoiner sj = new StringJoiner(".");
+            for (String segment : pointer.substring(base.length()).split("/")) 
{
+                if (!segment.isEmpty() && !INTEGER.matcher(segment).matches()) 
{
+                    sj.add(segment.replace("~1", "/").replace("~0", "~"));
+                }
+            }
+            return sj.toString();
+        }
+
+        private void add(int line, String text) {
+            problems.add(new Problem(line, text));
+        }
+    }
+
+    /** The last key of a path such as http.sendRequest.POST, or what the test 
itself is called. */
+    private static String name(String what) {
+        return what.isEmpty() ? "a Citrus test" : 
what.substring(what.lastIndexOf('.') + 1);
+    }
+
+    private static boolean isComposition(Error e) {
+        return "oneOf".equals(e.getKeyword()) || 
"anyOf".equals(e.getKeyword());
+    }
+
+    /** The instance location of an error as a pointer, "" for the root. */
+    private static String location(Error e) {
+        String at = e.getInstanceLocation() != null ? 
e.getInstanceLocation().toString() : "";
+        return "/".equals(at) ? "" : at;
+    }
+
+    private static String escape(String key) {
+        return key.replace("~", "~0").replace("/", "~1");
+    }
+
+    private static String scalar(Node node) {
+        return node instanceof ScalarNode s ? s.getValue() : null;
+    }
+
+    private static int line(Node node) {
+        return node.getStartMark().map(mark -> mark.getLine() + 1).orElse(0);
+    }
+
+    /** assert-log and assert_log as assertLog. */
+    private static String camelCase(String name) {
+        StringBuilder sb = new StringBuilder();
+        boolean upper = false;
+        for (char ch : name.toCharArray()) {
+            if (ch == '-' || ch == '_') {
+                upper = sb.length() > 0;
+            } else {
+                sb.append(upper ? Character.toUpperCase(ch) : ch);
+                upper = false;
+            }
+        }
+        return sb.toString();
+    }
+
+    /** The words of a name in lower case: assertLog, assert-log and 
assert_log are assert and log. */
+    private static List<String> camelCaseWords(String name) {
+        return 
List.of(camelCase(name).split("(?<=[a-z0-9])(?=[A-Z])")).stream()
+                .map(w -> w.toLowerCase(Locale.ROOT)).toList();
+    }
+
+    /** a, b and c. */
+    private static String and(List<String> words) {
+        if (words.size() <= 1) {
+            return String.join("", words);
+        }
+        return String.join(", ", words.subList(0, words.size() - 1)) + " and " 
+ words.get(words.size() - 1);
+    }
+}
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidator.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidator.java
index a9b14e74e2fb..4b74bee533f9 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidator.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/SourceValidator.java
@@ -83,15 +83,16 @@ public final class SourceValidator {
 
     /**
      * Whether the file is a Citrus test, such as test/orders.citrus.it.yaml: 
camel test run runs it, and no integration
-     * loads it. It is YAML of its own, not a Camel route, so only its YAML 
syntax is checked.
+     * loads it. It is YAML of its own, not a Camel route, so it is checked 
against the test schema of Citrus
+     * ({@link CitrusTestChecks}).
      */
     public static boolean isCitrusTest(String fileName) {
         return fileName != null && 
CITRUS_TEST.matcher(fileName.toLowerCase(Locale.ROOT)).matches();
     }
 
     /**
-     * Validates source by file type: Camel YAML DSL for .yaml/.yml files (a 
Citrus test for its YAML syntax only),
-     * Camel options for .properties files. Other file types have no 
validation and yield no messages.
+     * Validates source by file type: Camel YAML DSL for .yaml/.yml files (a 
Citrus test against the test schema of
+     * Citrus), Camel options for .properties files. Other file types have no 
validation and yield no messages.
      *
      * @param  fileName          the file name; its extension picks the checks
      * @param  content           the source
@@ -139,8 +140,11 @@ public final class SourceValidator {
         String name = fileName == null ? "" : 
fileName.toLowerCase(Locale.ROOT);
         if (isCitrusTest(name)) {
             // a Citrus test is not a route: checked as one, a new test was 
refused ("a Camel YAML file is a list of
-            // entries"), and a local model then wrote a route in its place 
(test-citrus-orders of the benchmark)
-            return validateYamlSyntax(content);
+            // entries"), and a local model then wrote a route in its place 
(test-citrus-orders of the benchmark).
+            // Checked for its YAML syntax only, a test with actions Citrus 
does not have was written, and camel test
+            // run then failed on it: so the test schema of Citrus checks it 
too
+            List<String> syntax = validateYamlSyntax(content);
+            return syntax.isEmpty() ? CitrusTestChecks.validate(content) : 
syntax;
         }
         if (name.endsWith(".yaml") || name.endsWith(".yml")) {
             // a rest binding to an OpenAPI specification hides the verb, and 
the specification is a file beside the
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/AuthoringToolsCitrusTest.java
 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/AuthoringToolsCitrusTest.java
index 2492bc9f7db9..03a007828a99 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/AuthoringToolsCitrusTest.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/AuthoringToolsCitrusTest.java
@@ -29,8 +29,8 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 /**
  * A Citrus test, such as test/orders.citrus.it.yaml, is run with camel test 
run and is not a route: the write, edit and
- * validate tools check its YAML syntax only, with none of the repairs, notes 
and reloads of a route (test-citrus-orders
- * of the local-model benchmark).
+ * validate tools check its YAML syntax and the test schema of Citrus, with 
none of the repairs, notes and reloads of a
+ * route (test-citrus-orders of the local-model benchmark).
  */
 class AuthoringToolsCitrusTest {
 
@@ -113,6 +113,7 @@ class AuthoringToolsCitrusTest {
         assertThat(result.get("existingProblems")).isNull();
         assertThat(result.get("notes")).isNull();
         
assertThat(result.getString("message")).isEqualTo(AuthoringTools.citrusTestNote(FILE))
+                .contains("checked against the test schema of Citrus " + 
CitrusTestChecks.version())
                 .contains("camel test run test/orders.citrus.it.yaml");
         assertThat(Files.readString(dir.resolve(FILE))).isEqualTo(ORDERS_TEST);
         // the content a route check refuses
@@ -161,6 +162,86 @@ class AuthoringToolsCitrusTest {
         assertThat(Files.readString(dir.resolve(FILE))).isEqualTo(SAMPLE);
     }
 
+    @Test
+    void aCitrusTestOfActionsCitrusDoesNotHaveIsNotWritten(@TempDir Path dir) 
throws IOException {
+        // a test a local model wrote for step 1 (r26 of the local-model 
benchmark): written, as its YAML parses, it
+        // failed in camel test run with "Unable to find property 'http' on 
class: org.citrusframework.yaml.TestActions"
+        String invented = """
+                name: orders.citrus.it
+                actions:
+                  - http:
+                      uri: http://localhost:8080/orders
+                      method: POST
+                      requestFile: sample-order.json
+                      expectStatus: 201
+                  - assert-log:
+                      pattern: "Order ORD-1001 accepted"
+                """;
+        Files.createDirectories(dir.resolve("test"));
+        Files.writeString(dir.resolve(FILE), SAMPLE);
+
+        JsonObject result = AuthoringTools.writeFile(new ToolContext(), dir, 
FILE, invented, true);
+
+        
assertThat(result.getString("status")).as(String.valueOf(result)).isEqualTo("invalid");
+        assertThat(result.get("errors").toString())
+                .contains("Line 4: uri, method, requestFile and expectStatus 
are not keys of the http action, which"
+                          + " takes actor, client,")
+                .contains("Line 8: assert-log is not a Citrus test action: 
echo: {message: ");
+        assertThat(result.getString("message")).startsWith("The file was not 
written")
+                .contains("camel_catalog_examples with filter citrus");
+        assertThat(result.get("repaired")).isNull();
+        assertThat(Files.readString(dir.resolve(FILE))).isEqualTo(SAMPLE);
+
+        // the test the example has: written
+        result = AuthoringTools.writeFile(new ToolContext(), dir, FILE, 
ORDERS_TEST, true);
+        
assertThat(result.getString("status")).as(String.valueOf(result)).isEqualTo("overwritten");
+        assertThat(Files.readString(dir.resolve(FILE))).isEqualTo(ORDERS_TEST);
+    }
+
+    @Test
+    void anEditThatBreaksTheTestIsNotWritten(@TempDir Path dir) throws 
IOException {
+        // step 2: the body of the request written as text, where Citrus takes 
body: {data: ...}
+        Files.createDirectories(dir.resolve("test"));
+        Files.writeString(dir.resolve(FILE), ORDERS_TEST);
+
+        JsonObject result = AuthoringTools.editFile(new ToolContext(), dir, 
FILE, """
+                          body:
+                            resource:
+                              file: "../sample-order.json"
+                """, """
+                          body: '{"orderId": "ORD-1002", "country": "US"}'
+                """);
+
+        
assertThat(result.getString("status")).as(String.valueOf(result)).isEqualTo("invalid");
+        assertThat(result.get("errors").toString())
+                .contains("Line 18: http.sendRequest.POST.body: string found, 
object expected; body takes data,"
+                          + " resource, script");
+        assertThat(Files.readString(dir.resolve(FILE))).isEqualTo(ORDERS_TEST);
+    }
+
+    @Test
+    void withoutTheSchemaACitrusTestIsCheckedForItsYamlOnly(@TempDir Path dir) 
{
+        // offline, with no catalog in the local Maven repository: the test is 
written, and the answer says how it
+        // was checked
+        CitrusTestChecks.setTestSchema(null);
+        try {
+            JsonObject result = AuthoringTools.writeFile(new ToolContext(), 
dir, FILE, """
+                    name: orders-test
+                    actions:
+                      - log:
+                          message: hello
+                    """, true);
+
+            
assertThat(result.getString("status")).as(String.valueOf(result)).isEqualTo("created");
+            assertThat(result.getString("message")).contains("only its YAML 
syntax is checked")
+                    .contains("camel test run " + FILE);
+            assertThat(AuthoringTools.validate(new ToolContext(), FILE, 
ORDERS_TEST).getString("message"))
+                    .startsWith("The YAML is valid.");
+        } finally {
+            CitrusTestChecks.reset();
+        }
+    }
+
     @Test
     void theRunningIntegrationIsNotSaidToReloadACitrusTest(@TempDir Path dir) {
         // the answer said "The running integration reloaded the file": dev 
mode with --source-dir reloads the routes
@@ -176,7 +257,7 @@ class AuthoringToolsCitrusTest {
     }
 
     @Test
-    void anEditOfACitrusTestIsCheckedForItsYamlOnly(@TempDir Path dir) throws 
IOException {
+    void anEditOfACitrusTestIsCheckedAsATest(@TempDir Path dir) throws 
IOException {
         // step 2: a case added after the last action
         Files.createDirectories(dir.resolve("test"));
         Files.writeString(dir.resolve(FILE), ORDERS_TEST);
@@ -200,10 +281,22 @@ class AuthoringToolsCitrusTest {
     }
 
     @Test
-    void validateSourceChecksTheYamlOfACitrusTest() {
+    void validateSourceChecksACitrusTest() {
         JsonObject valid = AuthoringTools.validate(new ToolContext(), FILE, 
ORDERS_TEST);
         
assertThat(valid.getBoolean("valid")).as(String.valueOf(valid)).isTrue();
-        assertThat(valid.getString("message")).startsWith("The YAML is 
valid.").contains("camel test run " + FILE);
+        assertThat(valid.getString("message")).startsWith("The test is 
valid.").contains("camel test run " + FILE);
+
+        // an action Citrus does not have
+        JsonObject log = AuthoringTools.validate(new ToolContext(), FILE, """
+                name: orders-test
+                actions:
+                  - log:
+                      message: hello
+                """);
+        assertThat(log.getBoolean("valid")).isFalse();
+        assertThat(log.get("errors").toString()).contains("Line 3: log is not 
a Citrus test action");
+        assertThat(log.getString("message")).isEqualTo("1 problem(s) found; 
fix them before writing the file. "
+                                                       + 
AuthoringTools.CITRUS_SAMPLES);
 
         // a quote that is not closed: the parser reads to the end of the 
file, and names the line of the quote
         JsonObject invalid = AuthoringTools.validate(new ToolContext(), FILE, 
"""
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/CitrusTestChecksTest.java
 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/CitrusTestChecksTest.java
new file mode 100644
index 000000000000..95c0c2456919
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/CitrusTestChecksTest.java
@@ -0,0 +1,337 @@
+/*
+ * 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.dsl.jbang.core.commands.ai;
+
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.stream.Stream;
+
+import org.apache.camel.catalog.DefaultCamelCatalog;
+import org.junit.jupiter.api.Named;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * A Citrus test is checked against the test schema of the Citrus catalog, 
which the tests have on the classpath (it is
+ * never downloaded here). The invalid tests in 
src/test/resources/citrus-orders are tests a local model wrote for
+ * test-citrus-orders of the local-model benchmark; camel test run failed on 
each of them.
+ */
+class CitrusTestChecksTest {
+
+    private static final Path ORDERS = 
Path.of("src/test/resources/citrus-orders");
+
+    /** What is said of an action named log: what to write to log a message, 
and to check the log of the integration. */
+    private static final String LOG_HINT = "echo: {message: \"...\"} writes a 
message to the test log, and camel: {cli:"
+                                           + " {verify: {integration: 
\"<name>\", logMessage: \"...\"}}} checks that the"
+                                           + " integration logged a line";
+
+    @Test
+    void theSchemaIsOnTheClasspath() {
+        
assertThat(CitrusTestChecks.hasSchema()).as(CitrusTestChecks.schemaProblem()).isTrue();
+        
assertThat(CitrusTestChecks.version()).isNotBlank().doesNotContain("${");
+        assertThat(CitrusTestChecks.schema().actions()).contains("echo", 
"http", "camel", "sequential", "waitFor")
+                .doesNotContain("log");
+        // the containers, whose actions the schema takes as any object, read 
from the schema
+        
assertThat(CitrusTestChecks.schema().nested().get("sequential")).containsExactly(List.of("actions",
 "[]"));
+        
assertThat(CitrusTestChecks.schema().nested().get("waitFor")).containsExactly(List.of("action"));
+        
assertThat(CitrusTestChecks.schema().lists()).containsExactly(List.of("actions",
 "[]"), List.of("finally", "[]"));
+    }
+
+    @ParameterizedTest
+    @ValueSource(strings = { "step1.citrus.it.yaml", "step2.citrus.it.yaml", 
"step3.citrus.it.yaml" })
+    void theTestsOfTheBenchmarkExampleAreValid(String file) throws Exception {
+        assertThat(validate(ORDERS.resolve(file))).isEmpty();
+    }
+
+    static Stream<Arguments> bundledTests() throws Exception {
+        // the Citrus tests of the bundled examples, from the classpath as 
ExampleRoutesLoadTest reads them, and the
+        // golden test
+        URL examples = 
CitrusTestChecksTest.class.getClassLoader().getResource("examples");
+        Path dir = Path.of(examples.toURI());
+        try (Stream<Path> files = Files.walk(dir)) {
+            List<Path> tests = files.filter(p -> 
SourceValidator.isCitrusTest(p.getFileName().toString())).sorted()
+                    .toList();
+            assertThat(tests).hasSizeGreaterThan(20);
+            Path golden = 
Path.of("src/test/resources/golden/citrus/test/orders.citrus.it.yaml");
+            return Stream.concat(tests.stream().map(p -> 
Arguments.of(Named.of(dir.relativize(p).toString(), p))),
+                    Stream.of(Arguments.of(Named.of("golden/" + 
golden.getFileName(), golden))));
+        }
+    }
+
+    @ParameterizedTest(name = "{0}")
+    @MethodSource("bundledTests")
+    void theTestsOfTheExamplesAreValid(Path file) throws Exception {
+        assertThat(validate(file)).isEmpty();
+    }
+
+    @Test
+    void anHttpActionWithKeysOfItsOwnAndLogActions() throws Exception {
+        List<String> msgs = 
validate(ORDERS.resolve("http-of-its-own.citrus.it.yaml"));
+
+        assertThat(msgs).hasSize(3);
+        assertThat(msgs.get(0)).isEqualTo("Line 32: uri, method, requestFile, 
contentType and expectStatus are not keys of"
+                                          + " the http action, which takes 
actor, client, description, receiveRequest,"
+                                          + " receiveResponse, sendRequest, 
sendResponse, server");
+        assertThat(msgs.get(1)).isEqualTo("Line 39: log is not a Citrus test 
action: " + LOG_HINT);
+        assertThat(msgs.get(2)).isEqualTo("Line 44: assert-log is not a Citrus 
test action: " + LOG_HINT);
+    }
+
+    @Test
+    void anHttpActionWithARequestAndAResponse() throws Exception {
+        List<String> msgs = 
validate(ORDERS.resolve("request-and-response.citrus.it.yaml"));
+
+        assertThat(msgs).hasSize(2);
+        assertThat(msgs.get(0)).startsWith("Line 30: request and response are 
not keys of the http action, which takes")
+                .contains("sendRequest", "receiveResponse");
+        assertThat(msgs.get(1)).startsWith("Line 53: log is not a Citrus test 
action");
+    }
+
+    @Test
+    void aBodyIsAnObjectWithItsData() throws Exception {
+        // step 2: the body of a request and of a response given as text, 
which is body: {data: ...}
+        List<String> msgs = 
validate(ORDERS.resolve("body-as-text.citrus.it.yaml"));
+
+        assertThat(msgs).hasSize(2);
+        assertThat(msgs.get(0)).isEqualTo("Line 60: 
http.sendRequest.POST.body: string found, object expected; body takes"
+                                          + " data, resource, script");
+        assertThat(msgs.get(1)).isEqualTo("Line 66: 
http.receiveResponse.response.body: string found, object expected;"
+                                          + " body takes data, resource, 
script");
+    }
+
+    @Test
+    void aTestCutOffInTheMiddleOfAnAction() throws Exception {
+        List<String> msgs = validate(ORDERS.resolve("cut-off.citrus.it.yaml"));
+
+        assertThat(msgs).hasSize(1);
+        assertThat(msgs.get(0)).isEqualTo("Line 72: http: string found, object 
expected; http takes actor, client,"
+                                          + " description, receiveRequest, 
receiveResponse, sendRequest, sendResponse,"
+                                          + " server");
+    }
+
+    @Test
+    void aKeyCloseToAnActionIsSaid() {
+        List<String> msgs = CitrusTestChecks.validate("""
+                name: t
+                actions:
+                  - Echo:
+                      message: a
+                  - create-variables:
+                      variables: []
+                  - htpp:
+                      client: c
+                  - wait:
+                      seconds: 1
+                """);
+
+        assertThat(msgs).hasSize(4);
+        assertThat(msgs.get(0)).isEqualTo("Line 3: Echo is not a Citrus test 
action (did you mean echo?)");
+        assertThat(msgs.get(1)).isEqualTo("Line 5: create-variables is not a 
Citrus test action (did you mean"
+                                          + " createVariables?)");
+        assertThat(msgs.get(2)).isEqualTo("Line 7: htpp is not a Citrus test 
action (did you mean http?)");
+        // nothing close: the actions of the schema
+        assertThat(msgs.get(3)).startsWith("Line 9: wait is not a Citrus test 
action; the actions are action, agent,")
+                .contains(" echo, ", " http, ", " waitFor");
+    }
+
+    @Test
+    void theActionsOfAContainerAreCheckedToo() {
+        // the schema takes the actions of sequential, parallel, catch and 
waitFor as any object
+        List<String> msgs = CitrusTestChecks.validate("""
+                name: t
+                actions:
+                  - sequential:
+                      actions:
+                        - assertLog:
+                            message: x
+                        - echo:
+                            msg: y
+                        - parallel:
+                            actions:
+                              - sleep:
+                                  millis: 5
+                  - waitFor:
+                      action:
+                        htpp:
+                          client: c
+                finally:
+                  - print:
+                      text: bye
+                """);
+
+        assertThat(msgs).hasSize(5);
+        assertThat(msgs.get(0)).startsWith("Line 5: assertLog is not a Citrus 
test action: echo:");
+        assertThat(msgs.get(1)).isEqualTo("Line 8: msg is not a key of the 
echo action, which takes description, message");
+        assertThat(msgs.get(2)).isEqualTo("Line 12: millis is not a key of the 
sleep action, which takes description,"
+                                          + " milliseconds, seconds");
+        assertThat(msgs.get(3)).isEqualTo("Line 15: htpp is not a Citrus test 
action (did you mean http?)");
+        assertThat(msgs.get(4)).isEqualTo("Line 19: text is not a key of the 
print action, which takes description,"
+                                          + " message");
+    }
+
+    @Test
+    void twoActionsInOneListItem() {
+        // a - left out: Citrus runs one of the two
+        List<String> msgs = CitrusTestChecks.validate("""
+                name: t
+                actions:
+                  - echo:
+                      message: a
+                    sleep:
+                      milliseconds: 5
+                  - echo:
+                      message: b
+                    echo:
+                      message: c
+                """);
+
+        assertThat(msgs).hasSize(2);
+        assertThat(msgs.get(0)).isEqualTo("Line 5: echo and sleep are two 
actions in one list item, and Citrus runs only"
+                                          + " one of them: start each action 
with - on a line of its own");
+        assertThat(msgs.get(1)).isEqualTo("Line 9: echo is given twice in one 
list item, and Citrus runs only one of them:"
+                                          + " start each action with - on a 
line of its own");
+    }
+
+    @Test
+    void theTestItself() {
+        // a route, the way a model wrote one in place of the test
+        assertThat(CitrusTestChecks.validate("""
+                - route:
+                    from:
+                      uri: timer:tick
+                """)).containsExactly("Line 1: array found, object expected: a 
Citrus test is a map with the keys"
+                                      + " actions, author, description, 
endpoints, finally, name, status, variables");
+        List<String> msgs = CitrusTestChecks.validate("""
+                name: t
+                status: final
+                steps:
+                  - echo:
+                      message: a
+                """);
+        assertThat(msgs).hasSize(2);
+        assertThat(msgs.get(0)).isEqualTo("Line 2: status: final is not one of 
DRAFT, READY_FOR_REVIEW, FINAL, DISABLED"
+                                          + " (did you mean FINAL?)");
+        assertThat(msgs.get(1)).isEqualTo("Line 3: steps is not a key of a 
Citrus test, which takes actions, author,"
+                                          + " description, endpoints, finally, 
name, status, variables");
+    }
+
+    @Test
+    void aBodyTakesOneOfItsKeys() {
+        assertThat(CitrusTestChecks.validate("""
+                name: t
+                actions:
+                  - http:
+                      client: c
+                      sendRequest:
+                        POST:
+                          path: /orders
+                          body:
+                            data: x
+                            resource:
+                              file: y
+                """)).containsExactly("Line 9: http.sendRequest.POST.body: 
data and resource are given together, and"
+                                      + " body takes only one of data, 
resource, script");
+    }
+
+    @Test
+    void aScalarCitrusConvertsIsValid() {
+        // SnakeYAML, which Citrus reads the test with, sets 201 as the text 
"201" and parses "3" as a number
+        assertThat(CitrusTestChecks.validate("""
+                name: t
+                actions:
+                  - sleep:
+                      milliseconds: 500
+                  - iterate:
+                      times: "3"
+                      actions:
+                        - echo:
+                            message: hi
+                  - http:
+                      client: c
+                      receiveResponse:
+                        response:
+                          status: 201
+                """)).isEmpty();
+        assertThat(CitrusTestChecks.validate("""
+                name: t
+                actions:
+                  - iterate:
+                      times: three
+                      actions:
+                        - echo:
+                            message: hi
+                """)).containsExactly("Line 4: iterate.times: string found, 
integer expected");
+    }
+
+    @Test
+    void anActionIsAMap() {
+        List<String> msgs = CitrusTestChecks.validate("""
+                name: t
+                actions:
+                  - echo "hi"
+                  - {}
+                  - echo:
+                """);
+        assertThat(msgs).hasSize(3);
+        assertThat(msgs.get(0)).isEqualTo("Line 3: string found, object 
expected: an action is a map with the action as"
+                                          + " its key, such as - echo: 
{message: \"...\"}");
+        assertThat(msgs.get(1)).isEqualTo("Line 4: the list item has no 
action: write the action as its key, such as"
+                                          + " - echo: {message: \"...\"}");
+        assertThat(msgs.get(2)).isEqualTo("Line 5: echo: null found, object 
expected; echo takes description, message");
+    }
+
+    @Test
+    void theYamlCheckSaysWhereATestDoesNotParse() {
+        // the schema is for a test that parses: the YAML check comes first
+        String content = """
+                name: t
+                actions:
+                  - echo:
+                      message: "a
+                """;
+        assertThat(CitrusTestChecks.validate(content)).isEmpty();
+        assertThat(SourceValidator.validate("test/t.citrus.it.yaml", content, 
new DefaultCamelCatalog(), null))
+                .singleElement().asString().contains("the YAML does not 
parse");
+    }
+
+    @Test
+    void withoutTheSchemaATestIsCheckedForItsYamlOnly() throws Exception {
+        // offline, with no catalog in the local Maven repository: no test is 
refused for the schema
+        CitrusTestChecks.setTestSchema(null);
+        try {
+            assertThat(CitrusTestChecks.hasSchema()).isFalse();
+            
assertThat(validate(ORDERS.resolve("http-of-its-own.citrus.it.yaml"))).isEmpty();
+            
assertThat(AuthoringTools.citrusTestNote("test/orders.citrus.it.yaml"))
+                    .contains("only its YAML syntax is checked, as the test 
schema of Citrus")
+                    .contains("could not be loaded (no schema (test))");
+        } finally {
+            CitrusTestChecks.reset();
+        }
+        assertThat(CitrusTestChecks.hasSchema()).isTrue();
+    }
+
+    private static List<String> validate(Path file) throws Exception {
+        return SourceValidator.validate(file.getFileName().toString(), 
Files.readString(file), new DefaultCamelCatalog(),
+                null);
+    }
+}
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/body-as-text.citrus.it.yaml
 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/body-as-text.citrus.it.yaml
new file mode 100644
index 000000000000..e9f72f77964c
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/body-as-text.citrus.it.yaml
@@ -0,0 +1,66 @@
+#
+# 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.
+#
+
+name: orders-test
+description: The order API accepts the sample order and logs it
+actions:
+  - camel:
+      jbang:
+        run:
+          integration:
+            name: "orders"
+            file: "../orders.camel.yaml"
+            systemProperties:
+              file: "../application.properties"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "(orders) started"
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body:
+            resource:
+              file: "../sample-order.json"
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "201"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "Order ORD-1001 accepted for C-482 with 2 line(s)"
+  # HTTP case: order without a customer gets 400 with error message
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body: '{"orderId": "ORD-1002", "country": "US", "lines": [{"sku": 
"CAMEL-HAT", "qty": 1, "price": 15.0}]}'
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "400"
+          body: '{"error": "an order needs a customer"}'
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/cut-off.citrus.it.yaml
 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/cut-off.citrus.it.yaml
new file mode 100644
index 000000000000..a020fd456cf5
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/cut-off.citrus.it.yaml
@@ -0,0 +1,72 @@
+#
+# 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.
+#
+
+name: orders-test
+description: The order API accepts the sample order and logs it
+actions:
+  - camel:
+      jbang:
+        run:
+          integration:
+            name: "orders"
+            file: "../orders.camel.yaml"
+            systemProperties:
+              file: "../application.properties"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "(orders) started"
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body:
+            resource:
+              file: "../sample-order.json"
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "201"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "Order ORD-1001 accepted for C-482 with 2 line(s)"
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body:
+            data: '{"orderId": "ORD-1002", "country": "DE", "lines": [{"sku": 
"CAMEL-MUG", "qty": 3, "price": 9.50}]}'
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "400"
+        validate:
+          - jsonPath:
+              - expression: "$.error"
+                value: "an order needs a customer"
+  # Test case: order with empty lines should return 400
+  - http:
+      clie
\ No newline at end of file
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/http-of-its-own.citrus.it.yaml
 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/http-of-its-own.citrus.it.yaml
new file mode 100644
index 000000000000..793da526ee18
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/http-of-its-own.citrus.it.yaml
@@ -0,0 +1,46 @@
+#
+# 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.
+#
+
+name: orders.citrus.it
+author: Citrus
+status: FINAL
+description: Test the order API by posting a sample order and verifying the 
log output
+
+variables:
+  - name: orderId
+    value: ORD-1001
+  - name: customer
+    value: C-482
+
+actions:
+  # Read the sample order from file
+  - http:
+      uri: http://localhost:8080/orders
+      method: POST
+      requestFile: sample-order.json
+      contentType: application/json
+      expectStatus: 201
+
+  # Verify the log message contains the expected text
+  - log:
+      message: "Verifying order was accepted"
+      logLevel: INFO
+
+  # Check that the integration logged the expected message
+  - assert-log:
+      pattern: "Order ORD-1001 accepted for C-482 with 2 line\\(s\\)"
+      count: 1
\ No newline at end of file
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/request-and-response.citrus.it.yaml
 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/request-and-response.citrus.it.yaml
new file mode 100644
index 000000000000..16649e45c134
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/request-and-response.citrus.it.yaml
@@ -0,0 +1,55 @@
+#
+# 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.
+#
+
+name: orders.citrus.it
+author: Citrus
+status: FINAL
+description: Test for the order API
+variables:
+  - name: orderId
+    value: ORD-1001
+  - name: customerId
+    value: C-482
+actions:
+  # Send POST request to /orders with the sample order
+  - http:
+      request:
+        uri: http://localhost:8080/orders
+        method: POST
+        body: |
+          {
+            "orderId": "ORD-1001",
+            "customer": "C-482",
+            "country": "DK",
+            "lines": [
+              {"sku": "CAMEL-TSHIRT", "qty": 2, "price": 19.95},
+              {"sku": "CAMEL-MUG", "qty": 1, "price": 9.50}
+            ]
+          }
+        contentType: application/json
+      response:
+        statusCode: 201
+        body: |
+          {
+            "orderId": "ORD-1001",
+            "status": "accepted"
+          }
+
+  # Verify the log message contains the expected text
+  - log:
+      message: "Order ${orderId} accepted for ${customerId} with 2 line(s)"
+      level: INFO
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/step1.citrus.it.yaml
 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/step1.citrus.it.yaml
new file mode 100644
index 000000000000..fb9a268778bb
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/step1.citrus.it.yaml
@@ -0,0 +1,52 @@
+#
+# 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.
+#
+
+name: orders-test
+description: The order API accepts the sample order and logs it
+actions:
+  - camel:
+      jbang:
+        run:
+          integration:
+            name: "orders"
+            file: "../orders.camel.yaml"
+            systemProperties:
+              file: "../application.properties"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "(orders) started"
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body:
+            resource:
+              file: "../sample-order.json"
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "201"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "Order ORD-1001 accepted for C-482 with 2 line(s)"
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/step2.citrus.it.yaml
 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/step2.citrus.it.yaml
new file mode 100644
index 000000000000..749235cfaa04
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/step2.citrus.it.yaml
@@ -0,0 +1,69 @@
+#
+# 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.
+#
+
+name: orders-test
+description: The order API accepts the sample order and logs it
+actions:
+  - camel:
+      jbang:
+        run:
+          integration:
+            name: "orders"
+            file: "../orders.camel.yaml"
+            systemProperties:
+              file: "../application.properties"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "(orders) started"
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body:
+            resource:
+              file: "../sample-order.json"
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "201"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "Order ORD-1001 accepted for C-482 with 2 line(s)"
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body:
+            data: '{"orderId": "ORD-1002", "country": "DE", "lines": [{"sku": 
"CAMEL-MUG", "qty": 3, "price": 9.50}]}'
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "400"
+        validate:
+          - jsonPath:
+              - expression: "$.error"
+                value: "an order needs a customer"
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/step3.citrus.it.yaml
 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/step3.citrus.it.yaml
new file mode 100644
index 000000000000..455d29a4a4e6
--- /dev/null
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/test/resources/citrus-orders/step3.citrus.it.yaml
@@ -0,0 +1,86 @@
+#
+# 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.
+#
+
+name: orders-test
+description: The order API accepts the sample order and logs it
+actions:
+  - camel:
+      jbang:
+        run:
+          integration:
+            name: "orders"
+            file: "../orders.camel.yaml"
+            systemProperties:
+              file: "../application.properties"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "(orders) started"
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body:
+            resource:
+              file: "../sample-order.json"
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "201"
+  - camel:
+      jbang:
+        verify:
+          integration: "orders"
+          logMessage: "Order ORD-1001 accepted for C-482 with 2 line(s)"
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body:
+            data: '{"orderId": "ORD-1002", "country": "DE", "lines": [{"sku": 
"CAMEL-MUG", "qty": 3, "price": 9.50}]}'
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "400"
+        validate:
+          - jsonPath:
+              - expression: "$.error"
+                value: "an order needs a customer"
+  - http:
+      client: "http://localhost:8080";
+      sendRequest:
+        POST:
+          path: "/orders"
+          contentType: "application/json"
+          body:
+            data: '{"orderId": "ORD-1003", "customer": "C-134", "country": 
"US", "lines": []}'
+  - http:
+      client: "http://localhost:8080";
+      receiveResponse:
+        response:
+          status: "400"
+        validate:
+          - jsonPath:
+              - expression: "$.error"
+                value: "an order needs at least one line"
diff --git a/dsl/camel-jbang/camel-jbang-mcp/pom.xml 
b/dsl/camel-jbang/camel-jbang-mcp/pom.xml
index 19240eb3ca0a..648fcfef5f78 100644
--- a/dsl/camel-jbang/camel-jbang-mcp/pom.xml
+++ b/dsl/camel-jbang/camel-jbang-mcp/pom.xml
@@ -105,6 +105,14 @@
             <artifactId>camel-yaml-dsl-validator</artifactId>
         </dependency>
 
+        <!-- The test schema of the Citrus catalog, which a Citrus test is 
checked against: on the classpath, so the
+             server checks a test offline, with no download -->
+        <dependency>
+            <groupId>org.citrusframework</groupId>
+            <artifactId>citrus-catalog-schema</artifactId>
+            <version>${citrus-version}</version>
+        </dependency>
+
         <!-- Camel XML/YAML IO for route transformation -->
         <dependency>
             <groupId>org.apache.camel</groupId>
diff --git a/dsl/camel-jbang/camel-jbang-plugin-test/pom.xml 
b/dsl/camel-jbang/camel-jbang-plugin-test/pom.xml
index f8630977878a..73153739c47b 100644
--- a/dsl/camel-jbang/camel-jbang-plugin-test/pom.xml
+++ b/dsl/camel-jbang/camel-jbang-plugin-test/pom.xml
@@ -63,6 +63,12 @@
             <artifactId>camel-tooling-maven</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <!-- the test schema of the Citrus catalog, which the AI tools check a 
Citrus test against -->
+        <dependency>
+            <groupId>org.citrusframework</groupId>
+            <artifactId>citrus-catalog-schema</artifactId>
+            <version>${citrus-version}</version>
+        </dependency>
 
        <!-- Test dependencies -->
         <dependency>
diff --git 
a/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/main/java/org/apache/camel/dsl/yaml/validator/YamlValidator.java
 
b/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/main/java/org/apache/camel/dsl/yaml/validator/YamlValidator.java
index e7ceac45d9d2..7e913eac2d38 100644
--- 
a/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/main/java/org/apache/camel/dsl/yaml/validator/YamlValidator.java
+++ 
b/dsl/camel-yaml-dsl/camel-yaml-dsl-validator/src/main/java/org/apache/camel/dsl/yaml/validator/YamlValidator.java
@@ -1829,9 +1829,10 @@ public class YamlValidator {
      * Filters noise from {@code oneOf} validation. When a {@code oneOf} has N 
branches and none match, the validator
      * reports errors from ALL branches — producing dozens of "required 
property 'X' not found" messages for branches
      * the user never intended. This method keeps only the errors from the 
branch that matched the user's YAML most
-     * closely (deepest structural match) and drops the rest.
+     * closely (deepest structural match) and drops the rest. Public for the 
validation of other YAML against its
+     * schema, such as a Citrus test.
      */
-    static List<Error> filterOneOfNoise(List<Error> errors) {
+    public static List<Error> filterOneOfNoise(List<Error> errors) {
         if (errors.size() <= 1) {
             return errors;
         }

Reply via email to