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/14 06:54:07 UTC

[james-project] 17/18: [REFACTORING] Convert mpt tests to JUNIT 5

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 fc23d65f120446f0c137a971ca5d15b00141e3d9
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Feb 8 16:06:07 2021 +0700

    [REFACTORING] Convert mpt tests to JUNIT 5
---
 .../cassandra/CassandraAuthenticatePlainTest.java  | 15 +++----
 .../cassandra/CassandraAuthenticatedStateTest.java | 15 +++----
 .../cassandra/CassandraConcurrentSessionsTest.java | 15 +++----
 .../cassandra/CassandraCondstoreTest.java          | 16 +++----
 .../imapmailbox/cassandra/CassandraCopyTest.java   | 15 +++----
 .../imapmailbox/cassandra/CassandraEventsTest.java | 15 +++----
 .../cassandra/CassandraExpungeTest.java            | 15 +++----
 .../cassandra/CassandraFetchBodySectionTest.java   | 15 +++----
 .../cassandra/CassandraFetchBodyStructureTest.java | 15 +++----
 .../cassandra/CassandraFetchHeadersTest.java       | 15 +++----
 .../imapmailbox/cassandra/CassandraFetchTest.java  | 15 +++----
 .../cassandra/CassandraListingTest.java            | 17 +++----
 .../cassandra/CassandraListingWithSharingTest.java | 15 +++----
 .../cassandra/CassandraMailboxAnnotationTest.java  | 15 +++----
 .../CassandraMailboxWithLongNameErrorTest.java     | 15 +++----
 .../imapmailbox/cassandra/CassandraMoveTest.java   | 15 +++----
 .../CassandraNonAuthenticatedStateTest.java        | 15 +++----
 .../cassandra/CassandraPartialFetchTest.java       | 15 +++----
 .../imapmailbox/cassandra/CassandraQuotaTest.java  | 15 +++----
 .../imapmailbox/cassandra/CassandraRenameTest.java | 15 +++----
 .../imapmailbox/cassandra/CassandraSearchTest.java | 15 +++----
 .../cassandra/CassandraSecurityTest.java           | 15 +++----
 .../imapmailbox/cassandra/CassandraSelectTest.java | 15 +++----
 .../cassandra/CassandraSelectedInboxTest.java      | 15 +++----
 .../cassandra/CassandraSelectedStateTest.java      | 15 +++----
 .../cassandra/CassandraUidSearchOnIndexTest.java   | 15 +++----
 .../cassandra/CassandraUidSearchTest.java          | 15 +++----
 .../cassandra/CassandraUserFlagsSupportTest.java   | 15 +++----
 ...Rule.java => CassandraHostSystemExtension.java} | 41 ++++++++++-------
 .../james/mpt/imapmailbox/suite/ACLCommands.java   |  7 ++-
 .../mpt/imapmailbox/suite/ACLIntegration.java      |  6 +--
 .../mpt/imapmailbox/suite/AuthenticatePlain.java   |  6 +--
 .../mpt/imapmailbox/suite/AuthenticatedState.java  |  6 +--
 .../mpt/imapmailbox/suite/ConcurrentSessions.java  |  6 +--
 .../james/mpt/imapmailbox/suite/Condstore.java     |  6 +--
 .../apache/james/mpt/imapmailbox/suite/Copy.java   |  6 +--
 .../apache/james/mpt/imapmailbox/suite/Events.java |  6 +--
 .../james/mpt/imapmailbox/suite/Expunge.java       |  6 +--
 .../apache/james/mpt/imapmailbox/suite/Fetch.java  |  6 +--
 .../mpt/imapmailbox/suite/FetchBodySection.java    |  6 +--
 .../mpt/imapmailbox/suite/FetchBodyStructure.java  |  6 +--
 .../james/mpt/imapmailbox/suite/FetchHeaders.java  |  6 +--
 .../james/mpt/imapmailbox/suite/Listing.java       |  6 +--
 .../imapmailbox/suite/ListingWithSharingTest.java  |  6 +--
 .../mpt/imapmailbox/suite/MailboxAnnotation.java   |  6 +--
 .../suite/MailboxWithLongNameError.java            |  6 +--
 .../apache/james/mpt/imapmailbox/suite/Move.java   |  6 +--
 .../imapmailbox/suite/NonAuthenticatedState.java   |  6 +--
 .../james/mpt/imapmailbox/suite/PartialFetch.java  |  6 +--
 .../james/mpt/imapmailbox/suite/QuotaTest.java     |  6 +--
 .../apache/james/mpt/imapmailbox/suite/Recent.java |  6 +--
 .../apache/james/mpt/imapmailbox/suite/Rename.java |  6 +--
 .../apache/james/mpt/imapmailbox/suite/Search.java |  6 +--
 .../james/mpt/imapmailbox/suite/Security.java      |  7 ++-
 .../apache/james/mpt/imapmailbox/suite/Select.java |  6 +--
 .../james/mpt/imapmailbox/suite/SelectedInbox.java |  6 +--
 .../james/mpt/imapmailbox/suite/SelectedState.java |  6 +--
 .../james/mpt/imapmailbox/suite/UidSearch.java     |  6 +--
 .../mpt/imapmailbox/suite/UidSearchOnIndex.java    |  6 +--
 .../mpt/imapmailbox/suite/UserFlagsSupport.java    |  6 +--
 .../mpt/imapmailbox/cyrus/CyrusACLCommands.java    |  8 ++--
 .../mpt/imapmailbox/cyrus/CyrusACLIntegration.java |  8 ++--
 .../elasticsearch/ElasticSearchRecentTest.java     | 12 ++---
 .../ElasticSearchUidSearchOnIndexTest.java         | 10 ++---
 .../inmemory/InMemoryAuthenticatePlainTest.java    |  6 +--
 .../inmemory/InMemoryAuthenticatedStateTest.java   |  6 +--
 .../inmemory/InMemoryConcurrentSessionsTest.java   |  6 +--
 .../inmemory/InMemoryCondstoreTest.java            |  5 +--
 .../mpt/imapmailbox/inmemory/InMemoryCopyTest.java |  6 +--
 .../imapmailbox/inmemory/InMemoryEventsTest.java   |  6 +--
 .../imapmailbox/inmemory/InMemoryExpungeTest.java  |  6 +--
 .../inmemory/InMemoryFetchBodySectionTest.java     |  6 +--
 .../inmemory/InMemoryFetchBodyStructureTest.java   |  6 +--
 .../inmemory/InMemoryFetchHeadersTest.java         |  6 +--
 .../imapmailbox/inmemory/InMemoryFetchTest.java    |  6 +--
 .../imapmailbox/inmemory/InMemoryListingTest.java  |  8 ++--
 .../inmemory/InMemoryListingWithSharingTest.java   |  6 +--
 .../inmemory/InMemoryMailboxAnnotationTest.java    |  6 +--
 .../InMemoryMailboxWithLongNameErrorTest.java      |  4 +-
 .../mpt/imapmailbox/inmemory/InMemoryMoveTest.java |  6 +--
 .../InMemoryNonAuthenticatedStateTest.java         |  6 +--
 .../inmemory/InMemoryPartialFetchTest.java         |  6 +--
 .../imapmailbox/inmemory/InMemoryQuotaTest.java    |  6 +--
 .../imapmailbox/inmemory/InMemoryRecentTest.java   |  6 +--
 .../imapmailbox/inmemory/InMemoryRenameTest.java   |  6 +--
 .../imapmailbox/inmemory/InMemorySearchTest.java   |  6 +--
 .../imapmailbox/inmemory/InMemorySecurityTest.java |  6 +--
 .../imapmailbox/inmemory/InMemorySelectTest.java   |  6 +--
 .../inmemory/InMemorySelectedInboxTest.java        |  6 +--
 .../inmemory/InMemorySelectedStateTest.java        |  6 +--
 .../inmemory/InMemoryUidSearchOnIndexTest.java     |  6 +--
 .../inmemory/InMemoryUidSearchTest.java            |  6 +--
 .../inmemory/InMemoryUserFlagsSupportTest.java     |  6 +--
 .../imapmailbox/jpa/JpaAuthenticatePlainTest.java  | 12 ++---
 .../imapmailbox/jpa/JpaAuthenticatedStateTest.java | 12 ++---
 .../imapmailbox/jpa/JpaConcurrentSessionsTest.java | 10 ++---
 .../mpt/imapmailbox/jpa/JpaCondstoreTest.java      | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaCopyTest.java     | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaEventsTest.java   | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaExpungeTest.java  | 10 ++---
 .../imapmailbox/jpa/JpaFetchBodySectionTest.java   | 10 ++---
 .../imapmailbox/jpa/JpaFetchBodyStructureTest.java | 10 ++---
 .../mpt/imapmailbox/jpa/JpaFetchHeadersTest.java   | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaFetchTest.java    | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaListingTest.java  | 10 ++---
 .../imapmailbox/jpa/JpaMailboxAnnotationTest.java  | 10 ++---
 .../jpa/JpaMailboxWithLongNameErrorTest.java       | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaMoveTest.java     | 10 ++---
 .../jpa/JpaNonAuthenticatedStateTest.java          | 10 ++---
 .../mpt/imapmailbox/jpa/JpaPartialFetchTest.java   | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaQuotaTest.java    | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaRenameTest.java   | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaSearchTest.java   | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaSecurityTest.java | 10 ++---
 .../james/mpt/imapmailbox/jpa/JpaSelectTest.java   | 10 ++---
 .../mpt/imapmailbox/jpa/JpaSelectedInboxTest.java  | 10 ++---
 .../mpt/imapmailbox/jpa/JpaSelectedStateTest.java  | 10 ++---
 .../imapmailbox/jpa/JpaUidSearchOnIndexTest.java   | 10 ++---
 .../mpt/imapmailbox/jpa/JpaUidSearchTest.java      | 10 ++---
 .../imapmailbox/jpa/JpaUserFlagsSupportTest.java   | 10 ++---
 ...SystemRule.java => JPAHostSystemExtension.java} | 21 +++++----
 .../lucenesearch/LuceneAuthenticatePlainTest.java  |  6 +--
 .../lucenesearch/LuceneAuthenticatedStateTest.java |  6 +--
 .../lucenesearch/LuceneConcurrentSessionsTest.java | 10 ++---
 .../lucenesearch/LuceneCondstoreTest.java          | 10 ++---
 .../imapmailbox/lucenesearch/LuceneCopyTest.java   |  8 ++--
 .../imapmailbox/lucenesearch/LuceneEventsTest.java | 10 ++---
 .../lucenesearch/LuceneExpungeTest.java            | 10 ++---
 .../lucenesearch/LuceneFetchBodySectionTest.java   | 10 ++---
 .../lucenesearch/LuceneFetchBodyStructureTest.java | 10 ++---
 .../lucenesearch/LuceneFetchHeadersTest.java       | 10 ++---
 .../imapmailbox/lucenesearch/LuceneFetchTest.java  | 10 ++---
 .../lucenesearch/LuceneListingTest.java            | 10 ++---
 .../lucenesearch/LuceneMailboxAnnotationTest.java  | 10 ++---
 .../LuceneMailboxWithLongNameErrorTest.java        | 10 ++---
 .../imapmailbox/lucenesearch/LuceneMoveTest.java   |  6 +--
 .../LuceneNonAuthenticatedStateTest.java           | 10 ++---
 .../lucenesearch/LucenePartialFetchTest.java       | 10 ++---
 .../imapmailbox/lucenesearch/LuceneQuotaTest.java  |  6 +--
 .../imapmailbox/lucenesearch/LuceneRecentTest.java | 10 ++---
 .../imapmailbox/lucenesearch/LuceneRenameTest.java | 10 ++---
 .../lucenesearch/LuceneSecurityTest.java           | 10 ++---
 .../imapmailbox/lucenesearch/LuceneSelectTest.java | 10 ++---
 .../lucenesearch/LuceneSelectedInboxTest.java      | 10 ++---
 .../lucenesearch/LuceneSelectedStateTest.java      | 10 ++---
 .../lucenesearch/LuceneUidSearchOnIndexTest.java   | 10 ++---
 .../lucenesearch/LuceneUserFlagsSupportTest.java   | 10 ++---
 .../maildir/MaildirAuthenticatePlainTest.java      | 10 ++---
 .../maildir/MaildirAuthenticatedStateTest.java     | 12 +++--
 .../maildir/MaildirConcurrentSessionsTest.java     | 10 ++---
 .../imapmailbox/maildir/MaildirCondstoreTest.java  | 10 ++---
 .../mpt/imapmailbox/maildir/MaildirCopyTest.java   | 10 ++---
 .../mpt/imapmailbox/maildir/MaildirEventsTest.java | 10 ++---
 .../imapmailbox/maildir/MaildirExpungeTest.java    | 10 ++---
 .../maildir/MaildirFetchBodySectionTest.java       | 10 ++---
 .../maildir/MaildirFetchBodyStructureTest.java     | 10 ++---
 .../maildir/MaildirFetchHeadersTest.java           | 10 ++---
 .../mpt/imapmailbox/maildir/MaildirFetchTest.java  | 10 ++---
 .../imapmailbox/maildir/MaildirListingTest.java    | 10 ++---
 .../maildir/MaildirMailboxAnnotationTest.java      | 10 ++---
 .../MaildirMailboxWithLongNameErrorTest.java       | 10 ++---
 .../mpt/imapmailbox/maildir/MaildirMoveTest.java   | 10 ++---
 .../maildir/MaildirNonAuthenticatedStateTest.java  | 10 ++---
 .../maildir/MaildirPartialFetchTest.java           | 10 ++---
 .../mpt/imapmailbox/maildir/MaildirQuotaTest.java  |  6 +--
 .../mpt/imapmailbox/maildir/MaildirRenameTest.java | 10 ++---
 .../mpt/imapmailbox/maildir/MaildirSearchTest.java |  8 ++--
 .../imapmailbox/maildir/MaildirSecurityTest.java   | 10 ++---
 .../mpt/imapmailbox/maildir/MaildirSelectTest.java | 10 ++---
 .../maildir/MaildirSelectedInboxTest.java          | 10 ++---
 .../maildir/MaildirSelectedStateTest.java          | 10 ++---
 .../maildir/MaildirUidSearchOnIndexTest.java       | 10 ++---
 .../imapmailbox/maildir/MaildirUidSearchTest.java  | 10 ++---
 .../maildir/MaildirUserFlagsSupportTest.java       | 10 ++---
 .../rabbitmq/RabbitMQAuthenticatePlainTest.java    | 14 +++---
 .../rabbitmq/RabbitMQAuthenticatedStateTest.java   | 14 +++---
 .../rabbitmq/RabbitMQConcurrentSessionsTest.java   | 14 +++---
 .../rabbitmq/RabbitMQCondstoreTest.java            | 14 +++---
 .../mpt/imapmailbox/rabbitmq/RabbitMQCopyTest.java | 14 +++---
 .../imapmailbox/rabbitmq/RabbitMQEventsTest.java   | 14 +++---
 .../rabbitmq/RabbitMQFetchBodySectionTest.java     | 14 +++---
 .../rabbitmq/RabbitMQFetchBodyStructureTest.java   | 14 +++---
 .../rabbitmq/RabbitMQFetchHeadersTest.java         | 14 +++---
 .../imapmailbox/rabbitmq/RabbitMQFetchTest.java    | 14 +++---
 .../imapmailbox/rabbitmq/RabbitMQListingTest.java  | 14 +++---
 .../rabbitmq/RabbitMQListingWithSharingTest.java   | 14 +++---
 .../rabbitmq/RabbitMQMailboxAnnotationTest.java    | 14 +++---
 .../RabbitMQMailboxWithLongNameErrorTest.java      | 14 +++---
 .../mpt/imapmailbox/rabbitmq/RabbitMQMoveTest.java | 14 +++---
 .../RabbitMQNonAuthenticatedStateTest.java         | 14 +++---
 .../rabbitmq/RabbitMQPartialFetchTest.java         | 14 +++---
 .../imapmailbox/rabbitmq/RabbitMQQuotaTest.java    | 14 +++---
 .../imapmailbox/rabbitmq/RabbitMQRenameTest.java   | 14 +++---
 .../imapmailbox/rabbitmq/RabbitMQSearchTest.java   | 14 +++---
 .../imapmailbox/rabbitmq/RabbitMQSecurityTest.java | 14 +++---
 .../imapmailbox/rabbitmq/RabbitMQSelectTest.java   | 14 +++---
 .../rabbitmq/RabbitMQSelectedInboxTest.java        | 14 +++---
 .../rabbitmq/RabbitMQSelectedStateTest.java        | 14 +++---
 .../rabbitmq/RabbitMQUidSearchTest.java            | 14 +++---
 .../rabbitmq/RabbitMQUserFlagsSupportTest.java     | 14 +++---
 .../host/RabbitMQEventBusHostSystemExtension.java  | 48 ++++++++++----------
 .../host/RabbitMQEventBusHostSystemRule.java       | 52 ----------------------
 .../apache/james/mpt/smtp/SmtpAuthCommandTest.java |  6 +--
 203 files changed, 843 insertions(+), 1293 deletions(-)

diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraAuthenticatePlainTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraAuthenticatePlainTest.java
index dfce173..ecb9503 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraAuthenticatePlainTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraAuthenticatePlainTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatePlain;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraAuthenticatePlainTest extends AuthenticatePlain {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraAuthenticatedStateTest.java
index ea55f59..7ff6f58 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraAuthenticatedStateTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatedState;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraAuthenticatedStateTest extends AuthenticatedState {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraConcurrentSessionsTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraConcurrentSessionsTest.java
index af41afc..ff62b7a 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraConcurrentSessionsTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraConcurrentSessionsTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.ConcurrentSessions;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraConcurrentSessionsTest extends ConcurrentSessions {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraCondstoreTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraCondstoreTest.java
index ab0a51a..6ba5416 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraCondstoreTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraCondstoreTest.java
@@ -19,23 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.host.JamesImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Condstore;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraCondstoreTest extends Condstore {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected JamesImapHostSystem createJamesImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
-
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraCopyTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraCopyTest.java
index 8e85c47..2fe1788 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraCopyTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraCopyTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Copy;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraCopyTest extends Copy {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraEventsTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraEventsTest.java
index 532b7a9..b27d553 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraEventsTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraEventsTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Events;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraEventsTest extends Events {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraExpungeTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraExpungeTest.java
index f5afd12..50a0f8d 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraExpungeTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraExpungeTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Expunge;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraExpungeTest extends Expunge {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchBodySectionTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchBodySectionTest.java
index 1cdf4c6..0ce06d6 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchBodySectionTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchBodySectionTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodySection;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraFetchBodySectionTest extends FetchBodySection {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchBodyStructureTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchBodyStructureTest.java
index 8a48092..78d37e5 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchBodyStructureTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchBodyStructureTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodyStructure;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraFetchBodyStructureTest extends FetchBodyStructure {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchHeadersTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchHeadersTest.java
index aa5d71b..cfb5658 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchHeadersTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchHeadersTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.FetchHeaders;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraFetchHeadersTest extends FetchHeaders {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchTest.java
index e8885ef..e776728 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraFetchTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Fetch;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraFetchTest extends Fetch {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraListingTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraListingTest.java
index 6a40777..4284d14 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraListingTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraListingTest.java
@@ -23,26 +23,21 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.Locale;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.backends.cassandra.StatementRecorder;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Listing;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraListingTest extends Listing {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 
     @Test
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraListingWithSharingTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraListingWithSharingTest.java
index 158f3c4..56bd704 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraListingWithSharingTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraListingWithSharingTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.ListingWithSharingTest;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraListingWithSharingTest extends ListingWithSharingTest {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxAnnotationTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxAnnotationTest.java
index a6e50e6..37f8046 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxAnnotationTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxAnnotationTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.MailboxAnnotation;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraMailboxAnnotationTest extends MailboxAnnotation {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxWithLongNameErrorTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxWithLongNameErrorTest.java
index 1a549f0..ba8e55e 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxWithLongNameErrorTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxWithLongNameErrorTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.MailboxWithLongNameError;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraMailboxWithLongNameErrorTest extends MailboxWithLongNameError {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMoveTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMoveTest.java
index c0f5907..dbb33c0 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMoveTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMoveTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Move;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraMoveTest extends Move {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraNonAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraNonAuthenticatedStateTest.java
index 3a3428f..95c800f 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraNonAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraNonAuthenticatedStateTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.NonAuthenticatedState;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraNonAuthenticatedStateTest extends NonAuthenticatedState {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraPartialFetchTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraPartialFetchTest.java
index 76816d9..aa20526 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraPartialFetchTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraPartialFetchTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.PartialFetch;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraPartialFetchTest extends PartialFetch {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraQuotaTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraQuotaTest.java
index 474c9cb..8ed2409 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraQuotaTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraQuotaTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.QuotaTest;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraQuotaTest extends QuotaTest {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraRenameTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraRenameTest.java
index c6a38b2..271daac 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraRenameTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraRenameTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Rename;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraRenameTest extends Rename {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSearchTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSearchTest.java
index 9b4d05a..25a6fa8 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSearchTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSearchTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Search;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraSearchTest extends Search {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSecurityTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSecurityTest.java
index d64613a..9a2d2da 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSecurityTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSecurityTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Security;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraSecurityTest extends Security {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectTest.java
index fc9c1b4..e41868b 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Select;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraSelectTest extends Select {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectedInboxTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectedInboxTest.java
index 78d0796..9d2b642 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectedInboxTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectedInboxTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.SelectedInbox;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraSelectedInboxTest extends SelectedInbox {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectedStateTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectedStateTest.java
index 2bc0c37..9267032 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectedStateTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraSelectedStateTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.SelectedState;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraSelectedStateTest extends SelectedState {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUidSearchOnIndexTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUidSearchOnIndexTest.java
index d356731..ac59ca8 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUidSearchOnIndexTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUidSearchOnIndexTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.UidSearchOnIndex;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraUidSearchOnIndexTest extends UidSearchOnIndex {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUidSearchTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUidSearchTest.java
index bbe8158..41e7546 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUidSearchTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUidSearchTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.UidSearch;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraUidSearchTest extends UidSearch {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUserFlagsSupportTest.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUserFlagsSupportTest.java
index a8eecdc..abf3adb 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUserFlagsSupportTest.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraUserFlagsSupportTest.java
@@ -19,22 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.cassandra;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemRule;
+import org.apache.james.mpt.imapmailbox.cassandra.host.CassandraHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.UserFlagsSupport;
-import org.junit.Rule;
-import org.junit.rules.RuleChain;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class CassandraUserFlagsSupportTest extends UserFlagsSupport {
-    public DockerCassandraRule cassandraServer = new DockerCassandraRule().allowRestart();
-    public CassandraHostSystemRule cassandraHostSystemRule = new CassandraHostSystemRule(cassandraServer);
-
-    @Rule
-    public RuleChain ruleChain = RuleChain.outerRule(cassandraServer).around(cassandraHostSystemRule);
+    @RegisterExtension
+    static CassandraHostSystemExtension hostSystemExtension = new CassandraHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return cassandraHostSystemRule.getImapHostSystem();
+        return hostSystemExtension.getImapHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystemRule.java b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystemExtension.java
similarity index 54%
rename from mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystemRule.java
rename to mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystemExtension.java
index f9cbcc5..1c32922 100644
--- a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystemRule.java
+++ b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/CassandraHostSystemExtension.java
@@ -18,31 +18,42 @@
  ****************************************************************/
 package org.apache.james.mpt.imapmailbox.cassandra.host;
 
-import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.backends.cassandra.DockerCassandraExtension;
 import org.apache.james.mpt.host.JamesImapHostSystem;
-import org.junit.rules.ExternalResource;
+import org.junit.jupiter.api.extension.AfterAllCallback;
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
 
-public class CassandraHostSystemRule extends ExternalResource {
-    private final DockerCassandraRule cassandraServer;
+public class CassandraHostSystemExtension implements BeforeAllCallback, AfterAllCallback, BeforeEachCallback, AfterEachCallback {
+    private final DockerCassandraExtension cassandraExtension;
     private CassandraHostSystem system;
 
-    public CassandraHostSystemRule(DockerCassandraRule cassandraServer) {
-        this.cassandraServer = cassandraServer;
+    public CassandraHostSystemExtension() {
+        this.cassandraExtension = new DockerCassandraExtension();
     }
 
     @Override
-    protected void before() throws Throwable {
-        system = new CassandraHostSystem(cassandraServer.getHost());
-        system.beforeTest();
+    public void afterAll(ExtensionContext extensionContext) {
+        cassandraExtension.afterAll(extensionContext);
+    }
+
+    @Override
+    public void afterEach(ExtensionContext extensionContext) throws Exception {
+        system.afterTest();
     }
 
     @Override
-    protected void after() {
-        try {
-            system.afterTest();
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+    public void beforeAll(ExtensionContext extensionContext) {
+        cassandraExtension.beforeAll(extensionContext);
+    }
+
+    @Override
+    public void beforeEach(ExtensionContext extensionContext) throws Exception {
+        cassandraExtension.beforeEach(extensionContext);
+        system = new CassandraHostSystem(cassandraExtension.getDockerCassandra().getHost());
+        system.beforeTest();
     }
 
     public JamesImapHostSystem getImapHostSystem() {
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLCommands.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLCommands.java
index df03477..e91aa42 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLCommands.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLCommands.java
@@ -28,11 +28,10 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.GrantRightsOnHost;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.MailboxMessageAppender;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class ACLCommands implements ImapTestConstants {
-    
     public static final Username OTHER_USER_NAME = Username.of("Boby");
     public static final String OTHER_USER_PASSWORD = "password";
     public static final MailboxPath OTHER_USER_MAILBOX = MailboxPath.forUser(OTHER_USER_NAME, "");
@@ -47,7 +46,7 @@ public abstract class ACLCommands implements ImapTestConstants {
     private MailboxACL.Rfc4314Rights readWriteSeenRight;
     private ACLScriptedTestProtocol scriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         grantRightsOnHost = createGrantRightsOnHost();
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java
index 114be87..d1998db 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java
@@ -28,8 +28,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.GrantRightsOnHost;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.MailboxMessageAppender;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class ACLIntegration implements ImapTestConstants {
     public static final Username OTHER_USER_NAME = Username.of("Boby");
@@ -49,7 +49,7 @@ public abstract class ACLIntegration implements ImapTestConstants {
 
     private ACLScriptedTestProtocol scriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         grantRightsOnHost = createGrantRightsOnHost();
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatePlain.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatePlain.java
index 0ca8d11..1743c4e 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatePlain.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatePlain.java
@@ -27,8 +27,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.ImapScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class AuthenticatePlain implements ImapTestConstants {
     
@@ -37,7 +37,7 @@ public abstract class AuthenticatePlain implements ImapTestConstants {
     private ImapHostSystem system;
     private ImapScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new ImapScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java
index b11fd73..f7c3f45 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/AuthenticatedState.java
@@ -28,8 +28,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
 import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class AuthenticatedState extends BasicImapCommands {
     private static final Username USER_2 = Username.of("imapuser2");
@@ -39,7 +39,7 @@ public abstract class AuthenticatedState extends BasicImapCommands {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ConcurrentSessions.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ConcurrentSessions.java
index bd0d3ae..7f6d984 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ConcurrentSessions.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ConcurrentSessions.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class ConcurrentSessions implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class ConcurrentSessions implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Condstore.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Condstore.java
index 106e7f2..3333820 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Condstore.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Condstore.java
@@ -26,8 +26,8 @@ import org.apache.james.mpt.host.JamesImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Condstore implements ImapTestConstants {
 
@@ -36,7 +36,7 @@ public abstract class Condstore implements ImapTestConstants {
     private JamesImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createJamesImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Copy.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Copy.java
index bc80f53..d1b19c6 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Copy.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Copy.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Copy implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class Copy implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Events.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Events.java
index 34c03ef..9c9c5c6 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Events.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Events.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Events implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class Events implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Expunge.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Expunge.java
index 0750814..fe4d4d3 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Expunge.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Expunge.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Expunge implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class Expunge implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Fetch.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Fetch.java
index aa30ba6..526b036 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Fetch.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Fetch.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Fetch implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class Fetch implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchBodySection.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchBodySection.java
index e96f98a..59ab6d4 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchBodySection.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchBodySection.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class FetchBodySection implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class FetchBodySection implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchBodyStructure.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchBodyStructure.java
index 8ff3280..7bae295 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchBodyStructure.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchBodyStructure.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class FetchBodyStructure implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class FetchBodyStructure implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchHeaders.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchHeaders.java
index fb34e02..05a1f61 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchHeaders.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/FetchHeaders.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class FetchHeaders implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class FetchHeaders implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Listing.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Listing.java
index c8c7c6c..ffbdb98 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Listing.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Listing.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Listing implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class Listing implements ImapTestConstants {
     protected ImapHostSystem system;
     protected SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ListingWithSharingTest.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ListingWithSharingTest.java
index 08a746e..95eedde 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ListingWithSharingTest.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ListingWithSharingTest.java
@@ -28,8 +28,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.ImapScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class ListingWithSharingTest implements ImapTestConstants {
     public static final Username OTHER_USER_NAME = Username.of("Boby");
@@ -42,7 +42,7 @@ public abstract class ListingWithSharingTest implements ImapTestConstants {
     private ImapHostSystem system;
     private ImapScriptedTestProtocol scriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         scriptedTestProtocol = new ImapScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxAnnotation.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxAnnotation.java
index 0cde7ec..7d78558 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxAnnotation.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxAnnotation.java
@@ -28,8 +28,8 @@ import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
 import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class MailboxAnnotation implements ImapTestConstants {
 
@@ -38,7 +38,7 @@ public abstract class MailboxAnnotation implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         Assume.assumeTrue(system.supports(ImapFeatures.Feature.ANNOTATION_SUPPORT));
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxWithLongNameError.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxWithLongNameError.java
index 9cb4163..791245d 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxWithLongNameError.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/MailboxWithLongNameError.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class MailboxWithLongNameError implements ImapTestConstants {
 
@@ -34,7 +34,7 @@ public abstract class MailboxWithLongNameError implements ImapTestConstants {
 
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", createImapHostSystem())
                 .withUser(USER, PASSWORD)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Move.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Move.java
index 613ef90..1a207bf 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Move.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Move.java
@@ -27,8 +27,8 @@ import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
 import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Move implements ImapTestConstants {
 
@@ -37,7 +37,7 @@ public abstract class Move implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/NonAuthenticatedState.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/NonAuthenticatedState.java
index 4b2b8f6..0657551 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/NonAuthenticatedState.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/NonAuthenticatedState.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class NonAuthenticatedState implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class NonAuthenticatedState implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/PartialFetch.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/PartialFetch.java
index 361aa76..f1baef7 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/PartialFetch.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/PartialFetch.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class PartialFetch implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class PartialFetch implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/QuotaTest.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/QuotaTest.java
index c827b48..5a6a14f 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/QuotaTest.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/QuotaTest.java
@@ -29,8 +29,8 @@ import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
 import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class QuotaTest implements ImapTestConstants {
 
@@ -42,7 +42,7 @@ public abstract class QuotaTest implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         Assume.assumeTrue(system.supports(ImapFeatures.Feature.QUOTA_SUPPORT));
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Recent.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Recent.java
index 39bdebe..2fd0e2f 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Recent.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Recent.java
@@ -24,8 +24,8 @@ import java.util.Locale;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Recent extends BasicImapCommands {
     protected abstract ImapHostSystem createImapHostSystem();
@@ -33,7 +33,7 @@ public abstract class Recent extends BasicImapCommands {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Rename.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Rename.java
index c77b2ad..6ab8d07 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Rename.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Rename.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Rename implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class Rename implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Search.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Search.java
index e1f64a5..df1dc87 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Search.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Search.java
@@ -27,8 +27,8 @@ import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
 import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Search implements ImapTestConstants {
 
@@ -37,7 +37,7 @@ public abstract class Search implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Security.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Security.java
index 29ec0ac..faaf452 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Security.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Security.java
@@ -24,17 +24,16 @@ import java.util.Locale;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Security implements ImapTestConstants {
-
     protected abstract ImapHostSystem createImapHostSystem();
     
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Select.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Select.java
index af6f85a..01f1436 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Select.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Select.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class Select implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class Select implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/SelectedInbox.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/SelectedInbox.java
index d695788..3971d04 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/SelectedInbox.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/SelectedInbox.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class SelectedInbox implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class SelectedInbox implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/SelectedState.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/SelectedState.java
index 64a1fcf..f699880 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/SelectedState.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/SelectedState.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class SelectedState implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class SelectedState implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearch.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearch.java
index e408248..ea30474 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearch.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearch.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class UidSearch implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class UidSearch implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearchOnIndex.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearchOnIndex.java
index 231768d..bf283a3 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearchOnIndex.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearchOnIndex.java
@@ -25,8 +25,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class UidSearchOnIndex implements ImapTestConstants {
 
@@ -35,7 +35,7 @@ public abstract class UidSearchOnIndex implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UserFlagsSupport.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UserFlagsSupport.java
index 21b0465..a02a421 100644
--- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UserFlagsSupport.java
+++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UserFlagsSupport.java
@@ -27,8 +27,8 @@ import org.apache.james.mpt.imapmailbox.ImapTestConstants;
 import org.apache.james.mpt.imapmailbox.suite.base.BasicImapCommands;
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
 import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class UserFlagsSupport implements ImapTestConstants {
 
@@ -37,7 +37,7 @@ public abstract class UserFlagsSupport implements ImapTestConstants {
     private ImapHostSystem system;
     private SimpleScriptedTestProtocol simpleScriptedTestProtocol;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = createImapHostSystem();
         simpleScriptedTestProtocol = new SimpleScriptedTestProtocol("/org/apache/james/imap/scripts/", system)
diff --git a/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusACLCommands.java b/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusACLCommands.java
index ae04e46..c51782b 100644
--- a/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusACLCommands.java
+++ b/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusACLCommands.java
@@ -22,8 +22,8 @@ package org.apache.james.mpt.imapmailbox.cyrus;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.GrantRightsOnHost;
 import org.apache.james.mpt.imapmailbox.suite.ACLCommands;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
@@ -34,7 +34,7 @@ public class CyrusACLCommands extends ACLCommands {
     private GrantRightsOnHost grantRightsOnHost;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new CyrusMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
@@ -48,7 +48,7 @@ public class CyrusACLCommands extends ACLCommands {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
diff --git a/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusACLIntegration.java b/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusACLIntegration.java
index 84f7367..c9ec00a 100644
--- a/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusACLIntegration.java
+++ b/mpt/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusACLIntegration.java
@@ -23,8 +23,8 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.GrantRightsOnHost;
 import org.apache.james.mpt.imapmailbox.MailboxMessageAppender;
 import org.apache.james.mpt.imapmailbox.suite.ACLIntegration;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
@@ -36,7 +36,7 @@ public class CyrusACLIntegration extends ACLIntegration {
     private MailboxMessageAppender mailboxMessageAppender;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new CyrusMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
@@ -51,7 +51,7 @@ public class CyrusACLIntegration extends ACLIntegration {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
diff --git a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchRecentTest.java b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchRecentTest.java
index 7265bf4..bd47223 100644
--- a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchRecentTest.java
+++ b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchRecentTest.java
@@ -22,17 +22,17 @@ package org.apache.james.mpt.imapmailbox.elasticsearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.elasticsearch.host.ElasticSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Recent;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
 
-@Ignore("MAILBOX-398 ElasticSearch backend do not take into account session recent messages")
+@Disabled("MAILBOX-398 ElasticSearch backend do not take into account session recent messages")
 public class ElasticSearchRecentTest extends Recent {
 
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new ElasticSearchHostSystem();
         system.beforeTest();
@@ -44,7 +44,7 @@ public class ElasticSearchRecentTest extends Recent {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
diff --git a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchUidSearchOnIndexTest.java b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchUidSearchOnIndexTest.java
index 8c40ce1..5d3003f 100644
--- a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchUidSearchOnIndexTest.java
+++ b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchUidSearchOnIndexTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.elasticsearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.elasticsearch.host.ElasticSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.UidSearchOnIndex;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class ElasticSearchUidSearchOnIndexTest extends UidSearchOnIndex {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new ElasticSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class ElasticSearchUidSearchOnIndexTest extends UidSearchOnIndex {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryAuthenticatePlainTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryAuthenticatePlainTest.java
index 6217310..0dd3a16 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryAuthenticatePlainTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryAuthenticatePlainTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatePlain;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryAuthenticatePlainTest extends AuthenticatePlain {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryAuthenticatePlainTest extends AuthenticatePlain {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryAuthenticatedStateTest.java
index 0c00814..48b2721 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryAuthenticatedStateTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatedState;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryAuthenticatedStateTest extends AuthenticatedState {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryAuthenticatedStateTest extends AuthenticatedState {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryConcurrentSessionsTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryConcurrentSessionsTest.java
index c50153a..740c7b1 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryConcurrentSessionsTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryConcurrentSessionsTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.ConcurrentSessions;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryConcurrentSessionsTest extends ConcurrentSessions {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryConcurrentSessionsTest extends ConcurrentSessions {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryCondstoreTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryCondstoreTest.java
index 63c2041..da7dab0 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryCondstoreTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryCondstoreTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.host.JamesImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Condstore;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryCondstoreTest extends Condstore {
-
     private JamesImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryCopyTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryCopyTest.java
index ebb507d..892cb8e 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryCopyTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryCopyTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Copy;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryCopyTest extends Copy {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryCopyTest extends Copy {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryEventsTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryEventsTest.java
index e9e1f6d..13783c6 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryEventsTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryEventsTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Events;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryEventsTest extends Events {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryEventsTest extends Events {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryExpungeTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryExpungeTest.java
index a919ef9..c917f50 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryExpungeTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryExpungeTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Expunge;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryExpungeTest extends Expunge {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryExpungeTest extends Expunge {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchBodySectionTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchBodySectionTest.java
index 98ef5dc..8ed5592 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchBodySectionTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchBodySectionTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodySection;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryFetchBodySectionTest extends FetchBodySection {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryFetchBodySectionTest extends FetchBodySection {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchBodyStructureTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchBodyStructureTest.java
index 040e463..d20c4c4 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchBodyStructureTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchBodyStructureTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodyStructure;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryFetchBodyStructureTest extends FetchBodyStructure {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryFetchBodyStructureTest extends FetchBodyStructure {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchHeadersTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchHeadersTest.java
index d16067f..b22d0cd 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchHeadersTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchHeadersTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.FetchHeaders;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryFetchHeadersTest extends FetchHeaders {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryFetchHeadersTest extends FetchHeaders {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchTest.java
index 2fad6b7..b3c2f57 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryFetchTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Fetch;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryFetchTest extends Fetch {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryFetchTest extends Fetch {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryListingTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryListingTest.java
index 5635007..e1b9d64 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryListingTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryListingTest.java
@@ -25,15 +25,14 @@ import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Listing;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public class InMemoryListingTest extends Listing {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -56,5 +55,4 @@ public class InMemoryListingTest extends Listing {
             .withLocale(Locale.KOREA)
             .run("ListSpecialChar");
     }
-
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryListingWithSharingTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryListingWithSharingTest.java
index f3c1b97..6e73887 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryListingWithSharingTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryListingWithSharingTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.ListingWithSharingTest;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryListingWithSharingTest extends ListingWithSharingTest {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryListingWithSharingTest extends ListingWithSharingTest {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxAnnotationTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxAnnotationTest.java
index b977684..352413f 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxAnnotationTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxAnnotationTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.MailboxAnnotation;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryMailboxAnnotationTest extends MailboxAnnotation {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryMailboxAnnotationTest extends MailboxAnnotation {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxWithLongNameErrorTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxWithLongNameErrorTest.java
index 14f52d3..0752f14 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxWithLongNameErrorTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxWithLongNameErrorTest.java
@@ -22,13 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.MailboxWithLongNameError;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryMailboxWithLongNameErrorTest extends MailboxWithLongNameError {
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMoveTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMoveTest.java
index b251ea3..87512c7 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMoveTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMoveTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Move;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryMoveTest extends Move {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryMoveTest extends Move {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryNonAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryNonAuthenticatedStateTest.java
index 0c42769..8f901a3 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryNonAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryNonAuthenticatedStateTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.NonAuthenticatedState;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryNonAuthenticatedStateTest extends NonAuthenticatedState {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryNonAuthenticatedStateTest extends NonAuthenticatedState {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryPartialFetchTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryPartialFetchTest.java
index 4c0c8fe..95d6eb2 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryPartialFetchTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryPartialFetchTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.PartialFetch;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryPartialFetchTest extends PartialFetch {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryPartialFetchTest extends PartialFetch {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryQuotaTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryQuotaTest.java
index 2118168..705b7ab 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryQuotaTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryQuotaTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.QuotaTest;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryQuotaTest extends QuotaTest {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryQuotaTest extends QuotaTest {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRecentTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRecentTest.java
index 5d2f4d9..415d9e6 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRecentTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRecentTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Recent;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryRecentTest extends Recent {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryRecentTest extends Recent {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRenameTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRenameTest.java
index 25a4b1e..b31b144 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRenameTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRenameTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Rename;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryRenameTest extends Rename {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryRenameTest extends Rename {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySearchTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySearchTest.java
index 811a716..8b605ae 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySearchTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySearchTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Search;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemorySearchTest extends Search {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemorySearchTest extends Search {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySecurityTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySecurityTest.java
index e8fef2f..f5ab9e0 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySecurityTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySecurityTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Security;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemorySecurityTest extends Security {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemorySecurityTest extends Security {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectTest.java
index 485d329..2b78ad7 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Select;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemorySelectTest extends Select {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemorySelectTest extends Select {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedInboxTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedInboxTest.java
index 64ef6bd..354036b 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedInboxTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedInboxTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.SelectedInbox;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemorySelectedInboxTest extends SelectedInbox {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemorySelectedInboxTest extends SelectedInbox {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedStateTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedStateTest.java
index 91fe52b..85792a4 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedStateTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedStateTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.SelectedState;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemorySelectedStateTest extends SelectedState {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemorySelectedStateTest extends SelectedState {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchOnIndexTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchOnIndexTest.java
index be5f752..b1f0ca0 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchOnIndexTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchOnIndexTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.UidSearchOnIndex;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryUidSearchOnIndexTest extends UidSearchOnIndex {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryUidSearchOnIndexTest extends UidSearchOnIndex {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchTest.java
index 40ab012..ff2fc30 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.UidSearch;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryUidSearchTest extends UidSearch {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryUidSearchTest extends UidSearch {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUserFlagsSupportTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUserFlagsSupportTest.java
index 4b7a0ab..ed10cd7 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUserFlagsSupportTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUserFlagsSupportTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.inmemory;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.inmemory.host.InMemoryHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.UserFlagsSupport;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class InMemoryUserFlagsSupportTest extends UserFlagsSupport {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new InMemoryHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class InMemoryUserFlagsSupportTest extends UserFlagsSupport {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatePlainTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatePlainTest.java
index 69a507a..fafd219 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatePlainTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatePlainTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatePlain;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaAuthenticatePlainTest extends AuthenticatePlain {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
-    
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
+
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatedStateTest.java
index 9716a4d..2060595 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatedStateTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatedState;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaAuthenticatedStateTest extends AuthenticatedState {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
-    
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
+
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaConcurrentSessionsTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaConcurrentSessionsTest.java
index 23f595e..886ee18 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaConcurrentSessionsTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaConcurrentSessionsTest.java
@@ -20,17 +20,17 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.ConcurrentSessions;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaConcurrentSessionsTest extends ConcurrentSessions {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 
     @Override
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCondstoreTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCondstoreTest.java
index 2cc6663..0a178b2 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCondstoreTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCondstoreTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.host.JamesImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Condstore;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaCondstoreTest extends Condstore {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected JamesImapHostSystem createJamesImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCopyTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCopyTest.java
index 3229e04..4af64ab 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCopyTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCopyTest.java
@@ -20,17 +20,17 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Copy;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaCopyTest extends Copy {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 
     @Override
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaEventsTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaEventsTest.java
index 7632d83..e0b40ea 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaEventsTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaEventsTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Events;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaEventsTest extends Events {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaExpungeTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaExpungeTest.java
index a19bd91..e72b7e2 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaExpungeTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaExpungeTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Expunge;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaExpungeTest extends Expunge {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodySectionTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodySectionTest.java
index 307ca90..04b3405 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodySectionTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodySectionTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodySection;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaFetchBodySectionTest extends FetchBodySection {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodyStructureTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodyStructureTest.java
index 01d5b82..4c1e10e 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodyStructureTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodyStructureTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodyStructure;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaFetchBodyStructureTest extends FetchBodyStructure {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchHeadersTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchHeadersTest.java
index babefad..193e932 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchHeadersTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchHeadersTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.FetchHeaders;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaFetchHeadersTest extends FetchHeaders {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchTest.java
index 2ae4fda..5a0e632 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Fetch;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaFetchTest extends Fetch {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaListingTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaListingTest.java
index 13ef593..982483d 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaListingTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaListingTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Listing;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaListingTest extends Listing {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxAnnotationTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxAnnotationTest.java
index b195b9c..722fa7e 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxAnnotationTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxAnnotationTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.MailboxAnnotation;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaMailboxAnnotationTest extends MailboxAnnotation {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxWithLongNameErrorTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxWithLongNameErrorTest.java
index 5cb028e..307d94c 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxWithLongNameErrorTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxWithLongNameErrorTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.MailboxWithLongNameError;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaMailboxWithLongNameErrorTest extends MailboxWithLongNameError {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMoveTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMoveTest.java
index 81767c0..3fcaf00 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMoveTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMoveTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Move;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaMoveTest extends Move {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaNonAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaNonAuthenticatedStateTest.java
index 2819006..818d7d9 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaNonAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaNonAuthenticatedStateTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.NonAuthenticatedState;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaNonAuthenticatedStateTest extends NonAuthenticatedState {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaPartialFetchTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaPartialFetchTest.java
index e1b26ba..2946c61 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaPartialFetchTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaPartialFetchTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.PartialFetch;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaPartialFetchTest extends PartialFetch {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaQuotaTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaQuotaTest.java
index c4a6a98..d6a8d81 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaQuotaTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaQuotaTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.QuotaTest;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaQuotaTest extends QuotaTest {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaRenameTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaRenameTest.java
index a2667a3..518cb89 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaRenameTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaRenameTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Rename;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaRenameTest extends Rename {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSearchTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSearchTest.java
index 1f53c55..f947db5 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSearchTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSearchTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Search;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaSearchTest extends Search {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSecurityTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSecurityTest.java
index 1fd05b7..e914703 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSecurityTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSecurityTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Security;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaSecurityTest extends Security {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectTest.java
index 4d0588e..60867e6 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Select;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaSelectTest extends Select {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedInboxTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedInboxTest.java
index c896d34..c630fdf 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedInboxTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedInboxTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.SelectedInbox;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaSelectedInboxTest extends SelectedInbox {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedStateTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedStateTest.java
index 8aaecea..6cdd380 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedStateTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedStateTest.java
@@ -20,17 +20,17 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.SelectedState;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaSelectedStateTest extends SelectedState {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 
     @Override
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchOnIndexTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchOnIndexTest.java
index ee1e03d..c816c4b 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchOnIndexTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchOnIndexTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.UidSearchOnIndex;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaUidSearchOnIndexTest extends UidSearchOnIndex {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchTest.java
index 9ba48f4..07ff8a7 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.UidSearch;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaUidSearchTest extends UidSearch {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUserFlagsSupportTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUserFlagsSupportTest.java
index 37fc21f..bfb81dd 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUserFlagsSupportTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUserFlagsSupportTest.java
@@ -20,16 +20,16 @@
 package org.apache.james.mpt.imapmailbox.jpa;
 
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemRule;
+import org.apache.james.mpt.imapmailbox.jpa.host.JPAHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.UserFlagsSupport;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class JpaUserFlagsSupportTest extends UserFlagsSupport {
-    @Rule
-    public JPAHostSystemRule hostSystemRule = new JPAHostSystemRule();
+    @RegisterExtension
+    public JPAHostSystemExtension hostSystemExtension = new JPAHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystemRule.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystemExtension.java
similarity index 77%
rename from mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystemRule.java
rename to mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystemExtension.java
index 40e5db5..8506a7b 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystemRule.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystemExtension.java
@@ -20,12 +20,14 @@
 package org.apache.james.mpt.imapmailbox.jpa.host;
 
 import org.apache.james.mpt.host.JamesImapHostSystem;
-import org.junit.rules.ExternalResource;
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
 
-public class JPAHostSystemRule extends ExternalResource {
+public class JPAHostSystemExtension implements BeforeEachCallback, AfterEachCallback {
     private final JamesImapHostSystem hostSystem;
 
-    public JPAHostSystemRule() {
+    public JPAHostSystemExtension() {
         try {
             hostSystem = JPAHostSystem.build();
         } catch (Exception e) {
@@ -34,17 +36,14 @@ public class JPAHostSystemRule extends ExternalResource {
     }
 
     @Override
-    protected void before() throws Throwable {
-        hostSystem.beforeTest();
+    public void afterEach(ExtensionContext extensionContext) throws Exception {
+
+        hostSystem.afterTest();
     }
 
     @Override
-    protected void after() {
-        try {
-            hostSystem.afterTest();
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+    public void beforeEach(ExtensionContext extensionContext) throws Exception {
+        hostSystem.beforeTest();
     }
 
     public JamesImapHostSystem getHostSystem() {
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneAuthenticatePlainTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneAuthenticatePlainTest.java
index 4d9896e..85ca3af 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneAuthenticatePlainTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneAuthenticatePlainTest.java
@@ -23,14 +23,13 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatePlain;
 import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneAuthenticatePlainTest extends AuthenticatePlain {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -46,5 +45,4 @@ public class LuceneAuthenticatePlainTest extends AuthenticatePlain {
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneAuthenticatedStateTest.java
index c95ae9a..5938954 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneAuthenticatedStateTest.java
@@ -23,14 +23,13 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatedState;
 import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneAuthenticatedStateTest extends AuthenticatedState {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -46,5 +45,4 @@ public class LuceneAuthenticatedStateTest extends AuthenticatedState {
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneConcurrentSessionsTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneConcurrentSessionsTest.java
index a28d5e3..f7a218c 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneConcurrentSessionsTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneConcurrentSessionsTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.ConcurrentSessions;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneConcurrentSessionsTest extends ConcurrentSessions {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneConcurrentSessionsTest extends ConcurrentSessions {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneCondstoreTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneCondstoreTest.java
index b23a6ce..2a61f08 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneCondstoreTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneCondstoreTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.host.JamesImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Condstore;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneCondstoreTest extends Condstore {
-
     private JamesImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneCondstoreTest extends Condstore {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneCopyTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneCopyTest.java
index 82133ab..30ed603 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneCopyTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneCopyTest.java
@@ -22,15 +22,15 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Copy;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneCopyTest extends Copy {
 
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,7 +42,7 @@ public class LuceneCopyTest extends Copy {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneEventsTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneEventsTest.java
index 6382ba2..822ae0a 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneEventsTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneEventsTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Events;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneEventsTest extends Events {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneEventsTest extends Events {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneExpungeTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneExpungeTest.java
index 14815c9..185db2c 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneExpungeTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneExpungeTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Expunge;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneExpungeTest extends Expunge {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneExpungeTest extends Expunge {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchBodySectionTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchBodySectionTest.java
index d950120..bec35f6 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchBodySectionTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchBodySectionTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodySection;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneFetchBodySectionTest extends FetchBodySection {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneFetchBodySectionTest extends FetchBodySection {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchBodyStructureTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchBodyStructureTest.java
index 8cdd3b4..13dfc11 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchBodyStructureTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchBodyStructureTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodyStructure;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneFetchBodyStructureTest extends FetchBodyStructure {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneFetchBodyStructureTest extends FetchBodyStructure {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchHeadersTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchHeadersTest.java
index 300be91..8557091 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchHeadersTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchHeadersTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.FetchHeaders;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneFetchHeadersTest extends FetchHeaders {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneFetchHeadersTest extends FetchHeaders {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchTest.java
index 3d31f11..da9191e 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneFetchTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Fetch;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneFetchTest extends Fetch {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneFetchTest extends Fetch {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneListingTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneListingTest.java
index 7b48142..ac1b3e6 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneListingTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneListingTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Listing;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneListingTest extends Listing {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneListingTest extends Listing {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMailboxAnnotationTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMailboxAnnotationTest.java
index 017e5e8..03e84cb 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMailboxAnnotationTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMailboxAnnotationTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.MailboxAnnotation;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneMailboxAnnotationTest extends MailboxAnnotation {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneMailboxAnnotationTest extends MailboxAnnotation {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMailboxWithLongNameErrorTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMailboxWithLongNameErrorTest.java
index 3376c4b..e351a9d 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMailboxWithLongNameErrorTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMailboxWithLongNameErrorTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.MailboxWithLongNameError;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneMailboxWithLongNameErrorTest extends MailboxWithLongNameError {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneMailboxWithLongNameErrorTest extends MailboxWithLongNameError
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMoveTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMoveTest.java
index a0bf1c4..92b9a04 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMoveTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneMoveTest.java
@@ -23,14 +23,13 @@ import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Move;
 import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneMoveTest extends Move {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -46,5 +45,4 @@ public class LuceneMoveTest extends Move {
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneNonAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneNonAuthenticatedStateTest.java
index 8a346f6..3e86baa 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneNonAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneNonAuthenticatedStateTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.NonAuthenticatedState;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneNonAuthenticatedStateTest extends NonAuthenticatedState {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneNonAuthenticatedStateTest extends NonAuthenticatedState {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LucenePartialFetchTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LucenePartialFetchTest.java
index a04e9af..5fffd2e 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LucenePartialFetchTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LucenePartialFetchTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.PartialFetch;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LucenePartialFetchTest extends PartialFetch {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LucenePartialFetchTest extends PartialFetch {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneQuotaTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneQuotaTest.java
index 5224d9e..d62a5a8 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneQuotaTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneQuotaTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.QuotaTest;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneQuotaTest extends QuotaTest {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -40,5 +39,4 @@ public class LuceneQuotaTest extends QuotaTest {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneRecentTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneRecentTest.java
index 40608eb..ff57000 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneRecentTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneRecentTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Recent;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneRecentTest extends Recent {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneRecentTest extends Recent {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneRenameTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneRenameTest.java
index c688815..b4d3326 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneRenameTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneRenameTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Rename;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneRenameTest extends Rename {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneRenameTest extends Rename {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSecurityTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSecurityTest.java
index 94267a1..ed6167d 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSecurityTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSecurityTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Security;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneSecurityTest extends Security {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneSecurityTest extends Security {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectTest.java
index fd3f455..e4721ac 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Select;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneSelectTest extends Select {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneSelectTest extends Select {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectedInboxTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectedInboxTest.java
index 7a878bb..b3590b8 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectedInboxTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectedInboxTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.SelectedInbox;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneSelectedInboxTest extends SelectedInbox {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneSelectedInboxTest extends SelectedInbox {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectedStateTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectedStateTest.java
index 829ba57..f8c18af 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectedStateTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneSelectedStateTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.SelectedState;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneSelectedStateTest extends SelectedState {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneSelectedStateTest extends SelectedState {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneUidSearchOnIndexTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneUidSearchOnIndexTest.java
index f60c95f..1fd679e 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneUidSearchOnIndexTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneUidSearchOnIndexTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.UidSearchOnIndex;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneUidSearchOnIndexTest extends UidSearchOnIndex {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneUidSearchOnIndexTest extends UidSearchOnIndex {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneUserFlagsSupportTest.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneUserFlagsSupportTest.java
index 5295316..60825e2 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneUserFlagsSupportTest.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/LuceneUserFlagsSupportTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.lucenesearch;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.lucenesearch.host.LuceneSearchHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.UserFlagsSupport;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class LuceneUserFlagsSupportTest extends UserFlagsSupport {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new LuceneSearchHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class LuceneUserFlagsSupportTest extends UserFlagsSupport {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatePlainTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatePlainTest.java
index d5c7b8e..f7eaef0 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatePlainTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatePlainTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatePlain;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirAuthenticatePlainTest extends AuthenticatePlain {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirAuthenticatePlainTest extends AuthenticatePlain {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatedStateTest.java
index 0247e8d..f3eb02b 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatedStateTest.java
@@ -22,29 +22,27 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatedState;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirAuthenticatedStateTest extends AuthenticatedState {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
         super.setUp();
     }
-    
+
     @Override
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirConcurrentSessionsTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirConcurrentSessionsTest.java
index 947684e..59937ff 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirConcurrentSessionsTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirConcurrentSessionsTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.ConcurrentSessions;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirConcurrentSessionsTest extends ConcurrentSessions {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirConcurrentSessionsTest extends ConcurrentSessions {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCondstoreTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCondstoreTest.java
index 09813fd..c23d855 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCondstoreTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCondstoreTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.host.JamesImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Condstore;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirCondstoreTest extends Condstore {
-
     private JamesImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirCondstoreTest extends Condstore {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCopyTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCopyTest.java
index 8cff96e..7aa0925 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCopyTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCopyTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Copy;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirCopyTest extends Copy {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirCopyTest extends Copy {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirEventsTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirEventsTest.java
index 3987e90..d42aab5 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirEventsTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirEventsTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Events;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirEventsTest extends Events {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirEventsTest extends Events {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirExpungeTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirExpungeTest.java
index 04f781d..3c04e46 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirExpungeTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirExpungeTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Expunge;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirExpungeTest extends Expunge {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirExpungeTest extends Expunge {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodySectionTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodySectionTest.java
index 549b502..67ae0bb 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodySectionTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodySectionTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodySection;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirFetchBodySectionTest extends FetchBodySection {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirFetchBodySectionTest extends FetchBodySection {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodyStructureTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodyStructureTest.java
index f57cee6..1d75318 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodyStructureTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodyStructureTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodyStructure;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirFetchBodyStructureTest extends FetchBodyStructure {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirFetchBodyStructureTest extends FetchBodyStructure {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchHeadersTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchHeadersTest.java
index 26c1fc7..c60d89b 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchHeadersTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchHeadersTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.FetchHeaders;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirFetchHeadersTest extends FetchHeaders {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirFetchHeadersTest extends FetchHeaders {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchTest.java
index 9de03be..2d5d29f 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Fetch;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirFetchTest extends Fetch {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirFetchTest extends Fetch {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirListingTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirListingTest.java
index 1440645..86ba749 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirListingTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirListingTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Listing;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirListingTest extends Listing {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirListingTest extends Listing {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMailboxAnnotationTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMailboxAnnotationTest.java
index 06ad3b2..378a212 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMailboxAnnotationTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMailboxAnnotationTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.MailboxAnnotation;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirMailboxAnnotationTest extends MailboxAnnotation {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         super.setUp();
@@ -41,9 +40,8 @@ public class MaildirMailboxAnnotationTest extends MailboxAnnotation {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMailboxWithLongNameErrorTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMailboxWithLongNameErrorTest.java
index 51349d5..d1223c6 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMailboxWithLongNameErrorTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMailboxWithLongNameErrorTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.MailboxWithLongNameError;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirMailboxWithLongNameErrorTest extends MailboxWithLongNameError {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirMailboxWithLongNameErrorTest extends MailboxWithLongNameErro
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMoveTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMoveTest.java
index 49cf4ff..f83abda 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMoveTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirMoveTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Move;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirMoveTest extends Move {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         super.setUp();
@@ -41,9 +40,8 @@ public class MaildirMoveTest extends Move {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirNonAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirNonAuthenticatedStateTest.java
index 75d4070..5153fd0 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirNonAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirNonAuthenticatedStateTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.NonAuthenticatedState;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirNonAuthenticatedStateTest extends NonAuthenticatedState {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirNonAuthenticatedStateTest extends NonAuthenticatedState {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirPartialFetchTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirPartialFetchTest.java
index 1428f07..987f1dd 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirPartialFetchTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirPartialFetchTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.PartialFetch;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirPartialFetchTest extends PartialFetch {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirPartialFetchTest extends PartialFetch {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirQuotaTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirQuotaTest.java
index def609a..4691cd2 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirQuotaTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirQuotaTest.java
@@ -22,14 +22,13 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.QuotaTest;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirQuotaTest extends QuotaTest {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         super.setUp();
@@ -39,5 +38,4 @@ public class MaildirQuotaTest extends QuotaTest {
     protected ImapHostSystem createImapHostSystem() {
         return system;
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirRenameTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirRenameTest.java
index 9324c39..188d7d9 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirRenameTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirRenameTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Rename;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirRenameTest extends Rename {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirRenameTest extends Rename {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSearchTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSearchTest.java
index 4d903f2..6f1f0d2 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSearchTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSearchTest.java
@@ -22,15 +22,15 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Search;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirSearchTest extends Search {
 
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,7 +42,7 @@ public class MaildirSearchTest extends Search {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSecurityTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSecurityTest.java
index d4be6a3..ccd0868 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSecurityTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSecurityTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Security;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirSecurityTest extends Security {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirSecurityTest extends Security {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectTest.java
index 856e30b..ed38849 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.Select;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirSelectTest extends Select {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirSelectTest extends Select {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedInboxTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedInboxTest.java
index 8f951ee..d5d1af9 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedInboxTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedInboxTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.SelectedInbox;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirSelectedInboxTest extends SelectedInbox {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirSelectedInboxTest extends SelectedInbox {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedStateTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedStateTest.java
index 2c6dc6a..4a88e6a 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedStateTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedStateTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.SelectedState;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirSelectedStateTest extends SelectedState {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirSelectedStateTest extends SelectedState {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchOnIndexTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchOnIndexTest.java
index 73776d0..c5ee110 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchOnIndexTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchOnIndexTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.UidSearchOnIndex;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirUidSearchOnIndexTest extends UidSearchOnIndex {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirUidSearchOnIndexTest extends UidSearchOnIndex {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchTest.java
index 2024150..7dbdb6c 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.UidSearch;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirUidSearchTest extends UidSearch {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirUidSearchTest extends UidSearch {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUserFlagsSupportTest.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUserFlagsSupportTest.java
index 3cf1d10..b776f94 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUserFlagsSupportTest.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUserFlagsSupportTest.java
@@ -22,15 +22,14 @@ package org.apache.james.mpt.imapmailbox.maildir;
 import org.apache.james.mpt.api.ImapHostSystem;
 import org.apache.james.mpt.imapmailbox.maildir.host.MaildirHostSystem;
 import org.apache.james.mpt.imapmailbox.suite.UserFlagsSupport;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 public class MaildirUserFlagsSupportTest extends UserFlagsSupport {
-
     private ImapHostSystem system;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         system = new MaildirHostSystem();
         system.beforeTest();
@@ -42,9 +41,8 @@ public class MaildirUserFlagsSupportTest extends UserFlagsSupport {
         return system;
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         system.afterTest();
     }
-    
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQAuthenticatePlainTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQAuthenticatePlainTest.java
index 7884439..327f923 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQAuthenticatePlainTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQAuthenticatePlainTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatePlain;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQAuthenticatePlainTest extends AuthenticatePlain {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQAuthenticatedStateTest.java
index 12c5feb..46e81c5 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQAuthenticatedStateTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.AuthenticatedState;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQAuthenticatedStateTest extends AuthenticatedState {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
-    
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQConcurrentSessionsTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQConcurrentSessionsTest.java
index f2fa662..15124a5 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQConcurrentSessionsTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQConcurrentSessionsTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.ConcurrentSessions;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQConcurrentSessionsTest extends ConcurrentSessions {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQCondstoreTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQCondstoreTest.java
index 2232338..2f3fa00 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQCondstoreTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQCondstoreTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.host.JamesImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Condstore;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQCondstoreTest extends Condstore {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected JamesImapHostSystem createJamesImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQCopyTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQCopyTest.java
index bcf7cde..38673ae 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQCopyTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQCopyTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Copy;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQCopyTest extends Copy {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQEventsTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQEventsTest.java
index 9dbd98c..6a3b72e 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQEventsTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQEventsTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Events;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQEventsTest extends Events {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchBodySectionTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchBodySectionTest.java
index f6b8fc1..76e5cee 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchBodySectionTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchBodySectionTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodySection;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQFetchBodySectionTest extends FetchBodySection {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchBodyStructureTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchBodyStructureTest.java
index c035570..6bc819a 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchBodyStructureTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchBodyStructureTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodyStructure;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQFetchBodyStructureTest extends FetchBodyStructure {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchHeadersTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchHeadersTest.java
index a021a8d..d854b42 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchHeadersTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchHeadersTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.FetchHeaders;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQFetchHeadersTest extends FetchHeaders {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchTest.java
index 25749d0..ac3d063 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQFetchTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Fetch;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQFetchTest extends Fetch {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQListingTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQListingTest.java
index f714173..e6f42a3 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQListingTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQListingTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Listing;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQListingTest extends Listing {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQListingWithSharingTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQListingWithSharingTest.java
index 86288e2..0198237 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQListingWithSharingTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQListingWithSharingTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.ListingWithSharingTest;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQListingWithSharingTest extends ListingWithSharingTest {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMailboxAnnotationTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMailboxAnnotationTest.java
index d093a37..4ace4c3 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMailboxAnnotationTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMailboxAnnotationTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.MailboxAnnotation;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQMailboxAnnotationTest extends MailboxAnnotation {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMailboxWithLongNameErrorTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMailboxWithLongNameErrorTest.java
index 15e2936..0efce94 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMailboxWithLongNameErrorTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMailboxWithLongNameErrorTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.MailboxWithLongNameError;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQMailboxWithLongNameErrorTest extends MailboxWithLongNameError {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMoveTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMoveTest.java
index 5358cf7..122444d 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMoveTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQMoveTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Move;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQMoveTest extends Move {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQNonAuthenticatedStateTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQNonAuthenticatedStateTest.java
index ba1bbf4..02738d2 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQNonAuthenticatedStateTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQNonAuthenticatedStateTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.NonAuthenticatedState;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQNonAuthenticatedStateTest extends NonAuthenticatedState {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQPartialFetchTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQPartialFetchTest.java
index 6773d25..6716140 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQPartialFetchTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQPartialFetchTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.PartialFetch;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQPartialFetchTest extends PartialFetch {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQQuotaTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQQuotaTest.java
index dd9b39f..dbeb2a9 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQQuotaTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQQuotaTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.QuotaTest;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQQuotaTest extends QuotaTest {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQRenameTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQRenameTest.java
index aa643ef..58aa5f2 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQRenameTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQRenameTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Rename;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQRenameTest extends Rename {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSearchTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSearchTest.java
index 9d0f260..7e3f0a9 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSearchTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSearchTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Search;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQSearchTest extends Search {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSecurityTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSecurityTest.java
index db61a4a..e4c4b7f 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSecurityTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSecurityTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Security;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQSecurityTest extends Security {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectTest.java
index 750b2e1..540710f 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.Select;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQSelectTest extends Select {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectedInboxTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectedInboxTest.java
index 67502e1..e9aed25 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectedInboxTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectedInboxTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.SelectedInbox;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQSelectedInboxTest extends SelectedInbox {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectedStateTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectedStateTest.java
index 35387aa..be06cf5 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectedStateTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQSelectedStateTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.SelectedState;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQSelectedStateTest extends SelectedState {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQUidSearchTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQUidSearchTest.java
index 6c27aa1..f6e3091 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQUidSearchTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQUidSearchTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.UidSearch;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQUidSearchTest extends UidSearch {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQUserFlagsSupportTest.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQUserFlagsSupportTest.java
index 92dfe8f..102cbaa 100644
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQUserFlagsSupportTest.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/RabbitMQUserFlagsSupportTest.java
@@ -19,21 +19,17 @@
 
 package org.apache.james.mpt.imapmailbox.rabbitmq;
 
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
 import org.apache.james.mpt.api.ImapHostSystem;
-import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemRule;
+import org.apache.james.mpt.imapmailbox.rabbitmq.host.RabbitMQEventBusHostSystemExtension;
 import org.apache.james.mpt.imapmailbox.suite.UserFlagsSupport;
-import org.junit.Rule;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class RabbitMQUserFlagsSupportTest extends UserFlagsSupport {
-    @Rule
-    public DockerRabbitMQTestRule rabbitMQRule = new DockerRabbitMQTestRule();
-
-    @Rule
-    public RabbitMQEventBusHostSystemRule hostSystemRule = new RabbitMQEventBusHostSystemRule(rabbitMQRule);
+    @RegisterExtension
+    static RabbitMQEventBusHostSystemExtension hostSystemExtension = new RabbitMQEventBusHostSystemExtension();
 
     @Override
     protected ImapHostSystem createImapHostSystem() {
-        return hostSystemRule.getHostSystem();
+        return hostSystemExtension.getHostSystem();
     }
 }
diff --git a/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/DockerRabbitMQTestRule.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystemExtension.java
similarity index 57%
rename from backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/DockerRabbitMQTestRule.java
rename to mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystemExtension.java
index 23d99c0..c1c8ed0 100644
--- a/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/DockerRabbitMQTestRule.java
+++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystemExtension.java
@@ -16,34 +16,40 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.backends.rabbitmq;
 
-import static org.apache.james.backends.rabbitmq.RabbitMQFixture.DEFAULT_MANAGEMENT_CREDENTIAL;
+package org.apache.james.mpt.imapmailbox.rabbitmq.host;
 
-import org.junit.rules.ExternalResource;
+import org.apache.james.backends.rabbitmq.RabbitMQExtension;
+import org.apache.james.backends.rabbitmq.RabbitMQManagementAPI;
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
 
 import com.github.fge.lambdas.runnable.ThrowingRunnable;
 
-public class DockerRabbitMQTestRule extends ExternalResource {
+public class RabbitMQEventBusHostSystemExtension implements BeforeEachCallback, AfterEachCallback {
+    private final RabbitMQExtension rabbitMQExtension;
+    private RabbitMQEventBusHostSystem hostSystem;
 
-    private DockerRabbitMQ dockerRabbitMQ;
-
-    public DockerRabbitMQTestRule() {
-        dockerRabbitMQ = DockerRabbitMQSingleton.SINGLETON;
+    public RabbitMQEventBusHostSystemExtension() {
+        rabbitMQExtension = RabbitMQExtension.singletonRabbitMQ()
+            .isolationPolicy(RabbitMQExtension.IsolationPolicy.WEAK);
     }
 
     @Override
-    protected void before() throws Throwable {
-        dockerRabbitMQ.start();
-    }
-
-    @Override
-    protected void after() {
+    public void afterEach(ExtensionContext extensionContext) {
         performQuietly(() -> {
-            RabbitMQManagementAPI managementAPI = managementAPI();
+            RabbitMQManagementAPI managementAPI = rabbitMQExtension.managementAPI();
             managementAPI.listQueues()
                 .forEach(queue -> managementAPI.deleteQueue("/", queue.getName()));
         });
+        hostSystem.afterTest();
+    }
+
+    @Override
+    public void beforeEach(ExtensionContext extensionContext) throws Exception {
+        hostSystem = new RabbitMQEventBusHostSystem(rabbitMQExtension.getRabbitMQ());
+        hostSystem.beforeTest();
     }
 
     private void performQuietly(ThrowingRunnable runnable) {
@@ -54,15 +60,7 @@ public class DockerRabbitMQTestRule extends ExternalResource {
         }
     }
 
-    private RabbitMQManagementAPI managementAPI() throws Exception {
-        return RabbitMQManagementAPI.from(RabbitMQConfiguration.builder()
-            .amqpUri(dockerRabbitMQ.amqpUri())
-            .managementUri(dockerRabbitMQ.managementUri())
-            .managementCredentials(DEFAULT_MANAGEMENT_CREDENTIAL)
-            .build());
-    }
-
-    public DockerRabbitMQ getDockerRabbitMQ() {
-        return dockerRabbitMQ;
+    public RabbitMQEventBusHostSystem getHostSystem() {
+        return hostSystem;
     }
 }
diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystemRule.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystemRule.java
deleted file mode 100644
index 8fb818b..0000000
--- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystemRule.java
+++ /dev/null
@@ -1,52 +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.mpt.imapmailbox.rabbitmq.host;
-
-import org.apache.james.backends.rabbitmq.DockerRabbitMQTestRule;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
-public class RabbitMQEventBusHostSystemRule implements TestRule {
-
-    private final DockerRabbitMQTestRule dockerRabbitMQTestRule;
-    private RabbitMQEventBusHostSystem hostSystem;
-
-    public RabbitMQEventBusHostSystemRule(DockerRabbitMQTestRule dockerRabbitMQTestRule) {
-        this.dockerRabbitMQTestRule = dockerRabbitMQTestRule;
-    }
-
-    @Override
-    public Statement apply(Statement base, Description description) {
-        return new Statement() {
-            @Override
-            public void evaluate() throws Throwable {
-                hostSystem = new RabbitMQEventBusHostSystem(dockerRabbitMQTestRule.getDockerRabbitMQ());
-                hostSystem.beforeTest();
-                base.evaluate();
-                hostSystem.afterTest();
-            }
-        };
-    }
-
-    public RabbitMQEventBusHostSystem getHostSystem() {
-        return hostSystem;
-    }
-}
diff --git a/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/SmtpAuthCommandTest.java b/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/SmtpAuthCommandTest.java
index f45a7bd..19136da 100644
--- a/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/SmtpAuthCommandTest.java
+++ b/mpt/impl/smtp/core/src/main/java/org/apache/james/mpt/smtp/SmtpAuthCommandTest.java
@@ -21,8 +21,8 @@ package org.apache.james.mpt.smtp;
 import java.util.Locale;
 
 import org.apache.james.mpt.script.SimpleScriptedTestProtocol;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public abstract class SmtpAuthCommandTest {
 
@@ -36,7 +36,7 @@ public abstract class SmtpAuthCommandTest {
     private SmtpHostSystem hostSystem;
     private SimpleScriptedTestProtocol scriptedTest;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         hostSystem = createSmtpHostSystem();
         String scriptDir = "/org/apache/james/smtp/scripts/";


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