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

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 612e60ade30df2e09a6319bf035f635228a27044
Author: Trung NGUYEN <[email protected]>
AuthorDate: Wed Sep 10 16:37:10 2025 +0200

    JAMES 4143 Update tests to show that start-with filter is different from 
contains filter
---
 .../org/apache/james/jmap/mailet/filter/JMAPFilteringTest.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/mailet/filter/JMAPFilteringTest.java
 
b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/mailet/filter/JMAPFilteringTest.java
index 3008166590..c3648f30ae 100644
--- 
a/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/mailet/filter/JMAPFilteringTest.java
+++ 
b/server/protocols/jmap-rfc-8621/src/test/java/org/apache/james/jmap/mailet/filter/JMAPFilteringTest.java
@@ -1147,7 +1147,10 @@ class JMAPFilteringTest {
     @Test
     void startWithAddressMailNotMatched(JMAPFilteringTestSystem testSystem) 
throws Exception {
         testSystem.defineRulesForRecipient1(
-            Rule.Condition.of(FROM, START_WITH, "abcdef")
+            // start-with a random text
+            Rule.Condition.of(FROM, START_WITH, "abcdef"),
+            // start-with behaves differently from contains
+            Rule.Condition.of(FROM, START_WITH, USER_1_ADDRESS.substring(2, 5))
         );
 
         FakeMail mail = testSystem.asMail(mimeMessageBuilder()
@@ -1173,7 +1176,10 @@ class JMAPFilteringTest {
     @Test
     void startWithSubjectNotMatched(JMAPFilteringTestSystem testSystem) throws 
Exception {
         testSystem.defineRulesForRecipient1(
-            Rule.Condition.of(SUBJECT, START_WITH, "abcdef")
+            // start-with a random text
+            Rule.Condition.of(SUBJECT, START_WITH, "abcdef"),
+            // start-with behaves differently from contains
+            Rule.Condition.of(SUBJECT, START_WITH, 
SCRAMBLED_SUBJECT.substring(2, 5))
         );
 
         FakeMail mail = testSystem.asMail(mimeMessageBuilder()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to