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 0216427de827 chore: clarify AssertJ rule to avoid mixing styles per
module in AGENTS.md
0216427de827 is described below
commit 0216427de8276fca415cb864178564a7188c0071
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun Aug 30 18:54:12 2026 +0200
chore: clarify AssertJ rule to avoid mixing styles per module in AGENTS.md
Don't introduce AssertJ into a module whose existing tests are
predominantly JUnit-style — match the module's established convention
instead of creating an outlier.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Signed-off-by: Claus Ibsen <[email protected]>
---
AGENTS.md | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/AGENTS.md b/AGENTS.md
index d9b14c20b0cd..aa8f7d3e73a2 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -215,8 +215,13 @@ assertTrue(list.contains("a"));
- New test code is preferred to use AssertJ assertions (`assertThat(...)`)
instead of JUnit assertions
(`assertEquals`, `assertTrue`, `assertFalse`, `assertNotNull`, etc.).
+- Do NOT mix styles within a project/module. Check the assertion style already
used by the other
+ test classes in the component/module being touched: if they are
predominantly JUnit assertions,
+ write new tests in that same JUnit style rather than introducing AssertJ as
an outlier. Only
+ default to AssertJ when the module has no established convention either way.
- When modifying existing test code that uses JUnit assertions, migrate
touched assertions to
- AssertJ where it improves readability. No need to migrate the entire file.
+ AssertJ where it improves readability and the surrounding module isn't
predominantly JUnit.
+ No need to migrate the entire file.
- Do NOT mix AssertJ and JUnit assertions in the same test method — pick one
style per method.
- `MockEndpoint.assertIsSatisfied()` and other Camel-specific assertion
methods are NOT JUnit
assertions — keep using them as-is.