This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch fix-mcp-migration-snippet-test in repository https://gitbox.apache.org/repos/asf/camel.git
commit 9cea20e7aad82435fb1199d920b33faad3f7c02e Author: Claus Ibsen <[email protected]> AuthorDate: Thu Nov 19 10:07:55 2026 +0100 chore: camel-jbang-mcp - MigrationDataSearchTest snippet test no longer depends on how common "subject" is The camel-nats entry in the 4.24 upgrade guide (#30349) mentions the subject alternative name, so "subject" became more common than "camel-mail" in the guides. The snippet then picked the line with "camel-mail" and "header" instead of the MAIL_SUBJECT line, and the test failed on main and on every PR that changes an upgrade guide. Search for "constants" too, which is on the MAIL_SUBJECT line. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../camel/dsl/jbang/core/commands/mcp/MigrationDataSearchTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dsl/camel-jbang/camel-jbang-mcp/src/test/java/org/apache/camel/dsl/jbang/core/commands/mcp/MigrationDataSearchTest.java b/dsl/camel-jbang/camel-jbang-mcp/src/test/java/org/apache/camel/dsl/jbang/core/commands/mcp/MigrationDataSearchTest.java index 08997634accd..6ba79eb4470d 100644 --- a/dsl/camel-jbang/camel-jbang-mcp/src/test/java/org/apache/camel/dsl/jbang/core/commands/mcp/MigrationDataSearchTest.java +++ b/dsl/camel-jbang/camel-jbang-mcp/src/test/java/org/apache/camel/dsl/jbang/core/commands/mcp/MigrationDataSearchTest.java @@ -132,7 +132,10 @@ class MigrationDataSearchTest { @Test void snippetShowsTheLinesAroundTheMatch() { - List<MigrationData.SearchHit> hits = migrationData.search("camel-mail subject header", null, null, 1); + // "constants" is on the MAIL_SUBJECT line, so that line stays the best match when new guide entries change + // how common the other terms are: an entry about the "subject alternative name" made "subject" more common + // than "camel-mail", and the snippet moved to the line with "camel-mail" and "header" + List<MigrationData.SearchHit> hits = migrationData.search("camel-mail subject header constants", null, null, 1); assertThat(hits).hasSize(1); String content = hits.get(0).section().content();
