You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2021/02/17 01:46:38 UTC

[james-project] branch master updated (daa817d -> 9b0fbe5)

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

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


    from daa817d  JAMES-3457 Implement JMAP eventSource
     new f3e16d0  JAMES-3500 Increase forkCounts in relevant Cassandra projects
     new 7587c64  JAMES-3500 Move RemoteDelivery integration tests to a separate package
     new 2336daa  JAMES-3500 Disable testcontainers checks
     new 1ecbeeb  JAMES-3500 Group assertions for 1 minute+ tests
     new 429006b  JAMES-3500 Reduce 'pause' duration
     new 775f4a0  JAMES-3500 Leverage PER_CLASS James server test lifecycle where possible
     new 875c8c1  JAMES-3500 Remove an uneeded test
     new 4d7223c  JAMES-3500 Leverage PER_CLASS James server test lifecycle where possible
     new 40c019a  JAMES-3500 Fasten PeriodicalHealthChecksTest
     new 00ffb12  JAMES-3500 Fasten mailbox/elasticsearch tests
     new dddc74a  JAMES-3500 Fasten Task tests
     new 23d2ebc  JAMES-2884 Attachment should not be created with Content-Transfer-Encoding
     new 9b0fbe5  JAMES-2987 MessageMetadataView::isIsForwarded should be compatible with JMAP RFC-8621

The 13 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ...asticSearchListeningMessageSearchIndexTest.java |  98 +++----
 mpt/impl/imap-mailbox/cassandra/pom.xml            |   2 +-
 server/blob/blob-cassandra/pom.xml                 |   2 +-
 .../CassandraMessageIdManagerInjectionTest.java    |  66 -----
 .../org/apache/james/CassandraCacheQueryTest.java  |  16 +-
 .../apache/james/PeriodicalHealthChecksTest.java   |  17 +-
 server/data/data-cassandra/pom.xml                 |   2 +-
 server/data/data-jmap-cassandra/pom.xml            |  13 +
 server/mailet/integration-testing/pom.xml          |  18 +-
 .../apache/james/mailets/TemporaryJamesServer.java |   0
 .../mailets/configuration/CommonProcessors.java    |   0
 .../james/mailets/configuration/Constants.java     |   0
 .../mailets/configuration/MailetConfiguration.java |   0
 .../mailets/configuration/MailetContainer.java     |   0
 .../configuration/ProcessorConfiguration.java      |   0
 .../mailets/configuration/SerializableAsXml.java   |   0
 .../mailets/configuration/SmtpConfiguration.java   |   0
 .../src/{test => main}/resources/dnsservice.xml    |   0
 .../src/{test => main}/resources/domainlist.xml    |   0
 .../{test => main}/resources/eml/bad_crypted.eml   |   0
 .../src/{test => main}/resources/eml/calendar.eml  |   0
 .../src/{test => main}/resources/eml/crypted.eml   |   0
 .../resources/eml/crypted_with_attachment.eml      |   0
 .../eml/dlp_read_mail_with_attachment.eml          |   0
 .../resources/eml/message-multipart-7bit.eml       | 284 +++++++++----------
 .../resources/eml/message-multipart-8bit.eml       | 256 ++++++++---------
 .../resources/eml/message-text-only-7bit.eml       |  52 ++--
 .../resources/eml/message-text-only-8bit.eml       |  54 ++--
 .../resources/eml/yahooInvitation.eml              |   0
 .../src/{test => main}/resources/imapserver.xml    |   0
 .../src/{test => main}/resources/keystore          | Bin
 .../src/{test => main}/resources/lmtpserver.xml    |   0
 .../resources/mailrepositorystore.xml              |   0
 .../{test => main}/resources/managesieveserver.xml |   0
 .../src/{test => main}/resources/pop3server.xml    |   0
 .../src/{test => main}/resources/smime.p12         | Bin
 .../src/{test => main}/resources/smtpserver.xml    |   0
 .../{test => main}/resources/usersrepository.xml   |   0
 .../crypto/SMIMEDecryptIntegrationTest.java        |   1 -
 .../remote-delivery-integration-testing}/pom.xml   |  23 +-
 .../mailets/RemoteDeliveryDKIMIntegrationTest.java | 243 ++++++++--------
 .../mailets/RemoteDeliveryErrorHandlingTest.java   |   0
 .../james/mailets/RemoteDeliveryErrorTest.java     |   0
 .../james/smtp/dsn/DSNLocalIntegrationTest.java    |   0
 .../org/apache/james/smtp/dsn/DSNRelayTest.java    |   0
 .../james/smtp/dsn/DSNRemoteIntegrationTest.java   |   0
 server/pom.xml                                     |   1 +
 .../model/message/view/MessageMetadataView.java    |   3 +-
 .../view/MessageMetadataViewFactoryTest.java       |  23 ++
 .../rfc8621/contract/EmailSetMethodContract.scala  |  68 +++++
 .../james/jmap/json/EmailSetSerializer.scala       |   8 +-
 .../rabbitmq/RabbitMQJwtFilterIntegrationTest.java |   3 +
 ...RabbitMQReindexingWithEventDeadLettersTest.java |  17 +-
 ...tMQWebAdminServerIntegrationImmutableTest.java} | 129 +--------
 .../RabbitMQWebAdminServerIntegrationTest.java     |  56 ----
 ...rTaskSerializationIntegrationImmutableTest.java | 309 +++++++++++++++++++++
 ...dminServerTaskSerializationIntegrationTest.java | 260 ++---------------
 .../memory/MemoryJwtFilterIntegrationTest.java     |   4 +-
 ...oryWebAdminServerIntegrationImmutableTest.java} |   8 +-
 .../integration/JwtFilterIntegrationTest.java      |  11 +-
 .../WebAdminServerIntegrationImmutableTest.java    | 169 +++++++++++
 .../integration/WebAdminServerIntegrationTest.java |  12 +
 .../org/apache/james/task/TaskManagerContract.java |   8 +-
 .../distributed/DistributedTaskManagerTest.java    |   4 +-
 .../james/task/SerialTaskManagerWorkerTest.java    |  12 +-
 .../src/main/resources/testcontainers.properties   |   1 +
 66 files changed, 1183 insertions(+), 1070 deletions(-)
 delete mode 100644 server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraMessageIdManagerInjectionTest.java
 rename server/mailet/integration-testing/src/{test => main}/java/org/apache/james/mailets/TemporaryJamesServer.java (100%)
 rename server/mailet/integration-testing/src/{test => main}/java/org/apache/james/mailets/configuration/CommonProcessors.java (100%)
 rename server/mailet/integration-testing/src/{test => main}/java/org/apache/james/mailets/configuration/Constants.java (100%)
 rename server/mailet/integration-testing/src/{test => main}/java/org/apache/james/mailets/configuration/MailetConfiguration.java (100%)
 rename server/mailet/integration-testing/src/{test => main}/java/org/apache/james/mailets/configuration/MailetContainer.java (100%)
 rename server/mailet/integration-testing/src/{test => main}/java/org/apache/james/mailets/configuration/ProcessorConfiguration.java (100%)
 rename server/mailet/integration-testing/src/{test => main}/java/org/apache/james/mailets/configuration/SerializableAsXml.java (100%)
 rename server/mailet/integration-testing/src/{test => main}/java/org/apache/james/mailets/configuration/SmtpConfiguration.java (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/dnsservice.xml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/domainlist.xml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/bad_crypted.eml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/calendar.eml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/crypted.eml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/crypted_with_attachment.eml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/dlp_read_mail_with_attachment.eml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/message-multipart-7bit.eml (98%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/message-multipart-8bit.eml (98%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/message-text-only-7bit.eml (93%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/message-text-only-8bit.eml (94%)
 rename server/mailet/integration-testing/src/{test => main}/resources/eml/yahooInvitation.eml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/imapserver.xml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/keystore (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/lmtpserver.xml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/mailrepositorystore.xml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/managesieveserver.xml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/pop3server.xml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/smime.p12 (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/smtpserver.xml (100%)
 rename server/mailet/integration-testing/src/{test => main}/resources/usersrepository.xml (100%)
 copy server/{protocols/jmap-draft-integration-testing => mailet/remote-delivery-integration-testing}/pom.xml (73%)
 rename server/mailet/{integration-testing => remote-delivery-integration-testing}/src/test/java/org/apache/james/mailets/RemoteDeliveryDKIMIntegrationTest.java (53%)
 rename server/mailet/{integration-testing/src/test/java/org/apache/james/transport => remote-delivery-integration-testing/src/test/java/org/apache/james}/mailets/RemoteDeliveryErrorHandlingTest.java (100%)
 rename server/mailet/{integration-testing => remote-delivery-integration-testing}/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java (100%)
 rename server/mailet/{integration-testing => remote-delivery-integration-testing}/src/test/java/org/apache/james/smtp/dsn/DSNLocalIntegrationTest.java (100%)
 rename server/mailet/{integration-testing => remote-delivery-integration-testing}/src/test/java/org/apache/james/smtp/dsn/DSNRelayTest.java (100%)
 rename server/mailet/{integration-testing => remote-delivery-integration-testing}/src/test/java/org/apache/james/smtp/dsn/DSNRemoteIntegrationTest.java (100%)
 copy server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/{RabbitMQWebAdminServerIntegrationTest.java => RabbitMQWebAdminServerIntegrationImmutableTest.java} (60%)
 create mode 100644 server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerTaskSerializationIntegrationImmutableTest.java
 copy server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/{MemoryWebAdminServerIntegrationTest.java => MemoryWebAdminServerIntegrationImmutableTest.java} (91%)
 create mode 100644 server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationImmutableTest.java
 create mode 100644 testing/base/src/main/resources/testcontainers.properties


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


[james-project] 13/13: JAMES-2987 MessageMetadataView::isIsForwarded should be compatible with JMAP RFC-8621

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9b0fbe58d5872dc7e43a68800250a86b04ae894f
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Feb 9 14:04:11 2021 +0700

    JAMES-2987 MessageMetadataView::isIsForwarded should be compatible with JMAP RFC-8621
    
    JMAP RFC-8621 states that keywords shold be case insentive, lower case.
---
 .../model/message/view/MessageMetadataView.java    |  3 ++-
 .../view/MessageMetadataViewFactoryTest.java       | 23 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/message/view/MessageMetadataView.java b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/message/view/MessageMetadataView.java
index c7d599e..130a7aa 100644
--- a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/message/view/MessageMetadataView.java
+++ b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/message/view/MessageMetadataView.java
@@ -156,7 +156,8 @@ public class MessageMetadataView implements MessageView {
     }
 
     public boolean isIsForwarded() {
-        return keywords.contains(Keyword.FORWARDED);
+        return keywords.contains(Keyword.FORWARDED)
+            || keywords.contains(Keyword.of("$forwarded"));
     }
 
     public Number getSize() {
diff --git a/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/message/view/MessageMetadataViewFactoryTest.java b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/message/view/MessageMetadataViewFactoryTest.java
index 19651ec..56736e8 100644
--- a/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/message/view/MessageMetadataViewFactoryTest.java
+++ b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/message/view/MessageMetadataViewFactoryTest.java
@@ -20,6 +20,7 @@
 package org.apache.james.jmap.draft.model.message.view;
 
 import static org.apache.james.jmap.draft.model.message.view.MessageViewFixture.BOB;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import javax.mail.Flags;
 
@@ -85,6 +86,28 @@ class MessageMetadataViewFactoryTest {
     }
 
     @Test
+    void forwardedShouldBeReturnTrueWhenLowerCase() throws Exception {
+        ComposedMessageId message2 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
+                .withFlags(new Flags("$forwarded"))
+                .build("header: value\r\n\r\nbody"),
+            session).getId();
+
+        MessageMetadataView actual = testee.fromMessageIds(ImmutableList.of(message2.getMessageId()), session).collectList().block().get(0);
+        assertThat(actual.isIsForwarded()).isTrue();
+    }
+
+    @Test
+    void isForwardedShouldReturnTrueWhenUpperCase() throws Exception {
+        ComposedMessageId message2 = bobInbox.appendMessage(MessageManager.AppendCommand.builder()
+                .withFlags(new Flags("$Forwarded"))
+                .build("header: value\r\n\r\nbody"),
+            session).getId();
+
+        MessageMetadataView actual = testee.fromMessageIds(ImmutableList.of(message2.getMessageId()), session).collectList().block().get(0);
+        assertThat(actual.isIsForwarded()).isTrue();
+    }
+
+    @Test
     void fromMessageResultsShouldCombineKeywords() throws Exception {
         messageIdManager.setInMailboxes(message1.getMessageId(), ImmutableList.of(bobInbox.getId(), bobMailbox.getId()), session);
         bobMailbox.setFlags(new Flags(Flags.Flag.FLAGGED), MessageManager.FlagsUpdateMode.REPLACE, MessageRange.all(), session);


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


[james-project] 09/13: JAMES-3500 Fasten PeriodicalHealthChecksTest

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 40c019a96c1a2b50154acc2b7a2e5eb622c9137e
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 18:47:09 2021 +0700

    JAMES-3500 Fasten PeriodicalHealthChecksTest
    
     - Takes 5 minutes on the CI
     - Takes 7 minutes on my laptop
    
    A quick investigation led to:
    
     - Static import refactoring
     - Remove noise NPE errors flooding logs
     - Avoid performing 10.000 checks due to 1ms period and 10
       seconds advance.
    
    Now `mvn clean install` takes 23 seconds which sounds more
    reasonable.
---
 .../org/apache/james/PeriodicalHealthChecksTest.java    | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/PeriodicalHealthChecksTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/PeriodicalHealthChecksTest.java
index 500be7a..8a18d43 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/PeriodicalHealthChecksTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/PeriodicalHealthChecksTest.java
@@ -20,6 +20,7 @@
 package org.apache.james;
 
 
+import static org.apache.james.PeriodicalHealthChecksTest.TestingHealthCheck.COMPONENT_NAME;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.mockito.Mockito.atLeast;
@@ -86,6 +87,8 @@ public class PeriodicalHealthChecksTest {
     void setUp() {
         mockHealthCheck1 = Mockito.mock(EventDeadLettersHealthCheck.class);
         mockHealthCheck2 = Mockito.mock(GuiceLifecycleHealthCheck.class);
+        when(mockHealthCheck1.componentName()).thenReturn(new ComponentName("mockHealthCheck1"));
+        when(mockHealthCheck2.componentName()).thenReturn(new ComponentName("mockHealthCheck2"));
         when(mockHealthCheck1.check()).thenReturn(Mono.just(Result.healthy(new ComponentName("mockHealthCheck1"))));
         when(mockHealthCheck2.check()).thenReturn(Mono.just(Result.healthy(new ComponentName("mockHealthCheck2"))));
 
@@ -111,7 +114,7 @@ public class PeriodicalHealthChecksTest {
 
         testee.start();
 
-        assertThatCode(() -> scheduler.advanceTimeBy(PERIOD))
+        assertThatCode(() -> scheduler.advanceTimeBy(Duration.ofMillis(5)))
             .doesNotThrowAnyException();
     }
 
@@ -127,7 +130,7 @@ public class PeriodicalHealthChecksTest {
     void startShouldLogPeriodicallyWhenUnhealthy() {
         ListAppender<ILoggingEvent> loggingEvents = getListAppenderForClass(PeriodicalHealthChecks.class);
 
-        TestingHealthCheck unhealthy = () -> Mono.just(Result.unhealthy(TestingHealthCheck.COMPONENT_NAME, "cause"));
+        TestingHealthCheck unhealthy = () -> Mono.just(Result.unhealthy(COMPONENT_NAME, "cause"));
         testee = new PeriodicalHealthChecks(ImmutableSet.of(unhealthy),
             scheduler,
             new PeriodicalHealthChecksConfiguration(PERIOD));
@@ -145,7 +148,7 @@ public class PeriodicalHealthChecksTest {
     void startShouldLogPeriodicallyWhenDegraded() {
         ListAppender<ILoggingEvent> loggingEvents = getListAppenderForClass(PeriodicalHealthChecks.class);
 
-        TestingHealthCheck degraded = () -> Mono.just(Result.degraded(TestingHealthCheck.COMPONENT_NAME, "cause"));
+        TestingHealthCheck degraded = () -> Mono.just(Result.degraded(COMPONENT_NAME, "cause"));
         testee = new PeriodicalHealthChecks(ImmutableSet.of(degraded),
             scheduler,
             new PeriodicalHealthChecksConfiguration(PERIOD));
@@ -163,7 +166,7 @@ public class PeriodicalHealthChecksTest {
     void startShouldNotLogWhenHealthy() {
         ListAppender<ILoggingEvent> loggingEvents = getListAppenderForClass(PeriodicalHealthChecks.class);
 
-        TestingHealthCheck healthy = () -> Mono.just(Result.healthy(TestingHealthCheck.COMPONENT_NAME));
+        TestingHealthCheck healthy = () -> Mono.just(Result.healthy(COMPONENT_NAME));
         testee = new PeriodicalHealthChecks(ImmutableSet.of(healthy),
             scheduler,
             new PeriodicalHealthChecksConfiguration(PERIOD));
@@ -177,9 +180,9 @@ public class PeriodicalHealthChecksTest {
     void startShouldLogWhenMultipleHealthChecks() {
         ListAppender<ILoggingEvent> loggingEvents = getListAppenderForClass(PeriodicalHealthChecks.class);
 
-        TestingHealthCheck unhealthy = () -> Mono.just(Result.unhealthy(TestingHealthCheck.COMPONENT_NAME, "cause"));
-        TestingHealthCheck degraded = () -> Mono.just(Result.degraded(TestingHealthCheck.COMPONENT_NAME, "cause"));
-        TestingHealthCheck healthy = () -> Mono.just(Result.healthy(TestingHealthCheck.COMPONENT_NAME));
+        TestingHealthCheck unhealthy = () -> Mono.just(Result.unhealthy(COMPONENT_NAME, "cause"));
+        TestingHealthCheck degraded = () -> Mono.just(Result.degraded(COMPONENT_NAME, "cause"));
+        TestingHealthCheck healthy = () -> Mono.just(Result.healthy(COMPONENT_NAME));
 
         testee = new PeriodicalHealthChecks(ImmutableSet.of(unhealthy, degraded, healthy),
             scheduler,


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


[james-project] 02/13: JAMES-3500 Move RemoteDelivery integration tests to a separate package

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7587c648f6818d6910ea4f997987257bdc59cf91
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 15:33:11 2021 +0700

    JAMES-3500 Move RemoteDelivery integration tests to a separate package
    
    Also avoid nested tests class
    
    Hopefully it enhance build stability
---
 server/mailet/integration-testing/pom.xml          |  18 +-
 .../apache/james/mailets/TemporaryJamesServer.java |   0
 .../mailets/configuration/CommonProcessors.java    |   0
 .../james/mailets/configuration/Constants.java     |   0
 .../mailets/configuration/MailetConfiguration.java |   0
 .../mailets/configuration/MailetContainer.java     |   0
 .../configuration/ProcessorConfiguration.java      |   0
 .../mailets/configuration/SerializableAsXml.java   |   0
 .../mailets/configuration/SmtpConfiguration.java   |   0
 .../src/{test => main}/resources/dnsservice.xml    |   0
 .../src/{test => main}/resources/domainlist.xml    |   0
 .../{test => main}/resources/eml/bad_crypted.eml   |   0
 .../src/{test => main}/resources/eml/calendar.eml  |   0
 .../src/{test => main}/resources/eml/crypted.eml   |   0
 .../resources/eml/crypted_with_attachment.eml      |   0
 .../eml/dlp_read_mail_with_attachment.eml          |   0
 .../resources/eml/message-multipart-7bit.eml       | 284 ++++++++++-----------
 .../resources/eml/message-multipart-8bit.eml       | 256 +++++++++----------
 .../resources/eml/message-text-only-7bit.eml       |  52 ++--
 .../resources/eml/message-text-only-8bit.eml       |  54 ++--
 .../resources/eml/yahooInvitation.eml              |   0
 .../src/{test => main}/resources/imapserver.xml    |   0
 .../src/{test => main}/resources/keystore          | Bin
 .../src/{test => main}/resources/lmtpserver.xml    |   0
 .../resources/mailrepositorystore.xml              |   0
 .../{test => main}/resources/managesieveserver.xml |   0
 .../src/{test => main}/resources/pop3server.xml    |   0
 .../src/{test => main}/resources/smime.p12         | Bin
 .../src/{test => main}/resources/smtpserver.xml    |   0
 .../{test => main}/resources/usersrepository.xml   |   0
 .../crypto/SMIMEDecryptIntegrationTest.java        |   1 -
 .../remote-delivery-integration-testing/pom.xml    |  55 ++++
 .../mailets/RemoteDeliveryDKIMIntegrationTest.java | 243 +++++++++---------
 .../mailets/RemoteDeliveryErrorHandlingTest.java   |   0
 .../james/mailets/RemoteDeliveryErrorTest.java     |   0
 .../james/smtp/dsn/DSNLocalIntegrationTest.java    |   0
 .../org/apache/james/smtp/dsn/DSNRelayTest.java    |   0
 .../james/smtp/dsn/DSNRemoteIntegrationTest.java   |   0
 server/pom.xml                                     |   1 +
 39 files changed, 498 insertions(+), 466 deletions(-)

diff --git a/server/mailet/integration-testing/pom.xml b/server/mailet/integration-testing/pom.xml
index 2e9d913..f93bd7d 100644
--- a/server/mailet/integration-testing/pom.xml
+++ b/server/mailet/integration-testing/pom.xml
@@ -46,24 +46,20 @@
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>apache-mailet-test</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-dnsservice-test</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-common</artifactId>
             <type>test-jar</type>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-jmap</artifactId>
             <type>test-jar</type>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
@@ -80,28 +76,23 @@
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-testing</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>james-server-webadmin-core</artifactId>
             <type>test-jar</type>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>mock-smtp-server</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>queue-activemq-guice</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
             <artifactId>testing-base</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.github.spullara.mustache.java</groupId>
@@ -114,27 +105,22 @@
         <dependency>
             <groupId>com.jayway.jsonpath</groupId>
             <artifactId>json-path</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.rabbitmq</groupId>
             <artifactId>amqp-client</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>io.rest-assured</groupId>
             <artifactId>rest-assured</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>net.javacrumbs.json-unit</groupId>
             <artifactId>json-unit-assertj</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.hamcrest</groupId>
             <artifactId>java-hamcrest</artifactId>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
@@ -162,10 +148,10 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
+                    <forkCount>8</forkCount>
                 </configuration>
             </plugin>
         </plugins>
     </build>
-
 </project>
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/TemporaryJamesServer.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
rename to server/mailet/integration-testing/src/main/java/org/apache/james/mailets/TemporaryJamesServer.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/CommonProcessors.java b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/CommonProcessors.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/CommonProcessors.java
rename to server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/CommonProcessors.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/Constants.java b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/Constants.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/Constants.java
rename to server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/Constants.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/MailetConfiguration.java b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/MailetConfiguration.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/MailetConfiguration.java
rename to server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/MailetConfiguration.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/MailetContainer.java b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/MailetContainer.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/MailetContainer.java
rename to server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/MailetContainer.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/ProcessorConfiguration.java b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/ProcessorConfiguration.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/ProcessorConfiguration.java
rename to server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/ProcessorConfiguration.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/SerializableAsXml.java b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/SerializableAsXml.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/SerializableAsXml.java
rename to server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/SerializableAsXml.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/SmtpConfiguration.java b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/SmtpConfiguration.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/configuration/SmtpConfiguration.java
rename to server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/SmtpConfiguration.java
diff --git a/server/mailet/integration-testing/src/test/resources/dnsservice.xml b/server/mailet/integration-testing/src/main/resources/dnsservice.xml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/dnsservice.xml
rename to server/mailet/integration-testing/src/main/resources/dnsservice.xml
diff --git a/server/mailet/integration-testing/src/test/resources/domainlist.xml b/server/mailet/integration-testing/src/main/resources/domainlist.xml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/domainlist.xml
rename to server/mailet/integration-testing/src/main/resources/domainlist.xml
diff --git a/server/mailet/integration-testing/src/test/resources/eml/bad_crypted.eml b/server/mailet/integration-testing/src/main/resources/eml/bad_crypted.eml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/eml/bad_crypted.eml
rename to server/mailet/integration-testing/src/main/resources/eml/bad_crypted.eml
diff --git a/server/mailet/integration-testing/src/test/resources/eml/calendar.eml b/server/mailet/integration-testing/src/main/resources/eml/calendar.eml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/eml/calendar.eml
rename to server/mailet/integration-testing/src/main/resources/eml/calendar.eml
diff --git a/server/mailet/integration-testing/src/test/resources/eml/crypted.eml b/server/mailet/integration-testing/src/main/resources/eml/crypted.eml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/eml/crypted.eml
rename to server/mailet/integration-testing/src/main/resources/eml/crypted.eml
diff --git a/server/mailet/integration-testing/src/test/resources/eml/crypted_with_attachment.eml b/server/mailet/integration-testing/src/main/resources/eml/crypted_with_attachment.eml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/eml/crypted_with_attachment.eml
rename to server/mailet/integration-testing/src/main/resources/eml/crypted_with_attachment.eml
diff --git a/server/mailet/integration-testing/src/test/resources/eml/dlp_read_mail_with_attachment.eml b/server/mailet/integration-testing/src/main/resources/eml/dlp_read_mail_with_attachment.eml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/eml/dlp_read_mail_with_attachment.eml
rename to server/mailet/integration-testing/src/main/resources/eml/dlp_read_mail_with_attachment.eml
diff --git a/server/mailet/integration-testing/src/test/resources/eml/message-multipart-7bit.eml b/server/mailet/integration-testing/src/main/resources/eml/message-multipart-7bit.eml
similarity index 98%
rename from server/mailet/integration-testing/src/test/resources/eml/message-multipart-7bit.eml
rename to server/mailet/integration-testing/src/main/resources/eml/message-multipart-7bit.eml
index ca97347..42cca02 100644
--- a/server/mailet/integration-testing/src/test/resources/eml/message-multipart-7bit.eml
+++ b/server/mailet/integration-testing/src/main/resources/eml/message-multipart-7bit.eml
@@ -1,142 +1,142 @@
-Return-Path: <bo...@james.org>
-MIME-Version: 1.0
-Delivered-To: bob@james.org
-Received: from 10.233.68.83 (EHLO incoming.james.org) ([10.233.68.83])
-          by james-0 (JAMES SMTP Server ) with ESMTP ID -973333758
-          for <bo...@james.james.org>;
-          Wed, 22 Jan 2020 03:47:32 +0000 (UTC)
-Received: from smtp.james.org (unknown [10.233.65.0])
-	by incoming.james.org (Postfix) with ESMTPS id 8151D43
-	for <bo...@james.james.org>; Wed, 22 Jan 2020 03:47:32 +0000 (UTC)
-Received: from [10.116.29.102] (unknown [1.54.162.156])
-	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
-	(No client certificate requested)
-	by smtp.james.org (Postfix) with ESMTPSA id D6C653F38C
-	for <bo...@james.org>; Wed, 22 Jan 2020 04:47:31 +0100 (CET)
-To: bob@james.org
-X-LINAGORA-Copy-Delivery-Done: 1
-From: Uncle Bob <bo...@james.org>
-Subject: multipart
-Message-ID: <69...@james.org>
-Date: Wed, 22 Jan 2020 10:47:17 +0700
-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
- Thunderbird/60.2.1
-Content-Type: multipart/mixed;
- boundary="------------C3FD44EAF9B6A93E163D9176"
-Content-Language: en-US
-
-This is a multi-part message in MIME format.
---------------C3FD44EAF9B6A93E163D9176
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: quoted-printable
-
-A quoted-printable encoded body with =E2=82=ACuro symbol.
-
-
-
---------------C3FD44EAF9B6A93E163D9176
-Content-Type: image/png;
- name="james-logo.png"
-Content-Transfer-Encoding: base64
-Content-Disposition: attachment;
- filename="james-logo.png"
-
-iVBORw0KGgoAAAANSUhEUgAAANkAAABaCAYAAAA1mvMAAAAAGXRFWHRTb2Z0d2FyZQBBZG9i
-ZSBJbWFnZVJlYWR5ccllPAAAFB1JREFUeNrsXV2MI9lVvuX+m2EXrTtLQGwydPVsRlmkSOOW
-+BNItB2tNiAk2n5BeYG2EwkpiSLbPPAjAW7zQiQe3C0SkBBg9ysv7ZZ4AGWFa/KClJeuRQhl
-s2SnOj1pYIfN1EhICRLj4pzyufbt6rrlW+W/cvc90lGVXVW37r11vnt+7h/zPI/JeJnp8jOm
-yTRpmhNF4Shzg8ud059eUxrIiNJYhmEssybL4/G1f3SsGaSNAM7STxfeYWtR0ppMRqs3uNwu
-8D6wNQVQoelZBc6HaUi4jgeH3nUKoOtqsdN04zUZCf8ZCPzOhNqwQeCKC/Aj4EN4v6vF7HZr
-spsOsjYcHoGg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B2id/r075jFOfJvlSR6TF9oQ8MtJqvOxF
-DqaIJI8Fc5g3Yo+ovKdU3jKBLtZ0F20uzo96AVbRfBYFNLiQc9v/MZkv5wrvReF7RqBU7TTP
-knB5BE4O5DrlqUd5GNuao7kaoQkQIHl6z0MWY54ZAbtJQO0RkCpkBtqU5yqVvaqQdkfIk2h+
-d6iuH7Oke3RjdFHGmpZbcwYilJpmSFE40prs5pLL9NSbVND/CzAAk/ZJrVWlr2oAAAAASUVO
-RK5CYII=
---------------C3FD44EAF9B6A93E163D9176--
+Return-Path: <bo...@james.org>
+MIME-Version: 1.0
+Delivered-To: bob@james.org
+Received: from 10.233.68.83 (EHLO incoming.james.org) ([10.233.68.83])
+          by james-0 (JAMES SMTP Server ) with ESMTP ID -973333758
+          for <bo...@james.james.org>;
+          Wed, 22 Jan 2020 03:47:32 +0000 (UTC)
+Received: from smtp.james.org (unknown [10.233.65.0])
+	by incoming.james.org (Postfix) with ESMTPS id 8151D43
+	for <bo...@james.james.org>; Wed, 22 Jan 2020 03:47:32 +0000 (UTC)
+Received: from [10.116.29.102] (unknown [1.54.162.156])
+	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
+	(No client certificate requested)
+	by smtp.james.org (Postfix) with ESMTPSA id D6C653F38C
+	for <bo...@james.org>; Wed, 22 Jan 2020 04:47:31 +0100 (CET)
+To: bob@james.org
+X-LINAGORA-Copy-Delivery-Done: 1
+From: Uncle Bob <bo...@james.org>
+Subject: multipart
+Message-ID: <69...@james.org>
+Date: Wed, 22 Jan 2020 10:47:17 +0700
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
+ Thunderbird/60.2.1
+Content-Type: multipart/mixed;
+ boundary="------------C3FD44EAF9B6A93E163D9176"
+Content-Language: en-US
+
+This is a multi-part message in MIME format.
+--------------C3FD44EAF9B6A93E163D9176
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: quoted-printable
+
+A quoted-printable encoded body with =E2=82=ACuro symbol.
+
+
+
+--------------C3FD44EAF9B6A93E163D9176
+Content-Type: image/png;
+ name="james-logo.png"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+ filename="james-logo.png"
+
+iVBORw0KGgoAAAANSUhEUgAAANkAAABaCAYAAAA1mvMAAAAAGXRFWHRTb2Z0d2FyZQBBZG9i
+ZSBJbWFnZVJlYWR5ccllPAAAFB1JREFUeNrsXV2MI9lVvuX+m2EXrTtLQGwydPVsRlmkSOOW
++BNItB2tNiAk2n5BeYG2EwkpiSLbPPAjAW7zQiQe3C0SkBBg9ysv7ZZ4AGWFa/KClJeuRQhl
+s2SnOj1pYIfN1EhICRLj4pzyufbt6rrlW+W/cvc90lGVXVW37r11vnt+7h/zPI/JeJnp8jOm
+yTRpmhNF4Shzg8ud059eUxrIiNJYhmEssybL4/G1f3SsGaSNAM7STxfeYWtR0ppMRqs3uNwu
+8D6wNQVQoelZBc6HaUi4jgeH3nUKoOtqsdN04zUZCf8ZCPzOhNqwQeCKC/Aj4EN4v6vF7HZr
+spsOsjYcHoGgd2I+lyVw1SQACpqHWYkPiPc24f2HWgw1yG4qyFADnQAXVP0meKZMADOFv9H8
+O0VzENJxxrxvD7gYeB7NyJLWahpkNw5kJPgnJPCVKKBJwNUhTeQkDI6gH1cWtFpBB0k0yG4i
+yNCU65E51yGNxDUK/veQNE92GuCSBE0aBDYNNA2ymwcyQdgPSLNkJbeg4B+jaTgNcEnA1qIg
+igaaBtnNA1nAb+L9XA6xPU1/6eL+G3nhp0nsB0wyr/5fnt3t733sG+/vaNHUILuRIJsmAZhM
+0kwPCbi5CE3J/TIMojzC4733v6UDIbcAZKu6emIDC4G0z65HEMcB6xRApTupbyFpkKkBK0uB
+i6oisJAs9PEAWB1dgxpkmqLNwQa7Hn2MIgRVE8Dl6BrUpEEWrblqLDoaGTQJ/WFU2s/SpEE2
+HmB5OLRjmIWoueoaXJo0yNS0l2y8osznqmizUJMGmTrA+KgQFdMQfS496FeT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/s74u+hZnDR8RGUQVxh26T6X8mdT
+OtZf/PXvFbS5uHiweQLnA6YRfrhN8vH47NsCtZ6GIFwtAsoOXW8QIHg6pwRmUSM1Ke1mQJOY
+BMbNkNacj+fj+aoLmgiBhYN2kXPwftnoF3yfiQ0D5bFK/4nmtT+GkN6BwaOyUB4VahKITtC0
+JjBys7RM+d+heg2WfYfKzreu3adnucncofp2qbw7bDT3TKTNcYEvDbL5UUFgO2BK8t/vjNGI
++JH3qTVuCIC4EkwRTUWhhbdE04fA0pEEORwCwBlphKEJSMDqCRotJzGPHdIGLUFYD0Pusbmm
+ikpP8g6bQLRD5WtQPZmU/xblNRcwvTv0LC/7sQDwfbruUjqmUN5sIB1swNxxgSLtk82JphD1
+4jZ/ReIjqZIbOIYCBNLcJlBVyWTapmeOgmCJoEM2WkahEhEIQa2Bi+jUEtat341CJhyvCyfC
+D34eeL4DzzbYaImBHeFyNyyqOa4ONcgW55vFBh0Jok3+hEOtc4Va2X3uw0Q8XyMhrvLgB/w3
+7p2Ydp6ELytoTd+chf9sAn2DWnNHIvwu5XWXAitB2id/r075jFOfJvlSR6TF9oQ8MtJqvOxF
+DqaIJI8Fc5g3Yo+ovKdU3jKBLtZ0F20uzo96AVbRfBYFNLiQc9v/MZkv5wrvReF7RqBU7TTP
+knB5BE4O5DrlqUd5GNuao7kaoQkQIHl6z0MWY54ZAbtJQO0RkCpkBtqU5yqVvaqQdkfIk2h+
+d6iuH7Oke3RjdFHGmpZbcwYilJpmSFE40prs5pLL9NSbVND/CzAAk/ZJrVWlr2oAAAAASUVO
+RK5CYII=
+--------------C3FD44EAF9B6A93E163D9176--
diff --git a/server/mailet/integration-testing/src/test/resources/eml/message-multipart-8bit.eml b/server/mailet/integration-testing/src/main/resources/eml/message-multipart-8bit.eml
similarity index 98%
rename from server/mailet/integration-testing/src/test/resources/eml/message-multipart-8bit.eml
rename to server/mailet/integration-testing/src/main/resources/eml/message-multipart-8bit.eml
index 3c8c8f4..649140c 100644
--- a/server/mailet/integration-testing/src/test/resources/eml/message-multipart-8bit.eml
+++ b/server/mailet/integration-testing/src/main/resources/eml/message-multipart-8bit.eml
@@ -1,128 +1,128 @@
-Return-Path: <bo...@james.org>
-MIME-Version: 1.0
-Delivered-To: bob@james.org
-Received: from 10.233.68.83 (EHLO incoming.james.org) ([10.233.68.83])
-          by james-0 (JAMES SMTP Server ) with ESMTP ID 926590876
-          for <bo...@james.james.org>;
-          Tue, 21 Jan 2020 07:12:56 +0000 (UTC)
-Received: from smtp.james.org (unknown [10.233.68.1])
-	by incoming.james.org (Postfix) with ESMTPS id B39A643
-	for <bo...@james.james.org>; Tue, 21 Jan 2020 07:12:56 +0000 (UTC)
-Received: from duc-HP-ProBook-450-G4 (unknown [1.54.162.156])
-	(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))
-	(No client certificate requested)
-	by smtp.james.org (Postfix) with ESMTPSA id F11B13F386
-	for <bo...@james.org>; Tue, 21 Jan 2020 08:12:55 +0100 (CET)
-Date: Tue, 21 Jan 2020 14:12:39 +0700 (ICT)
-X-LINAGORA-Copy-Delivery-Done: 1
-From: bob@james.org
-To: bob@james.org
-Message-ID: <42...@duc-HP-ProBook-450-G4>
-Subject: UTF-8 8bit multipart
-Content-Type: multipart/mixed; 
-	boundary="----=_Part_0_238762799.1579590759052"
-
-------=_Part_0_238762799.1579590759052
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-A 8bit encoded body with €uro symbol.
-------=_Part_0_238762799.1579590759052
-Content-Type: application/octet-stream; name=james-logo.png
-Content-Transfer-Encoding: base64
-Content-Disposition: attachment; filename=james-logo.png
-
-iVBORw0KGgoAAAANSUhEUgAAANkAAABaCAYAAAA1mvMAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ
-bWFnZVJlYWR5ccllPAAAFB1JREFUeNrsXV2MI9lVvuX+m2EXrTtLQGwydPVsRlmkSOOW+BNItB2t
-NiAk2n5BeYG2EwkpiSLbPP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D0PusbmmikpP8g6bQLRD5WtQPZmU/xblNRcwvTv0LC/7sQDwfbruUjqmUN5sIB1s
-wNxxgSLtk82JphD14jZ/ReIjqZIbOIYCBNLcJlBVyWTapmeOgmCJoEM2WkahEhEIQa2Bi+jUEtat
-341CJhyvCyfCD34eeL4DzzbYaImBHeFyNyyqOa4ONcgW55vFBh0Jok3+hEOtc4Va2X3uw0Q8XyMh
-rvLgB/w37p2Ydp6ELytoTd+chf9sAn2DWnNHIvwu5XWXAitB2id/r075jFOfJvlSR6TF9oQ8MtJq
-vOxFDqaIJI8Fc5g3Yo+ovKdU3jKBLtZ0F20uzo96AVbRfBYFNLiQc9v/MZkv5wrvReF7RqBU7TTP
-knB5BE4O5DrlqUd5GNuao7kaoQkQIHl6z0MWY54ZAbtJQO0RkCpkBtqU5yqVvaqQdkfIk2h+d6iu
-H7Oke3RjdFHGmpZbcwYilJpmSFE40prs5pLL9NSbVND/CzAAk/ZJrVWlr2oAAAAASUVORK5CYII=
-
-------=_Part_0_238762799.1579590759052--
+Return-Path: <bo...@james.org>
+MIME-Version: 1.0
+Delivered-To: bob@james.org
+Received: from 10.233.68.83 (EHLO incoming.james.org) ([10.233.68.83])
+          by james-0 (JAMES SMTP Server ) with ESMTP ID 926590876
+          for <bo...@james.james.org>;
+          Tue, 21 Jan 2020 07:12:56 +0000 (UTC)
+Received: from smtp.james.org (unknown [10.233.68.1])
+	by incoming.james.org (Postfix) with ESMTPS id B39A643
+	for <bo...@james.james.org>; Tue, 21 Jan 2020 07:12:56 +0000 (UTC)
+Received: from duc-HP-ProBook-450-G4 (unknown [1.54.162.156])
+	(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))
+	(No client certificate requested)
+	by smtp.james.org (Postfix) with ESMTPSA id F11B13F386
+	for <bo...@james.org>; Tue, 21 Jan 2020 08:12:55 +0100 (CET)
+Date: Tue, 21 Jan 2020 14:12:39 +0700 (ICT)
+X-LINAGORA-Copy-Delivery-Done: 1
+From: bob@james.org
+To: bob@james.org
+Message-ID: <42...@duc-HP-ProBook-450-G4>
+Subject: UTF-8 8bit multipart
+Content-Type: multipart/mixed; 
+	boundary="----=_Part_0_238762799.1579590759052"
+
+------=_Part_0_238762799.1579590759052
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+A 8bit encoded body with €uro symbol.
+------=_Part_0_238762799.1579590759052
+Content-Type: application/octet-stream; name=james-logo.png
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment; filename=james-logo.png
+
+iVBORw0KGgoAAAANSUhEUgAAANkAAABaCAYAAAA1mvMAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ
+bWFnZVJlYWR5ccllPAAAFB1JREFUeNrsXV2MI9lVvuX+m2EXrTtLQGwydPVsRlmkSOOW+BNItB2t
+NiAk2n5BeYG2EwkpiSLbPPAjAW7zQiQe3C0SkBBg9ysv7ZZ4AGWFa/KClJeuRQhls2SnOj1pYIfN
+1EhICRLj4pzyufbt6rrlW+W/cvc90lGVXVW37r11vnt+7h/zPI/JeJnp8jOmyTRpmhNF4Shzg8ud
+059eUxrIiNJYhmEssybL4/G1f3SsGaSNAM7STxfeYWtR0ppMRqs3uNwu8D6wNQVQoelZBc6HaUi4
+jgeH3nUKoOtqsdN04zUZCf8ZCPzOhNqwQeCKC/Aj4EN4v6vF7HZrspsOsjYcHoGgd2I+lyVw1SQA
+CpqHWYkPiPc24f2HWgw1yG4qyFADnQAXVP0meKZMADOFv9H8O0VzENJxxrxvD7gYeB7NyJLWahpk
+Nw5kJPgnJPCVKKBJwNUhTeQkDI6gH1cWtFpBB0k0yG4iyNCU65E51yGNxDUK/veQNE92GuCSBE0a
+BDYNNA2ymwcyQdgPSLNkJbeg4B+jaTgNcEnA1qIgigaaBtnNA1nAb+L9XA6xPU1/6eL+G3nhp0ns
+B0wyr/5fnt3t733sG+/vaNHUILuRIJsmAZhM0kwPCbi5CE3J/TIMojzC4733v6UDIbcAZKu6emID
+C4G0z65HEM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4BCY0Jw6ENJx6f86+Yo9OpqUNr8fG5B9+g+ZNwB+Pgl8PeE6vr9E
+AnUi5NUONh68vARYBPCOoHWqlPdTyoe4BHeWTMwK3Y/lLyAI6NndkHedkLZDE7cbuMYn/TpU/gKZ
+nrxcXDNi/s74u+hZnDR8RGUQVxh26T6X8mdTOtZf/PXvFbS5uHiweQLnA6YRfrhN8vH47NsCtZ6G
+IFwtAsoOXW8QIHg6pwRmUSM1Ke1mQJOYBMbNkNacj+fj+aoLmgiBhYN2kXPwftnoF3yfiQ0D5bFK
+/4nmtT+GkN6BwaOyUB4VahKITtC0JjBys7RM+d+heg2WfYfKzreu3adnucncofp2qbw7bDT3TKTN
+cYEvDbL5UUFgO2BK8t/vjNGI+JH3qTVuCIC4EkwRTUWhhbdE04fA0pEEORwCwBlphKEJSMDqCRot
+JzGPHdIGLUFYD0PusbmmikpP8g6bQLRD5WtQPZmU/xblNRcwvTv0LC/7sQDwfbruUjqmUN5sIB1s
+wNxxgSLtk82JphD14jZ/ReIjqZIbOIYCBNLcJlBVyWTapmeOgmCJoEM2WkahEhEIQa2Bi+jUEtat
+341CJhyvCyfCD34eeL4DzzbYaImBHeFyNyyqOa4ONcgW55vFBh0Jok3+hEOtc4Va2X3uw0Q8XyMh
+rvLgB/w37p2Ydp6ELytoTd+chf9sAn2DWnNHIvwu5XWXAitB2id/r075jFOfJvlSR6TF9oQ8MtJq
+vOxFDqaIJI8Fc5g3Yo+ovKdU3jKBLtZ0F20uzo96AVbRfBYFNLiQc9v/MZkv5wrvReF7RqBU7TTP
+knB5BE4O5DrlqUd5GNuao7kaoQkQIHl6z0MWY54ZAbtJQO0RkCpkBtqU5yqVvaqQdkfIk2h+d6iu
+H7Oke3RjdFHGmpZbcwYilJpmSFE40prs5pLL9NSbVND/CzAAk/ZJrVWlr2oAAAAASUVORK5CYII=
+
+------=_Part_0_238762799.1579590759052--
diff --git a/server/mailet/integration-testing/src/test/resources/eml/message-text-only-7bit.eml b/server/mailet/integration-testing/src/main/resources/eml/message-text-only-7bit.eml
similarity index 93%
rename from server/mailet/integration-testing/src/test/resources/eml/message-text-only-7bit.eml
rename to server/mailet/integration-testing/src/main/resources/eml/message-text-only-7bit.eml
index 7e010ba..80a6979 100644
--- a/server/mailet/integration-testing/src/test/resources/eml/message-text-only-7bit.eml
+++ b/server/mailet/integration-testing/src/main/resources/eml/message-text-only-7bit.eml
@@ -1,27 +1,27 @@
-Return-Path: <bo...@james.org>
-MIME-Version: 1.0
-Delivered-To: bob@james.org
-Received: from 10.233.68.83 (EHLO incoming.james.org) ([10.233.68.83])
-          by james-0 (JAMES SMTP Server ) with ESMTP ID -1705393842
-          for <bo...@james.james.org>;
-          Wed, 22 Jan 2020 04:11:54 +0000 (UTC)
-Received: from smtp.james.org (unknown [10.233.65.0])
-	by incoming.james.org (Postfix) with ESMTPS id CCCA943
-	for <bo...@james.james.org>; Wed, 22 Jan 2020 04:11:54 +0000 (UTC)
-Received: from [10.116.29.102] (unknown [1.54.162.156])
-	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
-	(No client certificate requested)
-	by smtp.james.org (Postfix) with ESMTPSA id 2B7D13F393
-	for <bo...@james.org>; Wed, 22 Jan 2020 05:11:53 +0100 (CET)
-To: bob@james.org
-X-LINAGORA-Copy-Delivery-Done: 1
-From: Uncle Bob <bo...@james.org>
-Subject: quoted
-Message-ID: <f4...@james.org>
-Date: Wed, 22 Jan 2020 11:11:38 +0700
-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
- Thunderbird/60.2.1
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: quoted-printable
-
+Return-Path: <bo...@james.org>
+MIME-Version: 1.0
+Delivered-To: bob@james.org
+Received: from 10.233.68.83 (EHLO incoming.james.org) ([10.233.68.83])
+          by james-0 (JAMES SMTP Server ) with ESMTP ID -1705393842
+          for <bo...@james.james.org>;
+          Wed, 22 Jan 2020 04:11:54 +0000 (UTC)
+Received: from smtp.james.org (unknown [10.233.65.0])
+	by incoming.james.org (Postfix) with ESMTPS id CCCA943
+	for <bo...@james.james.org>; Wed, 22 Jan 2020 04:11:54 +0000 (UTC)
+Received: from [10.116.29.102] (unknown [1.54.162.156])
+	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
+	(No client certificate requested)
+	by smtp.james.org (Postfix) with ESMTPSA id 2B7D13F393
+	for <bo...@james.org>; Wed, 22 Jan 2020 05:11:53 +0100 (CET)
+To: bob@james.org
+X-LINAGORA-Copy-Delivery-Done: 1
+From: Uncle Bob <bo...@james.org>
+Subject: quoted
+Message-ID: <f4...@james.org>
+Date: Wed, 22 Jan 2020 11:11:38 +0700
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
+ Thunderbird/60.2.1
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: quoted-printable
+
 A quoted-printable encoded body with =E2=82=ACuro symbol.
\ No newline at end of file
diff --git a/server/mailet/integration-testing/src/test/resources/eml/message-text-only-8bit.eml b/server/mailet/integration-testing/src/main/resources/eml/message-text-only-8bit.eml
similarity index 94%
rename from server/mailet/integration-testing/src/test/resources/eml/message-text-only-8bit.eml
rename to server/mailet/integration-testing/src/main/resources/eml/message-text-only-8bit.eml
index 96ed638..ea206d4 100644
--- a/server/mailet/integration-testing/src/test/resources/eml/message-text-only-8bit.eml
+++ b/server/mailet/integration-testing/src/main/resources/eml/message-text-only-8bit.eml
@@ -1,28 +1,28 @@
-Return-Path: <bo...@james.org>
-MIME-Version: 1.0
-Delivered-To: bob@james.org
-Received: from 10.233.68.83 (EHLO incoming.james.org) ([10.233.68.83])
-          by james-0 (JAMES SMTP Server ) with ESMTP ID -1705393842
-          for <bo...@james.james.org>;
-          Wed, 22 Jan 2020 04:11:54 +0000 (UTC)
-Received: from smtp.james.org (unknown [10.233.65.0])
-	by incoming.james.org (Postfix) with ESMTPS id CCCA943
-	for <bo...@james.james.org>; Wed, 22 Jan 2020 04:11:54 +0000 (UTC)
-Received: from [10.116.29.102] (unknown [1.54.162.156])
-	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
-	(No client certificate requested)
-	by smtp.james.org (Postfix) with ESMTPSA id 2B7D13F393
-	for <bo...@james.org>; Wed, 22 Jan 2020 05:11:53 +0100 (CET)
-To: bob@james.org
-X-LINAGORA-Copy-Delivery-Done: 1
-From: Uncle Bob <bo...@james.org>
-Subject: quoted
-Message-ID: <f4...@james.org>
-Date: Wed, 22 Jan 2020 11:11:38 +0700
-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
- Thunderbird/60.2.1
-Content-Type: text/plain; charset=utf-8; format=flowed
-Content-Transfer-Encoding: 8bit
-Content-Language: en-US
-
+Return-Path: <bo...@james.org>
+MIME-Version: 1.0
+Delivered-To: bob@james.org
+Received: from 10.233.68.83 (EHLO incoming.james.org) ([10.233.68.83])
+          by james-0 (JAMES SMTP Server ) with ESMTP ID -1705393842
+          for <bo...@james.james.org>;
+          Wed, 22 Jan 2020 04:11:54 +0000 (UTC)
+Received: from smtp.james.org (unknown [10.233.65.0])
+	by incoming.james.org (Postfix) with ESMTPS id CCCA943
+	for <bo...@james.james.org>; Wed, 22 Jan 2020 04:11:54 +0000 (UTC)
+Received: from [10.116.29.102] (unknown [1.54.162.156])
+	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
+	(No client certificate requested)
+	by smtp.james.org (Postfix) with ESMTPSA id 2B7D13F393
+	for <bo...@james.org>; Wed, 22 Jan 2020 05:11:53 +0100 (CET)
+To: bob@james.org
+X-LINAGORA-Copy-Delivery-Done: 1
+From: Uncle Bob <bo...@james.org>
+Subject: quoted
+Message-ID: <f4...@james.org>
+Date: Wed, 22 Jan 2020 11:11:38 +0700
+User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
+ Thunderbird/60.2.1
+Content-Type: text/plain; charset=utf-8; format=flowed
+Content-Transfer-Encoding: 8bit
+Content-Language: en-US
+
 A 8bit encoded body with €uro symbol.
\ No newline at end of file
diff --git a/server/mailet/integration-testing/src/test/resources/eml/yahooInvitation.eml b/server/mailet/integration-testing/src/main/resources/eml/yahooInvitation.eml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/eml/yahooInvitation.eml
rename to server/mailet/integration-testing/src/main/resources/eml/yahooInvitation.eml
diff --git a/server/mailet/integration-testing/src/test/resources/imapserver.xml b/server/mailet/integration-testing/src/main/resources/imapserver.xml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/imapserver.xml
rename to server/mailet/integration-testing/src/main/resources/imapserver.xml
diff --git a/server/mailet/integration-testing/src/test/resources/keystore b/server/mailet/integration-testing/src/main/resources/keystore
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/keystore
rename to server/mailet/integration-testing/src/main/resources/keystore
diff --git a/server/mailet/integration-testing/src/test/resources/lmtpserver.xml b/server/mailet/integration-testing/src/main/resources/lmtpserver.xml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/lmtpserver.xml
rename to server/mailet/integration-testing/src/main/resources/lmtpserver.xml
diff --git a/server/mailet/integration-testing/src/test/resources/mailrepositorystore.xml b/server/mailet/integration-testing/src/main/resources/mailrepositorystore.xml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/mailrepositorystore.xml
rename to server/mailet/integration-testing/src/main/resources/mailrepositorystore.xml
diff --git a/server/mailet/integration-testing/src/test/resources/managesieveserver.xml b/server/mailet/integration-testing/src/main/resources/managesieveserver.xml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/managesieveserver.xml
rename to server/mailet/integration-testing/src/main/resources/managesieveserver.xml
diff --git a/server/mailet/integration-testing/src/test/resources/pop3server.xml b/server/mailet/integration-testing/src/main/resources/pop3server.xml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/pop3server.xml
rename to server/mailet/integration-testing/src/main/resources/pop3server.xml
diff --git a/server/mailet/integration-testing/src/test/resources/smime.p12 b/server/mailet/integration-testing/src/main/resources/smime.p12
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/smime.p12
rename to server/mailet/integration-testing/src/main/resources/smime.p12
diff --git a/server/mailet/integration-testing/src/test/resources/smtpserver.xml b/server/mailet/integration-testing/src/main/resources/smtpserver.xml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/smtpserver.xml
rename to server/mailet/integration-testing/src/main/resources/smtpserver.xml
diff --git a/server/mailet/integration-testing/src/test/resources/usersrepository.xml b/server/mailet/integration-testing/src/main/resources/usersrepository.xml
similarity index 100%
rename from server/mailet/integration-testing/src/test/resources/usersrepository.xml
rename to server/mailet/integration-testing/src/main/resources/usersrepository.xml
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMEDecryptIntegrationTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMEDecryptIntegrationTest.java
index c415c25..9a8f95e 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMEDecryptIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/crypto/SMIMEDecryptIntegrationTest.java
@@ -42,7 +42,6 @@ import org.apache.james.util.date.ZonedDateTimeProvider;
 import org.apache.james.utils.DataProbeImpl;
 import org.apache.james.utils.SMTPMessageSender;
 import org.apache.james.utils.TestIMAPClient;
-import org.junit.Rule;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
diff --git a/server/mailet/remote-delivery-integration-testing/pom.xml b/server/mailet/remote-delivery-integration-testing/pom.xml
new file mode 100644
index 0000000..34fb786
--- /dev/null
+++ b/server/mailet/remote-delivery-integration-testing/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.james</groupId>
+        <artifactId>james-server</artifactId>
+        <version>3.6.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>james-server-remote-delivery-integration-testing</artifactId>
+    <packaging>jar</packaging>
+
+    <name>Apache James :: Server :: Remote Delivery :: Integration Testing</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-mailets-integration-testing</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <reuseForks>false</reuseForks>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryDKIMIntegrationTest.java b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryDKIMIntegrationTest.java
similarity index 53%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryDKIMIntegrationTest.java
rename to server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryDKIMIntegrationTest.java
index 9dcdac3..04cf598 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryDKIMIntegrationTest.java
+++ b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryDKIMIntegrationTest.java
@@ -59,7 +59,6 @@ import org.apache.james.utils.SMTPMessageSenderExtension;
 import org.apache.mailet.base.test.FakeMail;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.io.TempDir;
 import org.junit.jupiter.params.ParameterizedTest;
@@ -126,134 +125,126 @@ class RemoteDeliveryDKIMIntegrationTest {
         }
     }
 
-    @Nested
-    class WhenEnable8BitMime {
-        @CsvSource({
-            "a-mail-with-7bit-encoding, eml/message-text-only-7bit.eml",
-            "a-mail-with-8bit-encoding, eml/message-text-only-8bit.eml",
-        })
-        @ParameterizedTest
-        void remoteDeliveryCouldBreakDKIMSignWhenTextMessage(String mailName, String emlPath,
-                                                             SMTPMessageSender messageSender, DockerMockSmtp dockerMockSmtp) throws Exception {
-            InMemoryDNSService inMemoryDNSService = new InMemoryDNSService()
-                .registerMxRecord(JAMES_ANOTHER_DOMAIN, dockerMockSmtp.getIPAddress());
-
-            jamesServer = TemporaryJamesServer.builder()
-                .withBase(SMTP_ONLY_MODULE)
-                .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
-                .withMailetContainer(TemporaryJamesServer.simpleMailetContainerConfiguration()
-                    .putProcessor(directResolutionTransport(MailetConfiguration.remoteDeliveryBuilder()
-                        .addProperty("mail.smtp.allow8bitmime", "true")))
-                    .putProcessor(CommonProcessors.bounces()))
-                .build(tempDir);
-            jamesServer.start();
-
-            dataProbe = jamesServer.getProbe(DataProbeImpl.class);
-            dataProbe.addDomain(DEFAULT_DOMAIN);
-            dataProbe.addUser(FROM, PASSWORD);
-
-            FakeMail mail = FakeMail.builder()
-                .name(mailName)
-                .sender(new MailAddress(FROM))
-                .recipient(new MailAddress(RECIPIENT))
-                .mimeMessage(MimeMessageUtil.mimeMessageFromStream(
-                    ClassLoader.getSystemResourceAsStream(emlPath)))
-                .build();
-            messageSender.connect(LOCALHOST_IP, jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
-                .sendMessage(mail);
-
-            MimeMessage sendMessage = toMimeMessage(getFirstRecivedMail(dockerMockSmtp));
-
-            assertThatThrownBy(() -> dkimVerifier.verifyUsingCRLF(sendMessage))
-                .isInstanceOf(PermFailException.class)
-                .hasMessageContaining("Computed bodyhash is different from the expected one");
-        }
-
-        @CsvSource({
-            "a-mail-with-7bit-base64-encoding, eml/message-multipart-7bit.eml",
-            "a-mail-with-8bit-base64-encoding, eml/message-multipart-8bit.eml"
-        })
-        @ParameterizedTest
-        void remoteDeliveryShouldNotBreakDKIMSign(String mailName, String emlPath,
-                                                  SMTPMessageSender messageSender, DockerMockSmtp dockerMockSmtp) throws Exception {
-            InMemoryDNSService inMemoryDNSService = new InMemoryDNSService()
-                .registerMxRecord(JAMES_ANOTHER_DOMAIN, dockerMockSmtp.getIPAddress());
-
-            jamesServer = TemporaryJamesServer.builder()
-                .withBase(SMTP_ONLY_MODULE)
-                .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
-                .withMailetContainer(TemporaryJamesServer.simpleMailetContainerConfiguration()
-                    .putProcessor(directResolutionTransport(MailetConfiguration.remoteDeliveryBuilder()
-                        .addProperty("mail.smtp.allow8bitmime", "true")))
-                    .putProcessor(CommonProcessors.bounces()))
-                .build(tempDir);
-            jamesServer.start();
-
-            dataProbe = jamesServer.getProbe(DataProbeImpl.class);
-            dataProbe.addDomain(DEFAULT_DOMAIN);
-            dataProbe.addUser(FROM, PASSWORD);
-
-            FakeMail mail = FakeMail.builder()
-                .name(mailName)
-                .sender(new MailAddress(FROM))
-                .recipient(new MailAddress(RECIPIENT))
-                .mimeMessage(MimeMessageUtil.mimeMessageFromStream(
-                    ClassLoader.getSystemResourceAsStream(emlPath)))
-                .build();
-            messageSender.connect(LOCALHOST_IP, jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
-                .sendMessage(mail);
-
-            MimeMessage sendMessage = toMimeMessage(getFirstRecivedMail(dockerMockSmtp));
-
-            assertThat(dkimVerifier.verifyUsingCRLF(sendMessage))
-                .isNotEmpty();
-        }
+    @CsvSource({
+        "a-mail-with-7bit-encoding, eml/message-text-only-7bit.eml",
+        "a-mail-with-8bit-encoding, eml/message-text-only-8bit.eml",
+    })
+    @ParameterizedTest
+    void remoteDeliveryCouldBreakDKIMSignWhenTextMessageWhenEnable8BitMime(String mailName, String emlPath,
+                                                                           SMTPMessageSender messageSender, DockerMockSmtp dockerMockSmtp) throws Exception {
+        InMemoryDNSService inMemoryDNSService = new InMemoryDNSService()
+            .registerMxRecord(JAMES_ANOTHER_DOMAIN, dockerMockSmtp.getIPAddress());
+
+        jamesServer = TemporaryJamesServer.builder()
+            .withBase(SMTP_ONLY_MODULE)
+            .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
+            .withMailetContainer(TemporaryJamesServer.simpleMailetContainerConfiguration()
+                .putProcessor(directResolutionTransport(MailetConfiguration.remoteDeliveryBuilder()
+                    .addProperty("mail.smtp.allow8bitmime", "true")))
+                .putProcessor(CommonProcessors.bounces()))
+            .build(tempDir);
+        jamesServer.start();
+
+        dataProbe = jamesServer.getProbe(DataProbeImpl.class);
+        dataProbe.addDomain(DEFAULT_DOMAIN);
+        dataProbe.addUser(FROM, PASSWORD);
+
+        FakeMail mail = FakeMail.builder()
+            .name(mailName)
+            .sender(new MailAddress(FROM))
+            .recipient(new MailAddress(RECIPIENT))
+            .mimeMessage(MimeMessageUtil.mimeMessageFromStream(
+                ClassLoader.getSystemResourceAsStream(emlPath)))
+            .build();
+        messageSender.connect(LOCALHOST_IP, jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+            .sendMessage(mail);
+
+        MimeMessage sendMessage = toMimeMessage(getFirstRecivedMail(dockerMockSmtp));
+
+        assertThatThrownBy(() -> dkimVerifier.verifyUsingCRLF(sendMessage))
+            .isInstanceOf(PermFailException.class)
+            .hasMessageContaining("Computed bodyhash is different from the expected one");
     }
 
-    @Nested
-    class WhenDisable8BitMime {
-
-        @CsvSource({
-            "a-mail-with-7bit-encoding, eml/message-text-only-7bit.eml",
-            "a-mail-with-7bit-base64-encoding, eml/message-multipart-7bit.eml",
-            "a-mail-with-8bit-encoding, eml/message-text-only-8bit.eml",
-            "a-mail-with-8bit-base64-encoding, eml/message-multipart-8bit.eml"
-        })
-        @ParameterizedTest
-        void remoteDeliveryShouldNotBreakDKIMSign(String mailName, String emlPath,
-                                                  SMTPMessageSender messageSender, DockerMockSmtp dockerMockSmtp) throws Exception {
-            InMemoryDNSService inMemoryDNSService = new InMemoryDNSService()
-                .registerMxRecord(JAMES_ANOTHER_DOMAIN, dockerMockSmtp.getIPAddress());
-
-            jamesServer = TemporaryJamesServer.builder()
-                .withBase(SMTP_ONLY_MODULE)
-                .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
-                .withMailetContainer(TemporaryJamesServer.simpleMailetContainerConfiguration()
-                    .putProcessor(directResolutionTransport(MailetConfiguration.remoteDeliveryBuilder()))
-                    .putProcessor(CommonProcessors.bounces()))
-                .build(tempDir);
-            jamesServer.start();
-
-            dataProbe = jamesServer.getProbe(DataProbeImpl.class);
-            dataProbe.addDomain(DEFAULT_DOMAIN);
-            dataProbe.addUser(FROM, PASSWORD);
-
-            FakeMail mail = FakeMail.builder()
-                .name(mailName)
-                .sender(new MailAddress(FROM))
-                .recipient(new MailAddress(RECIPIENT))
-                .mimeMessage(MimeMessageUtil.mimeMessageFromStream(
-                    ClassLoader.getSystemResourceAsStream(emlPath)))
-                .build();
-            messageSender.connect(LOCALHOST_IP, jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
-                .sendMessage(mail);
-
-            MimeMessage sendMessage = toMimeMessage(getFirstRecivedMail(dockerMockSmtp));
-
-            assertThat(dkimVerifier.verifyUsingCRLF(sendMessage))
-                .isNotEmpty();
-        }
+    @CsvSource({
+        "a-mail-with-7bit-base64-encoding, eml/message-multipart-7bit.eml",
+        "a-mail-with-8bit-base64-encoding, eml/message-multipart-8bit.eml"
+    })
+    @ParameterizedTest
+    void remoteDeliveryShouldNotBreakDKIMSignWhenEnable8BitMime(String mailName, String emlPath,
+                                                                SMTPMessageSender messageSender, DockerMockSmtp dockerMockSmtp) throws Exception {
+        InMemoryDNSService inMemoryDNSService = new InMemoryDNSService()
+            .registerMxRecord(JAMES_ANOTHER_DOMAIN, dockerMockSmtp.getIPAddress());
+
+        jamesServer = TemporaryJamesServer.builder()
+            .withBase(SMTP_ONLY_MODULE)
+            .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
+            .withMailetContainer(TemporaryJamesServer.simpleMailetContainerConfiguration()
+                .putProcessor(directResolutionTransport(MailetConfiguration.remoteDeliveryBuilder()
+                    .addProperty("mail.smtp.allow8bitmime", "true")))
+                .putProcessor(CommonProcessors.bounces()))
+            .build(tempDir);
+        jamesServer.start();
+
+        dataProbe = jamesServer.getProbe(DataProbeImpl.class);
+        dataProbe.addDomain(DEFAULT_DOMAIN);
+        dataProbe.addUser(FROM, PASSWORD);
+
+        FakeMail mail = FakeMail.builder()
+            .name(mailName)
+            .sender(new MailAddress(FROM))
+            .recipient(new MailAddress(RECIPIENT))
+            .mimeMessage(MimeMessageUtil.mimeMessageFromStream(
+                ClassLoader.getSystemResourceAsStream(emlPath)))
+            .build();
+        messageSender.connect(LOCALHOST_IP, jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+            .sendMessage(mail);
+
+        MimeMessage sendMessage = toMimeMessage(getFirstRecivedMail(dockerMockSmtp));
+
+        assertThat(dkimVerifier.verifyUsingCRLF(sendMessage))
+            .isNotEmpty();
+    }
 
+    @CsvSource({
+        "a-mail-with-7bit-encoding, eml/message-text-only-7bit.eml",
+        "a-mail-with-7bit-base64-encoding, eml/message-multipart-7bit.eml",
+        "a-mail-with-8bit-encoding, eml/message-text-only-8bit.eml",
+        "a-mail-with-8bit-base64-encoding, eml/message-multipart-8bit.eml"
+    })
+    @ParameterizedTest
+    void remoteDeliveryShouldNotBreakDKIMSignWhenDisable8BitMime(String mailName, String emlPath,
+                                                                 SMTPMessageSender messageSender, DockerMockSmtp dockerMockSmtp) throws Exception {
+        InMemoryDNSService inMemoryDNSService = new InMemoryDNSService()
+            .registerMxRecord(JAMES_ANOTHER_DOMAIN, dockerMockSmtp.getIPAddress());
+
+        jamesServer = TemporaryJamesServer.builder()
+            .withBase(SMTP_ONLY_MODULE)
+            .withOverrides(binder -> binder.bind(DNSService.class).toInstance(inMemoryDNSService))
+            .withMailetContainer(TemporaryJamesServer.simpleMailetContainerConfiguration()
+                .putProcessor(directResolutionTransport(MailetConfiguration.remoteDeliveryBuilder()))
+                .putProcessor(CommonProcessors.bounces()))
+            .build(tempDir);
+        jamesServer.start();
+
+        dataProbe = jamesServer.getProbe(DataProbeImpl.class);
+        dataProbe.addDomain(DEFAULT_DOMAIN);
+        dataProbe.addUser(FROM, PASSWORD);
+
+        FakeMail mail = FakeMail.builder()
+            .name(mailName)
+            .sender(new MailAddress(FROM))
+            .recipient(new MailAddress(RECIPIENT))
+            .mimeMessage(MimeMessageUtil.mimeMessageFromStream(
+                ClassLoader.getSystemResourceAsStream(emlPath)))
+            .build();
+        messageSender.connect(LOCALHOST_IP, jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+            .sendMessage(mail);
+
+        MimeMessage sendMessage = toMimeMessage(getFirstRecivedMail(dockerMockSmtp));
+
+        assertThat(dkimVerifier.verifyUsingCRLF(sendMessage))
+            .isNotEmpty();
     }
 
     private MimeMessage toMimeMessage(Mail mail) {
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/RemoteDeliveryErrorHandlingTest.java b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/RemoteDeliveryErrorHandlingTest.java
rename to server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
rename to server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNLocalIntegrationTest.java b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNLocalIntegrationTest.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNLocalIntegrationTest.java
rename to server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNLocalIntegrationTest.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRelayTest.java b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRelayTest.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRelayTest.java
rename to server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRelayTest.java
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRemoteIntegrationTest.java b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRemoteIntegrationTest.java
similarity index 100%
rename from server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRemoteIntegrationTest.java
rename to server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRemoteIntegrationTest.java
diff --git a/server/pom.xml b/server/pom.xml
index 41cae9f..a107352 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -76,6 +76,7 @@
         <module>mailet/mailetcontainer-camel</module>
         <module>mailet/mailets</module>
         <module>mailet/mock-smtp-server</module>
+        <module>mailet/remote-delivery-integration-testing</module>
 
         <module>mailrepository/mailrepository-api</module>
         <module>mailrepository/mailrepository-cassandra</module>


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


[james-project] 12/13: JAMES-2884 Attachment should not be created with Content-Transfer-Encoding

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 23d2ebcddce70b59f67b4324575b1afce94b8e4c
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Feb 9 14:37:16 2021 +0700

    JAMES-2884 Attachment should not be created with Content-Transfer-Encoding
    
    https://jmap.io/spec-mail.html#properties-of-the-email-object
    
    4.1.4
    
    Within an EmailBodyPart [...] A Content-Transfer-Encoding
    header field MUST NOT be given.
---
 .../rfc8621/contract/EmailSetMethodContract.scala  | 68 ++++++++++++++++++++++
 .../james/jmap/json/EmailSetSerializer.scala       |  8 ++-
 2 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailSetMethodContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailSetMethodContract.scala
index 2cd0870..8807ba3 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailSetMethodContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailSetMethodContract.scala
@@ -2106,6 +2106,74 @@ trait EmailSetMethodContract {
   }
 
   @Test
+  def rejectAttahmentCreationRequestWithContentTransferEncoding(server: GuiceJamesServer): Unit = {
+    val bobPath = MailboxPath.inbox(BOB)
+    val mailboxId = server.getProbe(classOf[MailboxProbeImpl]).createMailbox(bobPath)
+    val payload = "123456789\r\n".getBytes(StandardCharsets.UTF_8)
+
+    val uploadResponse: String = `given`
+      .basePath("")
+      .header(ACCEPT.toString, ACCEPT_RFC8621_VERSION_HEADER)
+      .contentType("text/plain")
+      .body(payload)
+    .when
+      .post(s"/upload/$ACCOUNT_ID/")
+    .`then`
+      .statusCode(SC_CREATED)
+      .extract
+      .body
+      .asString
+
+    val blobId: String = Json.parse(uploadResponse).\("blobId").get.asInstanceOf[JsString].value
+
+    val request =
+      s"""{
+         |  "using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"],
+         |  "methodCalls": [
+         |    ["Email/set", {
+         |      "accountId": "$ACCOUNT_ID",
+         |      "create": {
+         |        "aaaaaa": {
+         |          "mailboxIds": {
+         |             "${mailboxId.serialize}": true
+         |          },
+         |          "subject": "World domination",
+         |          "attachments": [
+         |            {
+         |              "blobId": "$blobId",
+         |              "type":"text/plain",
+         |              "charset":"UTF-8",
+         |              "header:Content-Transfer-Encoding:asText":"7bit"
+         |            }
+         |          ]
+         |        }
+         |      }
+         |    }, "c1"]
+         |  ]
+         |}""".stripMargin
+
+    val response = `given`
+      .header(ACCEPT.toString, ACCEPT_RFC8621_VERSION_HEADER)
+      .body(request)
+    .when
+      .post.prettyPeek()
+    .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1].notCreated.aaaaaa")
+      .isEqualTo(
+        s"""{
+           |  "type": "invalidArguments",
+           |  "description": "List((/attachments(0),List(JsonValidationError(List(Content-Transfer-Encoding should not be specified on attachment),List()))))"
+           |}""".stripMargin)
+  }
+
+  @Test
   def createShouldSupportAttachmentAndHtmlBody(server: GuiceJamesServer): Unit = {
     val bobPath = MailboxPath.inbox(BOB)
     val mailboxId = server.getProbe(classOf[MailboxProbeImpl]).createMailbox(bobPath)
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/EmailSetSerializer.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/EmailSetSerializer.scala
index 83fa593..af3693b 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/EmailSetSerializer.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/EmailSetSerializer.scala
@@ -351,7 +351,13 @@ class EmailSetSerializer @Inject()(messageIdFactory: MessageId.Factory, mailboxI
   private implicit val languagesWrites: Format[Languages] = Json.valueFormat[Languages]
   private implicit val locationReads: Reads[Location] = Json.valueReads[Location]
   private implicit val cidFormat: Format[ClientCid] = Json.valueFormat[ClientCid]
-  private implicit val attachmentReads: Reads[Attachment] = Json.reads[Attachment]
+  private implicit val attachmentReads: Reads[Attachment] = {
+    case JsObject(keys) if keys.keys.exists(_.contains("header:Content-Transfer-Encoding")) =>
+      JsError("Content-Transfer-Encoding should not be specified on attachment")
+    case JsObject(keys) if keys.keys.exists(_.startsWith("header:Content-Transfer-Encoding:")) =>
+      JsError("Content-Transfer-Encoding should not be specified on attachment")
+    case jsValue: JsValue => Json.reads[Attachment].reads(jsValue)
+  }
   private implicit val emailCreationRequestWithoutHeadersReads: Reads[EmailCreationRequestWithoutHeaders] = Json.reads[EmailCreationRequestWithoutHeaders]
   private implicit val emailCreationRequestReads: Reads[EmailCreationRequest] = {
     case o: JsObject =>


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


[james-project] 11/13: JAMES-3500 Fasten Task tests

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit dddc74a8f53a740418fbda4cd1c9173cf2297bcd
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Feb 15 07:48:19 2021 +0700

    JAMES-3500 Fasten Task tests
    
     - Reduce waiting periods
    
    This effectively make us reclaim ~1 minute of build time
---
 .../test/java/org/apache/james/task/TaskManagerContract.java |  8 ++++----
 .../distributed/DistributedTaskManagerTest.java              |  4 ++--
 .../org/apache/james/task/SerialTaskManagerWorkerTest.java   | 12 ++++++------
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/server/task/task-api/src/test/java/org/apache/james/task/TaskManagerContract.java b/server/task/task-api/src/test/java/org/apache/james/task/TaskManagerContract.java
index 76cf714..3e5b4a1 100644
--- a/server/task/task-api/src/test/java/org/apache/james/task/TaskManagerContract.java
+++ b/server/task/task-api/src/test/java/org/apache/james/task/TaskManagerContract.java
@@ -44,7 +44,7 @@ public interface TaskManagerContract {
         .with()
         .pollDelay(slowPacedPollInterval)
         .await();
-    ConditionFactory awaitAtMostFiveSeconds = calmlyAwait.atMost(Duration.ofSeconds(5));
+    ConditionFactory awaitAtMostTwoSeconds = calmlyAwait.atMost(Duration.ofSeconds(2));
     java.time.Duration TIMEOUT = java.time.Duration.ofMinutes(15);
 
     TaskManager taskManager();
@@ -140,7 +140,7 @@ public interface TaskManagerContract {
         awaitUntilTaskHasStatus(id, TaskManager.Status.IN_PROGRESS, taskManager);
         taskManager.cancel(id);
 
-        awaitAtMostFiveSeconds.untilAsserted(() ->
+        awaitAtMostTwoSeconds.untilAsserted(() ->
             assertThat(taskManager.getExecutionDetails(id).getStatus())
                 .isIn(TaskManager.Status.CANCELLED, TaskManager.Status.CANCEL_REQUESTED));
 
@@ -573,7 +573,7 @@ public interface TaskManagerContract {
             return Task.Result.COMPLETED;
         }));
 
-        awaitAtMostFiveSeconds.until(() -> queue.contains(6));
+        awaitAtMostTwoSeconds.until(() -> queue.contains(6));
 
         assertThat(queue)
             .containsExactly(1, 2, 3, 4, 5, 6);
@@ -598,6 +598,6 @@ public interface TaskManagerContract {
     }
 
     default void awaitUntilTaskHasStatus(TaskId id, TaskManager.Status status, TaskManager taskManager) {
-        awaitAtMostFiveSeconds.until(() -> taskManager.getExecutionDetails(id).getStatus(), Matchers.equalTo(status));
+        awaitAtMostTwoSeconds.until(() -> taskManager.getExecutionDetails(id).getStatus(), Matchers.equalTo(status));
     }
 }
diff --git a/server/task/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/DistributedTaskManagerTest.java b/server/task/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/DistributedTaskManagerTest.java
index 2db3ea6..de2a3ca 100644
--- a/server/task/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/DistributedTaskManagerTest.java
+++ b/server/task/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/DistributedTaskManagerTest.java
@@ -367,7 +367,7 @@ class DistributedTaskManagerTest implements TaskManagerContract {
         Pair<Hostname, TaskManager> remoteTaskManager = getOtherTaskManager(runningNode, Pair.of(HOSTNAME, taskManager1), Pair.of(HOSTNAME_2, taskManager2));
         remoteTaskManager.getValue().cancel(id);
 
-        awaitAtMostFiveSeconds.untilAsserted(() ->
+        awaitAtMostTwoSeconds.untilAsserted(() ->
             assertThat(taskManager1.getExecutionDetails(id).getStatus())
                 .isIn(TaskManager.Status.CANCELLED, TaskManager.Status.CANCEL_REQUESTED));
 
@@ -453,7 +453,7 @@ class DistributedTaskManagerTest implements TaskManagerContract {
             TaskId taskToExecuteAfterFirstNodeIsDown = taskManagerRunningFirstTask.submit(new CompletedTask());
             taskManagerRunningFirstTask.close();
 
-            awaitAtMostFiveSeconds.untilAsserted(() ->
+            awaitAtMostTwoSeconds.untilAsserted(() ->
                 assertThat(otherTaskManager.getExecutionDetails(taskToExecuteAfterFirstNodeIsDown).getStatus())
                     .isEqualTo(TaskManager.Status.COMPLETED));
             TaskExecutionDetails detailsSecondTask = otherTaskManager.getExecutionDetails(taskToExecuteAfterFirstNodeIsDown);
diff --git a/server/task/task-memory/src/test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java b/server/task/task-memory/src/test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java
index 669e0bf..77c2be8 100644
--- a/server/task/task-memory/src/test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java
+++ b/server/task/task-memory/src/test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java
@@ -45,7 +45,7 @@ import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
 
 class SerialTaskManagerWorkerTest {
-    private  static final Duration UPDATE_INFORMATION_POLLING_DURATION = Duration.ofSeconds(1);
+    private  static final Duration UPDATE_INFORMATION_POLLING_DURATION = Duration.ofMillis(100);
 
     private TaskManagerWorker.Listener listener;
     private SerialTaskManagerWorker worker;
@@ -87,14 +87,14 @@ class SerialTaskManagerWorkerTest {
     void aRunningTaskShouldProvideInformationUpdatesDuringExecution() throws InterruptedException {
         TaskWithId taskWithId = new TaskWithId(TaskId.generateTaskId(), new MemoryReferenceWithCounterTask((counter) ->
             Mono.fromCallable(counter::incrementAndGet)
-                .delayElement(Duration.ofSeconds(2))
+                .delayElement(Duration.ofMillis(200))
                 .repeat(10)
                 .then(Mono.just(Task.Result.COMPLETED))
                 .block()));
 
         worker.executeTask(taskWithId).subscribe();
 
-        TimeUnit.SECONDS.sleep(2);
+        TimeUnit.MILLISECONDS.sleep(200);
 
         verify(listener, atLeastOnce()).updated(eq(taskWithId.getId()), notNull());
     }
@@ -103,7 +103,7 @@ class SerialTaskManagerWorkerTest {
     void aRunningTaskShouldHaveAFiniteNumberOfInformation() {
         TaskWithId taskWithId = new TaskWithId(TaskId.generateTaskId(), new MemoryReferenceWithCounterTask((counter) ->
             Mono.fromCallable(counter::incrementAndGet)
-                .delayElement(Duration.ofSeconds(1))
+                .delayElement(Duration.ofMillis(100))
                 .repeat(3)
                 .then(Mono.just(Task.Result.COMPLETED))
                 .block()));
@@ -114,10 +114,10 @@ class SerialTaskManagerWorkerTest {
     }
 
     @Test
-    void aRunningTaskShouldEmitAtMostOneInformationPerSecond() {
+    void aRunningTaskShouldEmitAtMostOneInformationPerPeriod() {
         TaskWithId taskWithId = new TaskWithId(TaskId.generateTaskId(), new MemoryReferenceWithCounterTask((counter) ->
             Mono.fromCallable(counter::incrementAndGet)
-                .delayElement(Duration.ofMillis(10))
+                .delayElement(Duration.ofMillis(1))
                 .repeat(200)
                 .then(Mono.just(Task.Result.COMPLETED))
                 .block()));


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


[james-project] 01/13: JAMES-3500 Increase forkCounts in relevant Cassandra projects

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f3e16d0544e832f5e2d356782c156a6b05678132
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 14:06:54 2021 +0700

    JAMES-3500 Increase forkCounts in relevant Cassandra projects
---
 mpt/impl/imap-mailbox/cassandra/pom.xml |  2 +-
 server/blob/blob-cassandra/pom.xml      |  2 +-
 server/data/data-cassandra/pom.xml      |  2 +-
 server/data/data-jmap-cassandra/pom.xml | 13 +++++++++++++
 4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/mpt/impl/imap-mailbox/cassandra/pom.xml b/mpt/impl/imap-mailbox/cassandra/pom.xml
index a2753cf..92b88bd 100644
--- a/mpt/impl/imap-mailbox/cassandra/pom.xml
+++ b/mpt/impl/imap-mailbox/cassandra/pom.xml
@@ -104,7 +104,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <reuseForks>true</reuseForks>
-                    <forkCount>2</forkCount>
+                    <forkCount>4</forkCount>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/server/blob/blob-cassandra/pom.xml b/server/blob/blob-cassandra/pom.xml
index 679071d..b98c929 100644
--- a/server/blob/blob-cassandra/pom.xml
+++ b/server/blob/blob-cassandra/pom.xml
@@ -103,7 +103,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <reuseForks>true</reuseForks>
-                    <forkCount>2</forkCount>
+                    <forkCount>4</forkCount>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/server/data/data-cassandra/pom.xml b/server/data/data-cassandra/pom.xml
index f603f5c..d3ae891 100644
--- a/server/data/data-cassandra/pom.xml
+++ b/server/data/data-cassandra/pom.xml
@@ -150,7 +150,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <reuseForks>true</reuseForks>
-                    <forkCount>2</forkCount>
+                    <forkCount>4</forkCount>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/server/data/data-jmap-cassandra/pom.xml b/server/data/data-jmap-cassandra/pom.xml
index bd4e3c6..c9154fd 100644
--- a/server/data/data-jmap-cassandra/pom.xml
+++ b/server/data/data-jmap-cassandra/pom.xml
@@ -123,4 +123,17 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <reuseForks>true</reuseForks>
+                    <forkCount>2</forkCount>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>


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


[james-project] 05/13: JAMES-3500 Reduce 'pause' duration

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 429006b3f7d44784e1cf49a9624e47944312807b
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 16:29:17 2021 +0700

    JAMES-3500 Reduce 'pause' duration
---
 .../rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java          | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java
index b99a6fa..9c3c5fc 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java
@@ -127,7 +127,7 @@ class RabbitMQReindexingWithEventDeadLettersTest {
         aliceAccessToken = authenticateJamesUser(LocalHostURIBuilder.baseUri(jmapPort), ALICE, ALICE_PASSWORD);
 
         dockerElasticSearch.getDockerES().pause();
-        Thread.sleep(Duration.ofSeconds(10).toMillis()); // Docker pause is asynchronous and we found no way to poll for it
+        Thread.sleep(Duration.ofSeconds(2).toMillis()); // Docker pause is asynchronous and we found no way to poll for it
     }
 
     @Disabled("JAMES-3011 It's already fails for a long time, but CI didn't detect this when it's not marked as BasicFeature")
@@ -155,7 +155,7 @@ class RabbitMQReindexingWithEventDeadLettersTest {
 
     private void unpauseElasticSearch() throws Exception {
         dockerElasticSearch.getDockerES().unpause();
-        Thread.sleep(Duration.ofSeconds(10).toMillis()); // Docker unpause is asynchronous and we found no way to poll for it
+        Thread.sleep(Duration.ofSeconds(2).toMillis()); // Docker unpause is asynchronous and we found no way to poll for it
     }
 
     private void aliceSavesADraft() {


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


[james-project] 03/13: JAMES-3500 Disable testcontainers checks

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2336daa70fb71e10f0f487f7b740a3d446525a56
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 15:33:32 2021 +0700

    JAMES-3500 Disable testcontainers checks
---
 testing/base/src/main/resources/testcontainers.properties | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testing/base/src/main/resources/testcontainers.properties b/testing/base/src/main/resources/testcontainers.properties
new file mode 100644
index 0000000..2818469
--- /dev/null
+++ b/testing/base/src/main/resources/testcontainers.properties
@@ -0,0 +1 @@
+checks.disable = false
\ No newline at end of file


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


[james-project] 07/13: JAMES-3500 Remove an uneeded test

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 875c8c1859170c74e7213d4047024c8a3393350f
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 16:40:23 2021 +0700

    JAMES-3500 Remove an uneeded test
    
    A James server without MessageIdManager will not start,
    remove this no longer needed intermediary implementation
    step.
---
 .../CassandraMessageIdManagerInjectionTest.java    | 66 ----------------------
 1 file changed, 66 deletions(-)

diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraMessageIdManagerInjectionTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraMessageIdManagerInjectionTest.java
deleted file mode 100644
index 3ea1bd9..0000000
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraMessageIdManagerInjectionTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information        *
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the            *
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *                                                              *
- *   http://www.apache.org/licenses/LICENSE-2.0                 *
- *                                                              *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
- * KIND, either express or implied.  See the License for the    *
- * specific language governing permissions and limitations      *
- * under the License.                                           *
- ****************************************************************/
-
-package org.apache.james;
-
-import static org.assertj.core.api.Assertions.assertThatCode;
-
-import javax.inject.Inject;
-
-import org.apache.james.lifecycle.api.Startable;
-import org.apache.james.mailbox.MessageIdManager;
-import org.apache.james.utils.InitializationOperation;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-import com.google.inject.multibindings.Multibinder;
-
-class CassandraMessageIdManagerInjectionTest {
-    @RegisterExtension
-    static JamesServerExtension testExtension = TestingDistributedJamesServerBuilder.withSearchConfiguration(SearchConfiguration.elasticSearch())
-        .extension(new DockerElasticSearchExtension())
-        .extension(new CassandraExtension())
-        .server(configuration -> CassandraJamesServerMain.createServer(configuration)
-            .overrideWith(binder -> Multibinder.newSetBinder(binder, InitializationOperation.class)
-                .addBinding()
-                .to(CallMe.class)))
-        .disableAutoStart()
-        .build();
-
-    @Test
-    void messageIdManagerShouldBeInjected(GuiceJamesServer server) {
-        assertThatCode(server::start).doesNotThrowAnyException();
-    }
-
-    public static class CallMe implements InitializationOperation, Startable {
-        @Inject
-        public CallMe(MessageIdManager messageIdManager) {
-        }
-
-        @Override
-        public void initModule() {
-
-        }
-
-        @Override
-        public Class<? extends Startable> forClass() {
-            return CallMe.class;
-        }
-    }
-}


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


[james-project] 06/13: JAMES-3500 Leverage PER_CLASS James server test lifecycle where possible

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 775f4a0d7ec46e21ba1e35ec816aab72e356a4dc
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 16:30:00 2021 +0700

    JAMES-3500 Leverage PER_CLASS James server test lifecycle where possible
---
 .../rabbitmq/RabbitMQJwtFilterIntegrationTest.java |   3 +
 ...tMQWebAdminServerIntegrationImmutableTest.java} | 129 +--------
 .../RabbitMQWebAdminServerIntegrationTest.java     |  56 ----
 ...rTaskSerializationIntegrationImmutableTest.java | 309 +++++++++++++++++++++
 ...dminServerTaskSerializationIntegrationTest.java | 260 ++---------------
 .../memory/MemoryJwtFilterIntegrationTest.java     |   4 +-
 ...oryWebAdminServerIntegrationImmutableTest.java} |  29 +-
 .../integration/JwtFilterIntegrationTest.java      |  11 +-
 .../WebAdminServerIntegrationImmutableTest.java    | 169 +++++++++++
 .../integration/WebAdminServerIntegrationTest.java |  12 +
 10 files changed, 546 insertions(+), 436 deletions(-)

diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQJwtFilterIntegrationTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQJwtFilterIntegrationTest.java
index e9c190d..42e975a 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQJwtFilterIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQJwtFilterIntegrationTest.java
@@ -19,6 +19,8 @@
 
 package org.apache.james.webadmin.integration.rabbitmq;
 
+import static org.apache.james.JamesServerExtension.Lifecycle.PER_CLASS;
+
 import org.apache.james.CassandraExtension;
 import org.apache.james.CassandraRabbitMQJamesConfiguration;
 import org.apache.james.CassandraRabbitMQJamesServerMain;
@@ -60,5 +62,6 @@ class RabbitMQJwtFilterIntegrationTest extends JwtFilterIntegrationTest {
                 .annotatedWith(Names.named("webadmin"))
                 .toInstance(() -> JwtTokenVerifier.create(jwtConfiguration())))
             .overrideWith(new WebadminIntegrationTestModule()))
+        .lifeCycle(PER_CLASS)
         .build();
 }
diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationImmutableTest.java
similarity index 60%
copy from server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationTest.java
copy to server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationImmutableTest.java
index 3384b31..038fad2 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationImmutableTest.java
@@ -22,10 +22,8 @@ package org.apache.james.webadmin.integration.rabbitmq;
 import static io.restassured.RestAssured.given;
 import static io.restassured.RestAssured.when;
 import static io.restassured.RestAssured.with;
+import static org.apache.james.JamesServerExtension.Lifecycle.PER_CLASS;
 import static org.apache.james.webadmin.Constants.JSON_CONTENT_TYPE;
-import static org.apache.james.webadmin.Constants.SEPARATOR;
-import static org.awaitility.Durations.TEN_SECONDS;
-import static org.hamcrest.CoreMatchers.hasItems;
 import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.is;
@@ -44,22 +42,17 @@ import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.blobstore.BlobStoreConfiguration;
 import org.apache.james.webadmin.RandomPortSupplier;
 import org.apache.james.webadmin.WebAdminConfiguration;
-import org.apache.james.webadmin.integration.WebAdminServerIntegrationTest;
+import org.apache.james.webadmin.integration.WebAdminServerIntegrationImmutableTest;
 import org.apache.james.webadmin.integration.WebadminIntegrationTestModule;
-import org.apache.james.webadmin.routes.AliasRoutes;
-import org.apache.james.webadmin.routes.CassandraMappingsRoutes;
 import org.apache.james.webadmin.routes.TasksRoutes;
 import org.apache.james.webadmin.swagger.routes.SwaggerRoutes;
-import org.awaitility.Awaitility;
 import org.eclipse.jetty.http.HttpStatus;
 import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
-import io.restassured.http.ContentType;
-
 @Tag(BasicFeature.TAG)
-class RabbitMQWebAdminServerIntegrationTest extends WebAdminServerIntegrationTest {
+class RabbitMQWebAdminServerIntegrationImmutableTest extends WebAdminServerIntegrationImmutableTest {
 
     @RegisterExtension
     static JamesServerExtension testExtension = new JamesServerBuilder<CassandraRabbitMQJamesConfiguration>(tmpDir ->
@@ -86,6 +79,7 @@ class RabbitMQWebAdminServerIntegrationTest extends WebAdminServerIntegrationTes
                     .port(new RandomPortSupplier())
                     .additionalRoute("org.apache.james.webadmin.dropwizard.MetricsRoutes")
                     .build())))
+        .lifeCycle(PER_CLASS)
         .build();
 
     private static final String VERSION = "/cassandra/version";
@@ -94,16 +88,6 @@ class RabbitMQWebAdminServerIntegrationTest extends WebAdminServerIntegrationTes
     private static final String UPGRADE_TO_LATEST_VERSION = UPGRADE_VERSION + "/latest";
 
     @Test
-    void getCurrentVersionShouldReturnNullForCurrentVersionAsBeginning() {
-        when()
-            .get(VERSION)
-        .then()
-            .statusCode(HttpStatus.OK_200)
-            .contentType(JSON_CONTENT_TYPE)
-            .body(is("{\"version\":null}"));
-    }
-
-    @Test
     void getLatestVersionShouldReturnTheConfiguredLatestVersion() {
         when()
             .get(VERSION_LATEST)
@@ -114,111 +98,6 @@ class RabbitMQWebAdminServerIntegrationTest extends WebAdminServerIntegrationTes
     }
 
     @Test
-    void postShouldDoMigrationAndUpdateCurrentVersion() {
-        String taskId = with()
-            .body(String.valueOf(CassandraSchemaVersionManager.MAX_VERSION.getValue()))
-        .post(UPGRADE_VERSION)
-            .jsonPath()
-            .get("taskId");
-
-        with()
-            .get("/tasks/" + taskId + "/await")
-        .then()
-            .body("status", is("completed"));
-
-        Awaitility.await()
-            .atMost(TEN_SECONDS)
-            .await()
-            .untilAsserted(() ->
-                when()
-                    .get(VERSION)
-                .then()
-                    .statusCode(HttpStatus.OK_200)
-                    .contentType(JSON_CONTENT_TYPE)
-                    .body(is("{\"version\":" + CassandraSchemaVersionManager.MAX_VERSION.getValue() + "}")));
-    }
-
-    @Test
-    void postShouldDoMigrationAndUpdateToTheLatestVersion() {
-        String taskId = with().post(UPGRADE_TO_LATEST_VERSION)
-            .jsonPath()
-            .get("taskId");
-
-        with()
-            .get("/tasks/" + taskId + "/await")
-        .then()
-            .body("status", is("completed"));
-
-        when()
-            .get(VERSION)
-        .then()
-            .statusCode(HttpStatus.OK_200)
-            .contentType(JSON_CONTENT_TYPE)
-            .body(is("{\"version\":" + CassandraSchemaVersionManager.MAX_VERSION.getValue() + "}"));
-    }
-
-    @Test
-    void cassandraMappingsEndpointShouldKeepDataConsistencyWhenDataValid() {
-        with()
-            .put(AliasRoutes.ROOT_PATH + SEPARATOR + USERNAME + "/sources/" + ALIAS_1);
-        with()
-            .put(AliasRoutes.ROOT_PATH + SEPARATOR + USERNAME + "/sources/" + ALIAS_2);
-
-        String taskId = with()
-            .queryParam("action", "SolveInconsistencies")
-        .post(CassandraMappingsRoutes.ROOT_PATH)
-            .jsonPath()
-            .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"));
-
-        when()
-            .get(AliasRoutes.ROOT_PATH + SEPARATOR + USERNAME)
-        .then()
-            .contentType(ContentType.JSON)
-        .statusCode(HttpStatus.OK_200)
-            .body("source", hasItems(ALIAS_1, ALIAS_2));
-    }
-
-    @Test
-    void solveMailboxInconsistenciesTaskShouldBeExposed() {
-        // schema version 6 or higher required to run solve mailbox inconsistencies task
-        String taskId = with().post(UPGRADE_TO_LATEST_VERSION)
-            .jsonPath()
-            .get("taskId");
-
-        with()
-            .get("/tasks/" + taskId + "/await")
-        .then()
-            .body("status", is("completed"));
-
-        taskId = with()
-            .header("I-KNOW-WHAT-I-M-DOING", "ALL-SERVICES-ARE-OFFLINE")
-            .queryParam("task", "SolveInconsistencies")
-        .post("/mailboxes")
-            .jsonPath()
-            .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("type", is("solve-mailbox-inconsistencies"))
-            .body("additionalInformation.processedMailboxEntries", is(0))
-            .body("additionalInformation.processedMailboxPathEntries", is(0))
-            .body("additionalInformation.errors", is(0))
-            .body("additionalInformation.fixedInconsistencies", hasSize(0))
-            .body("additionalInformation.conflictingEntries", hasSize(0));
-    }
-
-    @Test
     void solveMessageInconsistenciesTasksShouldBeExposed() {
         String taskId = with().post(UPGRADE_TO_LATEST_VERSION)
             .jsonPath()
diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationTest.java
index 3384b31..64cf61d 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerIntegrationTest.java
@@ -26,7 +26,6 @@ import static org.apache.james.webadmin.Constants.JSON_CONTENT_TYPE;
 import static org.apache.james.webadmin.Constants.SEPARATOR;
 import static org.awaitility.Durations.TEN_SECONDS;
 import static org.hamcrest.CoreMatchers.hasItems;
-import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.is;
 
@@ -49,7 +48,6 @@ import org.apache.james.webadmin.integration.WebadminIntegrationTestModule;
 import org.apache.james.webadmin.routes.AliasRoutes;
 import org.apache.james.webadmin.routes.CassandraMappingsRoutes;
 import org.apache.james.webadmin.routes.TasksRoutes;
-import org.apache.james.webadmin.swagger.routes.SwaggerRoutes;
 import org.awaitility.Awaitility;
 import org.eclipse.jetty.http.HttpStatus;
 import org.junit.jupiter.api.Tag;
@@ -104,16 +102,6 @@ class RabbitMQWebAdminServerIntegrationTest extends WebAdminServerIntegrationTes
     }
 
     @Test
-    void getLatestVersionShouldReturnTheConfiguredLatestVersion() {
-        when()
-            .get(VERSION_LATEST)
-        .then()
-            .statusCode(HttpStatus.OK_200)
-            .contentType(JSON_CONTENT_TYPE)
-            .body(is("{\"version\":" + CassandraSchemaVersionManager.MAX_VERSION.getValue() + "}"));
-    }
-
-    @Test
     void postShouldDoMigrationAndUpdateCurrentVersion() {
         String taskId = with()
             .body(String.valueOf(CassandraSchemaVersionManager.MAX_VERSION.getValue()))
@@ -217,48 +205,4 @@ class RabbitMQWebAdminServerIntegrationTest extends WebAdminServerIntegrationTes
             .body("additionalInformation.fixedInconsistencies", hasSize(0))
             .body("additionalInformation.conflictingEntries", hasSize(0));
     }
-
-    @Test
-    void solveMessageInconsistenciesTasksShouldBeExposed() {
-        String taskId = with().post(UPGRADE_TO_LATEST_VERSION)
-            .jsonPath()
-            .get("taskId");
-
-        with()
-            .get("/tasks/" + taskId + "/await")
-        .then()
-            .body("status", is("completed"));
-
-        taskId = with()
-            .queryParam("task", "SolveInconsistencies")
-            .post("/messages")
-            .jsonPath()
-            .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("type", is("solve-message-inconsistencies"))
-            .body("additionalInformation.processedImapUidEntries", is(0))
-            .body("additionalInformation.processedMessageIdEntries", is(0))
-            .body("additionalInformation.addedMessageIdEntries", is(0))
-            .body("additionalInformation.updatedMessageIdEntries", is(0))
-            .body("additionalInformation.removedMessageIdEntries", is(0))
-            .body("additionalInformation.runningOptions.messagesPerSecond", is(100))
-            .body("additionalInformation.fixedInconsistencies", hasSize(0))
-            .body("additionalInformation.errors", hasSize(0));
-    }
-
-    @Test
-    void getSwaggerShouldContainDistributedEndpoints() {
-        when()
-            .get(SwaggerRoutes.SWAGGER_ENDPOINT)
-        .then()
-            .statusCode(HttpStatus.OK_200)
-            .body(containsString("\"tags\":[\"Cassandra Mappings Operations\"]"))
-            .body(containsString("{\"name\":\"MessageIdReIndexing\"}"));
-    }
 }
diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerTaskSerializationIntegrationImmutableTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerTaskSerializationIntegrationImmutableTest.java
new file mode 100644
index 0000000..b969e49
--- /dev/null
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerTaskSerializationIntegrationImmutableTest.java
@@ -0,0 +1,309 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.webadmin.integration.rabbitmq;
+
+import static io.restassured.RestAssured.given;
+import static io.restassured.RestAssured.with;
+import static org.apache.james.JamesServerExtension.Lifecycle.PER_CLASS;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.collection.IsMapWithSize.anEmptyMap;
+
+import org.apache.james.CassandraExtension;
+import org.apache.james.CassandraRabbitMQJamesConfiguration;
+import org.apache.james.CassandraRabbitMQJamesServerMain;
+import org.apache.james.DockerElasticSearchExtension;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.JamesServerBuilder;
+import org.apache.james.JamesServerExtension;
+import org.apache.james.SearchConfiguration;
+import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionManager;
+import org.apache.james.backends.cassandra.versions.SchemaVersion;
+import org.apache.james.junit.categories.BasicFeature;
+import org.apache.james.modules.AwsS3BlobStoreExtension;
+import org.apache.james.modules.RabbitMQExtension;
+import org.apache.james.modules.blobstore.BlobStoreConfiguration;
+import org.apache.james.probe.DataProbe;
+import org.apache.james.utils.DataProbeImpl;
+import org.apache.james.utils.WebAdminGuiceProbe;
+import org.apache.james.webadmin.WebAdminUtils;
+import org.apache.james.webadmin.integration.WebadminIntegrationTestModule;
+import org.apache.james.webadmin.routes.CassandraMappingsRoutes;
+import org.apache.james.webadmin.routes.MailQueueRoutes;
+import org.apache.james.webadmin.routes.MailRepositoriesRoutes;
+import org.apache.james.webadmin.routes.TasksRoutes;
+import org.apache.james.webadmin.vault.routes.DeletedMessagesVaultRoutes;
+import org.eclipse.jetty.http.HttpStatus;
+import org.hamcrest.Matchers;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+
+@Tag(BasicFeature.TAG)
+class RabbitMQWebAdminServerTaskSerializationIntegrationImmutableTest {
+
+    @RegisterExtension
+    static JamesServerExtension testExtension = new JamesServerBuilder<CassandraRabbitMQJamesConfiguration>(tmpDir ->
+        CassandraRabbitMQJamesConfiguration.builder()
+            .workingDirectory(tmpDir)
+            .configurationFromClasspath()
+            .blobStore(BlobStoreConfiguration.builder()
+                    .s3()
+                    .disableCache()
+                    .deduplication())
+            .searchConfiguration(SearchConfiguration.elasticSearch())
+            .build())
+        .extension(new DockerElasticSearchExtension())
+        .extension(new CassandraExtension())
+        .extension(new AwsS3BlobStoreExtension())
+        .extension(new RabbitMQExtension())
+        .server(configuration -> CassandraRabbitMQJamesServerMain.createServer(configuration)
+            .overrideWith(new WebadminIntegrationTestModule()))
+        .lifeCycle(PER_CLASS)
+        .build();
+
+    private static final String DOMAIN = "domain";
+    private static final String USERNAME = "username@" + DOMAIN;
+
+    @BeforeAll
+    static void setUp(GuiceJamesServer guiceJamesServer) throws Exception {
+        DataProbe dataProbe = guiceJamesServer.getProbe(DataProbeImpl.class);
+        dataProbe.addDomain(DOMAIN);
+        WebAdminGuiceProbe webAdminGuiceProbe = guiceJamesServer.getProbe(WebAdminGuiceProbe.class);
+
+        RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminGuiceProbe.getWebAdminPort())
+            .build();
+        RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
+    }
+
+    @Test
+    void fullReindexingShouldCompleteWhenNoMail() {
+        String taskId = with()
+            .post("/mailboxes?task=reIndex")
+            .jsonPath()
+            .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(notNullValue()))
+            .body("type", is("full-reindexing"))
+            .body("additionalInformation.successfullyReprocessedMailCount", is(0))
+            .body("additionalInformation.failedReprocessedMailCount", is(0))
+            .body("additionalInformation.messageFailures", is(anEmptyMap()));
+    }
+
+    @Test
+    void clearMailQueueShouldCompleteWhenNoQueryParameters() {
+        String firstMailQueue = with()
+                .basePath(MailQueueRoutes.BASE_URL)
+            .get()
+            .then()
+                .statusCode(HttpStatus.OK_200)
+                .contentType(ContentType.JSON)
+                .extract()
+                .body()
+                .jsonPath()
+                .getString("[0]");
+
+        String taskId = with()
+                .basePath(MailQueueRoutes.BASE_URL)
+            .delete(firstMailQueue + "/mails")
+                .jsonPath()
+                .getString("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(Matchers.notNullValue()))
+            .body("type", is("clear-mail-queue"))
+            .body("additionalInformation.mailQueueName", is(notNullValue()))
+            .body("additionalInformation.initialCount", is(0))
+            .body("additionalInformation.remainingCount", is(0));
+    }
+
+    @Test
+    void blobStoreVaultGarbageCollectionShouldComplete() {
+        String taskId =
+            with()
+                .basePath(DeletedMessagesVaultRoutes.ROOT_PATH)
+                .queryParam("scope", "expired")
+            .delete()
+                .jsonPath()
+                .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(taskId))
+            .body("type", is("deleted-messages-blob-store-based-garbage-collection"))
+            .body("additionalInformation.beginningOfRetentionPeriod", is(notNullValue()))
+            .body("additionalInformation.deletedBuckets", is(empty()));
+    }
+
+    @Test
+    void clearMailRepositoryShouldComplete() {
+        String escapedRepositoryPath = with()
+                .basePath(MailRepositoriesRoutes.MAIL_REPOSITORIES)
+            .get()
+            .then()
+                .statusCode(HttpStatus.OK_200)
+                .contentType(ContentType.JSON)
+                .extract()
+                .body()
+                .jsonPath()
+                .getString("[0].path");
+
+        String taskId = with()
+                .basePath(MailRepositoriesRoutes.MAIL_REPOSITORIES)
+            .delete(escapedRepositoryPath + "/mails")
+                .jsonPath()
+                .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(taskId))
+            .body("type", is("clear-mail-repository"))
+            .body("additionalInformation.repositoryPath", is(notNullValue()))
+            .body("additionalInformation.initialCount", is(0))
+            .body("additionalInformation.remainingCount", is(0));
+    }
+
+    @Test
+    void cassandraMigrationShouldComplete() {
+        SchemaVersion toVersion = CassandraSchemaVersionManager.MAX_VERSION;
+        String taskId = with()
+                .body(String.valueOf(toVersion.getValue()))
+            .post("cassandra/version/upgrade")
+                .jsonPath()
+                .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(taskId))
+            .body("type", is("cassandra-migration"))
+            .body("additionalInformation.toVersion", is(toVersion.getValue()));
+    }
+
+    @Test
+    void cassandraMappingsSolveInconsistenciesShouldComplete() {
+        String taskId = with()
+                .basePath(CassandraMappingsRoutes.ROOT_PATH)
+                .queryParam("action", "SolveInconsistencies")
+            .post()
+                .jsonPath()
+                .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(taskId))
+            .body("type", is("cassandra-mappings-solve-inconsistencies"))
+            .body("additionalInformation.successfulMappingsCount", is(0))
+            .body("additionalInformation.errorMappingsCount", is(0));
+    }
+
+    @Test
+    void recomputeMailboxCountersShouldComplete() {
+        String taskId = with()
+                .basePath("/mailboxes")
+                .queryParam("task", "RecomputeMailboxCounters")
+            .post()
+                .jsonPath()
+                .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(taskId))
+            .body("type", is("recompute-mailbox-counters"))
+            .body("additionalInformation.processedMailboxes", is(0));
+    }
+
+    @Test
+    void recomputeCurrentQuotasShouldComplete() {
+        String taskId = with()
+            .basePath("/quota/users")
+            .queryParam("task", "RecomputeCurrentQuotas")
+        .post()
+            .jsonPath()
+            .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(taskId))
+            .body("type", is("recompute-current-quotas"))
+            .body("additionalInformation.processedQuotaRoots", is(0))
+            .body("additionalInformation.failedQuotaRoots", empty());
+    }
+
+    @Test
+    void republishNotProcessedMailsOnSpoolShouldComplete() {
+        String taskId = with()
+            .basePath("/mailQueues/spool")
+            .queryParam("action", "RepublishNotProcessedMails")
+            .queryParam("olderThan", "2d")
+        .post()
+            .jsonPath()
+        .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(taskId))
+            .body("type", is("republish-not-processed-mails"))
+            .body("additionalInformation.nbRequeuedMails", is(0));
+    }
+}
diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerTaskSerializationIntegrationTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerTaskSerializationIntegrationTest.java
index b20b6c0..5fb728e 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerTaskSerializationIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQWebAdminServerTaskSerializationIntegrationTest.java
@@ -26,7 +26,6 @@ import static org.apache.james.webadmin.Constants.SEPARATOR;
 import static org.apache.james.webadmin.vault.routes.DeletedMessagesVaultRoutes.MESSAGE_PATH_PARAM;
 import static org.apache.james.webadmin.vault.routes.DeletedMessagesVaultRoutes.USERS;
 import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.Matchers.empty;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.nullValue;
 import static org.hamcrest.collection.IsMapWithSize.anEmptyMap;
@@ -45,8 +44,6 @@ import org.apache.james.GuiceJamesServer;
 import org.apache.james.JamesServerBuilder;
 import org.apache.james.JamesServerExtension;
 import org.apache.james.SearchConfiguration;
-import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionManager;
-import org.apache.james.backends.cassandra.versions.SchemaVersion;
 import org.apache.james.core.Username;
 import org.apache.james.core.builder.MimeMessageBuilder;
 import org.apache.james.events.Event;
@@ -79,7 +76,6 @@ import org.apache.james.utils.WebAdminGuiceProbe;
 import org.apache.james.webadmin.WebAdminUtils;
 import org.apache.james.webadmin.integration.WebadminIntegrationTestModule;
 import org.apache.james.webadmin.routes.CassandraMailboxMergingRoutes;
-import org.apache.james.webadmin.routes.CassandraMappingsRoutes;
 import org.apache.james.webadmin.routes.MailQueueRoutes;
 import org.apache.james.webadmin.routes.MailRepositoriesRoutes;
 import org.apache.james.webadmin.routes.TasksRoutes;
@@ -137,26 +133,6 @@ class RabbitMQWebAdminServerTaskSerializationIntegrationTest {
     }
 
     @Test
-    void fullReindexingShouldCompleteWhenNoMail() {
-        String taskId = with()
-            .post("/mailboxes?task=reIndex")
-            .jsonPath()
-            .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(notNullValue()))
-            .body("type", is("full-reindexing"))
-            .body("additionalInformation.successfullyReprocessedMailCount", is(0))
-            .body("additionalInformation.failedReprocessedMailCount", is(0))
-            .body("additionalInformation.messageFailures", is(anEmptyMap()));
-    }
-
-    @Test
     void recomputeFastViewProjectionItemsShouldComplete(GuiceJamesServer server) throws Exception {
         server.getProbe(DataProbeImpl.class).addUser(USERNAME, "secret");
         mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX);
@@ -186,6 +162,30 @@ class RabbitMQWebAdminServerTaskSerializationIntegrationTest {
     }
 
     @Test
+    void singleMailboxReindexingShouldComplete(GuiceJamesServer server) {
+        MailboxId mailboxId = server.getProbe(MailboxProbeImpl.class)
+            .createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX);
+
+        String taskId = when()
+            .post("/mailboxes/" + mailboxId.serialize() + "?task=reIndex")
+            .jsonPath()
+            .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("taskId", is(Matchers.notNullValue()))
+            .body("type", is("mailbox-reindexing"))
+            .body("additionalInformation.successfullyReprocessedMailCount", is(0))
+            .body("additionalInformation.failedReprocessedMailCount", is(0))
+            .body("additionalInformation.mailboxId", is(mailboxId.serialize()))
+            .body("additionalInformation.messageFailures", is(anEmptyMap()));
+    }
+
+    @Test
     void populateEmailQueryViewShouldComplete(GuiceJamesServer server) throws Exception {
         server.getProbe(DataProbeImpl.class).addUser(USERNAME, "secret");
         mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX);
@@ -598,92 +598,6 @@ class RabbitMQWebAdminServerTaskSerializationIntegrationTest {
     }
 
     @Test
-    void clearMailQueueShouldCompleteWhenNoQueryParameters() {
-        String firstMailQueue = with()
-                .basePath(MailQueueRoutes.BASE_URL)
-            .get()
-            .then()
-                .statusCode(HttpStatus.OK_200)
-                .contentType(ContentType.JSON)
-                .extract()
-                .body()
-                .jsonPath()
-                .getString("[0]");
-
-        String taskId = with()
-                .basePath(MailQueueRoutes.BASE_URL)
-            .delete(firstMailQueue + "/mails")
-                .jsonPath()
-                .getString("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(Matchers.notNullValue()))
-            .body("type", is("clear-mail-queue"))
-            .body("additionalInformation.mailQueueName", is(notNullValue()))
-            .body("additionalInformation.initialCount", is(0))
-            .body("additionalInformation.remainingCount", is(0));
-    }
-
-    @Test
-    void blobStoreVaultGarbageCollectionShouldComplete() {
-        String taskId =
-            with()
-                .basePath(DeletedMessagesVaultRoutes.ROOT_PATH)
-                .queryParam("scope", "expired")
-            .delete()
-                .jsonPath()
-                .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(taskId))
-            .body("type", is("deleted-messages-blob-store-based-garbage-collection"))
-            .body("additionalInformation.beginningOfRetentionPeriod", is(notNullValue()))
-            .body("additionalInformation.deletedBuckets", is(empty()));
-    }
-
-    @Test
-    void clearMailRepositoryShouldComplete() {
-        String escapedRepositoryPath = with()
-                .basePath(MailRepositoriesRoutes.MAIL_REPOSITORIES)
-            .get()
-            .then()
-                .statusCode(HttpStatus.OK_200)
-                .contentType(ContentType.JSON)
-                .extract()
-                .body()
-                .jsonPath()
-                .getString("[0].path");
-
-        String taskId = with()
-                .basePath(MailRepositoriesRoutes.MAIL_REPOSITORIES)
-            .delete(escapedRepositoryPath + "/mails")
-                .jsonPath()
-                .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(taskId))
-            .body("type", is("clear-mail-repository"))
-            .body("additionalInformation.repositoryPath", is(notNullValue()))
-            .body("additionalInformation.initialCount", is(0))
-            .body("additionalInformation.remainingCount", is(0));
-    }
-
-    @Test
     void mailboxMergingShouldComplete() {
         MailboxId origin = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX);
         MailboxId destination = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX + "2");
@@ -713,29 +627,6 @@ class RabbitMQWebAdminServerTaskSerializationIntegrationTest {
     }
 
     @Test
-    void singleMailboxReindexingShouldComplete() {
-        MailboxId mailboxId = mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX);
-
-        String taskId = when()
-            .post("/mailboxes/" + mailboxId.serialize() + "?task=reIndex")
-                .jsonPath()
-                .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(Matchers.notNullValue()))
-            .body("type", is("mailbox-reindexing"))
-            .body("additionalInformation.successfullyReprocessedMailCount", is(0))
-            .body("additionalInformation.failedReprocessedMailCount", is(0))
-            .body("additionalInformation.mailboxId", is(mailboxId.serialize()))
-            .body("additionalInformation.messageFailures", is(anEmptyMap()));
-    }
-
-    @Test
     void deletedMessagesVaultDeleteShouldCompleteEvenNoDeletedMessageExisted() throws Exception {
         dataProbe.addUser(USERNAME, "password");
         mailboxProbe.createMailbox(MailboxConstants.USER_NAMESPACE, USERNAME, MailboxConstants.INBOX);
@@ -766,88 +657,6 @@ class RabbitMQWebAdminServerTaskSerializationIntegrationTest {
             .body("additionalInformation.deleteMessageId", is(composedMessageId.getMessageId().serialize()));
     }
 
-    @Test
-    void cassandraMigrationShouldComplete() {
-        SchemaVersion toVersion = CassandraSchemaVersionManager.MAX_VERSION;
-        String taskId = with()
-                .body(String.valueOf(toVersion.getValue()))
-            .post("cassandra/version/upgrade")
-                .jsonPath()
-                .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(taskId))
-            .body("type", is("cassandra-migration"))
-            .body("additionalInformation.toVersion", is(toVersion.getValue()));
-    }
-
-    @Test
-    void cassandraMappingsSolveInconsistenciesShouldComplete() {
-        String taskId = with()
-                .basePath(CassandraMappingsRoutes.ROOT_PATH)
-                .queryParam("action", "SolveInconsistencies")
-            .post()
-                .jsonPath()
-                .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(taskId))
-            .body("type", is("cassandra-mappings-solve-inconsistencies"))
-            .body("additionalInformation.successfulMappingsCount", is(0))
-            .body("additionalInformation.errorMappingsCount", is(0));
-    }
-
-    @Test
-    void recomputeMailboxCountersShouldComplete() {
-        String taskId = with()
-                .basePath("/mailboxes")
-                .queryParam("task", "RecomputeMailboxCounters")
-            .post()
-                .jsonPath()
-                .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(taskId))
-            .body("type", is("recompute-mailbox-counters"))
-            .body("additionalInformation.processedMailboxes", is(0));
-    }
-
-    @Test
-    void recomputeCurrentQuotasShouldComplete() {
-        String taskId = with()
-            .basePath("/quota/users")
-            .queryParam("task", "RecomputeCurrentQuotas")
-        .post()
-            .jsonPath()
-            .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(taskId))
-            .body("type", is("recompute-current-quotas"))
-            .body("additionalInformation.processedQuotaRoots", is(0))
-            .body("additionalInformation.failedQuotaRoots", empty());
-    }
-
     private MailboxAdded createMailboxAdded() {
         String uuid = "6e0dd59d-660e-4d9b-b22f-0354479f47b4";
         return EventFactory.mailboxAdded()
@@ -858,25 +667,4 @@ class RabbitMQWebAdminServerTaskSerializationIntegrationTest {
             .mailboxPath(MailboxPath.forUser(Username.of(USERNAME), "Important-mailbox"))
             .build();
     }
-
-    @Test
-    void republishNotProcessedMailsOnSpoolShouldComplete() {
-        String taskId = with()
-            .basePath("/mailQueues/spool")
-            .queryParam("action", "RepublishNotProcessedMails")
-            .queryParam("olderThan", "2d")
-        .post()
-            .jsonPath()
-        .get("taskId");
-
-        given()
-            .basePath(TasksRoutes.BASE)
-        .when()
-            .get(taskId + "/await")
-        .then()
-            .body("status", is("completed"))
-            .body("taskId", is(taskId))
-            .body("type", is("republish-not-processed-mails"))
-            .body("additionalInformation.nbRequeuedMails", is(0));
-    }
 }
diff --git a/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryJwtFilterIntegrationTest.java b/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryJwtFilterIntegrationTest.java
index 770b596..238f366 100644
--- a/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryJwtFilterIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryJwtFilterIntegrationTest.java
@@ -19,6 +19,8 @@
 
 package org.apache.james.webadmin.integration.memory;
 
+import static org.apache.james.JamesServerExtension.Lifecycle.PER_CLASS;
+
 import org.apache.james.JamesServerBuilder;
 import org.apache.james.JamesServerExtension;
 import org.apache.james.MemoryJamesServerMain;
@@ -32,7 +34,6 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 import com.google.inject.name.Names;
 
 class MemoryJwtFilterIntegrationTest extends JwtFilterIntegrationTest {
-
     @RegisterExtension
     static JamesServerExtension jamesServerExtension = new JamesServerBuilder<>(JamesServerBuilder.defaultConfigurationProvider())
         .server(configuration -> MemoryJamesServerMain.createServer(configuration)
@@ -41,5 +42,6 @@ class MemoryJwtFilterIntegrationTest extends JwtFilterIntegrationTest {
             .overrideWith(binder -> binder.bind(JwtTokenVerifier.Factory.class)
                 .annotatedWith(Names.named("webadmin"))
                 .toInstance(() -> JwtTokenVerifier.create(jwtConfiguration()))))
+        .lifeCycle(PER_CLASS)
         .build();
 }
diff --git a/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryJwtFilterIntegrationTest.java b/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryWebAdminServerIntegrationImmutableTest.java
similarity index 69%
copy from server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryJwtFilterIntegrationTest.java
copy to server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryWebAdminServerIntegrationImmutableTest.java
index 770b596..6dafd47 100644
--- a/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryJwtFilterIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/MemoryWebAdminServerIntegrationImmutableTest.java
@@ -19,27 +19,30 @@
 
 package org.apache.james.webadmin.integration.memory;
 
+import static org.apache.james.JamesServerExtension.Lifecycle.PER_CLASS;
+
 import org.apache.james.JamesServerBuilder;
 import org.apache.james.JamesServerExtension;
 import org.apache.james.MemoryJamesServerMain;
-import org.apache.james.jwt.JwtTokenVerifier;
-import org.apache.james.webadmin.authentication.AuthenticationFilter;
-import org.apache.james.webadmin.authentication.JwtFilter;
-import org.apache.james.webadmin.integration.JwtFilterIntegrationTest;
+import org.apache.james.webadmin.RandomPortSupplier;
+import org.apache.james.webadmin.WebAdminConfiguration;
+import org.apache.james.webadmin.integration.WebAdminServerIntegrationImmutableTest;
 import org.apache.james.webadmin.integration.WebadminIntegrationTestModule;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
-import com.google.inject.name.Names;
-
-class MemoryJwtFilterIntegrationTest extends JwtFilterIntegrationTest {
-
+class MemoryWebAdminServerIntegrationImmutableTest extends WebAdminServerIntegrationImmutableTest {
     @RegisterExtension
     static JamesServerExtension jamesServerExtension = new JamesServerBuilder<>(JamesServerBuilder.defaultConfigurationProvider())
         .server(configuration -> MemoryJamesServerMain.createServer(configuration)
             .overrideWith(new WebadminIntegrationTestModule())
-            .overrideWith(binder -> binder.bind(AuthenticationFilter.class).to(JwtFilter.class))
-            .overrideWith(binder -> binder.bind(JwtTokenVerifier.Factory.class)
-                .annotatedWith(Names.named("webadmin"))
-                .toInstance(() -> JwtTokenVerifier.create(jwtConfiguration()))))
+            .overrideWith(binder -> binder.bind(WebAdminConfiguration.class)
+                .toInstance(WebAdminConfiguration.builder()
+                    .enabled()
+                    .corsDisabled()
+                    .host("127.0.0.1")
+                    .port(new RandomPortSupplier())
+                    .additionalRoute("org.apache.james.webadmin.dropwizard.MetricsRoutes")
+                    .build())))
+        .lifeCycle(PER_CLASS)
         .build();
-}
+}
\ No newline at end of file
diff --git a/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/JwtFilterIntegrationTest.java b/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/JwtFilterIntegrationTest.java
index 860c72b..8406aee 100644
--- a/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/JwtFilterIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/JwtFilterIntegrationTest.java
@@ -48,7 +48,9 @@ public abstract class JwtFilterIntegrationTest {
     }
 
     private static final String DOMAIN = "domain";
+    private static final String DOMAIN2 = "other";
     private static final String SPECIFIC_DOMAIN = DomainsRoutes.DOMAINS + SEPARATOR + DOMAIN;
+    private static final String SPECIFIC_DOMAIN2 = DomainsRoutes.DOMAINS + SEPARATOR + DOMAIN2;
     private static final String VALID_TOKEN_ADMIN_TRUE = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbkBvcGVuL" +
         "XBhYXMub3JnIiwiYWRtaW4iOnRydWUsImlhdCI6MTQ4OTAzODQzOH0.rgxCkdWEa-92a4R-72a9Z49k4LRvQDShgci5Y7qWRUP9IGJCK-lMkrHF" +
         "4H0a6L87BYppxVW701zaZ6dNxRMvHnjLBBWnPsC2B0rkkr2hEL2zfz7sb-iNGV-J4ICx97t8-TfQ5rz3VOX0FwdusPL_rJtmlGEGRivPkR6_aBe1" +
@@ -90,12 +92,12 @@ public abstract class JwtFilterIntegrationTest {
         given()
             .header("Authorization", "Bearer " + VALID_TOKEN_ADMIN_FALSE)
         .when()
-            .put(SPECIFIC_DOMAIN)
+            .put(SPECIFIC_DOMAIN2)
         .then()
             .statusCode(HttpStatus.UNAUTHORIZED_401);
 
         assertThat(dataProbe.listDomains())
-            .doesNotContain(DOMAIN);
+            .doesNotContain(DOMAIN2);
     }
 
     @Test
@@ -103,12 +105,11 @@ public abstract class JwtFilterIntegrationTest {
         given()
             .header("Authorization", "Bearer invalid")
         .when()
-            .put(SPECIFIC_DOMAIN)
+            .put(SPECIFIC_DOMAIN2)
         .then()
             .statusCode(HttpStatus.UNAUTHORIZED_401);
 
         assertThat(dataProbe.listDomains())
-            .doesNotContain(DOMAIN);
+            .doesNotContain(DOMAIN2);
     }
-
 }
diff --git a/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationImmutableTest.java b/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationImmutableTest.java
new file mode 100644
index 0000000..219d5ff
--- /dev/null
+++ b/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationImmutableTest.java
@@ -0,0 +1,169 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.webadmin.integration;
+
+import static io.restassured.RestAssured.given;
+import static io.restassured.RestAssured.when;
+import static io.restassured.RestAssured.with;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.is;
+
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.probe.DataProbe;
+import org.apache.james.utils.DataProbeImpl;
+import org.apache.james.utils.WebAdminGuiceProbe;
+import org.apache.james.webadmin.WebAdminUtils;
+import org.apache.james.webadmin.routes.HealthCheckRoutes;
+import org.apache.james.webadmin.routes.MailQueueRoutes;
+import org.apache.james.webadmin.routes.MailRepositoriesRoutes;
+import org.apache.james.webadmin.routes.TasksRoutes;
+import org.apache.james.webadmin.swagger.routes.SwaggerRoutes;
+import org.eclipse.jetty.http.HttpStatus;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import io.restassured.RestAssured;
+
+public abstract class WebAdminServerIntegrationImmutableTest {
+    private static final String DOMAIN = "domain";
+    protected static final String USERNAME = "username@" + DOMAIN;
+
+    @BeforeAll
+    static void setUp(GuiceJamesServer guiceJamesServer) throws Exception {
+        DataProbe dataProbe = guiceJamesServer.getProbe(DataProbeImpl.class);
+        dataProbe.addDomain(DOMAIN);
+        WebAdminGuiceProbe webAdminGuiceProbe = guiceJamesServer.getProbe(WebAdminGuiceProbe.class);
+
+        RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminGuiceProbe.getWebAdminPort())
+            .build();
+    }
+
+    @Test
+    void mailQueueRoutesShouldBeExposed() {
+        when()
+            .get(MailQueueRoutes.BASE_URL)
+        .then()
+            .statusCode(HttpStatus.OK_200)
+            .body("", containsInAnyOrder("spool", "outgoing"));
+    }
+
+    @Test
+    void metricsRoutesShouldBeExposed() {
+        String body = when()
+                .get("/metrics").prettyPeek()
+            .then()
+                .statusCode(HttpStatus.OK_200)
+                .extract()
+                .body()
+                .asString();
+
+        assertThat(body).contains("outgoingMails_total 0.0");
+    }
+
+    @Test
+    void healthCheckShouldReturn200WhenCalledRepeatedly() {
+        given().get(HealthCheckRoutes.HEALTHCHECK);
+        given().get(HealthCheckRoutes.HEALTHCHECK);
+        given().get(HealthCheckRoutes.HEALTHCHECK);
+        given().get(HealthCheckRoutes.HEALTHCHECK);
+        given().get(HealthCheckRoutes.HEALTHCHECK);
+
+        when()
+            .get(HealthCheckRoutes.HEALTHCHECK)
+        .then()
+            .statusCode(HttpStatus.OK_200);
+    }
+
+    @Test
+    void mailRepositoriesRoutesShouldBeExposed() {
+        when()
+            .get(MailRepositoriesRoutes.MAIL_REPOSITORIES)
+        .then()
+            .statusCode(HttpStatus.OK_200)
+            .body("repository", containsInAnyOrder(
+                "var/mail/error",
+                "var/mail/relay-denied",
+                "var/mail/address-error"));
+    }
+
+    @Test
+    void gettingANonExistingMailRepositoryShouldNotCreateIt() {
+        given()
+            .get(MailRepositoriesRoutes.MAIL_REPOSITORIES + "file%3A%2F%2Fvar%2Fmail%2Fcustom");
+
+        when()
+            .get(MailRepositoriesRoutes.MAIL_REPOSITORIES)
+        .then()
+            .statusCode(HttpStatus.OK_200)
+            .body("repository", containsInAnyOrder(
+                "var/mail/error",
+                "var/mail/relay-denied",
+                "var/mail/address-error"));
+    }
+
+    @Test
+    void getSwaggerShouldReturnJsonDataForSwagger() {
+        when()
+            .get(SwaggerRoutes.SWAGGER_ENDPOINT)
+        .then()
+            .statusCode(HttpStatus.OK_200)
+            .body(containsString("\"swagger\":\"2.0\""))
+            .body(containsString("\"info\":{\"description\":\"All the web administration API for JAMES\",\"version\":\"V1.0\",\"title\":\"JAMES Web Admin API\"}"))
+            .body(containsString("\"tags\":[\"User's Mailbox\"]"))
+            .body(containsString("\"tags\":[\"GlobalQuota\"]"))
+            .body(containsString("\"tags\":[\"DomainQuota\"]"))
+            .body(containsString("\"tags\":[\"UserQuota\"]"))
+            .body(containsString("\"tags\":[\"Domains\"]"))
+            .body(containsString("\"tags\":[\"Users\"]"))
+            .body(containsString("\"tags\":[\"MailRepositories\"]"))
+            .body(containsString("\"tags\":[\"MailQueues\"]"))
+            .body(containsString("\"tags\":[\"Address Forwards\"]"))
+            .body(containsString("\"tags\":[\"Address Aliases\"]"))
+            .body(containsString("\"tags\":[\"Address Groups\"]"))
+            .body(containsString("{\"name\":\"Mailboxes\"}"));
+    }
+
+    @Test
+    void validateHealthChecksShouldReturnOk() {
+        when()
+            .get(HealthCheckRoutes.HEALTHCHECK)
+        .then()
+            .statusCode(HttpStatus.OK_200);
+    }
+
+    @Test
+    void jmapTasksShouldBeExposed() {
+        String taskId = with()
+            .queryParam("task", "recomputeFastViewProjectionItems")
+            .post("/mailboxes")
+            .jsonPath()
+            .get("taskId");
+
+        given()
+            .basePath(TasksRoutes.BASE)
+        .when()
+            .get(taskId + "/await")
+        .then()
+            .body("status", is("completed"))
+            .body("type", is("RecomputeAllFastViewProjectionItemsTask"));
+    }
+}
\ No newline at end of file
diff --git a/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java b/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
index 1730a1d..744ca80 100644
--- a/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/webadmin-integration-test-common/src/main/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
@@ -95,6 +95,8 @@ public abstract class WebAdminServerIntegrationTest {
         assertThat(dataProbe.listDomains()).contains(DOMAIN);
     }
 
+
+    // Immutable
     @Test
     void mailQueueRoutesShouldBeExposed() {
         when()
@@ -104,6 +106,8 @@ public abstract class WebAdminServerIntegrationTest {
             .body("", containsInAnyOrder("spool", "outgoing"));
     }
 
+
+    // Immutable
     @Test
     void metricsRoutesShouldBeExposed() {
         String body = when()
@@ -117,6 +121,8 @@ public abstract class WebAdminServerIntegrationTest {
         assertThat(body).contains("outgoingMails_total 0.0");
     }
 
+
+    // Immutable
     @Test
     void healthCheckShouldReturn200WhenCalledRepeatedly() {
         given().get(HealthCheckRoutes.HEALTHCHECK);
@@ -131,6 +137,7 @@ public abstract class WebAdminServerIntegrationTest {
             .statusCode(HttpStatus.OK_200);
     }
 
+    // Immutable
     @Test
     void mailRepositoriesRoutesShouldBeExposed() {
         when()
@@ -143,6 +150,8 @@ public abstract class WebAdminServerIntegrationTest {
                 "var/mail/address-error"));
     }
 
+
+    // Immutable
     @Test
     void gettingANonExistingMailRepositoryShouldNotCreateIt() {
         given()
@@ -301,6 +310,7 @@ public abstract class WebAdminServerIntegrationTest {
         assertThat(members).containsOnly(USERNAME, USERNAME_2);
     }
 
+    // Immutable
     @Test
     void getSwaggerShouldReturnJsonDataForSwagger() {
         when()
@@ -323,6 +333,7 @@ public abstract class WebAdminServerIntegrationTest {
             .body(containsString("{\"name\":\"Mailboxes\"}"));
     }
 
+    // Immutable
     @Test
     void validateHealthChecksShouldReturnOk() {
         when()
@@ -331,6 +342,7 @@ public abstract class WebAdminServerIntegrationTest {
             .statusCode(HttpStatus.OK_200);
     }
 
+    // Immutable
     @Test
     void jmapTasksShouldBeExposed() {
         String taskId = with()


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


[james-project] 10/13: JAMES-3500 Fasten mailbox/elasticsearch tests

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 00ffb12a92cda6ce72d368b05b34e050aec860a8
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 23:55:49 2021 +0700

    JAMES-3500 Fasten mailbox/elasticsearch tests
    
    Fasten tests exercising timeouts on top of a paused docker
    together in order to parallelize them as they each take 30
    seconds + (note that I did not succeed to find where to
    configure this timeout)
    
    This provides an effective 1 minute test speedup.
---
 ...asticSearchListeningMessageSearchIndexTest.java | 98 +++++++++-------------
 1 file changed, 41 insertions(+), 57 deletions(-)

diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java
index 02955a3..b0b8657 100644
--- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java
+++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java
@@ -28,6 +28,8 @@ import java.nio.charset.StandardCharsets;
 import java.time.Duration;
 import java.time.ZoneId;
 import java.util.Date;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
 
 import javax.mail.Flags;
 import javax.mail.util.SharedByteArrayInputStream;
@@ -50,7 +52,6 @@ import org.apache.james.mailbox.elasticsearch.json.MessageToElasticSearchJson;
 import org.apache.james.mailbox.elasticsearch.query.CriterionConverter;
 import org.apache.james.mailbox.elasticsearch.query.QueryConverter;
 import org.apache.james.mailbox.elasticsearch.search.ElasticSearchSearcher;
-import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.extractor.ParsedContent;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.inmemory.InMemoryId;
@@ -93,6 +94,12 @@ class ElasticSearchListeningMessageSearchIndexTest {
     static final ModSeq MOD_SEQ = ModSeq.of(42L);
     static final Username USERNAME = Username.of("user");
     static final MessageUid MESSAGE_UID_1 = MessageUid.of(25);
+    public static final UpdatedFlags UPDATED_FLAGS = UpdatedFlags.builder()
+        .uid(MESSAGE_UID_1)
+        .modSeq(MOD_SEQ)
+        .oldFlags(new Flags())
+        .newFlags(new Flags(Flags.Flag.ANSWERED))
+        .build();
     static final MessageUid MESSAGE_UID_2 = MessageUid.of(26);
     static final MessageUid MESSAGE_UID_3 = MessageUid.of(27);
     static final MessageUid MESSAGE_UID_4 = MessageUid.of(28);
@@ -133,6 +140,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
         .uid(MESSAGE_UID_3)
         .addAttachments(ImmutableList.of(MESSAGE_ATTACHMENT))
         .build();
+    public static final Duration TIMEOUT = Duration.ofSeconds(1);
 
     static class FailingTextExtractor implements TextExtractor {
         @Override
@@ -153,7 +161,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     DockerElasticSearchExtension elasticSearch = new DockerElasticSearchExtension();
 
     @BeforeEach
-    void setup() throws MailboxException, IOException {
+    void setup() throws Exception {
         mapperFactory = new InMemoryMailboxSessionMapperFactory();
 
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
@@ -165,7 +173,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
 
         ReactorElasticSearchClient client = MailboxIndexCreationUtil.prepareDefaultClient(
             elasticSearch.getDockerElasticSearch().clientProvider().get(),
-            elasticSearch.getDockerElasticSearch().configuration());
+            elasticSearch.getDockerElasticSearch().configuration(Optional.of(TIMEOUT)));
 
         elasticSearchSearcher = new ElasticSearchSearcher(client,
             new QueryConverter(new CriterionConverter()),
@@ -190,13 +198,30 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
+    void addDeleteAndUpdateShouldPropagateExceptionWhenExceptionOccurs() throws Exception {
+        elasticSearch.getDockerElasticSearch().pause();
+        Thread.sleep(Duration.ofSeconds(5).toMillis()); // Docker pause is asynchronous and we found no way to poll for it
+
+
+        CompletableFuture<Void> add = testee.add(session, mailbox, MESSAGE_1).toFuture();
+        CompletableFuture<Void> delete = testee.delete(session, mailbox.getMailboxId(), Lists.newArrayList(MESSAGE_UID_1)).toFuture();
+        CompletableFuture<Void> update = testee.update(session, mailbox.getMailboxId(), Lists.newArrayList(UPDATED_FLAGS)).toFuture();
+
+        assertThatThrownBy(add::get).hasCauseInstanceOf(IOException.class);
+        assertThatThrownBy(delete::get).hasCauseInstanceOf(IOException.class);
+        assertThatThrownBy(update::get).hasCauseInstanceOf(IOException.class);
+
+        elasticSearch.getDockerElasticSearch().unpause();
+    }
+
+    @Test
     void deserializeElasticSearchListeningMessageSearchIndexGroup() throws Exception {
         assertThat(Group.deserialize("org.apache.james.mailbox.elasticsearch.events.ElasticSearchListeningMessageSearchIndex$ElasticSearchListeningMessageSearchIndexGroup"))
             .isEqualTo(new ElasticSearchListeningMessageSearchIndex.ElasticSearchListeningMessageSearchIndexGroup());
     }
     
     @Test
-    void addShouldIndexMessageWithoutAttachment() throws Exception {
+    void addShouldIndexMessageWithoutAttachment() {
         testee.add(session, mailbox, MESSAGE_1).block();
         elasticSearch.awaitForElasticSearch();
 
@@ -207,7 +232,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
 
 
     @Test
-    void addShouldIndexMessageWithAttachment() throws Exception {
+    void addShouldIndexMessageWithAttachment() {
         testee.add(session, mailbox, MESSAGE_WITH_ATTACHMENT).block();
         elasticSearch.awaitForElasticSearch();
 
@@ -217,7 +242,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void addShouldBeIndempotent() throws Exception {
+    void addShouldBeIndempotent() {
         testee.add(session, mailbox, MESSAGE_1).block();
         testee.add(session, mailbox, MESSAGE_1).block();
 
@@ -229,7 +254,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void addShouldIndexMultipleMessages() throws Exception {
+    void addShouldIndexMultipleMessages() {
         testee.add(session, mailbox, MESSAGE_1).block();
         testee.add(session, mailbox, MESSAGE_2).block();
 
@@ -241,7 +266,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void addShouldIndexEmailBodyWhenNotIndexableAttachment() throws Exception {
+    void addShouldIndexEmailBodyWhenNotIndexableAttachment() {
         MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson(
             new FailingTextExtractor(),
             ZoneId.of("Europe/Paris"),
@@ -259,18 +284,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void addShouldPropagateExceptionWhenExceptionOccurs() throws Exception {
-        elasticSearch.getDockerElasticSearch().pause();
-        Thread.sleep(Duration.ofSeconds(5).toMillis()); // Docker pause is asynchronous and we found no way to poll for it
-
-        assertThatThrownBy(() -> testee.add(session, mailbox, MESSAGE_1).block())
-            .hasCauseInstanceOf(IOException.class);
-
-        elasticSearch.getDockerElasticSearch().unpause();
-    }
-
-    @Test
-    void deleteShouldRemoveIndex() throws IOException {
+    void deleteShouldRemoveIndex() {
         testee.add(session, mailbox, MESSAGE_1).block();
         elasticSearch.awaitForElasticSearch();
 
@@ -283,7 +297,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void deleteShouldOnlyRemoveIndexesPassedAsArguments() throws IOException {
+    void deleteShouldOnlyRemoveIndexesPassedAsArguments() {
         testee.add(session, mailbox, MESSAGE_1).block();
         testee.add(session, mailbox, MESSAGE_2).block();
 
@@ -298,7 +312,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void deleteShouldRemoveMultipleIndexes() throws IOException {
+    void deleteShouldRemoveMultipleIndexes() {
         testee.add(session, mailbox, MESSAGE_1).block();
         testee.add(session, mailbox, MESSAGE_2).block();
 
@@ -313,7 +327,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void deleteShouldBeIdempotent() throws IOException {
+    void deleteShouldBeIdempotent() {
         testee.add(session, mailbox, MESSAGE_1).block();
         elasticSearch.awaitForElasticSearch();
 
@@ -333,18 +347,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void deleteShouldPropagateExceptionWhenExceptionOccurs() throws Exception {
-        elasticSearch.getDockerElasticSearch().pause();
-        Thread.sleep(Duration.ofSeconds(5).toMillis()); // Docker pause is asynchronous and we found no way to poll for it
-
-        assertThatThrownBy(() -> testee.delete(session, mailbox.getMailboxId(), Lists.newArrayList(MESSAGE_UID_1)).block())
-            .hasCauseInstanceOf(IOException.class);
-
-        elasticSearch.getDockerElasticSearch().unpause();
-    }
-
-    @Test
-    void updateShouldUpdateIndex() throws Exception {
+    void updateShouldUpdateIndex() {
         testee.add(session, mailbox, MESSAGE_1).block();
         elasticSearch.awaitForElasticSearch();
 
@@ -365,7 +368,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void updateShouldNotUpdateNorThrowOnUnknownMessageUid() throws Exception {
+    void updateShouldNotUpdateNorThrowOnUnknownMessageUid() {
         testee.add(session, mailbox, MESSAGE_1).block();
         elasticSearch.awaitForElasticSearch();
 
@@ -386,7 +389,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void updateShouldBeIdempotent() throws Exception {
+    void updateShouldBeIdempotent() {
         testee.add(session, mailbox, MESSAGE_1).block();
         elasticSearch.awaitForElasticSearch();
 
@@ -408,26 +411,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
     }
 
     @Test
-    void updateShouldPropagateExceptionWhenExceptionOccurs() throws Exception {
-        elasticSearch.getDockerElasticSearch().pause();
-        Thread.sleep(Duration.ofSeconds(5).toMillis()); // Docker pause is asynchronous and we found no way to poll for it
-
-        Flags newFlags = new Flags(Flags.Flag.ANSWERED);
-        UpdatedFlags updatedFlags = UpdatedFlags.builder()
-            .uid(MESSAGE_UID_1)
-            .modSeq(MOD_SEQ)
-            .oldFlags(new Flags())
-            .newFlags(newFlags)
-            .build();
-
-        assertThatThrownBy(() -> testee.update(session, mailbox.getMailboxId(), Lists.newArrayList(updatedFlags)).block())
-            .hasCauseInstanceOf(IOException.class);
-
-        elasticSearch.getDockerElasticSearch().unpause();
-    }
-
-    @Test
-    void deleteAllShouldRemoveAllIndexes() throws Exception {
+    void deleteAllShouldRemoveAllIndexes() {
         testee.add(session, mailbox, MESSAGE_1).block();
         testee.add(session, mailbox, MESSAGE_2).block();
 


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


[james-project] 04/13: JAMES-3500 Group assertions for 1 minute+ tests

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1ecbeeb1f2b88c0aeda57b6afc6d755da776b084
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 16:28:59 2021 +0700

    JAMES-3500 Group assertions for 1 minute+ tests
---
 .../RabbitMQReindexingWithEventDeadLettersTest.java         | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java
index c3a4cf6..b99a6fa 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java
@@ -142,7 +142,7 @@ class RabbitMQReindexingWithEventDeadLettersTest {
     }
 
     @Test
-    void redeliverShouldReIndexFailedMessages() throws Exception {
+    void redeliverShouldReIndexFailedMessagesAndCleanEventDeadLetter() throws Exception {
         aliceSavesADraft();
         CALMLY_AWAIT.until(() -> listElasticSearchFailedEvents().size() == 1);
 
@@ -150,17 +150,6 @@ class RabbitMQReindexingWithEventDeadLettersTest {
         redeliverAllFailedEvents();
 
         CALMLY_AWAIT.until(() -> listMessageIdsForAccount(aliceAccessToken).size() == 1);
-    }
-
-    @Test
-    void redeliverShouldCleanEventDeadLetter() throws Exception {
-        aliceSavesADraft();
-        CALMLY_AWAIT.until(() -> listElasticSearchFailedEvents().size() == 1);
-
-        unpauseElasticSearch();
-        redeliverAllFailedEvents();
-        CALMLY_AWAIT.until(() -> listMessageIdsForAccount(aliceAccessToken).size() == 1);
-
         assertThat(listElasticSearchFailedEvents()).isEmpty();
     }
 


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


[james-project] 08/13: JAMES-3500 Leverage PER_CLASS James server test lifecycle where possible

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4d7223c68e00c426846b663ba11e1107c889ddbf
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 16:44:41 2021 +0700

    JAMES-3500 Leverage PER_CLASS James server test lifecycle where possible
---
 .../java/org/apache/james/CassandraCacheQueryTest.java   | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/server/container/guice/cassandra-rabbitmq-guice/src/test/java/org/apache/james/CassandraCacheQueryTest.java b/server/container/guice/cassandra-rabbitmq-guice/src/test/java/org/apache/james/CassandraCacheQueryTest.java
index bd92057..a9cd178 100644
--- a/server/container/guice/cassandra-rabbitmq-guice/src/test/java/org/apache/james/CassandraCacheQueryTest.java
+++ b/server/container/guice/cassandra-rabbitmq-guice/src/test/java/org/apache/james/CassandraCacheQueryTest.java
@@ -47,7 +47,7 @@ import org.apache.james.utils.TestIMAPClient;
 import org.apache.mailet.base.test.FakeMail;
 import org.awaitility.Awaitility;
 import org.awaitility.core.ConditionFactory;
-import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -97,7 +97,7 @@ class CassandraCacheQueryTest {
 
     @RegisterExtension
     static JamesServerExtension jamesServerExtension = WithCacheImmutableTest.baseExtensionBuilder()
-        .lifeCycle(JamesServerExtension.Lifecycle.PER_TEST)
+        .lifeCycle(JamesServerExtension.Lifecycle.PER_CLASS)
         .overrideServerModule(new TestingSessionModule())
         .build();
 
@@ -113,11 +113,11 @@ class CassandraCacheQueryTest {
         .and().pollDelay(ONE_HUNDRED_MILLISECONDS)
         .await();
 
-    private StatementRecorder statementRecorder;
+    private static StatementRecorder statementRecorder;
 
-    @BeforeEach
-    void beforeEach(GuiceJamesServer server) throws Exception {
-        this.statementRecorder = new StatementRecorder();
+    @BeforeAll
+    static void beforeEach(GuiceJamesServer server) throws Exception {
+        statementRecorder = new StatementRecorder();
         server.getProbe(DataProbeImpl.class).fluent()
             .addDomain(DOMAIN)
             .addUser(JAMES_USER, PASSWORD);
@@ -145,7 +145,7 @@ class CassandraCacheQueryTest {
             .isNotEmpty();
     }
 
-    private void readAMail(GuiceJamesServer server) throws IOException {
+    private static void readAMail(GuiceJamesServer server) throws IOException {
         try (TestIMAPClient reader = new TestIMAPClient()) {
             int imapPort = server.getProbe(ImapGuiceProbe.class).getImapPort();
             reader.connect(JAMES_SERVER_HOST, imapPort)
@@ -158,7 +158,7 @@ class CassandraCacheQueryTest {
         }
     }
 
-    private void sendAMail(GuiceJamesServer server) throws IOException, MessagingException {
+    private static void sendAMail(GuiceJamesServer server) throws IOException, MessagingException {
         Port smtpPort = server.getProbe(SmtpGuiceProbe.class).getSmtpPort();
         try (SMTPMessageSender sender = new SMTPMessageSender(Domain.LOCALHOST.asString())) {
             sender.connect(JAMES_SERVER_HOST, smtpPort);


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