james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [07/10] james-project git commit: JAMES-2370 Attachment file name search is required to start a JMAP server
Date Wed, 18 Apr 2018 00:36:59 GMT
JAMES-2370 Attachment file name search is required to start a JMAP server


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/67984d5a
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/67984d5a
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/67984d5a

Branch: refs/heads/master
Commit: 67984d5ad6e3912e70e2c07845d8a10dc00630a9
Parents: f4a3216
Author: benwa <btellier@linagora.com>
Authored: Mon Apr 9 14:14:50 2018 +0700
Committer: benwa <btellier@linagora.com>
Committed: Wed Apr 18 07:35:39 2018 +0700

----------------------------------------------------------------------
 .../apache/james/JamesCapabilitiesServerTest.java    | 15 +++++++++++++++
 .../main/java/org/apache/james/jmap/JMAPModule.java  |  2 ++
 2 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/67984d5a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
index 1bce059..8572be6 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
@@ -129,6 +129,21 @@ public class JamesCapabilitiesServerTest {
 
         assertThatThrownBy(() -> server.start()).isInstanceOf(IllegalArgumentException.class);
     }
+
+    @Test
+    public void startShouldFailWhenNoAttachmentFileNameSearchCapability() throws Exception
{
+        MailboxManager mailboxManager = mock(MailboxManager.class);
+        when(mailboxManager.getSupportedMailboxCapabilities())
+            .thenReturn(EnumSet.allOf(MailboxManager.MailboxCapabilities.class));
+        when(mailboxManager.getSupportedMessageCapabilities())
+            .thenReturn(EnumSet.allOf(MailboxManager.MessageCapabilities.class));
+        when(mailboxManager.getSupportedSearchCapabilities())
+            .thenReturn(EnumSet.complementOf(EnumSet.of(MailboxManager.SearchCapabilities.AttachmentFileName)));
+
+        server = createCassandraJamesServer(mailboxManager);
+
+        assertThatThrownBy(() -> server.start()).isInstanceOf(IllegalArgumentException.class);
+    }
     
     @Test
     public void startShouldFailWhenNoMultimailboxSearchCapability() throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/67984d5a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
index ad16a2f..b5bd236 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
@@ -159,6 +159,8 @@ public class JMAPModule extends AbstractModule {
                     "Multimailbox search in MailboxManager is required by JMAP Module");
             Preconditions.checkArgument(searchCapabilities.contains(MailboxManager.SearchCapabilities.Attachment),
                     "Attachment Search support in MailboxManager is required by JMAP Module");
+            Preconditions.checkArgument(searchCapabilities.contains(SearchCapabilities.AttachmentFileName),
+                    "Attachment file name Search support in MailboxManager is required by
JMAP Module");
         }
 
         @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message