This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 7c78061f9baa chore: camel-jbang-mcp - MigrationDataSearchTest snippet
test no longer depends on how common "subject" is (#30385)
7c78061f9baa is described below
commit 7c78061f9baa0f7363e41782fa9554a73d92d172
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 19 10:39:15 2026 +0100
chore: camel-jbang-mcp - MigrationDataSearchTest snippet test no longer
depends on how common "subject" is (#30385)
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]>
---
.../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();