james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [10/13] james-project git commit: JAMES-2544 Use CassandraCluster extension where applicable
Date Fri, 14 Sep 2018 03:19:34 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraIndexTableHandlerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraIndexTableHandlerTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraIndexTableHandlerTest.java
index ca9f314..e504e61 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraIndexTableHandlerTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraIndexTableHandlerTest.java
@@ -28,7 +28,7 @@ import java.util.Optional;
 import javax.mail.Flags;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.backends.cassandra.components.CassandraModule;
 import org.apache.james.mailbox.FlagsBuilder;
 import org.apache.james.mailbox.MessageUid;
@@ -47,12 +47,9 @@ import org.apache.james.mailbox.model.UpdatedFlags;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import com.github.steveash.guavate.Guavate;
 
@@ -64,8 +61,14 @@ public class CassandraIndexTableHandlerTest {
     public static final int UID_VALIDITY = 15;
     public static final long MODSEQ = 17;
 
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-    private static CassandraCluster cassandra;
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(
+        CassandraModule.aggregateModules(
+            CassandraMailboxCounterModule.MODULE,
+            CassandraMailboxRecentsModule.MODULE,
+            CassandraFirstUnseenModule.MODULE,
+            CassandraApplicableFlagsModule.MODULE,
+            CassandraDeletedMessageModule.MODULE));
 
     private CassandraMailboxCounterDAO mailboxCounterDAO;
     private CassandraMailboxRecentsDAO mailboxRecentsDAO;
@@ -75,19 +78,8 @@ public class CassandraIndexTableHandlerTest {
     private CassandraDeletedMessageDAO deletedMessageDAO;
     private Mailbox mailbox;
 
-    @BeforeClass
-    public static void setUpClass() {
-        CassandraModule modules = CassandraModule.aggregateModules(
-            CassandraMailboxCounterModule.MODULE,
-            CassandraMailboxRecentsModule.MODULE,
-            CassandraFirstUnseenModule.MODULE,
-            CassandraApplicableFlagsModule.MODULE,
-            CassandraDeletedMessageModule.MODULE);
-        cassandra = CassandraCluster.create(modules, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         mailboxCounterDAO = new CassandraMailboxCounterDAO(cassandra.getConf());
         mailboxRecentsDAO = new CassandraMailboxRecentsDAO(cassandra.getConf());
         firstUnseenDAO = new CassandraFirstUnseenDAO(cassandra.getConf());
@@ -105,18 +97,8 @@ public class CassandraIndexTableHandlerTest {
             MAILBOX_ID);
     }
 
-    @After
-    public void tearDown() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
-
     @Test
-    public void updateIndexOnAddShouldIncrementMessageCount() throws Exception {
+    void updateIndexOnAddShouldIncrementMessageCount() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -129,7 +111,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnAddShouldIncrementUnseenMessageCountWhenUnseen() throws Exception {
+    void updateIndexOnAddShouldIncrementUnseenMessageCountWhenUnseen() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -142,7 +124,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnAddShouldNotIncrementUnseenMessageCountWhenSeen() throws Exception {
+    void updateIndexOnAddShouldNotIncrementUnseenMessageCountWhenSeen() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.SEEN));
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -155,7 +137,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnAddShouldNotAddRecentWhenNoRecent() throws Exception {
+    void updateIndexOnAddShouldNotAddRecentWhenNoRecent() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -168,7 +150,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnAddShouldAddRecentWhenRecent() throws Exception {
+    void updateIndexOnAddShouldAddRecentWhenRecent() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.RECENT));
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -181,7 +163,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnDeleteShouldDecrementMessageCount() throws Exception {
+    void updateIndexOnDeleteShouldDecrementMessageCount() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -199,7 +181,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnDeleteShouldDecrementUnseenMessageCountWhenUnseen() throws Exception {
+    void updateIndexOnDeleteShouldDecrementUnseenMessageCountWhenUnseen() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -217,7 +199,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnDeleteShouldNotDecrementUnseenMessageCountWhenSeen() throws Exception {
+    void updateIndexOnDeleteShouldNotDecrementUnseenMessageCountWhenSeen() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -235,7 +217,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnDeleteShouldRemoveRecentWhenRecent() throws Exception {
+    void updateIndexOnDeleteShouldRemoveRecentWhenRecent() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.RECENT));
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -253,7 +235,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnDeleteShouldRemoveUidFromRecentAnyway() throws Exception {
+    void updateIndexOnDeleteShouldRemoveUidFromRecentAnyway() {
         // Clean up strategy if some flags updates missed
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.RECENT));
@@ -272,7 +254,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnDeleteShouldDeleteMessageFromDeletedMessage() throws Exception {
+    void updateIndexOnDeleteShouldDeleteMessageFromDeletedMessage() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.getUid()).thenReturn(MESSAGE_UID);
         deletedMessageDAO.addDeleted(MAILBOX_ID, MESSAGE_UID).join();
@@ -292,7 +274,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldNotChangeMessageCount() throws Exception {
+    void updateIndexOnFlagsUpdateShouldNotChangeMessageCount() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -311,7 +293,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldDecrementUnseenMessageCountWhenSeenIsSet() throws Exception {
+    void updateIndexOnFlagsUpdateShouldDecrementUnseenMessageCountWhenSeenIsSet() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -330,7 +312,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldSaveMessageInDeletedMessageWhenDeletedFlagIsSet() throws Exception {
+    void updateIndexOnFlagsUpdateShouldSaveMessageInDeletedMessageWhenDeletedFlagIsSet() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -352,7 +334,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldRemoveMessageInDeletedMessageWhenDeletedFlagIsUnset() throws Exception {
+    void updateIndexOnFlagsUpdateShouldRemoveMessageInDeletedMessageWhenDeletedFlagIsUnset() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -376,7 +358,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldNotRemoveMessageInDeletedMessageWhenDeletedFlagIsNotUnset() throws Exception {
+    void updateIndexOnFlagsUpdateShouldNotRemoveMessageInDeletedMessageWhenDeletedFlagIsNotUnset() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -400,7 +382,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldNotSaveMessageInDeletedMessageWhenDeletedFlagIsNotSet() throws Exception {
+    void updateIndexOnFlagsUpdateShouldNotSaveMessageInDeletedMessageWhenDeletedFlagIsNotSet() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -422,7 +404,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldIncrementUnseenMessageCountWhenSeenIsUnset() throws Exception {
+    void updateIndexOnFlagsUpdateShouldIncrementUnseenMessageCountWhenSeenIsUnset() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.SEEN));
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -441,7 +423,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldNotChangeUnseenCountWhenBothSeen() throws Exception {
+    void updateIndexOnFlagsUpdateShouldNotChangeUnseenCountWhenBothSeen() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.SEEN));
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -460,7 +442,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldNotChangeUnseenCountWhenBothUnSeen() throws Exception {
+    void updateIndexOnFlagsUpdateShouldNotChangeUnseenCountWhenBothUnSeen() throws Exception {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -479,7 +461,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldAddRecentOnSettingRecentFlag() throws Exception {
+    void updateIndexOnFlagsUpdateShouldAddRecentOnSettingRecentFlag() {
         // Clean up strategy if some flags updates missed
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
@@ -499,7 +481,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldRemoveRecentOnUnsettingRecentFlag() throws Exception {
+    void updateIndexOnFlagsUpdateShouldRemoveRecentOnUnsettingRecentFlag() {
         // Clean up strategy if some flags updates missed
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.RECENT));
@@ -519,7 +501,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnAddShouldUpdateFirstUnseenWhenUnseen() throws Exception {
+    void updateIndexOnAddShouldUpdateFirstUnseenWhenUnseen() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -531,7 +513,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnAddShouldSaveMessageInDeletedWhenDeleted() throws Exception {
+    void updateIndexOnAddShouldSaveMessageInDeletedWhenDeleted() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.DELETED));
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -546,7 +528,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnAddShouldNotSaveMessageInDeletedWhenNotDeleted() throws Exception {
+    void updateIndexOnAddShouldNotSaveMessageInDeletedWhenNotDeleted() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -561,7 +543,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnAddShouldNotUpdateFirstUnseenWhenSeen() throws Exception {
+    void updateIndexOnAddShouldNotUpdateFirstUnseenWhenSeen() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.SEEN));
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -572,7 +554,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldUpdateLastUnseenWhenSetToSeen() throws Exception {
+    void updateIndexOnFlagsUpdateShouldUpdateLastUnseenWhenSetToSeen() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -590,7 +572,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldUpdateLastUnseenWhenSetToUnseen() throws Exception {
+    void updateIndexOnFlagsUpdateShouldUpdateLastUnseenWhenSetToUnseen() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.SEEN));
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -609,7 +591,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldNotUpdateLastUnseenWhenKeepUnseen() throws Exception {
+    void updateIndexOnFlagsUpdateShouldNotUpdateLastUnseenWhenKeepUnseen() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -628,7 +610,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldNotUpdateLastUnseenWhenKeepSeen() throws Exception {
+    void updateIndexOnFlagsUpdateShouldNotUpdateLastUnseenWhenKeepSeen() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags(Flags.Flag.SEEN));
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -646,7 +628,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnDeleteShouldUpdateFirstUnseenWhenUnseen() throws Exception {
+    void updateIndexOnDeleteShouldUpdateFirstUnseenWhenUnseen() {
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(new Flags());
         when(message.getUid()).thenReturn(MESSAGE_UID);
@@ -662,7 +644,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnAddShouldUpdateApplicableFlag() throws Exception {
+    void updateIndexOnAddShouldUpdateApplicableFlag() {
         Flags customFlags = new Flags("custom");
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(customFlags);
@@ -675,7 +657,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void updateIndexOnFlagsUpdateShouldUnionApplicableFlag() throws Exception {
+    void updateIndexOnFlagsUpdateShouldUnionApplicableFlag() {
         Flags customFlag = new Flags("custom");
         MailboxMessage message = mock(MailboxMessage.class);
         when(message.createFlags()).thenReturn(customFlag);
@@ -696,7 +678,7 @@ public class CassandraIndexTableHandlerTest {
     }
 
     @Test
-    public void applicableFlagShouldKeepAllFlagsEvenTheMessageRemovesFlag() throws Exception {
+    void applicableFlagShouldKeepAllFlagsEvenTheMessageRemovesFlag() {
         Flags messageFlags = FlagsBuilder.builder()
             .add("custom1", "custom2", "custom3")
             .build();

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxCounterDAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxCounterDAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxCounterDAOTest.java
index fb14a1e..6292f98 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxCounterDAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxCounterDAOTest.java
@@ -22,81 +22,64 @@ package org.apache.james.mailbox.cassandra.mail;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.mailbox.cassandra.ids.CassandraId;
 import org.apache.james.mailbox.cassandra.modules.CassandraMailboxCounterModule;
 import org.apache.james.mailbox.model.MailboxCounters;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-public class CassandraMailboxCounterDAOTest {
-    public static final int UID_VALIDITY = 15;
-    public static final CassandraId MAILBOX_ID = CassandraId.timeBased();
-
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-    private static CassandraCluster cassandra;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+class CassandraMailboxCounterDAOTest {
+    private static final int UID_VALIDITY = 15;
+    private static final CassandraId MAILBOX_ID = CassandraId.timeBased();
+
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMailboxCounterModule.MODULE);
+
     private CassandraMailboxCounterDAO testee;
     private SimpleMailbox mailbox;
 
-    @BeforeClass
-    public static void setUpClass() {
-        cassandra = CassandraCluster.create(CassandraMailboxCounterModule.MODULE, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         testee = new CassandraMailboxCounterDAO(cassandra.getConf());
 
         mailbox = new SimpleMailbox(MailboxPath.forUser("user", "name"), UID_VALIDITY, MAILBOX_ID);
     }
 
-    @After
-    public void tearDown() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
-
     @Test
-    public void countMessagesInMailboxShouldReturnEmptyByDefault() throws Exception {
+    void countMessagesInMailboxShouldReturnEmptyByDefault() throws Exception {
         assertThat(testee.countMessagesInMailbox(mailbox).join()).isEmpty();
     }
 
     @Test
-    public void countUnseenMessagesInMailboxShouldReturnEmptyByDefault() throws Exception {
+    void countUnseenMessagesInMailboxShouldReturnEmptyByDefault() throws Exception {
         assertThat(testee.countUnseenMessagesInMailbox(mailbox).join()).isEmpty();
     }
 
     @Test
-    public void retrieveMailboxCounterShouldReturnEmptyByDefault() throws Exception {
+    void retrieveMailboxCounterShouldReturnEmptyByDefault() throws Exception {
         assertThat(testee.retrieveMailboxCounters(mailbox).join()).isEmpty();
     }
 
     @Test
-    public void incrementCountShouldAddOneWhenAbsent() throws Exception {
+    void incrementCountShouldAddOneWhenAbsent() throws Exception {
         testee.incrementCount(MAILBOX_ID).join();
 
         assertThat(testee.countMessagesInMailbox(mailbox).join()).contains(1L);
     }
 
     @Test
-    public void incrementUnseenShouldAddOneWhenAbsent() throws Exception {
+    void incrementUnseenShouldAddOneWhenAbsent() throws Exception {
         testee.incrementUnseen(MAILBOX_ID).join();
 
         assertThat(testee.countUnseenMessagesInMailbox(mailbox).join()).contains(1L);
     }
 
     @Test
-    public void incrementUnseenShouldAddOneWhenAbsentOnMailboxCounters() throws Exception {
+    void incrementUnseenShouldAddOneWhenAbsentOnMailboxCounters() throws Exception {
         testee.incrementUnseen(MAILBOX_ID).join();
 
         assertThat(testee.retrieveMailboxCounters(mailbox).join())
@@ -107,7 +90,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void incrementCountShouldAddOneWhenAbsentOnMailboxCounters() throws Exception {
+    void incrementCountShouldAddOneWhenAbsentOnMailboxCounters() throws Exception {
         testee.incrementCount(MAILBOX_ID).join();
 
         assertThat(testee.retrieveMailboxCounters(mailbox).join())
@@ -118,7 +101,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void retrieveMailboxCounterShouldWorkWhenFullRow() throws Exception {
+    void retrieveMailboxCounterShouldWorkWhenFullRow() throws Exception {
         testee.incrementCount(MAILBOX_ID).join();
         testee.incrementUnseen(MAILBOX_ID).join();
 
@@ -130,7 +113,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void decrementCountShouldRemoveOne() throws Exception {
+    void decrementCountShouldRemoveOne() throws Exception {
         testee.incrementCount(MAILBOX_ID).join();
 
         testee.decrementCount(MAILBOX_ID).join();
@@ -140,7 +123,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void decrementUnseenShouldRemoveOne() throws Exception {
+    void decrementUnseenShouldRemoveOne() throws Exception {
         testee.incrementUnseen(MAILBOX_ID).join();
 
         testee.decrementUnseen(MAILBOX_ID).join();
@@ -150,7 +133,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void incrementUnseenShouldHaveNoImpactOnMessageCount() throws Exception {
+    void incrementUnseenShouldHaveNoImpactOnMessageCount() throws Exception {
         testee.incrementUnseen(MAILBOX_ID).join();
 
         assertThat(testee.countMessagesInMailbox(mailbox).join())
@@ -158,7 +141,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void incrementCountShouldHaveNoEffectOnUnseenCount() throws Exception {
+    void incrementCountShouldHaveNoEffectOnUnseenCount() throws Exception {
         testee.incrementCount(MAILBOX_ID).join();
 
         assertThat(testee.countUnseenMessagesInMailbox(mailbox).join())
@@ -166,7 +149,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void decrementUnseenShouldHaveNoEffectOnMessageCount() throws Exception {
+    void decrementUnseenShouldHaveNoEffectOnMessageCount() throws Exception {
         testee.incrementCount(MAILBOX_ID).join();
 
         testee.decrementUnseen(MAILBOX_ID).join();
@@ -176,7 +159,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void decrementCountShouldHaveNoEffectOnUnseenCount() throws Exception {
+    void decrementCountShouldHaveNoEffectOnUnseenCount() throws Exception {
         testee.incrementUnseen(MAILBOX_ID).join();
 
         testee.decrementCount(MAILBOX_ID).join();
@@ -186,7 +169,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void decrementCountCanLeadToNegativeValue() throws Exception {
+    void decrementCountCanLeadToNegativeValue() throws Exception {
         testee.decrementCount(MAILBOX_ID).join();
 
         assertThat(testee.countMessagesInMailbox(mailbox).join())
@@ -194,7 +177,7 @@ public class CassandraMailboxCounterDAOTest {
     }
 
     @Test
-    public void decrementUnseenCanLeadToNegativeValue() throws Exception {
+    void decrementUnseenCanLeadToNegativeValue() throws Exception {
         testee.decrementUnseen(MAILBOX_ID).join();
 
         assertThat(testee.countUnseenMessagesInMailbox(mailbox).join())

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxDAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxDAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxDAOTest.java
index 6844f5e..09dc1ee 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxDAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxDAOTest.java
@@ -25,45 +25,39 @@ import java.util.List;
 import java.util.Optional;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.backends.cassandra.components.CassandraModule;
 import org.apache.james.mailbox.cassandra.ids.CassandraId;
 import org.apache.james.mailbox.cassandra.modules.CassandraAclModule;
 import org.apache.james.mailbox.cassandra.modules.CassandraMailboxModule;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import com.github.steveash.guavate.Guavate;
 
-public class CassandraMailboxDAOTest {
+class CassandraMailboxDAOTest {
+    private static final int UID_VALIDITY_1 = 145;
+    private static final int UID_VALIDITY_2 = 147;
+    private static final MailboxPath NEW_MAILBOX_PATH = MailboxPath.forUser("user", "xyz");
+    private static CassandraId CASSANDRA_ID_1 = CassandraId.timeBased();
+    private static CassandraId CASSANDRA_ID_2 = CassandraId.timeBased();
 
-    public static final int UID_VALIDITY_1 = 145;
-    public static final int UID_VALIDITY_2 = 147;
-    public static final MailboxPath NEW_MAILBOX_PATH = MailboxPath.forUser("user", "xyz");
-    public static CassandraId CASSANDRA_ID_1 = CassandraId.timeBased();
-    public static CassandraId CASSANDRA_ID_2 = CassandraId.timeBased();
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(
+        CassandraModule.aggregateModules(
+            CassandraMailboxModule.MODULE,
+            CassandraAclModule.MODULE));
 
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-    private static CassandraCluster cassandra;
 
     private CassandraMailboxDAO testee;
     private SimpleMailbox mailbox1;
     private SimpleMailbox mailbox2;
 
-    @BeforeClass
-    public static void setUpClass() {
-        CassandraModule modules = CassandraModule.aggregateModules(CassandraMailboxModule.MODULE, CassandraAclModule.MODULE);
-        cassandra = CassandraCluster.create(modules, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         testee = new CassandraMailboxDAO(cassandra.getConf(), cassandra.getTypesProvider());
 
         mailbox1 = new SimpleMailbox(MailboxPath.forUser("user", "abcd"),
@@ -74,24 +68,14 @@ public class CassandraMailboxDAOTest {
             CASSANDRA_ID_2);
     }
 
-    @After
-    public void tearDown() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
-
     @Test
-    public void retrieveMailboxShouldReturnEmptyWhenNone() {
+    void retrieveMailboxShouldReturnEmptyWhenNone() {
         assertThat(testee.retrieveMailbox(CASSANDRA_ID_1).join())
             .isEmpty();
     }
 
     @Test
-    public void saveShouldAddAMailbox() {
+    void saveShouldAddAMailbox() {
         testee.save(mailbox1).join();
 
         Optional<SimpleMailbox> readMailbox = testee.retrieveMailbox(CASSANDRA_ID_1)
@@ -101,7 +85,7 @@ public class CassandraMailboxDAOTest {
     }
 
     @Test
-    public void saveShouldOverride() {
+    void saveShouldOverride() {
         testee.save(mailbox1).join();
 
         mailbox2.setMailboxId(CASSANDRA_ID_1);
@@ -115,7 +99,7 @@ public class CassandraMailboxDAOTest {
     }
 
     @Test
-    public void retrieveAllMailboxesShouldBeEmptyByDefault() {
+    void retrieveAllMailboxesShouldBeEmptyByDefault() {
         List<SimpleMailbox> mailboxes = testee.retrieveAllMailboxes()
             .join()
             .collect(Guavate.toImmutableList());
@@ -124,7 +108,7 @@ public class CassandraMailboxDAOTest {
     }
 
     @Test
-    public void retrieveAllMailboxesShouldReturnSingleMailbox() {
+    void retrieveAllMailboxesShouldReturnSingleMailbox() {
         testee.save(mailbox1).join();
 
         List<SimpleMailbox> mailboxes = testee.retrieveAllMailboxes()
@@ -135,7 +119,7 @@ public class CassandraMailboxDAOTest {
     }
 
     @Test
-    public void retrieveAllMailboxesShouldReturnMultiMailboxes() {
+    void retrieveAllMailboxesShouldReturnMultiMailboxes() {
         testee.save(mailbox1).join();
         testee.save(mailbox2).join();
 
@@ -147,12 +131,12 @@ public class CassandraMailboxDAOTest {
     }
 
     @Test
-    public void deleteShouldNotFailWhenMailboxIsAbsent() {
+    void deleteShouldNotFailWhenMailboxIsAbsent() {
         testee.delete(CASSANDRA_ID_1).join();
     }
 
     @Test
-    public void deleteShouldRemoveExistingMailbox() {
+    void deleteShouldRemoveExistingMailbox() {
         testee.save(mailbox1).join();
 
         testee.delete(CASSANDRA_ID_1).join();
@@ -162,12 +146,12 @@ public class CassandraMailboxDAOTest {
     }
 
     @Test
-    public void updateShouldNotFailWhenMailboxIsAbsent() {
+    void updateShouldNotFailWhenMailboxIsAbsent() {
         testee.updatePath(CASSANDRA_ID_1, NEW_MAILBOX_PATH).join();
     }
 
     @Test
-    public void updateShouldChangeMailboxPath() {
+    void updateShouldChangeMailboxPath() {
         testee.save(mailbox1).join();
 
         testee.updatePath(CASSANDRA_ID_1, NEW_MAILBOX_PATH).join();

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java
index ef7b1b1..b4f8090 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java
@@ -25,7 +25,7 @@ import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.backends.cassandra.components.CassandraModule;
 import org.apache.james.mailbox.cassandra.mail.utils.GuiceUtils;
 import org.apache.james.mailbox.cassandra.modules.CassandraAclModule;
@@ -34,50 +34,33 @@ import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 import org.apache.james.util.concurrency.ConcurrentTestRunner;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
-public class CassandraMailboxMapperConcurrencyTest {
+class CassandraMailboxMapperConcurrencyTest {
 
     private static final int UID_VALIDITY = 52;
     private static final MailboxPath MAILBOX_PATH = MailboxPath.forUser("user", "name");
     private static final int THREAD_COUNT = 10;
     private static final int OPERATION_COUNT = 10;
 
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-
-    private static CassandraCluster cassandra;
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(
+        CassandraModule.aggregateModules(
+            CassandraMailboxModule.MODULE,
+            CassandraAclModule.MODULE));
 
     private CassandraMailboxMapper testee;
 
-    @BeforeClass
-    public static void setUpClass() {
-        CassandraModule modules = CassandraModule.aggregateModules(CassandraMailboxModule.MODULE, CassandraAclModule.MODULE);
-        cassandra = CassandraCluster.create(modules, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         testee = GuiceUtils.testInjector(cassandra)
             .getInstance(CassandraMailboxMapper.class);
     }
 
-    @After
-    public void tearDown() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
-
     @Test
-    public void saveShouldBeThreadSafe() throws Exception {
+    void saveShouldBeThreadSafe() throws Exception {
         boolean termination = ConcurrentTestRunner.builder()
             .threadCount(THREAD_COUNT)
             .operationCount(OPERATION_COUNT)
@@ -90,7 +73,7 @@ public class CassandraMailboxMapperConcurrencyTest {
     }
 
     @Test
-    public void saveWithUpdateShouldBeThreadSafe() throws Exception {
+    void saveWithUpdateShouldBeThreadSafe() throws Exception {
         SimpleMailbox mailbox = new SimpleMailbox(MAILBOX_PATH, UID_VALIDITY);
         testee.save(mailbox);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOImplTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOImplTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOImplTest.java
index d1ab133..429b8af 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOImplTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOImplTest.java
@@ -21,19 +21,20 @@ package org.apache.james.mailbox.cassandra.mail;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import org.junit.Test;
+import org.apache.james.backends.cassandra.CassandraCluster;
+import org.junit.jupiter.api.Test;
 
 import com.github.steveash.guavate.Guavate;
 
-public class CassandraMailboxPathDAOImplTest extends CassandraMailboxPathDAOTest {
+class CassandraMailboxPathDAOImplTest extends CassandraMailboxPathDAOTest {
 
     @Override
-    CassandraMailboxPathDAO testee() {
+    CassandraMailboxPathDAO testee(CassandraCluster cassandra) {
         return new CassandraMailboxPathDAOImpl(cassandra.getConf(), cassandra.getTypesProvider());
     }
 
     @Test
-    public void countAllShouldReturnEntryCount() {
+    void countAllShouldReturnEntryCount() {
         testee.save(USER_INBOX_MAILBOXPATH, INBOX_ID).join();
         testee.save(USER_OUTBOX_MAILBOXPATH, OUTBOX_ID).join();
         testee.save(OTHER_USER_MAILBOXPATH, otherMailboxId).join();
@@ -45,7 +46,7 @@ public class CassandraMailboxPathDAOImplTest extends CassandraMailboxPathDAOTest
     }
 
     @Test
-    public void countAllShouldReturnZeroByDefault() {
+    void countAllShouldReturnZeroByDefault() {
         CassandraMailboxPathDAOImpl daoV1 = (CassandraMailboxPathDAOImpl) testee;
 
         assertThat(daoV1.countAll().join())
@@ -53,7 +54,7 @@ public class CassandraMailboxPathDAOImplTest extends CassandraMailboxPathDAOTest
     }
 
     @Test
-    public void readAllShouldReturnAllStoredData() {
+    void readAllShouldReturnAllStoredData() {
         testee.save(USER_INBOX_MAILBOXPATH, INBOX_ID).join();
         testee.save(USER_OUTBOX_MAILBOXPATH, OUTBOX_ID).join();
         testee.save(OTHER_USER_MAILBOXPATH, otherMailboxId).join();
@@ -68,7 +69,7 @@ public class CassandraMailboxPathDAOImplTest extends CassandraMailboxPathDAOTest
     }
 
     @Test
-    public void readAllShouldReturnEmptyByDefault() {
+    void readAllShouldReturnEmptyByDefault() {
         CassandraMailboxPathDAOImpl daoV1 = (CassandraMailboxPathDAOImpl) testee;
 
         assertThat(daoV1.readAll().join().collect(Guavate.toImmutableList()))

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOTest.java
index db054cd..2071b0f 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathDAOTest.java
@@ -24,16 +24,13 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.util.List;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.mailbox.cassandra.ids.CassandraId;
 import org.apache.james.mailbox.cassandra.modules.CassandraMailboxModule;
 import org.apache.james.mailbox.model.MailboxPath;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import com.github.steveash.guavate.Guavate;
 
@@ -51,41 +48,25 @@ public abstract class CassandraMailboxPathDAOTest {
     public static final MailboxPath USER_OUTBOX_MAILBOXPATH = MailboxPath.forUser(USER, "OUTBOX");
     public static final MailboxPath OTHER_USER_MAILBOXPATH = MailboxPath.forUser(OTHER_USER, "INBOX");
 
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-
-    protected static CassandraCluster cassandra;
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMailboxModule.MODULE);
 
     protected CassandraMailboxPathDAO testee;
 
-    abstract CassandraMailboxPathDAO testee();
-
-    @BeforeClass
-    public static void setUpClass() {
-        cassandra = CassandraCluster.create(CassandraMailboxModule.MODULE, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        testee = testee();
-    }
-
-    @After
-    public void tearDown() {
-        cassandra.clearTables();
-    }
+    abstract CassandraMailboxPathDAO testee(CassandraCluster cassandra);
 
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
+        testee = testee(cassandra);
     }
 
     @Test
-    public void cassandraIdAndPathShouldRespectBeanContract() {
+    void cassandraIdAndPathShouldRespectBeanContract() {
         EqualsVerifier.forClass(CassandraIdAndPath.class).verify();
     }
 
     @Test
-    public void saveShouldInsertNewEntry() {
+    void saveShouldInsertNewEntry() {
         assertThat(testee.save(USER_INBOX_MAILBOXPATH, INBOX_ID).join()).isTrue();
 
         assertThat(testee.retrieveId(USER_INBOX_MAILBOXPATH).join())
@@ -93,20 +74,20 @@ public abstract class CassandraMailboxPathDAOTest {
     }
 
     @Test
-    public void saveOnSecondShouldBeFalse() {
+    void saveOnSecondShouldBeFalse() {
         assertThat(testee.save(USER_INBOX_MAILBOXPATH, INBOX_ID).join()).isTrue();
         assertThat(testee.save(USER_INBOX_MAILBOXPATH, INBOX_ID).join()).isFalse();
     }
 
     @Test
-    public void retrieveIdShouldReturnEmptyWhenEmptyData() {
+    void retrieveIdShouldReturnEmptyWhenEmptyData() {
         assertThat(testee.retrieveId(USER_INBOX_MAILBOXPATH).join()
             .isPresent())
             .isFalse();
     }
 
     @Test
-    public void retrieveIdShouldReturnStoredData() {
+    void retrieveIdShouldReturnStoredData() {
         testee.save(USER_INBOX_MAILBOXPATH, INBOX_ID).join();
 
         assertThat(testee.retrieveId(USER_INBOX_MAILBOXPATH).join())
@@ -114,7 +95,7 @@ public abstract class CassandraMailboxPathDAOTest {
     }
 
     @Test
-    public void getUserMailboxesShouldReturnAllMailboxesOfUser() {
+    void getUserMailboxesShouldReturnAllMailboxesOfUser() {
         testee.save(USER_INBOX_MAILBOXPATH, INBOX_ID).join();
         testee.save(USER_OUTBOX_MAILBOXPATH, OUTBOX_ID).join();
         testee.save(OTHER_USER_MAILBOXPATH, otherMailboxId).join();
@@ -130,12 +111,12 @@ public abstract class CassandraMailboxPathDAOTest {
     }
 
     @Test
-    public void deleteShouldNotThrowWhenEmpty() {
+    void deleteShouldNotThrowWhenEmpty() {
         testee.delete(USER_INBOX_MAILBOXPATH).join();
     }
 
     @Test
-    public void deleteShouldDeleteTheExistingMailboxId() {
+    void deleteShouldDeleteTheExistingMailboxId() {
         testee.save(USER_INBOX_MAILBOXPATH, INBOX_ID).join();
 
         testee.delete(USER_INBOX_MAILBOXPATH).join();

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathV2DAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathV2DAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathV2DAOTest.java
index 1840821..dc1f559 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathV2DAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxPathV2DAOTest.java
@@ -19,11 +19,12 @@
 
 package org.apache.james.mailbox.cassandra.mail;
 
+import org.apache.james.backends.cassandra.CassandraCluster;
 import org.apache.james.backends.cassandra.utils.CassandraUtils;
 
 public class CassandraMailboxPathV2DAOTest extends CassandraMailboxPathDAOTest {
     @Override
-    CassandraMailboxPathDAO testee() {
+    CassandraMailboxPathDAO testee(CassandraCluster cassandra) {
         return new CassandraMailboxPathV2DAO(cassandra.getConf(), CassandraUtils.WITH_DEFAULT_CONFIGURATION);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxRecentDAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxRecentDAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxRecentDAOTest.java
index d5767eb..f189677 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxRecentDAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxRecentDAOTest.java
@@ -24,58 +24,39 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.util.stream.IntStream;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.cassandra.ids.CassandraId;
 import org.apache.james.mailbox.cassandra.modules.CassandraMailboxRecentsModule;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import com.github.steveash.guavate.Guavate;
 
-public class CassandraMailboxRecentDAOTest {
-    public static final MessageUid UID1 = MessageUid.of(36L);
-    public static final MessageUid UID2 = MessageUid.of(37L);
-    public static final CassandraId CASSANDRA_ID = CassandraId.timeBased();
+class CassandraMailboxRecentDAOTest {
+    private static final MessageUid UID1 = MessageUid.of(36L);
+    private static final MessageUid UID2 = MessageUid.of(37L);
+    private static final CassandraId CASSANDRA_ID = CassandraId.timeBased();
 
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-
-    private static CassandraCluster cassandra;
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMailboxRecentsModule.MODULE);
 
     private CassandraMailboxRecentsDAO testee;
 
-    @BeforeClass
-    public static void setUpClass() {
-        cassandra = CassandraCluster.create(CassandraMailboxRecentsModule.MODULE, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         testee = new CassandraMailboxRecentsDAO(cassandra.getConf());
     }
 
-    @After
-    public void tearDown() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
-
     @Test
-    public void getRecentMessageUidsInMailboxShouldBeEmptyByDefault() throws Exception {
+    void getRecentMessageUidsInMailboxShouldBeEmptyByDefault() {
         assertThat(testee.getRecentMessageUidsInMailbox(CASSANDRA_ID).join()
             .collect(Guavate.toImmutableList())).isEmpty();
     }
 
     @Test
-    public void addToRecentShouldAddUidWhenEmpty() throws Exception {
+    void addToRecentShouldAddUidWhenEmpty() {
         testee.addToRecent(CASSANDRA_ID, UID1).join();
 
         assertThat(testee.getRecentMessageUidsInMailbox(CASSANDRA_ID).join()
@@ -83,7 +64,7 @@ public class CassandraMailboxRecentDAOTest {
     }
 
     @Test
-    public void removeFromRecentShouldRemoveUidWhenOnlyOneUid() throws Exception {
+    void removeFromRecentShouldRemoveUidWhenOnlyOneUid() {
         testee.addToRecent(CASSANDRA_ID, UID1).join();
 
         testee.removeFromRecent(CASSANDRA_ID, UID1).join();
@@ -93,7 +74,7 @@ public class CassandraMailboxRecentDAOTest {
     }
 
     @Test
-    public void removeFromRecentShouldNotFailIfNotExisting() throws Exception {
+    void removeFromRecentShouldNotFailIfNotExisting() {
         testee.removeFromRecent(CASSANDRA_ID, UID1).join();
 
         assertThat(testee.getRecentMessageUidsInMailbox(CASSANDRA_ID).join()
@@ -101,7 +82,7 @@ public class CassandraMailboxRecentDAOTest {
     }
 
     @Test
-    public void addToRecentShouldAddUidWhenNotEmpty() throws Exception {
+    void addToRecentShouldAddUidWhenNotEmpty() {
         testee.addToRecent(CASSANDRA_ID, UID1).join();
 
         testee.addToRecent(CASSANDRA_ID, UID2).join();
@@ -111,7 +92,7 @@ public class CassandraMailboxRecentDAOTest {
     }
 
     @Test
-    public void removeFromRecentShouldOnlyRemoveUidWhenNotEmpty() throws Exception {
+    void removeFromRecentShouldOnlyRemoveUidWhenNotEmpty() {
         testee.addToRecent(CASSANDRA_ID, UID1).join();
         testee.addToRecent(CASSANDRA_ID, UID2).join();
 
@@ -122,7 +103,7 @@ public class CassandraMailboxRecentDAOTest {
     }
 
     @Test
-    public void addToRecentShouldBeIdempotent() throws Exception {
+    void addToRecentShouldBeIdempotent() {
         testee.addToRecent(CASSANDRA_ID, UID1).join();
         testee.addToRecent(CASSANDRA_ID, UID1).join();
 
@@ -131,7 +112,7 @@ public class CassandraMailboxRecentDAOTest {
     }
 
     @Test
-    public void getRecentMessageUidsInMailboxShouldNotTimeoutWhenOverPagingLimit() throws Exception {
+    void getRecentMessageUidsInMailboxShouldNotTimeoutWhenOverPagingLimit() {
         int pageSize = 5000;
         int size = pageSize + 1000;
         IntStream.range(0, size)

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java
index 2c89621..da90b78 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageDAOTest.java
@@ -35,7 +35,7 @@ import javax.mail.util.SharedByteArrayInputStream;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.backends.cassandra.components.CassandraModule;
 import org.apache.james.backends.cassandra.utils.CassandraUtils;
 import org.apache.james.blob.api.HashBlobId;
@@ -55,12 +55,9 @@ import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailboxMessage;
 import org.apache.james.util.streams.Limit;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
@@ -68,15 +65,18 @@ import com.google.common.primitives.Bytes;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
 
-public class CassandraMessageDAOTest {
+class CassandraMessageDAOTest {
     private static final int BODY_START = 16;
     private static final CassandraId MAILBOX_ID = CassandraId.timeBased();
     private static final String CONTENT = "Subject: Test7 \n\nBody7\n.\n";
     private static final MessageUid messageUid = MessageUid.of(1);
     private static final List<MessageAttachment> NO_ATTACHMENT = ImmutableList.of();
 
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-    private static CassandraCluster cassandra;
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(
+        CassandraModule.aggregateModules(
+            CassandraMessageModule.MODULE,
+            CassandraBlobModule.MODULE));
 
     private CassandraMessageDAO testee;
     private CassandraMessageId.Factory messageIdFactory;
@@ -85,14 +85,8 @@ public class CassandraMessageDAOTest {
     private CassandraMessageId messageId;
     private List<ComposedMessageIdWithMetaData> messageIds;
 
-    @BeforeClass
-    public static void setUpClass() {
-        CassandraModule modules = CassandraModule.aggregateModules(CassandraMessageModule.MODULE, CassandraBlobModule.MODULE);
-        cassandra = CassandraCluster.create(modules, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         messageIdFactory = new CassandraMessageId.Factory();
         messageId = messageIdFactory.generate();
         CassandraBlobsDAO blobsDAO = new CassandraBlobsDAO(cassandra.getConf());
@@ -107,18 +101,8 @@ public class CassandraMessageDAOTest {
                 .build());
     }
 
-    @After
-    public void tearDown() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
-
     @Test
-    public void saveShouldSaveNullValueForTextualLineCountAsZero() throws Exception {
+    void saveShouldSaveNullValueForTextualLineCountAsZero() throws Exception {
         message = createMessage(messageId, CONTENT, BODY_START, new PropertyBuilder(), NO_ATTACHMENT);
 
         testee.save(message).join();
@@ -131,7 +115,7 @@ public class CassandraMessageDAOTest {
     }
 
     @Test
-    public void saveShouldSaveTextualLineCount() throws Exception {
+    void saveShouldSaveTextualLineCount() throws Exception {
         long textualLineCount = 10L;
         PropertyBuilder propertyBuilder = new PropertyBuilder();
         propertyBuilder.setTextualLineCount(textualLineCount);
@@ -146,7 +130,7 @@ public class CassandraMessageDAOTest {
     }
 
     @Test
-    public void saveShouldStoreMessageWithFullContent() throws Exception {
+    void saveShouldStoreMessageWithFullContent() throws Exception {
         message = createMessage(messageId, CONTENT, BODY_START, new PropertyBuilder(), NO_ATTACHMENT);
 
         testee.save(message).join();
@@ -159,7 +143,7 @@ public class CassandraMessageDAOTest {
     }
 
     @Test
-    public void saveShouldStoreMessageWithBodyContent() throws Exception {
+    void saveShouldStoreMessageWithBodyContent() throws Exception {
         message = createMessage(messageId, CONTENT, BODY_START, new PropertyBuilder(), NO_ATTACHMENT);
 
         testee.save(message).join();
@@ -175,7 +159,7 @@ public class CassandraMessageDAOTest {
     }
 
     @Test
-    public void saveShouldStoreMessageWithHeaderContent() throws Exception {
+    void saveShouldStoreMessageWithHeaderContent() throws Exception {
         message = createMessage(messageId, CONTENT, BODY_START, new PropertyBuilder(), NO_ATTACHMENT);
 
         testee.save(message).join();
@@ -211,14 +195,14 @@ public class CassandraMessageDAOTest {
     }
 
     @Test
-    public void retrieveAllMessageIdAttachmentIdsShouldReturnEmptyWhenNone() {
+    void retrieveAllMessageIdAttachmentIdsShouldReturnEmptyWhenNone() {
         Stream<MessageIdAttachmentIds> actual = testee.retrieveAllMessageIdAttachmentIds().join();
         
         assertThat(actual).isEmpty();
     }
 
     @Test
-    public void retrieveAllMessageIdAttachmentIdsShouldReturnOneWhenStored() throws Exception {
+    void retrieveAllMessageIdAttachmentIdsShouldReturnOneWhenStored() throws Exception {
         //Given
         MessageAttachment attachment = MessageAttachment.builder()
             .attachment(Attachment.builder()
@@ -238,7 +222,7 @@ public class CassandraMessageDAOTest {
     }
 
     @Test
-    public void retrieveAllMessageIdAttachmentIdsShouldReturnOneWhenStoredWithTwoAttachments() throws Exception {
+    void retrieveAllMessageIdAttachmentIdsShouldReturnOneWhenStoredWithTwoAttachments() throws Exception {
         //Given
         MessageAttachment attachment1 = MessageAttachment.builder()
             .attachment(Attachment.builder()
@@ -264,7 +248,7 @@ public class CassandraMessageDAOTest {
     }
     
     @Test
-    public void retrieveAllMessageIdAttachmentIdsShouldReturnAllWhenStoredWithAttachment() throws Exception {
+    void retrieveAllMessageIdAttachmentIdsShouldReturnAllWhenStoredWithAttachment() throws Exception {
         //Given
         MessageId messageId1 = messageIdFactory.generate();
         MessageId messageId2 = messageIdFactory.generate();
@@ -295,7 +279,7 @@ public class CassandraMessageDAOTest {
     }
     
     @Test
-    public void retrieveAllMessageIdAttachmentIdsShouldReturnEmtpyWhenStoredWithoutAttachment() throws Exception {
+    void retrieveAllMessageIdAttachmentIdsShouldReturnEmtpyWhenStoredWithoutAttachment() throws Exception {
         //Given
         SimpleMailboxMessage message1 = createMessage(messageId, CONTENT, BODY_START, new PropertyBuilder(), NO_ATTACHMENT);
         testee.save(message1).join();
@@ -308,7 +292,7 @@ public class CassandraMessageDAOTest {
     }
     
     @Test
-    public void retrieveAllMessageIdAttachmentIdsShouldFilterMessagesWithoutAttachment() throws Exception {
+    void retrieveAllMessageIdAttachmentIdsShouldFilterMessagesWithoutAttachment() throws Exception {
         //Given
         MessageId messageId1 = messageIdFactory.generate();
         MessageId messageId2 = messageIdFactory.generate();
@@ -341,19 +325,19 @@ public class CassandraMessageDAOTest {
     }
 
     @Test
-    public void messageIdAttachmentIdsShouldMatchBeanContract() {
+    void messageIdAttachmentIdsShouldMatchBeanContract() {
         EqualsVerifier.forClass(MessageIdAttachmentIds.class)
             .verify();
     }
 
     @Test
-    public void messageIdAttachmentIdsShouldThrowOnNullMessageId() {
+    void messageIdAttachmentIdsShouldThrowOnNullMessageId() {
         assertThatThrownBy(() -> new MessageIdAttachmentIds(null, ImmutableSet.of()))
             .isInstanceOf(NullPointerException.class);
     }
 
     @Test
-    public void messageIdAttachmentIdsShouldThrowOnNullAttachmentIds() {
+    void messageIdAttachmentIdsShouldThrowOnNullAttachmentIds() {
         assertThatThrownBy(() -> new MessageIdAttachmentIds(messageIdFactory.generate(), null))
             .isInstanceOf(NullPointerException.class);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdDAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdDAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdDAOTest.java
index d4514ca..26947ab 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdDAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdDAOTest.java
@@ -29,7 +29,7 @@ import javax.mail.Flags;
 import javax.mail.Flags.Flag;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.cassandra.ids.CassandraId;
 import org.apache.james.mailbox.cassandra.ids.CassandraMessageId;
@@ -37,51 +37,31 @@ import org.apache.james.mailbox.cassandra.modules.CassandraMessageModule;
 import org.apache.james.mailbox.model.ComposedMessageId;
 import org.apache.james.mailbox.model.ComposedMessageIdWithMetaData;
 import org.apache.james.mailbox.model.MessageRange;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
-public class CassandraMessageIdDAOTest {
-
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-
-    private static CassandraCluster cassandra;
+class CassandraMessageIdDAOTest {
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMessageModule.MODULE);
 
     private CassandraMessageId.Factory messageIdFactory;
     private CassandraMessageIdDAO testee;
 
-    @BeforeClass
-    public static void setUpClass() {
-        cassandra = CassandraCluster.create(CassandraMessageModule.MODULE, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         messageIdFactory = new CassandraMessageId.Factory();
         testee = new CassandraMessageIdDAO(cassandra.getConf(), messageIdFactory);
     }
 
-    @After
-    public void tearDown() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
-
     @Test
-    public void deleteShouldNotThrowWhenRowDoesntExist() {
+    void deleteShouldNotThrowWhenRowDoesntExist() {
         testee.delete(CassandraId.timeBased(), MessageUid.of(1))
             .join();
     }
 
     @Test
-    public void deleteShouldDeleteWhenRowExists() {
+    void deleteShouldDeleteWhenRowExists() {
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
         CassandraMessageId messageId = messageIdFactory.generate();
@@ -99,7 +79,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void deleteShouldDeleteOnlyConcernedRowWhenMultipleRowExists() {
+    void deleteShouldDeleteOnlyConcernedRowWhenMultipleRowExists() {
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
         MessageUid messageUid2 = MessageUid.of(2);
@@ -127,7 +107,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void insertShouldWork() {
+    void insertShouldWork() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -144,7 +124,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateModSeq() {
+    void updateShouldUpdateModSeq() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -169,7 +149,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateAnsweredFlag() {
+    void updateShouldUpdateAnsweredFlag() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -194,7 +174,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateDeletedFlag() {
+    void updateShouldUpdateDeletedFlag() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -219,7 +199,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateDraftFlag() {
+    void updateShouldUpdateDraftFlag() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -244,7 +224,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateFlaggedFlag() {
+    void updateShouldUpdateFlaggedFlag() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -269,7 +249,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateRecentFlag() {
+    void updateShouldUpdateRecentFlag() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -294,7 +274,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateSeenFlag() {
+    void updateShouldUpdateSeenFlag() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -319,7 +299,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateUserFlag() {
+    void updateShouldUpdateUserFlag() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -344,7 +324,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateUserFlags() {
+    void updateShouldUpdateUserFlags() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -371,7 +351,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void retrieveShouldRetrieveWhenKeyMatches() {
+    void retrieveShouldRetrieveWhenKeyMatches() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -388,7 +368,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void retrieveMessagesShouldRetrieveAllWhenRangeAll() {
+    void retrieveMessagesShouldRetrieveAllWhenRangeAll() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraMessageId messageId2 = messageIdFactory.generate();
         CassandraId mailboxId = CassandraId.timeBased();
@@ -416,7 +396,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void retrieveMessagesShouldRetrieveSomeWhenRangeFrom() {
+    void retrieveMessagesShouldRetrieveSomeWhenRangeFrom() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraMessageId messageId2 = messageIdFactory.generate();
         CassandraMessageId messageId3 = messageIdFactory.generate();
@@ -452,7 +432,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void retrieveMessagesShouldRetrieveSomeWhenRange() {
+    void retrieveMessagesShouldRetrieveSomeWhenRange() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraMessageId messageId2 = messageIdFactory.generate();
         CassandraMessageId messageId3 = messageIdFactory.generate();
@@ -497,7 +477,7 @@ public class CassandraMessageIdDAOTest {
     }
 
     @Test
-    public void retrieveMessagesShouldRetrieveOneWhenRangeOne() {
+    void retrieveMessagesShouldRetrieveOneWhenRangeOne() {
         CassandraMessageId messageId = messageIdFactory.generate();
         CassandraMessageId messageId2 = messageIdFactory.generate();
         CassandraMessageId messageId3 = messageIdFactory.generate();

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAOTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAOTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAOTest.java
index c7d6e7d..afefdcc 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAOTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdToImapUidDAOTest.java
@@ -28,64 +28,42 @@ import javax.mail.Flags;
 import javax.mail.Flags.Flag;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
-import org.apache.james.backends.cassandra.DockerCassandraSingleton;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.cassandra.ids.CassandraId;
 import org.apache.james.mailbox.cassandra.ids.CassandraMessageId;
 import org.apache.james.mailbox.cassandra.modules.CassandraMessageModule;
 import org.apache.james.mailbox.model.ComposedMessageId;
 import org.apache.james.mailbox.model.ComposedMessageIdWithMetaData;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import com.datastax.driver.core.utils.UUIDs;
 import com.github.steveash.guavate.Guavate;
 
-public class CassandraMessageIdToImapUidDAOTest {
-
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-
-    private static CassandraCluster cassandra;
+class CassandraMessageIdToImapUidDAOTest {
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMessageModule.MODULE);
 
     private CassandraMessageId.Factory messageIdFactory;
 
     private CassandraMessageIdToImapUidDAO testee;
 
-    @BeforeClass
-    public static void setUpClass() {
-        DockerCassandraSingleton.restart();
-        cassandra = CassandraCluster.create(CassandraMessageModule.MODULE, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         messageIdFactory = new CassandraMessageId.Factory();
         testee = new CassandraMessageIdToImapUidDAO(cassandra.getConf(), messageIdFactory);
     }
 
-    @After
-    public void tearDown() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
-
     @Test
-    public void deleteShouldNotThrowWhenRowDoesntExist() {
+    void deleteShouldNotThrowWhenRowDoesntExist() {
         testee.delete(messageIdFactory.of(UUIDs.timeBased()), CassandraId.timeBased())
             .join();
     }
 
     @Test
-    public void deleteShouldDeleteWhenRowExists() {
+    void deleteShouldDeleteWhenRowExists() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -103,7 +81,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void deleteShouldDeleteOnlyConcernedRowWhenMultipleRowExists() {
+    void deleteShouldDeleteOnlyConcernedRowWhenMultipleRowExists() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         CassandraId mailboxId2 = CassandraId.timeBased();
@@ -134,7 +112,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void insertShouldWork() {
+    void insertShouldWork() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -156,7 +134,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldReturnTrueWhenOldModSeqMatches() {
+    void updateShouldReturnTrueWhenOldModSeqMatches() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -174,7 +152,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldReturnFalseWhenOldModSeqDoesntMatch() {
+    void updateShouldReturnFalseWhenOldModSeqDoesntMatch() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -192,7 +170,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateModSeq() {
+    void updateShouldUpdateModSeq() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -217,7 +195,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateAnsweredFlag() {
+    void updateShouldUpdateAnsweredFlag() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -242,7 +220,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateDeletedFlag() {
+    void updateShouldUpdateDeletedFlag() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -267,7 +245,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateDraftFlag() {
+    void updateShouldUpdateDraftFlag() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -292,7 +270,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateFlaggedFlag() {
+    void updateShouldUpdateFlaggedFlag() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -317,7 +295,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateRecentFlag() {
+    void updateShouldUpdateRecentFlag() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -342,7 +320,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateSeenFlag() {
+    void updateShouldUpdateSeenFlag() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -367,7 +345,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateUserFlag() {
+    void updateShouldUpdateUserFlag() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -392,7 +370,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void updateShouldUpdateUserFlags() {
+    void updateShouldUpdateUserFlags() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -419,7 +397,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void retrieveShouldReturnOneMessageWhenKeyMatches() {
+    void retrieveShouldReturnOneMessageWhenKeyMatches() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         MessageUid messageUid = MessageUid.of(1);
@@ -441,7 +419,7 @@ public class CassandraMessageIdToImapUidDAOTest {
     }
 
     @Test
-    public void retrieveShouldReturnMultipleMessagesWhenMessageIdMatches() {
+    void retrieveShouldReturnMultipleMessagesWhenMessageIdMatches() {
         CassandraMessageId messageId = messageIdFactory.of(UUIDs.timeBased());
         CassandraId mailboxId = CassandraId.timeBased();
         CassandraId mailboxId2 = CassandraId.timeBased();

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java
index 6059389..a0b691d 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java
@@ -23,55 +23,37 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.util.stream.LongStream;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.mailbox.cassandra.ids.CassandraId;
 import org.apache.james.mailbox.cassandra.modules.CassandraModSeqModule;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import com.github.fge.lambdas.Throwing;
 
-public class CassandraModSeqProviderTest {
+class CassandraModSeqProviderTest {
     private static final CassandraId CASSANDRA_ID = new CassandraId.Factory().fromString("e22b3ac0-a80b-11e7-bb00-777268d65503");
 
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-    
-    private static CassandraCluster cassandra;
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraModSeqModule.MODULE);
     
     private CassandraModSeqProvider modSeqProvider;
     private SimpleMailbox mailbox;
 
-    @BeforeClass
-    public static void setUpClass() {
-        cassandra = CassandraCluster.create(CassandraModSeqModule.MODULE, cassandraServer.getHost());
-    }
 
-    @Before
-    public void setUp() throws Exception {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         modSeqProvider = new CassandraModSeqProvider(cassandra.getConf());
         MailboxPath path = new MailboxPath("gsoc", "ieugen", "Trash");
         mailbox = new SimpleMailbox(path, 1234);
         mailbox.setMailboxId(CASSANDRA_ID);
     }
-    
-    @After
-    public void cleanUp() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
 
     @Test
-    public void highestModSeqShouldRetrieveValueStoredNextModSeq() throws Exception {
+    void highestModSeqShouldRetrieveValueStoredNextModSeq() throws Exception {
         int nbEntries = 100;
         long result = modSeqProvider.highestModSeq(null, mailbox);
         assertThat(result).isEqualTo(0);
@@ -84,19 +66,18 @@ public class CassandraModSeqProviderTest {
     }
 
     @Test
-    public void nextModSeqShouldIncrementValueByOne() throws Exception {
+    void nextModSeqShouldIncrementValueByOne() throws Exception {
         int nbEntries = 100;
         long lastUid = modSeqProvider.highestModSeq(null, mailbox);
         LongStream.range(lastUid + 1, lastUid + nbEntries)
             .forEach(Throwing.longConsumer(value -> {
-                        long result = modSeqProvider.nextModSeq(null, mailbox);
-                        assertThat(value).isEqualTo(result);
-                })
-            );
+                long result = modSeqProvider.nextModSeq(null, mailbox);
+                assertThat(value).isEqualTo(result);
+            }));
     }
 
     @Test
-    public void nextModSeqShouldGenerateUniqueValuesWhenParallelCalls() throws Exception {
+    void nextModSeqShouldGenerateUniqueValuesWhenParallelCalls() {
         int nbEntries = 100;
         long nbValues = LongStream.range(0, nbEntries)
             .parallel()

http://git-wip-us.apache.org/repos/asf/james-project/blob/df6fe4fb/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidProviderTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidProviderTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidProviderTest.java
index fe0d6a1..619ced7 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidProviderTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidProviderTest.java
@@ -24,56 +24,37 @@ import java.util.Optional;
 import java.util.stream.LongStream;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.cassandra.ids.CassandraId;
 import org.apache.james.mailbox.cassandra.modules.CassandraUidModule;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import com.github.fge.lambdas.Throwing;
 
-public class CassandraUidProviderTest {
+class CassandraUidProviderTest {
     private static final CassandraId CASSANDRA_ID = new CassandraId.Factory().fromString("e22b3ac0-a80b-11e7-bb00-777268d65503");
 
-    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
-
-    private static CassandraCluster cassandra;
+    @RegisterExtension
+    static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraUidModule.MODULE);
 
     private CassandraUidProvider uidProvider;
     private SimpleMailbox mailbox;
 
-    @BeforeClass
-    public static void setUpClass() {
-        cassandra = CassandraCluster.create(CassandraUidModule.MODULE, cassandraServer.getHost());
-    }
-
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp(CassandraCluster cassandra) {
         uidProvider = new CassandraUidProvider(cassandra.getConf());
         MailboxPath path = new MailboxPath("gsoc", "ieugen", "Trash");
         mailbox = new SimpleMailbox(path, 1234);
         mailbox.setMailboxId(CASSANDRA_ID);
     }
-    
-    @After
-    public void cleanUp() {
-        cassandra.clearTables();
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        cassandra.closeCluster();
-    }
 
     @Test
-    public void lastUidShouldRetrieveValueStoredByNextUid() throws Exception {
+    void lastUidShouldRetrieveValueStoredByNextUid() throws Exception {
         int nbEntries = 100;
         Optional<MessageUid> result = uidProvider.lastUid(null, mailbox);
         assertThat(result).isEmpty();
@@ -86,18 +67,17 @@ public class CassandraUidProviderTest {
     }
 
     @Test
-    public void nextUidShouldIncrementValueByOne() throws Exception {
+    void nextUidShouldIncrementValueByOne() {
         int nbEntries = 100;
         LongStream.range(1, nbEntries)
             .forEach(Throwing.longConsumer(value -> {
-                        MessageUid result = uidProvider.nextUid(null, mailbox);
-                        assertThat(value).isEqualTo(result.asLong());
-                })
-            );
+                MessageUid result = uidProvider.nextUid(null, mailbox);
+                assertThat(value).isEqualTo(result.asLong());
+            }));
     }
 
     @Test
-    public void nextUidShouldGenerateUniqueValuesWhenParallelCalls() throws Exception {
+    void nextUidShouldGenerateUniqueValuesWhenParallelCalls() {
         int nbEntries = 100;
         long nbValues = LongStream.range(0, nbEntries)
             .parallel()


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


Mime
View raw message