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:53:50 UTC

[james-project] branch master updated (98f9684 -> 053aaa9)

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

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


    from 98f9684  Merge pull request #289 from chibenwa/drop-jmap-draft-cassandra-integration-tests
     new c386502  JAMES-3500 Re-enable some reuseForks
     new 355153e  JAMES-3500 Use a wait strategy on MockSMTP server
     new c52ee9e  JAMES-3500 Reduce build verbosity
     new f73be07  JAMES-3500 Tag extra unstable test
     new d7eea88  JAMES-3500 Fix instable test in RabbitMQEventDeadLettersIntegrationTest
     new f3eb2cf  JAMES-3500 Reuse Cassandra image accross maven projects
     new 153bc57  JAMES-3500 Add a retrier for ConfigurationClient
     new d0f347b  JAMES-3255 Tag some unstable tests
     new 74e2b8d  JAMES-3500 Increase isolation for mailet integration tests
     new bea9c7e  JAMES-3500 Increase memory allocated to surefire for webadmin deployment tests
     new 735d689  JAMES-3500 Disable unused protocols in webAdmin integration tests
     new 88ae89d  JAMES-3500 Fix instable test in GetMailboxesMethodTest
     new 139dbc9  JAMES-3500 Fasten deploy: -T1C
     new 9569e94  JAMES-3491 WebSocket PUSH cancellation
     new 6698bcb  JAMES-3497 Remove unused properties in MPT master POM
     new 85f9ee2  JAMES-3497 apache-james-mpt-antlib no longer exists
     new fc23d65  [REFACTORING] Convert mpt tests to JUNIT 5
     new 053aaa9  JAMES-2884 Improve JMAP EmailBodyPart documentation formatting

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


Summary of changes:
 Jenkinsfile                                        |   3 +-
 .../james/backends/cassandra/DockerCassandra.java  |  31 +++++--
 backends-common/elasticsearch/pom.xml              |   2 +-
 backends-common/rabbitmq/pom.xml                   |   2 +-
 mailbox/api/pom.xml                                |   2 +-
 mailbox/backup/pom.xml                             |   2 +-
 mailbox/cassandra/pom.xml                          |   4 +-
 mailbox/event/json/pom.xml                         |   2 +-
 mailbox/memory/pom.xml                             |   2 +-
 mailbox/store/pom.xml                              |   2 +-
 mailbox/tools/indexer/pom.xml                      |   2 +-
 mailet/standard/pom.xml                            |   2 +-
 mdn/pom.xml                                        |   2 +-
 mpt/impl/imap-mailbox/cassandra/pom.xml            |   2 +-
 .../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 +-
 mpt/impl/imap-mailbox/inmemory/pom.xml             |   2 +-
 .../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 +-
 mpt/impl/imap-mailbox/jpa/pom.xml                  |   2 +-
 .../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 ++---
 mpt/impl/imap-mailbox/lucenesearch/pom.xml         |   2 +-
 .../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 +-
 mpt/pom.xml                                        |   4 -
 pom.xml                                            |  13 +--
 protocols/imap/pom.xml                             |   2 +-
 protocols/smtp/pom.xml                             |   2 +-
 server/blob/blob-cassandra/pom.xml                 |   2 +-
 server/blob/blob-memory/pom.xml                    |   2 +-
 server/blob/blob-s3/pom.xml                        |  13 +++
 .../guice/cassandra-rabbitmq-guice/pom.xml         |   2 +-
 server/data/data-cassandra/pom.xml                 |   2 +-
 server/data/data-file/pom.xml                      |   2 +-
 server/mailet/integration-testing/pom.xml          |   1 -
 .../james/mailets/RemoteDeliveryErrorTest.java     |  34 +++----
 .../org/apache/james/smtp/dsn/DSNRelayTest.java    |  55 ++++-------
 .../james/smtp/dsn/DSNRemoteIntegrationTest.java   |  25 ++---
 server/mailet/mailets/pom.xml                      |   2 +-
 server/mailet/mock-smtp-server/pom.xml             |  18 +++-
 .../mock/smtp/server/ConfigurationClient.java      |   2 +
 .../mock/smtp/server/HTTPConfigurationServer.java  |   2 +-
 .../james/mock/smtp/server/MockSMTPServerMain.java |   6 +-
 .../server/testing/MockSmtpServerExtension.java    |   8 +-
 .../src/{resources => main/jib}/logback.xml        |   0
 .../mock/smtp/server/ConfigurationClientTest.java  |   2 +-
 .../smtp/server/HTTPConfigurationServerTest.java   |   3 +-
 .../mailrepository-cassandra/pom.xml               |   2 +-
 .../integration/GetMailboxesMethodTest.java        |  24 ++---
 .../pom.xml                                        |   2 +-
 server/protocols/jmap-draft/pom.xml                |   2 +-
 .../pom.xml                                        |   2 +-
 .../jmap/rfc8621/contract/WebSocketContract.scala  | 102 +++++++++++++++++++++
 .../memory-jmap-rfc-8621-integration-tests/pom.xml |  13 +++
 .../doc/specs/spec/mail/message.mdown              |   8 +-
 .../james/jmap/core/WebSocketTransport.scala       |   3 +-
 .../james/jmap/json/ResponseSerializer.scala       |   1 +
 .../apache/james/jmap/routes/WebSocketRoutes.scala |   3 +-
 .../distributed-webadmin-integration-test/pom.xml  |   4 +-
 .../RabbitMQEventDeadLettersIntegrationTest.java   |  86 ++++++++++++-----
 ...LinshareBlobExportMechanismIntegrationTest.java |   3 +
 .../src/test/resources/imapserver.xml              |  15 ---
 .../src/test/resources/lmtpserver.xml              |  18 ----
 .../src/test/resources/managesieveserver.xml       |  33 -------
 .../src/test/resources/pop3server.xml              |  19 ----
 .../src/test/resources/smtpserver.xml              |  56 -----------
 .../memory-webadmin-integration-test/pom.xml       |   4 +-
 ...LinshareBlobExportMechanismIntegrationTest.java |   3 +
 .../webadmin/routes/AddressMappingRoutesTest.java  |   1 -
 .../james/webadmin/routes/AliasRoutesTest.java     |   1 -
 .../webadmin/routes/DomainMappingsRoutesTest.java  |   1 -
 .../james/webadmin/routes/ForwardRoutesTest.java   |   1 -
 .../james/webadmin/routes/GroupsRoutesTest.java    |   1 -
 .../james/webadmin/routes/MappingRoutesTest.java   |   1 -
 .../webadmin/routes/RegexMappingRoutesTest.java    |   1 -
 .../routes/DeletedMessagesVaultRoutesTest.java     |   2 -
 server/protocols/webadmin/webadmin-mailbox/pom.xml |   2 +-
 .../java/org/apache/james/util/docker/Images.java  |   2 +-
 274 files changed, 1194 insertions(+), 1626 deletions(-)
 rename mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/host/{CassandraHostSystemRule.java => CassandraHostSystemExtension.java} (54%)
 rename mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/{JPAHostSystemRule.java => JPAHostSystemExtension.java} (77%)
 rename backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/DockerRabbitMQTestRule.java => mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystemExtension.java (57%)
 delete mode 100644 mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystemRule.java
 rename server/mailet/mock-smtp-server/src/{resources => main/jib}/logback.xml (100%)


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


[james-project] 13/18: JAMES-3500 Fasten deploy: -T1C

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

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

commit 139dbc937a06f078f8a9e7a7597979abb7bc35c3
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Feb 11 15:18:50 2021 +0700

    JAMES-3500 Fasten deploy: -T1C
    
    Deploying means uploading each jar generated by the build
    to Apache Snapshot repository.
    
    As a contributor, I hate it: it takes ages to complete, as
    tons of small objects are uploaded sequencially.
    
    A good way to speed things up is to leverage maven concurrency: instead of uploading one stuff at the same time,
    we end up uploading 16 stuff at the same time.
    
    This could take the deploy phase, currently taking 1h+ down to 5 minutes.
---
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index b027b18..1fff004 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -130,7 +130,7 @@ pipeline {
             when { branch 'master' }
             steps {
                 echo 'Deploying'
-                sh 'mvn -B -e deploy -Pdeploy -DskipTests'
+                sh 'mvn -B -e deploy -Pdeploy -DskipTests -T2C'
             }
         }
    }


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


[james-project] 07/18: JAMES-3500 Add a retrier for ConfigurationClient

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

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

commit 153bc571a18bb1b2c53b9652adb35d8a5ae22162
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat Feb 13 12:56:10 2021 +0700

    JAMES-3500 Add a retrier for ConfigurationClient
---
 .../java/org/apache/james/mock/smtp/server/ConfigurationClient.java     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/ConfigurationClient.java b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/ConfigurationClient.java
index 484d628..708edc9 100644
--- a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/ConfigurationClient.java
+++ b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/ConfigurationClient.java
@@ -42,6 +42,7 @@ import com.google.common.collect.ImmutableList;
 import feign.Feign;
 import feign.Logger;
 import feign.RequestLine;
+import feign.Retryer;
 import feign.jackson.JacksonDecoder;
 import feign.jackson.JacksonEncoder;
 import feign.slf4j.Slf4jLogger;
@@ -168,6 +169,7 @@ public interface ConfigurationClient {
             .logLevel(Logger.Level.FULL)
             .encoder(new JacksonEncoder(OBJECT_MAPPER))
             .decoder(new JacksonDecoder(OBJECT_MAPPER))
+            .retryer(new Retryer.Default())
             .target(ConfigurationClient.class, "http://" + mockServerHttpHost.asString());
     }
 


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


[james-project] 05/18: JAMES-3500 Fix instable test in RabbitMQEventDeadLettersIntegrationTest

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

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

commit d7eea88e048bca8c70c53f90ac1008618bed4825
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Feb 12 16:41:35 2021 +0700

    JAMES-3500 Fix instable test in RabbitMQEventDeadLettersIntegrationTest
    
    As storing things in dead-letter might take time, the fact
    that all events had been processed by the listener is not
    a guarantee that the event is effectively stored in
    dead-letter.
    
    Awaiting the event itself being appended is indeed more
    reliable.
---
 .../RabbitMQEventDeadLettersIntegrationTest.java   | 88 ++++++++++++++++------
 1 file changed, 64 insertions(+), 24 deletions(-)

diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java
index f933b81..edb1b30 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java
@@ -53,7 +53,6 @@ import org.apache.james.events.EventListener;
 import org.apache.james.events.Group;
 import org.apache.james.events.RetryBackoffConfiguration;
 import org.apache.james.junit.categories.BasicFeature;
-import org.apache.james.junit.categories.Unstable;
 import org.apache.james.mailbox.DefaultMailboxes;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -115,7 +114,7 @@ class RabbitMQEventDeadLettersIntegrationTest {
         }
 
         @Override
-        public void event(Event event) throws Exception {
+        public void event(Event event) {
             totalCalls.incrementAndGet();
             if (done(event)) {
                 callsByEventId.remove(event.getEventId());
@@ -161,7 +160,7 @@ class RabbitMQEventDeadLettersIntegrationTest {
         private RetryEventsListener2 retryEventsListener2;
 
         @Override
-        public void beforeEach(ExtensionContext extensionContext) throws Exception {
+        public void beforeEach(ExtensionContext extensionContext) {
             retryEventsListener = new RetryEventsListener();
             retryEventsListener2 = new RetryEventsListener2();
         }
@@ -221,7 +220,7 @@ class RabbitMQEventDeadLettersIntegrationTest {
             .overrideWith(binder -> binder.bind(RetryBackoffConfiguration.class)
                 .toInstance(RetryBackoffConfiguration.builder()
                     .maxRetries(MAX_RETRIES)
-                    .firstBackoff(java.time.Duration.ofMillis(10))
+                    .firstBackoff(java.time.Duration.ofMillis(5))
                     .jitterFactor(0.2)
                     .build())))
         .build();
@@ -285,7 +284,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES + 1);
         generateInitialEvent();
 
-        waitForCalls(retryEventsListener, MAX_RETRIES + 1);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(1)));
 
         when()
             .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID)
@@ -315,7 +317,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES + 1);
         generateInitialEvent();
 
-        waitForCalls(retryEventsListener, MAX_RETRIES + 1);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(1)));
 
         when()
             .get(EventDeadLettersRoutes.BASE_PATH + "/groups")
@@ -330,7 +335,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES + 1);
         MailboxId mailboxId = generateInitialEvent();
 
-        waitForCalls(retryEventsListener, MAX_RETRIES + 1);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(1)));
 
         String failedInsertionId = retrieveFirstFailedInsertionId();
 
@@ -352,7 +360,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         generateInitialEvent();
         generateSecondEvent();
 
-        waitForCalls(retryEventsListener, (MAX_RETRIES + 1) * 2);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(2)));
 
         when()
             .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID)
@@ -367,7 +378,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES + 1);
         generateInitialEvent();
 
-        waitForCalls(retryEventsListener, MAX_RETRIES + 1);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(1)));
 
         String failedInsertionId = retrieveFirstFailedInsertionId();
 
@@ -385,7 +399,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES + 1);
         generateInitialEvent();
 
-        waitForCalls(retryEventsListener, MAX_RETRIES + 1);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(1)));
 
         String failedInsertionId = retrieveFirstFailedInsertionId();
 
@@ -412,7 +429,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES + 1);
         generateInitialEvent();
 
-        waitForCalls(retryEventsListener, MAX_RETRIES + 1);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(1)));
 
         String failedInsertionId = retrieveFirstFailedInsertionId();
 
@@ -433,11 +453,14 @@ class RabbitMQEventDeadLettersIntegrationTest {
     }
 
     @Test
-    void failedEventShouldBeCorrectlyProcessedByListenerAfterSuccessfulRedelivery(RetryEventsListener retryEventsListener) throws InterruptedException {
+    void failedEventShouldBeCorrectlyProcessedByListenerAfterSuccessfulRedelivery(RetryEventsListener retryEventsListener) {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES + 1);
         generateInitialEvent();
 
-        waitForCalls(retryEventsListener, MAX_RETRIES + 1);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(1)));
 
         String failedInsertionId = retrieveFirstFailedInsertionId();
 
@@ -454,9 +477,6 @@ class RabbitMQEventDeadLettersIntegrationTest {
         awaitAtMostTenSeconds.until(() -> retryEventsListener.getSuccessfulEvents().size() == 1);
     }
 
-    private void waitForCalls(RetryEventsListener retryEventsListener, int count) {
-        calmlyAwait.atMost(ONE_MINUTE).until(() -> retryEventsListener.totalCalls.intValue() >= count);
-    }
 
     @Test
     void taskShouldBeCompletedAfterSuccessfulGroupRedelivery(RetryEventsListener retryEventsListener) {
@@ -464,7 +484,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         generateInitialEvent();
         generateSecondEvent();
 
-        waitForCalls(retryEventsListener, (MAX_RETRIES + 1) * 2);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(2)));
 
         String taskId = with()
             .queryParam("action", EVENTS_ACTION)
@@ -489,7 +512,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         generateInitialEvent();
         generateSecondEvent();
 
-        waitForCalls(retryEventsListener, (MAX_RETRIES + 1) * 2);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(2)));
 
         String taskId = with()
             .queryParam("action", EVENTS_ACTION)
@@ -509,14 +535,16 @@ class RabbitMQEventDeadLettersIntegrationTest {
             .body(".", hasSize(0));
     }
 
-    @Tag(Unstable.TAG)
     @Test
     void multipleFailedEventsShouldBeCorrectlyProcessedByListenerAfterSuccessfulGroupRedelivery(RetryEventsListener retryEventsListener) {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES + 1);
         generateInitialEvent();
         generateSecondEvent();
 
-        waitForCalls(retryEventsListener, (MAX_RETRIES + 1) * 2);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(2)));
 
         String taskId = with()
             .queryParam("action", EVENTS_ACTION)
@@ -537,7 +565,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         generateInitialEvent();
         generateSecondEvent();
 
-        waitForCalls(retryEventsListener, (MAX_RETRIES + 1) * 2);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(2)));
 
         String taskId = with()
             .queryParam("action", EVENTS_ACTION)
@@ -561,7 +592,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         generateInitialEvent();
         generateSecondEvent();
 
-        waitForCalls(retryEventsListener, (MAX_RETRIES + 1) * 2);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(2)));
 
         String taskId = with()
             .queryParam("action", EVENTS_ACTION)
@@ -587,7 +621,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         generateInitialEvent();
         generateSecondEvent();
 
-        waitForCalls(retryEventsListener, (MAX_RETRIES + 1) * 2);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(2)));
 
         String taskId = with()
             .queryParam("action", EVENTS_ACTION)
@@ -608,7 +645,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES * 2 + 1);
         generateInitialEvent();
 
-        waitForCalls(retryEventsListener, MAX_RETRIES + 1);
+        calmlyAwait.atMost(ONE_MINUTE).untilAsserted(() -> with()
+            .get(EventDeadLettersRoutes.BASE_PATH + "/groups/" + GROUP_ID).prettyPeek()
+            .then()
+            .body(".", hasSize(1)));
 
         String failedInsertionId = retrieveFirstFailedInsertionId();
 


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


[james-project] 15/18: JAMES-3497 Remove unused properties in MPT master POM

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

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

commit 6698bcb3dc72113eabeeca1956bb6de50ef5ebf1
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Feb 8 11:13:37 2021 +0700

    JAMES-3497 Remove unused properties in MPT master POM
---
 mpt/pom.xml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/mpt/pom.xml b/mpt/pom.xml
index 9064939..296a9fe 100644
--- a/mpt/pom.xml
+++ b/mpt/pom.xml
@@ -52,9 +52,5 @@
 
     <properties>
         <felix.plugin.version>3.3.0</felix.plugin.version>
-        <commons-lang.version>2.6</commons-lang.version>
-        <derby.version>10.14.2.0</derby.version>
-        <lucene-core.version>3.6.0</lucene-core.version>
-        <slf4j.version>1.7.25</slf4j.version>
     </properties>
 </project>


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


[james-project] 12/18: JAMES-3500 Fix instable test in GetMailboxesMethodTest

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

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

commit 88ae89daadb872b0b51317e4541fcc3b764e6ffa
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat Feb 13 07:30:27 2021 +0700

    JAMES-3500 Fix instable test in GetMailboxesMethodTest
    
    Quota update is asynchronous for the distributed
    server hence needs to be awaited.
---
 .../integration/GetMailboxesMethodTest.java        | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
index 332be1e..1261e75 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/GetMailboxesMethodTest.java
@@ -31,6 +31,7 @@ import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
 import static org.apache.james.jmap.JMAPTestingConstants.FIRST_MAILBOX;
 import static org.apache.james.jmap.JMAPTestingConstants.NAME;
 import static org.apache.james.jmap.JMAPTestingConstants.SECOND_MAILBOX;
+import static org.apache.james.jmap.JMAPTestingConstants.calmlyAwait;
 import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder;
 import static org.apache.james.jmap.JmapURIBuilder.baseUri;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -899,16 +900,17 @@ public abstract class GetMailboxesMethodTest {
 
         mailboxProbe.appendMessage(ALICE.asString(), MailboxPath.forUser(ALICE, DefaultMailboxes.INBOX), AppendCommand.from(message));
 
-        given()
-            .header("Authorization", accessToken.asString())
-            .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, \"#0\"]]")
-        .when()
-            .post("/jmap")
-        .then()
-            .statusCode(200)
-            .body(NAME, equalTo("mailboxes"))
-            .body(ARGUMENTS + ".list", hasSize(1))
-            .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['STORAGE'].used", equalTo(85))
-            .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['MESSAGE'].used", equalTo(1));
+        calmlyAwait.untilAsserted(() ->
+            given()
+                .header("Authorization", accessToken.asString())
+                .body("[[\"getMailboxes\", {\"ids\": [\"" + mailboxId + "\"]}, \"#0\"]]")
+            .when()
+                .post("/jmap")
+            .then()
+                .statusCode(200)
+                .body(NAME, equalTo("mailboxes"))
+                .body(ARGUMENTS + ".list", hasSize(1))
+                .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['STORAGE'].used", equalTo(85))
+                .body(FIRST_MAILBOX + ".quotas['#private&alice@domain.tld']['MESSAGE'].used", equalTo(1)));
     }
 }


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


[james-project] 01/18: JAMES-3500 Re-enable some reuseForks

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

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

commit c38650230ceb981c00503774068dfa62a27e7d31
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Feb 11 15:01:54 2021 +0700

    JAMES-3500 Re-enable some reuseForks
---
 backends-common/elasticsearch/pom.xml                       |  2 +-
 backends-common/rabbitmq/pom.xml                            |  2 +-
 mailbox/api/pom.xml                                         |  2 +-
 mailbox/backup/pom.xml                                      |  2 +-
 mailbox/cassandra/pom.xml                                   |  4 ++--
 mailbox/event/json/pom.xml                                  |  2 +-
 mailbox/memory/pom.xml                                      |  2 +-
 mailbox/store/pom.xml                                       |  2 +-
 mailbox/tools/indexer/pom.xml                               |  2 +-
 mailet/standard/pom.xml                                     |  2 +-
 mdn/pom.xml                                                 |  2 +-
 mpt/impl/imap-mailbox/cassandra/pom.xml                     |  2 +-
 mpt/impl/imap-mailbox/inmemory/pom.xml                      |  2 +-
 mpt/impl/imap-mailbox/jpa/pom.xml                           |  2 +-
 mpt/impl/imap-mailbox/lucenesearch/pom.xml                  |  2 +-
 protocols/imap/pom.xml                                      |  2 +-
 protocols/smtp/pom.xml                                      |  2 +-
 server/blob/blob-cassandra/pom.xml                          |  2 +-
 server/blob/blob-memory/pom.xml                             |  2 +-
 server/blob/blob-s3/pom.xml                                 | 13 +++++++++++++
 server/container/guice/cassandra-rabbitmq-guice/pom.xml     |  2 +-
 server/data/data-cassandra/pom.xml                          |  2 +-
 server/data/data-file/pom.xml                               |  2 +-
 server/mailet/integration-testing/pom.xml                   |  4 ++--
 server/mailet/mailets/pom.xml                               |  2 +-
 server/mailrepository/mailrepository-cassandra/pom.xml      |  2 +-
 .../rabbitmq-jmap-draft-integration-testing/pom.xml         |  2 +-
 server/protocols/jmap-draft/pom.xml                         |  2 +-
 .../distributed-jmap-rfc-8621-integration-tests/pom.xml     |  2 +-
 .../memory-jmap-rfc-8621-integration-tests/pom.xml          | 13 +++++++++++++
 .../distributed-webadmin-integration-test/pom.xml           |  2 +-
 .../memory-webadmin-integration-test/pom.xml                |  4 ++--
 server/protocols/webadmin/webadmin-mailbox/pom.xml          |  2 +-
 33 files changed, 60 insertions(+), 34 deletions(-)

diff --git a/backends-common/elasticsearch/pom.xml b/backends-common/elasticsearch/pom.xml
index c1d56ad..9620615 100644
--- a/backends-common/elasticsearch/pom.xml
+++ b/backends-common/elasticsearch/pom.xml
@@ -113,7 +113,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>2</forkCount>
                 </configuration>
             </plugin>
diff --git a/backends-common/rabbitmq/pom.xml b/backends-common/rabbitmq/pom.xml
index 584dc4f..1bfe6ba 100644
--- a/backends-common/rabbitmq/pom.xml
+++ b/backends-common/rabbitmq/pom.xml
@@ -115,7 +115,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>2</forkCount>
                 </configuration>
             </plugin>
diff --git a/mailbox/api/pom.xml b/mailbox/api/pom.xml
index 91339f7..ff31374 100644
--- a/mailbox/api/pom.xml
+++ b/mailbox/api/pom.xml
@@ -130,7 +130,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/mailbox/backup/pom.xml b/mailbox/backup/pom.xml
index a203ff5..854b934 100644
--- a/mailbox/backup/pom.xml
+++ b/mailbox/backup/pom.xml
@@ -95,7 +95,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/mailbox/cassandra/pom.xml b/mailbox/cassandra/pom.xml
index 12ae44d..ef3566d 100644
--- a/mailbox/cassandra/pom.xml
+++ b/mailbox/cassandra/pom.xml
@@ -200,8 +200,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
-                    <forkCount>2</forkCount>
+                    <reuseForks>true</reuseForks>
+                    <forkCount>4</forkCount>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/mailbox/event/json/pom.xml b/mailbox/event/json/pom.xml
index 5fa06d1..fadfddb 100644
--- a/mailbox/event/json/pom.xml
+++ b/mailbox/event/json/pom.xml
@@ -91,7 +91,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/mailbox/memory/pom.xml b/mailbox/memory/pom.xml
index 3c409c2..3a78ac7 100644
--- a/mailbox/memory/pom.xml
+++ b/mailbox/memory/pom.xml
@@ -109,7 +109,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/mailbox/store/pom.xml b/mailbox/store/pom.xml
index 28b59b2..7d64df7 100644
--- a/mailbox/store/pom.xml
+++ b/mailbox/store/pom.xml
@@ -144,7 +144,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/mailbox/tools/indexer/pom.xml b/mailbox/tools/indexer/pom.xml
index a34f43c..fd7e836 100644
--- a/mailbox/tools/indexer/pom.xml
+++ b/mailbox/tools/indexer/pom.xml
@@ -156,7 +156,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <argLine>-Xms128m -Xmx256m</argLine>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/mailet/standard/pom.xml b/mailet/standard/pom.xml
index d920076..a46de03 100644
--- a/mailet/standard/pom.xml
+++ b/mailet/standard/pom.xml
@@ -127,7 +127,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/mdn/pom.xml b/mdn/pom.xml
index 3bd0bd7..68e15ea 100644
--- a/mdn/pom.xml
+++ b/mdn/pom.xml
@@ -82,7 +82,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/mpt/impl/imap-mailbox/cassandra/pom.xml b/mpt/impl/imap-mailbox/cassandra/pom.xml
index b34a69b..a2753cf 100644
--- a/mpt/impl/imap-mailbox/cassandra/pom.xml
+++ b/mpt/impl/imap-mailbox/cassandra/pom.xml
@@ -103,7 +103,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>2</forkCount>
                 </configuration>
             </plugin>
diff --git a/mpt/impl/imap-mailbox/inmemory/pom.xml b/mpt/impl/imap-mailbox/inmemory/pom.xml
index 46c79cd..0edd035 100644
--- a/mpt/impl/imap-mailbox/inmemory/pom.xml
+++ b/mpt/impl/imap-mailbox/inmemory/pom.xml
@@ -76,7 +76,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/mpt/impl/imap-mailbox/jpa/pom.xml b/mpt/impl/imap-mailbox/jpa/pom.xml
index 703217b..77e815a 100644
--- a/mpt/impl/imap-mailbox/jpa/pom.xml
+++ b/mpt/impl/imap-mailbox/jpa/pom.xml
@@ -97,7 +97,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/mpt/impl/imap-mailbox/lucenesearch/pom.xml b/mpt/impl/imap-mailbox/lucenesearch/pom.xml
index 254744e..0111b39 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/pom.xml
+++ b/mpt/impl/imap-mailbox/lucenesearch/pom.xml
@@ -94,7 +94,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/protocols/imap/pom.xml b/protocols/imap/pom.xml
index de7c0b0..91bd67c 100644
--- a/protocols/imap/pom.xml
+++ b/protocols/imap/pom.xml
@@ -121,7 +121,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/protocols/smtp/pom.xml b/protocols/smtp/pom.xml
index 82b6ad1..88b524e 100644
--- a/protocols/smtp/pom.xml
+++ b/protocols/smtp/pom.xml
@@ -98,7 +98,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/server/blob/blob-cassandra/pom.xml b/server/blob/blob-cassandra/pom.xml
index 2a8c4f7..679071d 100644
--- a/server/blob/blob-cassandra/pom.xml
+++ b/server/blob/blob-cassandra/pom.xml
@@ -102,7 +102,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>2</forkCount>
                 </configuration>
             </plugin>
diff --git a/server/blob/blob-memory/pom.xml b/server/blob/blob-memory/pom.xml
index cb3badf..5284361 100644
--- a/server/blob/blob-memory/pom.xml
+++ b/server/blob/blob-memory/pom.xml
@@ -87,7 +87,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <argLine>-Xms1024m -Xmx2048m</argLine>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>
                 </configuration>
             </plugin>
diff --git a/server/blob/blob-s3/pom.xml b/server/blob/blob-s3/pom.xml
index 0d862bd..a481878 100644
--- a/server/blob/blob-s3/pom.xml
+++ b/server/blob/blob-s3/pom.xml
@@ -115,4 +115,17 @@
             <version>${s3-sdk.version}</version>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <reuseForks>true</reuseForks>
+                    <forkCount>2</forkCount>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/server/container/guice/cassandra-rabbitmq-guice/pom.xml b/server/container/guice/cassandra-rabbitmq-guice/pom.xml
index 3cccc99..9423391 100644
--- a/server/container/guice/cassandra-rabbitmq-guice/pom.xml
+++ b/server/container/guice/cassandra-rabbitmq-guice/pom.xml
@@ -201,7 +201,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <argLine>-Xms512m -Xmx2048m</argLine>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <!-- Fail tests longer than 20 minutes, prevent form random locking tests -->
                     <forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>
                     <excludedGroups>unstable</excludedGroups>
diff --git a/server/data/data-cassandra/pom.xml b/server/data/data-cassandra/pom.xml
index ef8679a..f603f5c 100644
--- a/server/data/data-cassandra/pom.xml
+++ b/server/data/data-cassandra/pom.xml
@@ -149,7 +149,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>2</forkCount>
                 </configuration>
             </plugin>
diff --git a/server/data/data-file/pom.xml b/server/data/data-file/pom.xml
index 1edbfe5..5c1cf2e 100644
--- a/server/data/data-file/pom.xml
+++ b/server/data/data-file/pom.xml
@@ -149,7 +149,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/server/mailet/integration-testing/pom.xml b/server/mailet/integration-testing/pom.xml
index 83dd596..9928346 100644
--- a/server/mailet/integration-testing/pom.xml
+++ b/server/mailet/integration-testing/pom.xml
@@ -162,8 +162,8 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
-                    <forkCount>1C</forkCount>
+                    <reuseForks>true</reuseForks>
+                    <forkCount>2</forkCount>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/server/mailet/mailets/pom.xml b/server/mailet/mailets/pom.xml
index e2b00ed..e7b9659 100644
--- a/server/mailet/mailets/pom.xml
+++ b/server/mailet/mailets/pom.xml
@@ -280,7 +280,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/server/mailrepository/mailrepository-cassandra/pom.xml b/server/mailrepository/mailrepository-cassandra/pom.xml
index 6f38b42..0b5c0f0 100644
--- a/server/mailrepository/mailrepository-cassandra/pom.xml
+++ b/server/mailrepository/mailrepository-cassandra/pom.xml
@@ -90,7 +90,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>2</forkCount>
                 </configuration>
             </plugin>
diff --git a/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/pom.xml b/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/pom.xml
index 0891a7a..3b44dc8 100644
--- a/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/pom.xml
+++ b/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/pom.xml
@@ -161,7 +161,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <argLine>-Xms512m -Xmx2048m</argLine>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <!-- Fail tests longer than 20 minutes, prevent form random locking tests -->
                     <forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>
                     <groups combine.self="override">org.apache.james.junit.categories.BasicFeature,org.apache.james.jmap.categories.EnableCucumber</groups>
diff --git a/server/protocols/jmap-draft/pom.xml b/server/protocols/jmap-draft/pom.xml
index 9664430..faf106a 100644
--- a/server/protocols/jmap-draft/pom.xml
+++ b/server/protocols/jmap-draft/pom.xml
@@ -269,7 +269,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkCount>1C</forkCount>
                 </configuration>
             </plugin>
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/pom.xml b/server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/pom.xml
index e608bb4..2018d3a 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/pom.xml
+++ b/server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/pom.xml
@@ -121,7 +121,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <argLine>-Xms512m -Xmx2048m</argLine>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <!-- Fail tests longer than 20 minutes, prevent form random locking tests -->
                     <forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>
                     <!-- Junit 5 move from Category to Tag, and it need tag's name as parameter -->
diff --git a/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/pom.xml b/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/pom.xml
index e23f323..06d250b 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/pom.xml
+++ b/server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/pom.xml
@@ -53,4 +53,17 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <reuseForks>true</reuseForks>
+                    <forkCount>4</forkCount>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/pom.xml b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/pom.xml
index dddc6b3..dcb88dd 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/pom.xml
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/pom.xml
@@ -98,7 +98,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <argLine>-Xms512m -Xmx2048m</argLine>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <!-- Fail tests longer than 20 minutes, prevent form random locking tests -->
                     <forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>
                     <groups combine.self="override">BasicFeature&amp;!unstable</groups>
diff --git a/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/pom.xml b/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/pom.xml
index 43d0ed6..73c485a 100644
--- a/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/pom.xml
+++ b/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/pom.xml
@@ -58,9 +58,9 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <argLine>-Xms512m -Xmx2048m</argLine>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>
-                    <forkCount>1C</forkCount>
+                    <forkCount>4</forkCount>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/server/protocols/webadmin/webadmin-mailbox/pom.xml b/server/protocols/webadmin/webadmin-mailbox/pom.xml
index 4ed88c8..49a9372 100644
--- a/server/protocols/webadmin/webadmin-mailbox/pom.xml
+++ b/server/protocols/webadmin/webadmin-mailbox/pom.xml
@@ -244,7 +244,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <argLine>-Xms512m -Xmx2048m</argLine>
-                    <reuseForks>false</reuseForks>
+                    <reuseForks>true</reuseForks>
                     <!-- Fail tests longer than 20 minutes, prevent form random locking tests -->
                     <forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>
                     <excludedGroups>unstable</excludedGroups>


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


[james-project] 10/18: JAMES-3500 Increase memory allocated to surefire for webadmin deployment tests

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

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

commit bea9c7e5c1ce2659f63f48696513ce530cd61ed9
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 08:52:03 2021 +0700

    JAMES-3500 Increase memory allocated to surefire for webadmin deployment tests
---
 .../distributed-webadmin-integration-test/pom.xml                       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/pom.xml b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/pom.xml
index dcb88dd..0e8522b 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/pom.xml
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/pom.xml
@@ -97,7 +97,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <argLine>-Xms512m -Xmx2048m</argLine>
+                    <argLine>-Xms1024m -Xmx4096m</argLine>
                     <reuseForks>true</reuseForks>
                     <!-- Fail tests longer than 20 minutes, prevent form random locking tests -->
                     <forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>


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


[james-project] 03/18: JAMES-3500 Reduce build verbosity

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

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

commit c52ee9e8d2a25251795cef372ab1467510a8bfef
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Feb 12 10:47:46 2021 +0700

    JAMES-3500 Reduce build verbosity
    
    Logging only the HTTP method is useless and generates thousands of lines
---
 .../java/org/apache/james/webadmin/routes/AddressMappingRoutesTest.java | 1 -
 .../src/test/java/org/apache/james/webadmin/routes/AliasRoutesTest.java | 1 -
 .../java/org/apache/james/webadmin/routes/DomainMappingsRoutesTest.java | 1 -
 .../test/java/org/apache/james/webadmin/routes/ForwardRoutesTest.java   | 1 -
 .../test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java    | 1 -
 .../test/java/org/apache/james/webadmin/routes/MappingRoutesTest.java   | 1 -
 .../java/org/apache/james/webadmin/routes/RegexMappingRoutesTest.java   | 1 -
 .../james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java     | 2 --
 8 files changed, 9 deletions(-)

diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AddressMappingRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AddressMappingRoutesTest.java
index 8e701f7..7f53ccd 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AddressMappingRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AddressMappingRoutesTest.java
@@ -71,7 +71,6 @@ class AddressMappingRoutesTest {
 
         RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminServer)
             .setBasePath(AddressMappingRoutes.BASE_PATH)
-            .log(LogDetail.METHOD)
             .build();
     }
 
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AliasRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AliasRoutesTest.java
index 7b7e9e7..198d51c 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AliasRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AliasRoutesTest.java
@@ -88,7 +88,6 @@ class AliasRoutesTest {
 
         RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminServer)
             .setBasePath("address/aliases")
-            .log(LogDetail.METHOD)
             .build();
     }
 
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DomainMappingsRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DomainMappingsRoutesTest.java
index 66bd803..0dbb303 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DomainMappingsRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DomainMappingsRoutesTest.java
@@ -81,7 +81,6 @@ class DomainMappingsRoutesTest {
 
         RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminServer)
             .setBasePath(DOMAIN_MAPPINGS)
-            .log(LogDetail.METHOD)
             .build();
     }
 
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/ForwardRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/ForwardRoutesTest.java
index c7a1f96..5c7c798 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/ForwardRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/ForwardRoutesTest.java
@@ -87,7 +87,6 @@ class ForwardRoutesTest {
 
         RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminServer)
             .setBasePath("address/forwards")
-            .log(LogDetail.METHOD)
             .build();
     }
 
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java
index d27fef5..5726d24 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java
@@ -86,7 +86,6 @@ class GroupsRoutesTest {
 
         RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminServer)
             .setBasePath("address/groups")
-            .log(LogDetail.METHOD)
             .build();
     }
 
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/MappingRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/MappingRoutesTest.java
index a06a429..dce8772 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/MappingRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/MappingRoutesTest.java
@@ -82,7 +82,6 @@ class MappingRoutesTest {
 
         RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminServer)
             .setBasePath(MappingRoutes.BASE_PATH)
-            .log(LogDetail.METHOD)
             .build();
     }
 
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/RegexMappingRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/RegexMappingRoutesTest.java
index bdd7eba..b1abf71 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/RegexMappingRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/RegexMappingRoutesTest.java
@@ -63,7 +63,6 @@ class RegexMappingRoutesTest {
 
         RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminServer)
             .setBasePath(RegexMappingRoutes.BASE_PATH)
-            .log(LogDetail.METHOD)
             .build();
     }
 
diff --git a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
index 6e97a84..97d4583 100644
--- a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
@@ -133,7 +133,6 @@ import org.junit.jupiter.params.provider.ValueSource;
 import com.google.common.collect.ImmutableList;
 
 import io.restassured.RestAssured;
-import io.restassured.filter.log.LogDetail;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
 
@@ -216,7 +215,6 @@ class DeletedMessagesVaultRoutesTest {
             .start();
         RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminServer)
             .setBasePath(DeletedMessagesVaultRoutes.ROOT_PATH)
-            .log(LogDetail.METHOD)
             .build();
     }
 


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


[james-project] 09/18: JAMES-3500 Increase isolation for mailet integration tests

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

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

commit 74e2b8d35d8084af4e69017a9caf04e23e38b384
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat Feb 13 19:30:58 2021 +0700

    JAMES-3500 Increase isolation for mailet integration tests
---
 server/mailet/integration-testing/pom.xml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/server/mailet/integration-testing/pom.xml b/server/mailet/integration-testing/pom.xml
index 9928346..2e9d913 100644
--- a/server/mailet/integration-testing/pom.xml
+++ b/server/mailet/integration-testing/pom.xml
@@ -162,8 +162,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <reuseForks>true</reuseForks>
-                    <forkCount>2</forkCount>
+                    <reuseForks>false</reuseForks>
                 </configuration>
             </plugin>
         </plugins>


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


[james-project] 14/18: JAMES-3491 WebSocket PUSH cancellation

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

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

commit 9569e94c64123c875932bb5aa68b08987537b4ac
Author: LanKhuat <dl...@linagora.com>
AuthorDate: Fri Feb 5 10:57:12 2021 +0700

    JAMES-3491 WebSocket PUSH cancellation
---
 .../jmap/rfc8621/contract/WebSocketContract.scala  | 102 +++++++++++++++++++++
 .../james/jmap/core/WebSocketTransport.scala       |   3 +-
 .../james/jmap/json/ResponseSerializer.scala       |   1 +
 .../apache/james/jmap/routes/WebSocketRoutes.scala |   3 +-
 4 files changed, 107 insertions(+), 2 deletions(-)

diff --git a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/WebSocketContract.scala b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/WebSocketContract.scala
index b8f443a..b80740d 100644
--- a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/WebSocketContract.scala
+++ b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/WebSocketContract.scala
@@ -35,6 +35,8 @@ import org.apache.james.utils.DataProbeImpl
 import org.assertj.core.api.Assertions.{assertThat, assertThatThrownBy}
 import org.junit.jupiter.api.{BeforeEach, Test, Timeout}
 import play.api.libs.json.{JsString, Json}
+import reactor.core.scala.publisher.SMono
+import reactor.core.scheduler.Schedulers
 import sttp.capabilities.WebSockets
 import sttp.client3.monad.IdMonad
 import sttp.client3.okhttp.OkHttpSyncBackend
@@ -966,6 +968,106 @@ trait WebSocketContract {
       .contains(mailboxStateChange, emailStateChange)
   }
 
+  @Test
+  @Timeout(180)
+  def pushCancelRequestsShouldDisableNotification(server: GuiceJamesServer): Unit = {
+    val bobPath = MailboxPath.inbox(BOB)
+    val accountId: AccountId = AccountId.fromUsername(BOB)
+    val mailboxId = server.getProbe(classOf[MailboxProbeImpl]).createMailbox(bobPath)
+
+    Thread.sleep(100)
+
+    val response: Either[String, List[String]] =
+      authenticatedRequest(server)
+        .response(asWebSocket[Identity, List[String]] {
+          ws =>
+            ws.send(WebSocketFrame.text(
+              """{
+                |  "@type": "WebSocketPushEnable",
+                |  "dataTypes": ["Mailbox", "Email"]
+                |}""".stripMargin))
+
+            Thread.sleep(100)
+
+                ws.send(WebSocketFrame.text(
+              """{
+                |  "@type": "WebSocketPushDisable"
+                |}""".stripMargin))
+
+            Thread.sleep(100)
+
+            ws.send(WebSocketFrame.text(
+              s"""{
+                 |  "@type": "Request",
+                 |  "requestId": "req-36",
+                 |  "using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"],
+                 |  "methodCalls": [
+                 |    ["Email/set", {
+                 |      "accountId": "$ACCOUNT_ID",
+                 |      "create": {
+                 |        "aaaaaa":{
+                 |          "mailboxIds": {
+                 |             "${mailboxId.serialize}": true
+                 |          }
+                 |        }
+                 |      }
+                 |    }, "c1"]]
+                 |}""".stripMargin))
+
+            val response = ws.receive()
+              .map { case t: Text =>
+                t.payload
+              }
+
+            val maybeNotification: String = SMono.fromCallable(() =>
+            ws.receive()
+              .map { case t: Text =>
+                t.payload
+              })
+              .timeout(scala.concurrent.duration.Duration.fromNanos(100000000), Some(SMono.just("No notification received")))
+              .subscribeOn(Schedulers.elastic())
+              .block()
+
+          List(response, maybeNotification)
+        })
+        .send(backend)
+        .body
+
+      Thread.sleep(100)
+      val jmapGuiceProbe: JmapGuiceProbe = server.getProbe(classOf[JmapGuiceProbe])
+      val emailState: String = jmapGuiceProbe.getLatestEmailState(accountId).getValue.toString
+      val mailboxState: String = jmapGuiceProbe.getLatestMailboxState(accountId).getValue.toString
+
+      val mailboxStateChange: String = s"""{"@type":"StateChange","changed":{"$ACCOUNT_ID":{"Mailbox":"$mailboxState"}}}"""
+      val emailStateChange: String = s"""{"@type":"StateChange","changed":{"$ACCOUNT_ID":{"Email":"$emailState"}}}"""
+
+      assertThat(response.toOption.get.asJava)
+        .hasSize(2) // Email create response + no notification message
+        .contains("No notification received")
+        .doesNotContain(mailboxStateChange, emailStateChange)
+  }
+
+  @Test
+  @Timeout(180)
+  def pushCancelRequestAsFirstMessageShouldBeProcessedNormally(server: GuiceJamesServer): Unit = {
+    Thread.sleep(100)
+
+    authenticatedRequest(server)
+      .response(asWebSocket[Identity, Unit] {
+        ws =>
+          ws.send(WebSocketFrame.text(
+            """{
+              |  "@type": "WebSocketPushDisable"
+              |}""".stripMargin))
+
+          Thread.sleep(100)
+
+          assertThat(ws.isOpen()).isTrue
+      })
+      .send(backend)
+      .body
+  }
+
   private def authenticatedRequest(server: GuiceJamesServer): RequestT[Identity, Either[String, String], Any] = {
     val port = server.getProbe(classOf[JmapGuiceProbe])
       .getJmapPort
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/WebSocketTransport.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/WebSocketTransport.scala
index 90ca138..4c25d4a 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/WebSocketTransport.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/WebSocketTransport.scala
@@ -43,4 +43,5 @@ case class StateChange(changes: Map[AccountId, TypeState]) extends WebSocketOutb
     .map(StateChange)
 }
 
-case class WebSocketPushEnable(dataTypes: Option[Set[TypeName]]) extends WebSocketInboundMessage
\ No newline at end of file
+case class WebSocketPushEnable(dataTypes: Option[Set[TypeName]]) extends WebSocketInboundMessage
+case object WebSocketPushDisable extends WebSocketInboundMessage
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/ResponseSerializer.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/ResponseSerializer.scala
index 042d4d8..46aa195 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/ResponseSerializer.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/ResponseSerializer.scala
@@ -202,6 +202,7 @@ object ResponseSerializer {
       json.value.get("@type") match {
         case Some(JsString("Request")) => webSocketRequestReads.reads(json)
         case Some(JsString("WebSocketPushEnable")) => webSocketPushEnableReads.reads(json)
+        case Some(JsString("WebSocketPushDisable")) => JsSuccess(WebSocketPushDisable)
         case Some(JsString(unknownType)) => JsError(s"Unknown @type field on a webSocket inbound message: $unknownType")
         case Some(invalidType) => JsError(s"Invalid @type field on a webSocket inbound message: expecting a JsString, got $invalidType")
         case None => JsError(s"Missing @type field on a webSocket inbound message")
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/WebSocketRoutes.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/WebSocketRoutes.scala
index d6d2c40..c45ef45 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/WebSocketRoutes.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/WebSocketRoutes.scala
@@ -31,7 +31,7 @@ import org.apache.james.events.{EventBus, Registration}
 import org.apache.james.jmap.HttpConstants.JSON_CONTENT_TYPE
 import org.apache.james.jmap.JMAPUrls.JMAP_WS
 import org.apache.james.jmap.change.{AccountIdRegistrationKey, StateChangeListener, TypeName}
-import org.apache.james.jmap.core.{ProblemDetails, RequestId, WebSocketError, WebSocketOutboundMessage, WebSocketPushEnable, WebSocketRequest, WebSocketResponse}
+import org.apache.james.jmap.core.{ProblemDetails, RequestId, WebSocketError, WebSocketOutboundMessage, WebSocketPushDisable, WebSocketPushEnable, WebSocketRequest, WebSocketResponse}
 import org.apache.james.jmap.http.rfc8621.InjectionKeys
 import org.apache.james.jmap.http.{Authenticator, UserProvisioning}
 import org.apache.james.jmap.json.ResponseSerializer
@@ -133,6 +133,7 @@ class WebSocketRoutes @Inject() (@Named(InjectionKeys.RFC_8621) val authenticato
                 AccountIdRegistrationKey.of(clientContext.session.getUser)))
               .doOnNext(newRegistration => clientContext.withRegistration(newRegistration))
               .`then`()
+          case WebSocketPushDisable => SMono.fromCallable(() => clientContext.clean())
       })
 
   private def handleHttpHandshakeError(throwable: Throwable, response: HttpServerResponse): SMono[Void] =


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


[james-project] 08/18: JAMES-3255 Tag some unstable tests

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

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

commit d0f347bc32cf2a47562046d04bbce49f47ddbece
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat Feb 13 17:23:14 2021 +0700

    JAMES-3255 Tag some unstable tests
---
 .../vault/RabbitMQLinshareBlobExportMechanismIntegrationTest.java      | 3 +++
 .../memory/vault/MemoryLinshareBlobExportMechanismIntegrationTest.java | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/vault/RabbitMQLinshareBlobExportMechanismIntegrationTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/vault/RabbitMQLinshareBlobExportMechanismIntegrationTest.java
index 1a7f13f..e5f9323 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/vault/RabbitMQLinshareBlobExportMechanismIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/vault/RabbitMQLinshareBlobExportMechanismIntegrationTest.java
@@ -27,6 +27,7 @@ import org.apache.james.JamesServerBuilder;
 import org.apache.james.JamesServerExtension;
 import org.apache.james.SearchConfiguration;
 import org.apache.james.backends.rabbitmq.DockerRabbitMQSingleton;
+import org.apache.james.junit.categories.Unstable;
 import org.apache.james.modules.AwsS3BlobStoreExtension;
 import org.apache.james.modules.LinshareGuiceExtension;
 import org.apache.james.modules.RabbitMQExtension;
@@ -36,8 +37,10 @@ import org.apache.james.modules.blobstore.BlobStoreConfiguration;
 import org.apache.james.modules.vault.TestDeleteMessageVaultPreDeletionHookModule;
 import org.apache.james.webadmin.integration.WebadminIntegrationTestModule;
 import org.apache.james.webadmin.integration.vault.LinshareBlobExportMechanismIntegrationTest;
+import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
+@Tag(Unstable.TAG)
 class RabbitMQLinshareBlobExportMechanismIntegrationTest extends LinshareBlobExportMechanismIntegrationTest {
     @RegisterExtension
     static JamesServerExtension testExtension = new JamesServerBuilder<CassandraRabbitMQJamesConfiguration>(tmpDir ->
diff --git a/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/vault/MemoryLinshareBlobExportMechanismIntegrationTest.java b/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/vault/MemoryLinshareBlobExportMechanismIntegrationTest.java
index 738d911..dc129c3 100644
--- a/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/vault/MemoryLinshareBlobExportMechanismIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/memory-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/memory/vault/MemoryLinshareBlobExportMechanismIntegrationTest.java
@@ -22,13 +22,16 @@ package org.apache.james.webadmin.integration.memory.vault;
 import org.apache.james.JamesServerBuilder;
 import org.apache.james.JamesServerExtension;
 import org.apache.james.MemoryJamesServerMain;
+import org.apache.james.junit.categories.Unstable;
 import org.apache.james.modules.LinshareGuiceExtension;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.modules.vault.TestDeleteMessageVaultPreDeletionHookModule;
 import org.apache.james.webadmin.integration.WebadminIntegrationTestModule;
 import org.apache.james.webadmin.integration.vault.LinshareBlobExportMechanismIntegrationTest;
+import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
+@Tag(Unstable.TAG)
 class MemoryLinshareBlobExportMechanismIntegrationTest extends LinshareBlobExportMechanismIntegrationTest {
     @RegisterExtension
     static JamesServerExtension jamesServerExtension = new JamesServerBuilder<>(JamesServerBuilder.defaultConfigurationProvider())


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


[james-project] 06/18: JAMES-3500 Reuse Cassandra image accross maven projects

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

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

commit f3eb2cf71dd1ebe7c02cf4269c11ca60b86ff262
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat Feb 13 09:14:26 2021 +0700

    JAMES-3500 Reuse Cassandra image accross maven projects
    
     - Set up a unique BUILD_ID env variable in Jenkinsfile
     - Append it to the Cassandra image
---
 Jenkinsfile                                        |  1 +
 .../james/backends/cassandra/DockerCassandra.java  | 31 +++++++++++++++-------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 05f6645..b027b18 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -32,6 +32,7 @@ pipeline {
 
     environment {
         // ... setup any environment variables ...
+        BUILD_ID = UUID.randomUUID().toString()
         MVN_LOCAL_REPO_OPT = '-Dmaven.repo.local=.repository'
         MVN_TEST_FAIL_IGNORE = '-Dmaven.test.failure.ignore=true'
         MVN_SHOW_TIMESTAMPS="-Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS"
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
index 3d18326..b5be0eb 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
@@ -19,10 +19,11 @@
 
 package org.apache.james.backends.cassandra;
 
-import com.github.dockerjava.api.async.ResultCallback;
-import com.github.dockerjava.api.command.EventsCmd;
-import com.github.dockerjava.api.model.Event;
-import com.github.dockerjava.api.model.EventType;
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.Optional;
+import java.util.UUID;
+
 import org.apache.james.backends.cassandra.init.ClusterFactory;
 import org.apache.james.backends.cassandra.init.KeyspaceFactory;
 import org.apache.james.backends.cassandra.init.configuration.CassandraConsistenciesConfiguration;
@@ -40,12 +41,12 @@ import org.testcontainers.images.builder.dockerfile.DockerfileBuilder;
 import com.datastax.driver.core.Cluster;
 import com.datastax.driver.core.Session;
 import com.github.dockerjava.api.DockerClient;
+import com.github.dockerjava.api.async.ResultCallback;
+import com.github.dockerjava.api.command.EventsCmd;
+import com.github.dockerjava.api.model.Event;
+import com.github.dockerjava.api.model.EventType;
 import com.google.common.collect.ImmutableMap;
 
-import java.io.Closeable;
-import java.io.IOException;
-import java.util.UUID;
-
 public class DockerCassandra {
 
     /**
@@ -115,6 +116,18 @@ public class DockerCassandra {
         DockerfileBuilder applyStep(DockerfileBuilder builder);
     }
 
+    /**
+     * @return a string to append to image names in order to avoid conflict with concurrent builds
+     */
+    private static String buildSpecificImageDiscriminator() {
+        // If available try to access the image shared by all maven projects
+        // This avoids rebuilding one for each maven surefire fork.
+        // BUILD_ID should be set by the execution context, here JenkinsFile
+        return Optional.ofNullable(System.getenv("BUILD_ID"))
+            // Default to an image discriminator specific to this JVM
+            .orElse(UUID.randomUUID().toString());
+    }
+
     private static final int CASSANDRA_PORT = 9042;
     private static final int CASSANDRA_MEMORY = 650;
 
@@ -126,7 +139,7 @@ public class DockerCassandra {
 
     @SuppressWarnings("resource")
     public DockerCassandra() {
-        this("cassandra_3_11_3-"+ UUID.randomUUID().toString(), AdditionalDockerFileStep.IDENTITY);
+        this("cassandra_3_11_3-" + buildSpecificImageDiscriminator(), AdditionalDockerFileStep.IDENTITY);
     }
 
     private DockerCassandra(String imageName, AdditionalDockerFileStep additionalSteps) {


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


[james-project] 16/18: JAMES-3497 apache-james-mpt-antlib no longer exists

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

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

commit 85f9ee2413ce63b7564568cc43205f25b57afd0c
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Feb 8 11:16:52 2021 +0700

    JAMES-3497 apache-james-mpt-antlib no longer exists
---
 pom.xml | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0b5a8f7..3645889 100644
--- a/pom.xml
+++ b/pom.xml
@@ -899,17 +899,6 @@
             </dependency>
             <dependency>
                 <groupId>${james.groupId}</groupId>
-                <artifactId>apache-james-mpt-antlib</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>${james.groupId}</groupId>
-                <artifactId>apache-james-mpt-antlib</artifactId>
-                <version>${project.version}</version>
-                <classifier>tests</classifier>
-            </dependency>
-            <dependency>
-                <groupId>${james.groupId}</groupId>
                 <artifactId>apache-james-mpt-app</artifactId>
                 <version>${project.version}</version>
             </dependency>


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


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

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

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

commit 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


[james-project] 04/18: JAMES-3500 Tag extra unstable test

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

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

commit f73be077a7a252f3a0bf79fd7a9933558ba4dbc0
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Feb 12 14:57:39 2021 +0700

    JAMES-3500 Tag extra unstable test
---
 .../integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java
index 29f907d..f933b81 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java
@@ -53,6 +53,7 @@ import org.apache.james.events.EventListener;
 import org.apache.james.events.Group;
 import org.apache.james.events.RetryBackoffConfiguration;
 import org.apache.james.junit.categories.BasicFeature;
+import org.apache.james.junit.categories.Unstable;
 import org.apache.james.mailbox.DefaultMailboxes;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -508,6 +509,7 @@ class RabbitMQEventDeadLettersIntegrationTest {
             .body(".", hasSize(0));
     }
 
+    @Tag(Unstable.TAG)
     @Test
     void multipleFailedEventsShouldBeCorrectlyProcessedByListenerAfterSuccessfulGroupRedelivery(RetryEventsListener retryEventsListener) {
         retryEventsListener.callsPerEventBeforeSuccess(MAX_RETRIES + 1);


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


[james-project] 18/18: JAMES-2884 Improve JMAP EmailBodyPart documentation formatting

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

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

commit 053aaa9215641e004763b01e9882b0aeac738384
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Feb 8 16:41:22 2021 +0700

    JAMES-2884 Improve JMAP EmailBodyPart documentation formatting
---
 server/protocols/jmap-rfc-8621/doc/specs/spec/mail/message.mdown | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/server/protocols/jmap-rfc-8621/doc/specs/spec/mail/message.mdown b/server/protocols/jmap-rfc-8621/doc/specs/spec/mail/message.mdown
index bbf4492..34be185 100644
--- a/server/protocols/jmap-rfc-8621/doc/specs/spec/mail/message.mdown
+++ b/server/protocols/jmap-rfc-8621/doc/specs/spec/mail/message.mdown
@@ -856,10 +856,6 @@ Due to the format of the Email object, when creating an Email there are a number
 - Within an EmailBodyPart:
   - The client may specify a *partId* OR a *blobId*, but not both. If a *partId* is
     given, this *partId* MUST be present in the bodyValues property.
-
-> :warning:
-> htmlBody and textBody parts needs to have a *partId*. `attachments` parts need to specify *blobId*.
-
   - The charset property MUST be omitted if a partId is given (the part's
     content is included in bodyValues, and the server may choose any appropriate
     encoding).
@@ -869,7 +865,9 @@ Due to the format of the Email object, when creating an Email there are a number
   - A `Content-Transfer-Encoding` header field MUST NOT be given.
 
 > :warning:
-> EmailBodyPart specific headers are not supported for Email/set create.
+> The following limitations applies for the James implementation of EmailBodyPart:
+>  - htmlBody and textBody parts needs to have a *partId*. `attachments` parts need to specify *blobId*.
+>  - EmailBodyPart specific headers are not supported for Email/set create.
 
 - Within an EmailBodyValue object, isEncodingProblem and isTruncated MUST be
   either `false` or omitted.


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


[james-project] 02/18: JAMES-3500 Use a wait strategy on MockSMTP server

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

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

commit 355153e7bf1c2b8288e769bc6010ba948ecfde21
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Feb 12 10:41:11 2021 +0700

    JAMES-3500 Use a wait strategy on MockSMTP server
    
    CI is unstable as we try to call mockSMTP REST API before
    it starts, causing failure.
    
    A safer approach is to specify a wait strategy. I chose a
    log wait strategy as the host ports wait strategy waits for
    any port to be reachable, and thus do not guaranty both
    SMTP and HTTP are usable.
    
    The road to add logs in the container was painful:
     - conflicts with other lockback configurations in
       the classpath required specifying explicitly the file
       on the command line.
     - JIB did not like mounting resource files inside
       the container, once moved worked straight away.
    
    I bumped the version of MockSMTP.
    
    Also, as a side refactoring, I generalized the usage
    of MockSmtpServerExtension.
---
 pom.xml                                            |  2 +-
 .../james/mailets/RemoteDeliveryErrorTest.java     | 34 +++++--------
 .../org/apache/james/smtp/dsn/DSNRelayTest.java    | 55 ++++++++--------------
 .../james/smtp/dsn/DSNRemoteIntegrationTest.java   | 25 ++++------
 server/mailet/mock-smtp-server/pom.xml             | 18 ++++++-
 .../mock/smtp/server/HTTPConfigurationServer.java  |  2 +-
 .../james/mock/smtp/server/MockSMTPServerMain.java |  6 ++-
 .../server/testing/MockSmtpServerExtension.java    |  8 +++-
 .../src/{resources => main/jib}/logback.xml        |  0
 .../mock/smtp/server/ConfigurationClientTest.java  |  2 +-
 .../smtp/server/HTTPConfigurationServerTest.java   |  3 +-
 .../java/org/apache/james/util/docker/Images.java  |  2 +-
 12 files changed, 73 insertions(+), 84 deletions(-)

diff --git a/pom.xml b/pom.xml
index d471c25..0b5a8f7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2814,7 +2814,7 @@
                 <plugin>
                     <groupId>com.google.cloud.tools</groupId>
                     <artifactId>jib-maven-plugin</artifactId>
-                    <version>1.5.1</version>
+                    <version>2.7.1</version>
                 </plugin>
                 <plugin>
                     <groupId>org.scalatest</groupId>
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
index aee9e52..3ad4da4 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
@@ -28,7 +28,6 @@ import static org.apache.james.mock.smtp.server.ConfigurationClient.BehaviorsPar
 import static org.apache.james.mock.smtp.server.ConfigurationClient.BehaviorsParamsBuilder.ConditionStep.inputContaining;
 import static org.apache.james.mock.smtp.server.ConfigurationClient.BehaviorsParamsBuilder.ResponseStep.doesNotAcceptAnyMail;
 import static org.apache.james.mock.smtp.server.ConfigurationClient.BehaviorsParamsBuilder.ResponseStep.serviceNotAvailable;
-import static org.apache.james.util.docker.Images.MOCK_SMTP_SERVER;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
@@ -46,6 +45,7 @@ import org.apache.james.mailets.configuration.ProcessorConfiguration;
 import org.apache.james.mock.smtp.server.ConfigurationClient;
 import org.apache.james.mock.smtp.server.model.Mail;
 import org.apache.james.mock.smtp.server.model.SMTPCommand;
+import org.apache.james.mock.smtp.server.testing.MockSmtpServerExtension;
 import org.apache.james.modules.protocols.ImapGuiceProbe;
 import org.apache.james.modules.protocols.SmtpGuiceProbe;
 import org.apache.james.server.core.MailImpl;
@@ -63,15 +63,10 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.io.TempDir;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableList;
 
 class RemoteDeliveryErrorTest {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(RemoteDeliveryErrorTest.class);
-
     private static final String ANOTHER_DOMAIN = "other.com";
     private static final String FROM = "from@" + DEFAULT_DOMAIN;
     private static final String RECIPIENT = "touser@" + ANOTHER_DOMAIN;
@@ -107,11 +102,9 @@ class RemoteDeliveryErrorTest {
     @RegisterExtension
     public SMTPMessageSender messageSender = new SMTPMessageSender(DEFAULT_DOMAIN);
     @RegisterExtension
-    public static DockerContainer mockSmtp = DockerContainer.fromName(MOCK_SMTP_SERVER)
-        .withLogConsumer(outputFrame -> LOGGER.debug("MockSMTP 1: " + outputFrame.getUtf8String()));
+    public static MockSmtpServerExtension mockSmtp1 = new MockSmtpServerExtension();
     @RegisterExtension
-    public static DockerContainer mockSmtp2 = DockerContainer.fromName(MOCK_SMTP_SERVER)
-        .withLogConsumer(outputFrame -> LOGGER.debug("MockSMTP 2: " + outputFrame.getUtf8String()));
+    public static MockSmtpServerExtension mockSmtp2 = new MockSmtpServerExtension();
 
     private TemporaryJamesServer jamesServer;
 
@@ -131,7 +124,7 @@ class RemoteDeliveryErrorTest {
     void setUp(@TempDir File temporaryFolder) throws Exception {
         inMemoryDNSService = new InMemoryDNSService()
             .registerMxRecord(DEFAULT_DOMAIN, LOCALHOST_IP)
-            .registerMxRecord(ANOTHER_DOMAIN, mockSmtp.getContainerIp());
+            .registerMxRecord(ANOTHER_DOMAIN, mockSmtp1.getMockSmtp().getIPAddress());
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_AND_IMAP_MODULE)
@@ -149,19 +142,16 @@ class RemoteDeliveryErrorTest {
             .addDomain(DEFAULT_DOMAIN)
             .addUser(FROM, PASSWORD);
 
-        mockSMTP1Configuration = configurationClient(mockSmtp);
-        mockSMTP2Configuration = configurationClient(mockSmtp2);
+        mockSMTP1Configuration = mockSmtp1.getMockSmtp().getConfigurationClient();
+        mockSMTP2Configuration = mockSmtp2.getMockSmtp().getConfigurationClient();
 
-        assertThat(mockSMTP1Configuration.version()).isEqualTo("0.2");
-        assertThat(mockSMTP2Configuration.version()).isEqualTo("0.2");
+        assertThat(mockSMTP1Configuration.version()).isEqualTo("0.4");
+        assertThat(mockSMTP2Configuration.version()).isEqualTo("0.4");
     }
 
     @AfterEach
     void tearDown() {
         jamesServer.shutdown();
-
-        mockSMTP1Configuration.cleanServer();
-        mockSMTP2Configuration.cleanServer();
     }
 
     @Test
@@ -384,13 +374,13 @@ class RemoteDeliveryErrorTest {
 
     @Test
     void remoteDeliveryShouldNotDuplicateContentWhenSendPartialWhenFailover() throws Exception {
-        ImmutableList<InetAddress> addresses = ImmutableList.of(InetAddress.getByName(mockSmtp.getContainerIp()));
-        ImmutableList<String> mxs = ImmutableList.of(mockSmtp.getContainerIp(), mockSmtp2.getContainerIp());
+        ImmutableList<InetAddress> addresses = ImmutableList.of(InetAddress.getByName(mockSmtp1.getMockSmtp().getIPAddress()));
+        ImmutableList<String> mxs = ImmutableList.of(mockSmtp1.getMockSmtp().getIPAddress(), mockSmtp2.getMockSmtp().getIPAddress());
         ImmutableList<String> txtRecords = ImmutableList.of();
 
         inMemoryDNSService.registerRecord(ANOTHER_DOMAIN, addresses, mxs, txtRecords)
-            .registerMxRecord(mockSmtp.getContainerIp(), mockSmtp.getContainerIp())
-            .registerMxRecord(mockSmtp2.getContainerIp(), mockSmtp2.getContainerIp());
+            .registerMxRecord(mockSmtp1.getMockSmtp().getIPAddress(), mockSmtp1.getMockSmtp().getIPAddress())
+            .registerMxRecord(mockSmtp2.getMockSmtp().getIPAddress(), mockSmtp2.getMockSmtp().getIPAddress());
 
         mockSMTP1Configuration
             .addNewBehavior()
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRelayTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRelayTest.java
index da7d5ba..a104f66 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRelayTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRelayTest.java
@@ -24,7 +24,6 @@ import static org.apache.james.mailets.configuration.Constants.DEFAULT_DOMAIN;
 import static org.apache.james.mailets.configuration.Constants.LOCALHOST_IP;
 import static org.apache.james.mailets.configuration.Constants.PASSWORD;
 import static org.apache.james.mailets.configuration.Constants.calmlyAwait;
-import static org.apache.james.util.docker.Images.MOCK_SMTP_SERVER;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Durations.TEN_SECONDS;
 
@@ -40,10 +39,11 @@ import org.apache.james.mailets.configuration.MailetConfiguration;
 import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.mailets.configuration.ProcessorConfiguration;
 import org.apache.james.mailets.configuration.SmtpConfiguration;
-import org.apache.james.mock.smtp.server.ConfigurationClient;
 import org.apache.james.mock.smtp.server.model.Mail;
 import org.apache.james.mock.smtp.server.model.SMTPExtension;
 import org.apache.james.mock.smtp.server.model.SMTPExtensions;
+import org.apache.james.mock.smtp.server.testing.MockSmtpServerExtension;
+import org.apache.james.mock.smtp.server.testing.MockSmtpServerExtension.DockerMockSmtp;
 import org.apache.james.modules.protocols.SmtpGuiceProbe;
 import org.apache.james.smtpserver.dsn.DSNEhloHook;
 import org.apache.james.smtpserver.dsn.DSNMailParameterHook;
@@ -52,8 +52,6 @@ import org.apache.james.smtpserver.dsn.DSNRcptParameterHook;
 import org.apache.james.transport.mailets.RecipientRewriteTable;
 import org.apache.james.transport.mailets.RemoteDelivery;
 import org.apache.james.transport.matchers.All;
-import org.apache.james.util.Host;
-import org.apache.james.util.docker.DockerContainer;
 import org.apache.james.utils.DataProbeImpl;
 import org.apache.james.utils.SMTPMessageSender;
 import org.apache.james.utils.TestIMAPClient;
@@ -63,12 +61,8 @@ import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.io.TempDir;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 class DSNRelayTest {
-    private static final Logger LOGGER = LoggerFactory.getLogger(DSNRelayTest.class);
-
     private static final String ANOTHER_DOMAIN = "other.com";
     private static final String FROM = "from@" + DEFAULT_DOMAIN;
     private static final String RECIPIENT = "touser@" + ANOTHER_DOMAIN;
@@ -76,23 +70,21 @@ class DSNRelayTest {
     private static final String RECIPIENT2 = "touser2@" + ANOTHER_DOMAIN;
 
     private InMemoryDNSService inMemoryDNSService;
-    private ConfigurationClient mockSMTPConfiguration;
 
     @RegisterExtension
     public TestIMAPClient testIMAPClient = new TestIMAPClient();
     @RegisterExtension
     public SMTPMessageSender messageSender = new SMTPMessageSender(DEFAULT_DOMAIN);
     @RegisterExtension
-    public static DockerContainer mockSmtp = DockerContainer.fromName(MOCK_SMTP_SERVER)
-        .withLogConsumer(outputFrame -> LOGGER.debug("MockSMTP 1: " + outputFrame.getUtf8String()));
+    public static MockSmtpServerExtension mockSmtpExtension = new MockSmtpServerExtension();
 
     private TemporaryJamesServer jamesServer;
 
     @BeforeEach
-    void setUp(@TempDir File temporaryFolder) throws Exception {
+    void setUp(@TempDir File temporaryFolder, DockerMockSmtp mockSmtp) throws Exception {
         inMemoryDNSService = new InMemoryDNSService()
             .registerMxRecord(DEFAULT_DOMAIN, LOCALHOST_IP)
-            .registerMxRecord(ANOTHER_DOMAIN, mockSmtp.getContainerIp());
+            .registerMxRecord(ANOTHER_DOMAIN, mockSmtp.getIPAddress());
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_AND_IMAP_MODULE)
@@ -115,22 +107,19 @@ class DSNRelayTest {
             .addDomain(DEFAULT_DOMAIN)
             .addUser(FROM, PASSWORD);
 
-        mockSMTPConfiguration = configurationClient(mockSmtp);
-        mockSMTPConfiguration.setSMTPExtensions(SMTPExtensions.of(SMTPExtension.of("dsn")));
+        mockSmtp.getConfigurationClient().setSMTPExtensions(SMTPExtensions.of(SMTPExtension.of("dsn")));
 
-        assertThat(mockSMTPConfiguration.version()).isEqualTo("0.2");
+        assertThat(mockSmtp.getConfigurationClient().version()).isEqualTo("0.4");
     }
 
     @AfterEach
     void tearDown() {
         jamesServer.shutdown();
-
-        mockSMTPConfiguration.cleanServer();
     }
 
     @Disabled("JAMES-3431 No javax.mail support for ORCPT DSN parameter...")
     @Test
-    void orcptIsUnsupported() throws Exception {
+    void orcptIsUnsupported(DockerMockSmtp mockSmtp) throws Exception {
         AuthenticatingSMTPClient smtpClient = new AuthenticatingSMTPClient("TLS", "UTF-8");
 
         try {
@@ -143,7 +132,7 @@ class DSNRelayTest {
             smtpClient.disconnect();
         }
 
-        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSMTPConfiguration.listMails())
+        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSmtp.getConfigurationClient().listMails())
             .hasSize(3)
             .extracting(Mail::getEnvelope)
             .containsExactly(Mail.Envelope.builder()
@@ -171,7 +160,7 @@ class DSNRelayTest {
     }
 
     @Test
-    void remoteDeliveryShouldCarryOverDSNParameters() throws Exception {
+    void remoteDeliveryShouldCarryOverDSNParameters(DockerMockSmtp mockSmtp) throws Exception {
         AuthenticatingSMTPClient smtpClient = new AuthenticatingSMTPClient("TLS", "UTF-8");
 
         try {
@@ -186,7 +175,7 @@ class DSNRelayTest {
             smtpClient.disconnect();
         }
 
-        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSMTPConfiguration.listMails())
+        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSmtp.getConfigurationClient().listMails())
             .hasSize(3)
             .extracting(Mail::getEnvelope)
             .containsOnly(Mail.Envelope.builder()
@@ -242,7 +231,7 @@ class DSNRelayTest {
     }
 
     @Test
-    void remoteDeliveryShouldDeliverSimilarDsnNotifyParametersTogether() throws Exception {
+    void remoteDeliveryShouldDeliverSimilarDsnNotifyParametersTogether(DockerMockSmtp mockSmtp) throws Exception {
         AuthenticatingSMTPClient smtpClient = new AuthenticatingSMTPClient("TLS", "UTF-8");
 
         try {
@@ -257,7 +246,7 @@ class DSNRelayTest {
             smtpClient.disconnect();
         }
 
-        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSMTPConfiguration.listMails())
+        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSmtp.getConfigurationClient().listMails())
             .hasSize(2)
             .extracting(Mail::getEnvelope)
             .containsOnly(Mail.Envelope.builder()
@@ -290,7 +279,7 @@ class DSNRelayTest {
     }
 
     @Test
-    void remoteDeliveryShouldCarryOverDSNParametersWhenSingleRecipient() throws Exception {
+    void remoteDeliveryShouldCarryOverDSNParametersWhenSingleRecipient(DockerMockSmtp mockSmtp) throws Exception {
         AuthenticatingSMTPClient smtpClient = new AuthenticatingSMTPClient("TLS", "UTF-8");
 
         try {
@@ -303,7 +292,7 @@ class DSNRelayTest {
             smtpClient.disconnect();
         }
 
-        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSMTPConfiguration.listMails())
+        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSmtp.getConfigurationClient().listMails())
             .hasSize(1)
             .extracting(Mail::getEnvelope)
             .containsExactly(Mail.Envelope.builder()
@@ -327,7 +316,7 @@ class DSNRelayTest {
     }
 
     @Test
-    void dsnShouldBeCarriedAfterRRT() throws Exception {
+    void dsnShouldBeCarriedAfterRRT(DockerMockSmtp mockSmtp) throws Exception {
         DataProbeImpl dataProbe = jamesServer.getProbe(DataProbeImpl.class);
         dataProbe.addDomain(ANOTHER_DOMAIN);
         dataProbe.addAddressMapping("touser", ANOTHER_DOMAIN, "touser-alias@other.com");
@@ -344,7 +333,7 @@ class DSNRelayTest {
             smtpClient.disconnect();
         }
 
-        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSMTPConfiguration.listMails())
+        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSmtp.getConfigurationClient().listMails())
             .hasSize(1)
             .extracting(Mail::getEnvelope)
             .containsExactly(Mail.Envelope.builder()
@@ -368,7 +357,7 @@ class DSNRelayTest {
     }
 
     @Test
-    void remoteDeliveryShouldCarryOverDSNMailParameters() throws Exception {
+    void remoteDeliveryShouldCarryOverDSNMailParameters(DockerMockSmtp mockSmtp) throws Exception {
         AuthenticatingSMTPClient smtpClient = new AuthenticatingSMTPClient("TLS", "UTF-8");
 
         try {
@@ -381,7 +370,7 @@ class DSNRelayTest {
             smtpClient.disconnect();
         }
 
-        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSMTPConfiguration.listMails())
+        calmlyAwait.atMost(TEN_SECONDS).untilAsserted(() -> assertThat(mockSmtp.getConfigurationClient().listMails())
             .hasSize(1)
             .extracting(Mail::getEnvelope)
             .containsExactly(Mail.Envelope.builder()
@@ -416,10 +405,4 @@ class DSNRelayTest {
                 .addProperty("deliveryThreads", "2")
                 .addProperty("sendpartial", "true"));
     }
-
-    private ConfigurationClient configurationClient(DockerContainer mockSmtp) {
-        return ConfigurationClient.from(
-            Host.from(mockSmtp.getHostIp(),
-                mockSmtp.getMappedPort(8000)));
-    }
 }
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRemoteIntegrationTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRemoteIntegrationTest.java
index 3b79bc0..a97ffb2 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRemoteIntegrationTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/smtp/dsn/DSNRemoteIntegrationTest.java
@@ -28,7 +28,6 @@ import static org.apache.james.mock.smtp.server.ConfigurationClient.BehaviorsPar
 import static org.apache.james.mock.smtp.server.ConfigurationClient.BehaviorsParamsBuilder.ResponseStep.serviceNotAvailable;
 import static org.apache.james.mock.smtp.server.model.Condition.MATCH_ALL;
 import static org.apache.james.mock.smtp.server.model.SMTPCommand.RCPT_TO;
-import static org.apache.james.util.docker.Images.MOCK_SMTP_SERVER;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Durations.FIVE_SECONDS;
 
@@ -47,6 +46,8 @@ import org.apache.james.mailets.configuration.SmtpConfiguration;
 import org.apache.james.mock.smtp.server.ConfigurationClient;
 import org.apache.james.mock.smtp.server.model.SMTPExtension;
 import org.apache.james.mock.smtp.server.model.SMTPExtensions;
+import org.apache.james.mock.smtp.server.testing.MockSmtpServerExtension;
+import org.apache.james.mock.smtp.server.testing.MockSmtpServerExtension.DockerMockSmtp;
 import org.apache.james.modules.protocols.ImapGuiceProbe;
 import org.apache.james.modules.protocols.SmtpGuiceProbe;
 import org.apache.james.smtpserver.dsn.DSNEhloHook;
@@ -64,8 +65,6 @@ import org.apache.james.transport.matchers.DSNFailureRequested;
 import org.apache.james.transport.matchers.IsRemoteDeliveryPermanentError;
 import org.apache.james.transport.matchers.IsRemoteDeliveryTemporaryError;
 import org.apache.james.transport.matchers.RecipientIsLocal;
-import org.apache.james.util.Host;
-import org.apache.james.util.docker.DockerContainer;
 import org.apache.james.utils.DataProbeImpl;
 import org.apache.james.utils.SMTPMessageSender;
 import org.apache.james.utils.TestIMAPClient;
@@ -92,11 +91,10 @@ class DSNRemoteIntegrationTest {
     private InMemoryDNSService inMemoryDNSService;
     private ConfigurationClient mockSMTPConfiguration;
 
-    @RegisterExtension
-    public static DockerContainer mockSmtp = DockerContainer.fromName(MOCK_SMTP_SERVER)
-        .withLogConsumer(outputFrame -> LOGGER.debug("MockSMTP 1: " + outputFrame.getUtf8String()));
 
     @RegisterExtension
+    public static MockSmtpServerExtension mockSmtpExtension = new MockSmtpServerExtension();
+    @RegisterExtension
     public TestIMAPClient testIMAPClient = new TestIMAPClient();
     @RegisterExtension
     public SMTPMessageSender messageSender = new SMTPMessageSender(DEFAULT_DOMAIN);
@@ -104,10 +102,10 @@ class DSNRemoteIntegrationTest {
     private TemporaryJamesServer jamesServer;
 
     @BeforeEach
-    void setUp(@TempDir File temporaryFolder) throws Exception {
+    void setUp(@TempDir File temporaryFolder, DockerMockSmtp mockSmtp) throws Exception {
         inMemoryDNSService = new InMemoryDNSService()
             .registerMxRecord(DEFAULT_DOMAIN, LOCALHOST_IP)
-            .registerMxRecord(ANOTHER_DOMAIN, mockSmtp.getContainerIp());
+            .registerMxRecord(ANOTHER_DOMAIN, mockSmtp.getIPAddress());
 
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_AND_IMAP_MODULE)
@@ -157,10 +155,10 @@ class DSNRemoteIntegrationTest {
             .fluent()
             .addDomain(DEFAULT_DOMAIN)
             .addUser(FROM, PASSWORD);
-        mockSMTPConfiguration = configurationClient(mockSmtp);
+        mockSMTPConfiguration = mockSmtp.getConfigurationClient();
         mockSMTPConfiguration.setSMTPExtensions(SMTPExtensions.of(SMTPExtension.of("dsn")));
 
-        assertThat(mockSMTPConfiguration.version()).isEqualTo("0.2");
+        assertThat(mockSMTPConfiguration.version()).isEqualTo("0.4");
     }
 
     private ProcessorConfiguration.Builder directResolutionTransport() {
@@ -391,12 +389,5 @@ class DSNRemoteIntegrationTest {
     @AfterEach
     void tearDown() {
         jamesServer.shutdown();
-        mockSMTPConfiguration.cleanServer();
-    }
-
-    private ConfigurationClient configurationClient(DockerContainer mockSmtp) {
-        return ConfigurationClient.from(
-            Host.from(mockSmtp.getHostIp(),
-                mockSmtp.getMappedPort(8000)));
     }
 }
diff --git a/server/mailet/mock-smtp-server/pom.xml b/server/mailet/mock-smtp-server/pom.xml
index 53a05c6..9acfed5 100644
--- a/server/mailet/mock-smtp-server/pom.xml
+++ b/server/mailet/mock-smtp-server/pom.xml
@@ -54,6 +54,10 @@
             <artifactId>testing-base</artifactId>
         </dependency>
         <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+        </dependency>
+        <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
         </dependency>
@@ -119,6 +123,7 @@
             <plugin>
                 <groupId>com.google.cloud.tools</groupId>
                 <artifactId>jib-maven-plugin</artifactId>
+                <version>2.7.0</version>
                 <configuration>
                     <from>
                         <image>adoptopenjdk:11-jre-hotspot</image>
@@ -126,7 +131,7 @@
                     <to>
                         <image>linagora/mock-smtp-server</image>
                         <tags>
-                            <tag>0.3</tag>
+                            <tag>0.4</tag>
                         </tags>
                     </to>
                     <container>
@@ -135,7 +140,18 @@
                             <port>25</port>
                             <port>8000</port>
                         </ports>
+                        <jvmFlags>
+                            <jvmFlag>-Dlogback.configurationFile=/root/logback.xml</jvmFlag>
+                        </jvmFlags>
                     </container>
+                    <extraDirectories>
+                        <paths>
+                            <path>
+                                <from>src/main/jib</from>
+                                <into>/root</into>
+                            </path>
+                        </paths>
+                    </extraDirectories>
                 </configuration>
             </plugin>
         </plugins>
diff --git a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/HTTPConfigurationServer.java b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/HTTPConfigurationServer.java
index 46925e0..ca5add3 100644
--- a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/HTTPConfigurationServer.java
+++ b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/HTTPConfigurationServer.java
@@ -174,7 +174,7 @@ public class HTTPConfigurationServer {
 
     private Publisher<Void> getVersion(HttpServerRequest req, HttpServerResponse res) {
         return res.status(OK)
-            .sendString(Mono.just("0.2"));
+            .sendString(Mono.just("0.4"));
     }
 
     private Publisher<Void> putBehaviors(HttpServerRequest req, HttpServerResponse res) {
diff --git a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPServerMain.java b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPServerMain.java
index 0dd6621..1916444 100644
--- a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPServerMain.java
+++ b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/MockSMTPServerMain.java
@@ -20,12 +20,15 @@
 package org.apache.james.mock.smtp.server;
 
 import org.apache.james.util.Port;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class MockSMTPServerMain {
+    private static final Logger LOGGER = LoggerFactory.getLogger(MockSMTPServerMain.class);
     private static final Port HTTP_PORT = new Port(8000);
     private static final Port SMTP_PORT = new Port(25);
 
-    public static void main(String[] args) throws Exception {
+    public static void main(String[] args) {
         SMTPBehaviorRepository behaviorRepository = new SMTPBehaviorRepository();
         ReceivedMailRepository receivedMailRepository = new ReceivedMailRepository();
 
@@ -33,5 +36,6 @@ public class MockSMTPServerMain {
         MockSMTPServer mockSMTPServer = MockSMTPServer.onPort(behaviorRepository, receivedMailRepository, SMTP_PORT);
         httpConfigurationServer.start();
         mockSMTPServer.start();
+        LOGGER.info("Mock SMTP server started");
     }
 }
diff --git a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/testing/MockSmtpServerExtension.java b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/testing/MockSmtpServerExtension.java
index 8095c06..cf2c5a1 100644
--- a/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/testing/MockSmtpServerExtension.java
+++ b/server/mailet/mock-smtp-server/src/main/java/org/apache/james/mock/smtp/server/testing/MockSmtpServerExtension.java
@@ -32,6 +32,7 @@ import org.junit.jupiter.api.extension.ParameterResolutionException;
 import org.junit.jupiter.api.extension.ParameterResolver;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.wait.strategy.Wait;
 
 public class MockSmtpServerExtension implements AfterEachCallback, BeforeAllCallback,
     AfterAllCallback, ParameterResolver {
@@ -43,7 +44,8 @@ public class MockSmtpServerExtension implements AfterEachCallback, BeforeAllCall
 
         DockerMockSmtp() {
             mockSmtpServer = DockerContainer.fromName(Images.MOCK_SMTP_SERVER)
-                .withLogConsumer(outputFrame -> LOGGER.debug("MockSMTP: " + outputFrame.getUtf8String()));
+                .withLogConsumer(outputFrame -> LOGGER.debug("MockSMTP: " + outputFrame.getUtf8String()))
+                .waitingFor(Wait.forListeningPort());
         }
 
         void start() {
@@ -96,4 +98,8 @@ public class MockSmtpServerExtension implements AfterEachCallback, BeforeAllCall
     public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException {
         return dockerMockSmtp;
     }
+
+    public DockerMockSmtp getMockSmtp() {
+        return dockerMockSmtp;
+    }
 }
diff --git a/server/mailet/mock-smtp-server/src/resources/logback.xml b/server/mailet/mock-smtp-server/src/main/jib/logback.xml
similarity index 100%
rename from server/mailet/mock-smtp-server/src/resources/logback.xml
rename to server/mailet/mock-smtp-server/src/main/jib/logback.xml
diff --git a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/ConfigurationClientTest.java b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/ConfigurationClientTest.java
index 0f18c82..c85a80d 100644
--- a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/ConfigurationClientTest.java
+++ b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/ConfigurationClientTest.java
@@ -139,7 +139,7 @@ class ConfigurationClientTest {
         mailRepository.store(MailsFixutre.MAIL_2);
 
         assertThat(testee.version())
-            .isEqualTo("0.2");
+            .isEqualTo("0.4");
     }
 
     @Test
diff --git a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/HTTPConfigurationServerTest.java b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/HTTPConfigurationServerTest.java
index 29b99bc..6d4ddef 100644
--- a/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/HTTPConfigurationServerTest.java
+++ b/server/mailet/mock-smtp-server/src/test/java/org/apache/james/mock/smtp/server/HTTPConfigurationServerTest.java
@@ -28,7 +28,6 @@ import static io.restassured.config.RestAssuredConfig.newConfig;
 import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
 import static org.apache.james.mock.smtp.server.Fixture.JSON_BEHAVIORS;
 import static org.apache.james.mock.smtp.server.Fixture.JSON_MAIL;
-import static org.apache.james.mock.smtp.server.Fixture.JSON_MAILS_LIST;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.hasSize;
 
@@ -85,7 +84,7 @@ class HTTPConfigurationServerTest {
                 .basePath("/version")
                 .get()
             .then()
-                .body(equalTo("0.2"));
+                .body(equalTo("0.4"));
         }
 
         @Test
diff --git a/server/testing/src/main/java/org/apache/james/util/docker/Images.java b/server/testing/src/main/java/org/apache/james/util/docker/Images.java
index ccd946a..b0f603b 100644
--- a/server/testing/src/main/java/org/apache/james/util/docker/Images.java
+++ b/server/testing/src/main/java/org/apache/james/util/docker/Images.java
@@ -27,5 +27,5 @@ public interface Images {
     String NGINX = "nginx:1.15.1";
     String TIKA = "apache/tika:1.24";
     String SPAMASSASSIN = "dinkel/spamassassin:3.4.0";
-    String MOCK_SMTP_SERVER = "linagora/mock-smtp-server:0.3";
+    String MOCK_SMTP_SERVER = "linagora/mock-smtp-server:0.4";
 }


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


[james-project] 11/18: JAMES-3500 Disable unused protocols in webAdmin integration tests

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

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

commit 735d689c5773413227ef5db2f3ff155bf4578da4
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 14 08:58:18 2021 +0700

    JAMES-3500 Disable unused protocols in webAdmin integration tests
---
 .../src/test/resources/imapserver.xml              | 15 ------
 .../src/test/resources/lmtpserver.xml              | 18 -------
 .../src/test/resources/managesieveserver.xml       | 33 -------------
 .../src/test/resources/pop3server.xml              | 19 --------
 .../src/test/resources/smtpserver.xml              | 56 ----------------------
 5 files changed, 141 deletions(-)

diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/imapserver.xml b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/imapserver.xml
index e997022..aa7c2fb 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/imapserver.xml
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/imapserver.xml
@@ -36,19 +36,4 @@ under the License.
         <connectionLimit>0</connectionLimit>
         <connectionLimitPerIP>0</connectionLimitPerIP>
     </imapserver>
-    <imapserver enabled="true">
-        <jmxName>imapserver-ssl</jmxName>
-        <bind>0.0.0.0:0</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <!-- To create a new keystore execute:
-              keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
-             -->
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-        </tls>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-    </imapserver>
 </imapservers>
diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/lmtpserver.xml b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/lmtpserver.xml
index 7739071..f838adb 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/lmtpserver.xml
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/lmtpserver.xml
@@ -20,22 +20,4 @@
 
 <lmtpservers>
 
-    <lmtpserver enabled="true">
-        <jmxName>lmtpserver</jmxName>
-        <!-- LMTP should not be reachable from outside your network so bind it to loopback-->
-        <bind>127.0.0.1:0</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <connectiontimeout>1200</connectiontimeout>
-        <!-- Set the maximum simultaneous incoming connections for this service -->
-        <connectionLimit>0</connectionLimit>
-        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--  This sets the maximum allowed message size (in kilobytes) for this -->
-        <!--  LMTP service. If unspecified, the value defaults to 0, which means no limit. -->
-        <maxmessagesize>0</maxmessagesize>
-        <handlerchain>
-            <handler class="org.apache.james.lmtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </lmtpserver>
-
 </lmtpservers>
diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/managesieveserver.xml b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/managesieveserver.xml
index eee4052..f136a43 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/managesieveserver.xml
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/managesieveserver.xml
@@ -27,39 +27,6 @@
 
 <managesieveservers>
 
-   <managesieveserver enabled="true">
-
-     <jmxName>managesieveserver</jmxName>
-
-     <bind>0.0.0.0:0</bind>
-
-     <connectionBacklog>200</connectionBacklog>
-
-     <tls socketTLS="false" startTLS="false">
-       <!-- To create a new keystore execute:
-        keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
-         -->
-       <keystore>file://conf/keystore</keystore>
-       <secret>james72laBalle</secret>
-       <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-       <!-- The algorithm is optional and only needs to be specified when using something other
-        than the Sun JCE provider - You could use IbmX509 with IBM Java runtime. -->
-       <algorithm>SunX509</algorithm>
-     </tls>
-         
-        <!-- connection timeout in secconds -->
-        <connectiontimeout>360</connectiontimeout>
-
-        <!-- Set the maximum simultaneous incoming connections for this service -->
-        <connectionLimit>0</connectionLimit>
-         
-        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-  
-   </managesieveserver>
-
 </managesieveservers>
 
 
diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/pop3server.xml b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/pop3server.xml
index 595c313..bec385a 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/pop3server.xml
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/pop3server.xml
@@ -20,23 +20,4 @@
 
 
 <pop3servers>
-    <pop3server enabled="true">
-        <jmxName>pop3server</jmxName>
-        <bind>0.0.0.0:0</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <!-- To create a new keystore execute:
-                  keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
-             -->
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-        </tls>
-        <connectiontimeout>1200</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <handlerchain>
-            <handler class="org.apache.james.pop3server.core.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </pop3server>
 </pop3servers>
diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/smtpserver.xml b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/smtpserver.xml
index 66cc7e8..b0230ac 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/smtpserver.xml
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/resources/smtpserver.xml
@@ -44,62 +44,6 @@
             <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
         </handlerchain>
     </smtpserver>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-TLS</jmxName>
-        <bind>0.0.0.0:0</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--
-           Authorize only local users
-        -->
-        <authRequired>true</authRequired>
-        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
-        <!-- Trust authenticated users -->
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>Apache JAMES awesome SMTP Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
-    <smtpserver enabled="true">
-        <jmxName>smtpserver-authenticated</jmxName>
-        <bind>0.0.0.0:0</bind>
-        <connectionBacklog>200</connectionBacklog>
-        <tls socketTLS="false" startTLS="false">
-            <keystore>file://conf/keystore</keystore>
-            <secret>james72laBalle</secret>
-            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
-            <algorithm>SunX509</algorithm>
-        </tls>
-        <connectiontimeout>360</connectiontimeout>
-        <connectionLimit>0</connectionLimit>
-        <connectionLimitPerIP>0</connectionLimitPerIP>
-        <!--
-           Authorize only local users
-        -->
-        <authRequired>true</authRequired>
-        <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
-        <!-- Trust authenticated users -->
-        <verifyIdentity>false</verifyIdentity>
-        <maxmessagesize>0</maxmessagesize>
-        <addressBracketsEnforcement>true</addressBracketsEnforcement>
-        <smtpGreeting>Apache JAMES awesome SMTP Server</smtpGreeting>
-        <handlerchain>
-            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
-            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
-        </handlerchain>
-    </smtpserver>
 </smtpservers>
 
 


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