james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [10/12] james-project git commit: JAMES-2543 replace a bunch of assertEquals by assertThat
Date Tue, 11 Sep 2018 09:06:46 GMT
JAMES-2543 replace a bunch of assertEquals by assertThat


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

Branch: refs/heads/master
Commit: 491e8642d95eaab81ac75234e1440c9c2b007fc1
Parents: 6388bd2
Author: Matthieu Baechler <matthieu@apache.org>
Authored: Thu Sep 6 18:21:35 2018 +0200
Committer: Matthieu Baechler <matthieu@apache.org>
Committed: Mon Sep 10 21:25:26 2018 +0200

----------------------------------------------------------------------
 .../james/mailbox/MailboxManagerStressTest.java |   3 +-
 .../acl/UnionMailboxACLResolverTest.java        |   1 -
 .../james/mailbox/model/MailboxACLTest.java     |  11 +-
 .../mail/CassandraModSeqProviderTest.java       |   3 +-
 .../HBaseMailboxSessionMapperFactoryTest.java   |   5 +-
 .../james/mailbox/hbase/HBaseUtilsTest.java     |  11 +-
 .../hbase/mail/HBaseMailboxMapperTest.java      |  35 +-
 .../mail/HBaseMailboxMessageMapperTest.java     |  16 +-
 .../mail/HBaseUidAndModSeqProviderTest.java     |  14 +-
 .../hbase/mail/model/HBaseMailboxTest.java      |  26 +-
 .../hbase/user/HBaseSubscriptionMapperTest.java |  10 +-
 mailbox/spring/pom.xml                          |   5 +
 .../james/mailbox/spring/SpringMailboxTest.java |   6 +-
 .../store/MailboxMessageResultImplTest.java     |  33 +-
 .../PartContentBuilderComplexMultipartTest.java |  12 +-
 ...tContentBuilderMultipartAlternativeTest.java |  20 +-
 .../model/DelegatingMailboxMessageTest.java     |   3 +-
 .../mailbox/store/search/SearchUtilTest.java    |  25 +-
 mailbox/zoo-seq-provider/pom.xml                |   5 +
 .../mailbox/store/mail/ZooUidProviderTest.java  |  14 +-
 .../apache/mailet/base/MatcherInverterTest.java |   3 +-
 .../james/transport/mailets/OnlyTextTest.java   |  38 +-
 .../james/transport/mailets/UnwrapTextTest.java |  27 +-
 .../matchers/AbstractHasMailAttributeTest.java  |   6 +-
 .../HasMailAttributeWithValueRegexTest.java     |  10 +-
 mpt/antlib/pom.xml                              |   4 +
 .../org/apache/james/mpt/ant/TestAddUser.java   |   5 +-
 .../apache/james/mpt/ant/TestRunScripts.java    |   9 +-
 .../apache/james/mpt/TestDiscardProtocol.java   |   5 +-
 .../apache/james/mpt/TestScriptedUserAdder.java |   5 +-
 protocols/api/pom.xml                           |   5 +
 .../api/AbstractProtocolTransportTest.java      |   8 +-
 .../org/apache/james/imap/api/IdRangeTest.java  |  15 +-
 .../AbstractTestForStatusResponseFactory.java   | 109 +++---
 .../message/response/StatusResponseTest.java    |  11 +-
 .../imap/decode/FetchPartPathDecoderTest.java   | 101 +++--
 .../imap/decode/main/IdRangeParseTest.java      |  20 +-
 .../imap/decode/parser/GetQuotaParserTest.java  |   4 +-
 .../decode/parser/GetQuotaRootParserTest.java   |   6 +-
 .../SearchCommandParserAndParenthesesTest.java  |   4 +-
 .../parser/SearchCommandParserCharsetTest.java  |   6 +-
 .../parser/SearchCommandParserNotTest.java      |  10 +-
 .../parser/SearchCommandParserOrTest.java       |   4 +-
 .../SearchCommandParserQuotedCharsetTest.java   |  10 +-
 ...chCommandParserSearchKeySequenceSetTest.java |   4 +-
 .../SearchCommandParserSearchKeyTest.java       |   4 +-
 .../SearchCommandParserTopLevelAndTest.java     |   4 +-
 .../parser/SetQuotaCommandParserTest.java       |  14 +-
 .../encode/EncoderUtilsDateTimeLocaleTest.java  |  58 +--
 .../james/imap/encode/EncoderUtilsTest.java     |  58 +--
 .../FetchResponseEncoderEnvelopeTest.java       |  36 +-
 .../FetchResponseEncoderNoExtensionsTest.java   |   9 +-
 .../imap/encode/FetchResponseEncoderTest.java   |   7 +-
 .../MailboxStatusResponseEncoderTest.java       |   3 +-
 .../imap/encode/QuotaResponseEncoderTest.java   |   6 +-
 .../encode/QuotaRootResponseEncoderTest.java    |   4 +-
 .../imap/encode/SearchResponseEncoderTest.java  |   3 +-
 ...tractTestOutputStreamImapResponseWriter.java |   4 +-
 .../fetch/MailboxMessageResultUtilsTest.java    |  27 +-
 .../fetch/PartialFetchBodyElementTest.java      |  21 +-
 .../imap/utils/DecoderUtilsLocaleDateTest.java  | 386 +++++++++----------
 .../protocols/imap/utils/DecoderUtilsTest.java  | 361 +++++++++--------
 .../protocols/lmtp/AbstractLMTPServerTest.java  |   3 +-
 .../pop3/AbstractStartTlsPOP3ServerTest.java    |   3 +-
 .../pop3/core/AbstractInputStreamTest.java      |   8 +-
 .../smtp/core/fastfail/DNSRBLHandlerTest.java   |   4 +-
 .../smtp/core/fastfail/MaxRcptHandlerTest.java  |   6 +-
 .../core/fastfail/MaxUnknownCmdHandlerTest.java |   8 +-
 .../fastfail/ResolvableEhloHeloHandlerTest.java |   9 +-
 .../smtp/core/fastfail/SpamTrapHandlerTest.java |  10 +-
 .../fastfail/ValidSenderDomainHandlerTest.java  |   6 +-
 .../james/server/core/MailHeadersTest.java      |   8 +-
 .../core/MimeMessageCopyOnWriteProxyTest.java   |   9 +-
 .../james/server/core/MimeMessageTest.java      |  13 +-
 .../server/core/MimeMessageWrapperTest.java     |  37 +-
 .../onami/lifecycle/MultiLifeCycleTestCase.java |  16 +-
 .../onami/lifecycle/StagingOrderTestCase.java   |   7 +-
 .../james/util/BodyOffsetInputStreamTest.java   |  14 +-
 .../util/retry/DoublingRetryScheduleTest.java   |  55 ++-
 .../util/retry/ExceptionRetryHandlerTest.java   |  11 +-
 .../naming/NamingExceptionRetryHandlerTest.java |   5 +-
 .../memory/UsersRepositoryManagementTest.java   |  11 +-
 .../dnsservice/dnsjava/DNSJavaServiceTest.java  |  27 +-
 .../library/MXHostAddressIteratorTest.java      |   3 -
 .../inetnetwork/InetNetworkBuilderTest.java     |  10 +-
 .../inetnetwork/model/InetNetworkTest.java      |  17 +-
 .../library/netmatcher/NetMatcherTest.java      |   5 +-
 .../dnsservice/api/AbstractDNSServiceTest.java  |   4 +-
 .../karaf/features/KarafLiveTestSupport.java    |   6 +-
 .../impl/MailetConfigImplTest.java              |  20 +-
 .../AbstractStateCompositeProcessorTest.java    |   4 +-
 .../lib/AbstractStateMailetProcessorTest.java   |  39 +-
 .../mailets/delivery/ToRecipientFolderTest.java |   3 +-
 .../apache/james/pop3server/POP3ServerTest.java | 143 ++++---
 .../apache/james/smtpserver/SPFHandlerTest.java |  36 +-
 .../smtpserver/SetMimeHeaderHandlerTest.java    |   6 +-
 .../smtpserver/SpamAssassinHandlerTest.java     |  13 +-
 .../james/smtpserver/URIRBLHandlerTest.java     |   8 +-
 .../james/smtpserver/ValidRcptMXTest.java       |   4 +-
 99 files changed, 1116 insertions(+), 1167 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java
index 60a2726..8f41eb7 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java
@@ -19,7 +19,6 @@
 package org.apache.james.mailbox;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
 
 import java.nio.charset.StandardCharsets;
 import java.util.Collection;
@@ -125,7 +124,7 @@ public abstract class MailboxManagerStressTest {
         // For mailboxes without locks, even if the UID is monotic, as re-scheduling can happen between UID generation and event delivery,
         // we can not check the order on the event listener
         // No UID duplicates prevents message loss
-        assertEquals(APPEND_OPERATIONS, ImmutableSet.copyOf(uList).size());
+        assertThat(ImmutableSet.copyOf(uList).size()).isEqualTo(APPEND_OPERATIONS);
         assertThat(fail.get()).describedAs("Unable to append all messages").isFalse();
         pool.shutdown();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/api/src/test/java/org/apache/james/mailbox/acl/UnionMailboxACLResolverTest.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/acl/UnionMailboxACLResolverTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/acl/UnionMailboxACLResolverTest.java
index ab75f1e..b3f85e7 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/acl/UnionMailboxACLResolverTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/acl/UnionMailboxACLResolverTest.java
@@ -28,7 +28,6 @@ import org.apache.james.mailbox.model.MailboxACL.Entry;
 import org.apache.james.mailbox.model.MailboxACL.EntryKey;
 import org.apache.james.mailbox.model.MailboxACL.NameType;
 import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/api/src/test/java/org/apache/james/mailbox/model/MailboxACLTest.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/model/MailboxACLTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/model/MailboxACLTest.java
index 5804932..08a3dc0 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/model/MailboxACLTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/model/MailboxACLTest.java
@@ -21,7 +21,6 @@
 package org.apache.james.mailbox.model;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -82,7 +81,7 @@ public class MailboxACLTest {
 
         Map<EntryKey, Rfc4314Rights> foundEntries = result.getEntries();
 
-        assertEquals(foundEntries, expectedEntries);
+        assertThat(expectedEntries).isEqualTo(foundEntries);
     }
 
     @Test
@@ -109,7 +108,7 @@ public class MailboxACLTest {
 
         Map<EntryKey, Rfc4314Rights> foundEntries = result.getEntries();
 
-        assertEquals(foundEntries, expectedEntries);
+        assertThat(expectedEntries).isEqualTo(foundEntries);
     }
 
     @Test
@@ -122,7 +121,7 @@ public class MailboxACLTest {
 
         Map<EntryKey, Rfc4314Rights> foundEntries = result.getEntries();
 
-        assertEquals(foundEntries, expectedEntries);
+        assertThat(foundEntries).isEqualTo(expectedEntries);
     }
 
     @Test
@@ -146,7 +145,7 @@ public class MailboxACLTest {
 
         Map<EntryKey, Rfc4314Rights> foundEntries = result.getEntries();
 
-        assertEquals(foundEntries, expectedEntries);
+        assertThat(expectedEntries).isEqualTo(foundEntries);
     }
 
     @Test
@@ -159,7 +158,7 @@ public class MailboxACLTest {
 
         Map<EntryKey, Rfc4314Rights> foundEntries = result.getEntries();
 
-        assertEquals(foundEntries, expectedEntries);
+        assertThat(expectedEntries).isEqualTo(foundEntries);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java
index 9ae65ad..6059389 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProviderTest.java
@@ -19,7 +19,6 @@
 package org.apache.james.mailbox.cassandra.mail;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
 
 import java.util.stream.LongStream;
 
@@ -75,7 +74,7 @@ public class CassandraModSeqProviderTest {
     public void highestModSeqShouldRetrieveValueStoredNextModSeq() throws Exception {
         int nbEntries = 100;
         long result = modSeqProvider.highestModSeq(null, mailbox);
-        assertEquals(0, result);
+        assertThat(result).isEqualTo(0);
         LongStream.range(0, nbEntries)
             .forEach(Throwing.longConsumer(value -> {
                         long uid = modSeqProvider.nextModSeq(null, mailbox);

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java
index f040d50..8890662 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java
@@ -30,7 +30,6 @@ import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS_TABLE;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTION_CF;
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 
@@ -135,7 +134,7 @@ public class HBaseMailboxSessionMapperFactoryTest {
         MessageId.Factory messageIdFactory = null;
         HBaseMailboxSessionMapperFactory instance = new HBaseMailboxSessionMapperFactory(conf, null, expResult, messageIdFactory);
         ModSeqProvider result = instance.getModSeqProvider();
-        assertEquals(expResult, result);
+        assertThat(result).isEqualTo(expResult);
     }
 
     /**
@@ -148,6 +147,6 @@ public class HBaseMailboxSessionMapperFactoryTest {
         MessageId.Factory messageIdFactory = null;
         HBaseMailboxSessionMapperFactory instance = new HBaseMailboxSessionMapperFactory(conf, expResult, null, messageIdFactory);
         UidProvider result = instance.getUidProvider();
-        assertEquals(expResult, result);
+        assertThat(result).isEqualTo(expResult);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java
index e1404d3..224ca16 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java
@@ -44,7 +44,6 @@ import static org.apache.james.mailbox.hbase.PropertyConvertor.getProperty;
 import static org.apache.james.mailbox.hbase.PropertyConvertor.getValue;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
 
 import java.util.Date;
 import java.util.UUID;
@@ -83,10 +82,10 @@ public class HBaseUtilsTest {
         assertArrayEquals(expResult, result);
 
         HBaseId newUUID = hBaseIdFromRowKey(result);
-        assertEquals(uuid, newUUID);
+        assertThat(newUUID).isEqualTo(uuid);
 
         newUUID = hBaseIdFromRowKey(expResult);
-        assertEquals(uuid, newUUID);
+        assertThat(newUUID).isEqualTo(uuid);
     }
 
     /**
@@ -121,9 +120,9 @@ public class HBaseUtilsTest {
         final Property prop1 = new SimpleProperty("nspace", "localName", "test");
         byte[] value = getValue(prop1);
         final Property prop2 = getProperty(value);
-        assertEquals(prop1.getNamespace(), prop2.getNamespace());
-        assertEquals(prop1.getLocalName(), prop2.getLocalName());
-        assertEquals(prop1.getValue(), prop2.getValue());
+        assertThat(prop2.getNamespace()).isEqualTo(prop1.getNamespace());
+        assertThat(prop2.getLocalName()).isEqualTo(prop1.getLocalName());
+        assertThat(prop2.getValue()).isEqualTo(prop1.getValue());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
index 4519e53..3aef240 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
@@ -29,9 +29,6 @@ import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTION_CF;
 import static org.apache.james.mailbox.hbase.HBaseUtils.mailboxFromResult;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -132,7 +129,7 @@ public class HBaseMailboxMapperTest {
         for (MailboxPath path : pathsList) {
             LOG.info("Searching for {}", path);
             mailbox = (HBaseMailbox) mapper.findMailboxByPath(path);
-            assertEquals(path, new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName()));
+            assertThat(new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName())).isEqualTo(path);
         }
     }
 
@@ -142,7 +139,7 @@ public class HBaseMailboxMapperTest {
         for (MailboxId id : idsList) {
             LOG.info("Searching for {}", id.serialize());
             mailbox = (HBaseMailbox) mapper.findMailboxById(id);
-            assertEquals(mailbox.getMailboxId(), id);
+            assertThat(id).isEqualTo(mailbox.getMailboxId());
         }
     }
 
@@ -154,7 +151,7 @@ public class HBaseMailboxMapperTest {
         MailboxPath path = pathsList.get(pathsList.size() / 2);
 
         List<Mailbox> result = mapper.findMailboxWithPathLike(path);
-        assertEquals(1, result.size());
+        assertThat(result.size()).isEqualTo(1);
 
         int start = 3;
         int end = 7;
@@ -167,7 +164,7 @@ public class HBaseMailboxMapperTest {
             addMailbox(new HBaseMailbox(newPath, 1234));
         }
         result = mapper.findMailboxWithPathLike(path);
-        assertEquals(end - start + 1, result.size());
+        assertThat(result.size()).isEqualTo(end - start + 1);
     }
 
     private String computeUserName(String user, int i) {
@@ -187,7 +184,7 @@ public class HBaseMailboxMapperTest {
     private void testList() throws Exception {
         LOG.info("list");
         List<Mailbox> result = mapper.list();
-        assertEquals(mailboxList.size(), result.size());
+        assertThat(result.size()).isEqualTo(mailboxList.size());
 
     }
 
@@ -207,14 +204,14 @@ public class HBaseMailboxMapperTest {
         
             final Result result = mailboxes.get(get);
             final HBaseMailbox newValue = (HBaseMailbox) mailboxFromResult(result);
-            assertEquals(mlbx, newValue);
-            assertEquals(mlbx.getUser(), newValue.getUser());
-            assertEquals(mlbx.getName(), newValue.getName());
-            assertEquals(mlbx.getNamespace(), newValue.getNamespace());
-            assertEquals(mlbx.getMailboxId(), newValue.getMailboxId());
-            assertEquals(mlbx.getLastUid(), newValue.getLastUid());
-            assertEquals(mlbx.getUidValidity(), newValue.getUidValidity());
-            assertEquals(mlbx.getHighestModSeq(), newValue.getHighestModSeq());
+            assertThat(newValue).isEqualTo(mlbx);
+            assertThat(newValue.getUser()).isEqualTo(mlbx.getUser());
+            assertThat(newValue.getName()).isEqualTo(mlbx.getName());
+            assertThat(newValue.getNamespace()).isEqualTo(mlbx.getNamespace());
+            assertThat(newValue.getMailboxId()).isEqualTo(mlbx.getMailboxId());
+            assertThat(newValue.getLastUid()).isEqualTo(mlbx.getLastUid());
+            assertThat(newValue.getUidValidity()).isEqualTo(mlbx.getUidValidity());
+            assertThat(newValue.getHighestModSeq()).isEqualTo(mlbx.getHighestModSeq());
             assertArrayEquals(mlbx.getMailboxId().toBytes(), newValue.getMailboxId().toBytes());
         } finally {
             mailboxes.close();
@@ -246,8 +243,8 @@ public class HBaseMailboxMapperTest {
                 notFoundCount++;
             }
         }
-        assertEquals(offset, notFoundCount);
-        assertEquals(mailboxList.size(), mapper.list().size());
+        assertThat(notFoundCount).isEqualTo(offset);
+        assertThat(mapper.list().size()).isEqualTo(mailboxList.size());
     }
 
     /**
@@ -279,7 +276,7 @@ public class HBaseMailboxMapperTest {
     private void testDeleteAllMailboxes() throws MailboxException {
         LOG.info("deleteAllMailboxes");
         mapper.deleteAllMailboxes();
-        assertEquals(0, mapper.list().size());
+        assertThat(mapper.list().size()).isEqualTo(0);
         fillMailboxList();
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java
index c3832fe..5c9363e 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMessageMapperTest.java
@@ -29,7 +29,7 @@ import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_HEADERS_CF;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS_TABLE;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTION_CF;
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -179,7 +179,7 @@ public class HBaseMailboxMessageMapperTest {
     private void testCountMessagesInMailbox() throws Exception {
         LOG.info("countMessagesInMailbox");
         long messageCount = messageMapper.countMessagesInMailbox(MBOXES.get(1));
-        assertEquals(MESSAGE_NO.size(), messageCount);
+        assertThat(messageCount).isEqualTo(MESSAGE_NO.size());
     }
 
     /**
@@ -188,7 +188,7 @@ public class HBaseMailboxMessageMapperTest {
     private void testCountUnseenMessagesInMailbox() throws Exception {
         LOG.info("countUnseenMessagesInMailbox");
         long unseen = messageMapper.countUnseenMessagesInMailbox(MBOXES.get(1));
-        assertEquals(MESSAGE_NO.size() - 1, unseen);
+        assertThat(unseen).isEqualTo(MESSAGE_NO.size() - 1);
     }
 
     /**
@@ -197,7 +197,7 @@ public class HBaseMailboxMessageMapperTest {
     private void testFindFirstUnseenMessageUid() throws Exception {
         LOG.info("findFirstUnseenMessageUid");
         MessageUid uid = messageMapper.findFirstUnseenMessageUid(MBOXES.get(1));
-        assertEquals(MessageUid.of(1), uid);
+        assertThat(uid).isEqualTo(MessageUid.of(1));
     }
 
     /**
@@ -207,7 +207,7 @@ public class HBaseMailboxMessageMapperTest {
     private void testFindRecentMessageUidsInMailbox() throws Exception {
         LOG.info("findRecentMessageUidsInMailbox");
         List<MessageUid> recentMessages = messageMapper.findRecentMessageUidsInMailbox(MBOXES.get(1));
-        assertEquals(MESSAGE_NO.size() - 1, recentMessages.size());
+        assertThat(recentMessages.size()).isEqualTo(MESSAGE_NO.size() - 1);
     }
 
     /**
@@ -218,7 +218,7 @@ public class HBaseMailboxMessageMapperTest {
         // The tables should be deleted every time the tests run.
         long msgCount = messageMapper.countMessagesInMailbox(MBOXES.get(1));
         LOG.info("{} {}", msgCount, MESSAGE_NO.size());
-        assertEquals(MESSAGE_NO.size(), msgCount);
+        assertThat(msgCount).isEqualTo(MESSAGE_NO.size());
     }
 
     /**
@@ -227,7 +227,7 @@ public class HBaseMailboxMessageMapperTest {
     private void testGetLastUid() throws Exception {
         LOG.info("getLastUid");
         MessageUid lastUid = messageMapper.getLastUid(MBOXES.get(1)).get();
-        assertEquals(MessageUid.of(MESSAGE_NO.size()), lastUid);
+        assertThat(lastUid).isEqualTo(MessageUid.of(MESSAGE_NO.size()));
     }
 
     /**
@@ -236,6 +236,6 @@ public class HBaseMailboxMessageMapperTest {
     private void testGetHighestModSeq() throws Exception {
         LOG.info("getHighestModSeq");
         long highestModSeq = messageMapper.getHighestModSeq(MBOXES.get(1));
-        assertEquals(MESSAGE_NO.size(), highestModSeq);
+        assertThat(highestModSeq).isEqualTo(MESSAGE_NO.size());
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseUidAndModSeqProviderTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseUidAndModSeqProviderTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseUidAndModSeqProviderTest.java
index 09d371e..4fbb051 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseUidAndModSeqProviderTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseUidAndModSeqProviderTest.java
@@ -29,7 +29,7 @@ import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_HEADERS_CF;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS_TABLE;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTION_CF;
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -130,10 +130,10 @@ public class HBaseUidAndModSeqProviderTest {
         pathsList.add(path);
         MailboxSession session = null;
         Optional<MessageUid> result = uidProvider.lastUid(session, newBox);
-        assertEquals(Optional.empty(), result);
+        assertThat(result).isEqualTo(Optional.empty());
         for (int i = 1; i < 10; i++) {
             MessageUid uid = uidProvider.nextUid(session, newBox);
-            assertEquals(uid, uidProvider.lastUid(session, newBox).get());
+            assertThat(uidProvider.lastUid(session, newBox).get()).isEqualTo(uid);
         }
     }
 
@@ -153,7 +153,7 @@ public class HBaseUidAndModSeqProviderTest {
                 lastUid = Optional.of(MessageUid.MIN_VALUE);
             }
             MessageUid result = uidProvider.nextUid(session, mailbox);
-            assertEquals(lastUid.get(), result);
+            assertThat(result).isEqualTo(lastUid.get());
         }
     }
 
@@ -171,10 +171,10 @@ public class HBaseUidAndModSeqProviderTest {
         pathsList.add(path);
         MailboxSession session = null;
         long result = modSeqProvider.highestModSeq(session, newBox);
-        assertEquals(0, result);
+        assertThat(result).isEqualTo(0);
         for (int i = 1; i < 10; i++) {
             long uid = modSeqProvider.nextModSeq(session, newBox);
-            assertEquals(uid, modSeqProvider.highestModSeq(session, newBox));
+            assertThat(modSeqProvider.highestModSeq(session, newBox)).isEqualTo(uid);
         }
     }
 
@@ -190,7 +190,7 @@ public class HBaseUidAndModSeqProviderTest {
         long result;
         for (int i = (int) lastUid + 1; i < (lastUid + 10); i++) {
             result = modSeqProvider.nextModSeq(session, mailbox);
-            assertEquals(i, result);
+            assertThat(result).isEqualTo(i);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailboxTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailboxTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailboxTest.java
index 8e685a4..32def39 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailboxTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailboxTest.java
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.james.mailbox.hbase.mail.model;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.UUID;
 
@@ -41,7 +41,7 @@ public class HBaseMailboxTest {
 
         HBaseId expResult = HBaseId.of(UUID.randomUUID());
         instance.setMailboxId(expResult);
-        assertEquals(expResult, instance.getMailboxId());
+        assertThat(instance.getMailboxId()).isEqualTo(expResult);
 
     }
 
@@ -53,10 +53,10 @@ public class HBaseMailboxTest {
         final MailboxPath mailboxPath = new MailboxPath("gsoc", "ieugen", "INBOX");
         final HBaseMailbox instance = new HBaseMailbox(mailboxPath, 124566);
         String result = instance.getNamespace();
-        assertEquals(mailboxPath.getNamespace(), result);
+        assertThat(result).isEqualTo(mailboxPath.getNamespace());
 
         instance.setNamespace("newName");
-        assertEquals("newName", instance.getNamespace());
+        assertThat(instance.getNamespace()).isEqualTo("newName");
 
     }
 
@@ -68,10 +68,10 @@ public class HBaseMailboxTest {
         final MailboxPath mailboxPath = new MailboxPath("gsoc", "ieugen", "INBOX");
         final HBaseMailbox instance = new HBaseMailbox(mailboxPath, 12);
         String result = instance.getUser();
-        assertEquals(mailboxPath.getUser(), result);
+        assertThat(result).isEqualTo(mailboxPath.getUser());
 
         instance.setUser("eric");
-        assertEquals("eric", instance.getUser());
+        assertThat(instance.getUser()).isEqualTo("eric");
     }
 
     /**
@@ -82,10 +82,10 @@ public class HBaseMailboxTest {
         final MailboxPath mailboxPath = new MailboxPath("gsoc", "ieugen", "INBOX");
         final HBaseMailbox instance = new HBaseMailbox(mailboxPath, 1677);
         String result = instance.getName();
-        assertEquals(mailboxPath.getName(), result);
+        assertThat(result).isEqualTo(mailboxPath.getName());
 
         instance.setName("newINBOX");
-        assertEquals("newINBOX", instance.getName());
+        assertThat(instance.getName()).isEqualTo("newINBOX");
     }
 
     /**
@@ -97,7 +97,7 @@ public class HBaseMailboxTest {
         final HBaseMailbox instance = new HBaseMailbox(mailboxPath, 123345);
         long expResult = 123345L;
         long result = instance.getUidValidity();
-        assertEquals(expResult, result);
+        assertThat(result).isEqualTo(expResult);
 
     }
 
@@ -114,7 +114,7 @@ public class HBaseMailboxTest {
         HBaseId mailboxId = instance.getMailboxId();
         int expResult = PRIME * result + (int) (mailboxId.getRawId().getMostSignificantBits() ^ (mailboxId.getRawId().getMostSignificantBits() >>> 32));
 
-        assertEquals(expResult, instance.hashCode());
+        assertThat(instance.hashCode()).isEqualTo(expResult);
     }
 
     /**
@@ -126,7 +126,7 @@ public class HBaseMailboxTest {
         final HBaseMailbox instance = new HBaseMailbox(mailboxPath, 12345);
         final HBaseMailbox instance2 = new HBaseMailbox(mailboxPath, 12345);
         instance2.setMailboxId(instance.getMailboxId());
-        assertEquals(instance, instance2);
+        assertThat(instance2).isEqualTo(instance);
     }
 
     /**
@@ -138,7 +138,7 @@ public class HBaseMailboxTest {
         final HBaseMailbox instance = new HBaseMailbox(mailboxPath, 10);
         long expResult = instance.getLastUid() + 1;
         long result = instance.consumeUid();
-        assertEquals(expResult, result);
+        assertThat(result).isEqualTo(expResult);
     }
 
     /**
@@ -150,6 +150,6 @@ public class HBaseMailboxTest {
         final HBaseMailbox instance = new HBaseMailbox(mailboxPath, 10);
         long expResult = instance.getHighestModSeq() + 1;
         long result = instance.consumeModSeq();
-        assertEquals(expResult, result);
+        assertThat(result).isEqualTo(expResult);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/user/HBaseSubscriptionMapperTest.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/user/HBaseSubscriptionMapperTest.java b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/user/HBaseSubscriptionMapperTest.java
index 6eabd6a..1b86d4c 100644
--- a/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/user/HBaseSubscriptionMapperTest.java
+++ b/mailbox/hbase/src/test/java/org/apache/james/mailbox/hbase/user/HBaseSubscriptionMapperTest.java
@@ -30,8 +30,6 @@ import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS_TABLE;
 import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTION_CF;
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -138,8 +136,8 @@ public class HBaseSubscriptionMapperTest {
             LOG.info("Searching for all subscriptions for user:{}", user);
             for (SimpleSubscription subscription : subscriptionList.get(user)) {
                 final Subscription result = mapper.findMailboxSubscriptionForUser(user, subscription.getMailbox());
-                assertEquals(subscription.getMailbox(), result.getMailbox());
-                assertEquals(subscription.getUser(), result.getUser());
+                assertThat(result.getMailbox()).isEqualTo(subscription.getMailbox());
+                assertThat(result.getUser()).isEqualTo(subscription.getUser());
             }
         }
         assertThat(mapper.findMailboxSubscriptionForUser(fake1.getUser(), fake1.getMailbox())).isNull();
@@ -177,7 +175,7 @@ public class HBaseSubscriptionMapperTest {
         for (String user : subscriptionList.keySet()) {
             LOG.info("Searching for all subscriptions for user: {}", user);
             final List<Subscription> found = mapper.findSubscriptionsForUser(user);
-            assertEquals(subscriptionList.get(user).size(), found.size());
+            assertThat(found.size()).isEqualTo(subscriptionList.get(user).size());
             // TODO: patch Subscription to implement equals
             //assertTrue(subscriptionList.get(user).containsAll(foundSubscriptions));
             //assertTrue(foundSubscriptions.containsAll(subscriptionList.get(user)));
@@ -185,7 +183,7 @@ public class HBaseSubscriptionMapperTest {
             //assertFalse(foundSubscriptions.contains(fake2));
         }
         //TODO: check what value we should return in case of no subscriptions: null or empty list
-        assertEquals(mapper.findSubscriptionsForUser(fake2.getMailbox()).size(), 0);
+        assertThat(0).isEqualTo(mapper.findSubscriptionsForUser(fake2.getMailbox()).size());
 
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/spring/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/spring/pom.xml b/mailbox/spring/pom.xml
index 4376d68..ac4f542 100644
--- a/mailbox/spring/pom.xml
+++ b/mailbox/spring/pom.xml
@@ -141,6 +141,11 @@
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
         <!--
                 JCR temporary desactivated because jackrabbit still uses lucene 2
                 <dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/spring/src/test/java/org/apache/james/mailbox/spring/SpringMailboxTest.java
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/test/java/org/apache/james/mailbox/spring/SpringMailboxTest.java b/mailbox/spring/src/test/java/org/apache/james/mailbox/spring/SpringMailboxTest.java
index 4e5bae8..81f3c31 100644
--- a/mailbox/spring/src/test/java/org/apache/james/mailbox/spring/SpringMailboxTest.java
+++ b/mailbox/spring/src/test/java/org/apache/james/mailbox/spring/SpringMailboxTest.java
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.james.mailbox.spring;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.IOException;
 
@@ -37,8 +37,8 @@ public class SpringMailboxTest {
     
     @Test
     public void testGetBean() throws IOException {
-        assertEquals(AnonymousAuthenticator.class.getName(), springMailbox.getBean("authenticator").getClass().getName());
-        assertEquals(MailboxCopierImpl.class.getName(), springMailbox.getBean("mailboxcopier").getClass().getName());
+        assertThat(springMailbox.getBean("authenticator").getClass().getName()).isEqualTo(AnonymousAuthenticator.class.getName());
+        assertThat(springMailbox.getBean("mailboxcopier").getClass().getName()).isEqualTo(MailboxCopierImpl.class.getName());
     }
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java
index 44637d7..12d2171 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java
@@ -20,7 +20,6 @@
 package org.apache.james.mailbox.store;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
 
 import java.util.Date;
 
@@ -68,57 +67,57 @@ public class MailboxMessageResultImplTest {
 
     @Test
     public void testEqualsReflexive() throws Exception {
-        assertEquals(msgResultA, msgResultA);
+        assertThat(msgResultA).isEqualTo(msgResultA);
     }
 
 
     @Test
     public void testCompareToReflexive() throws Exception {
-        assertEquals(0, msgResultA.compareTo(msgResultA));
+        assertThat(msgResultA.compareTo(msgResultA)).isEqualTo(0);
     }
 
 
     @Test
     public void testHashCodeReflexive() throws Exception {
-        assertEquals(msgResultA.hashCode(), msgResultA.hashCode());
+        assertThat(msgResultA.hashCode()).isEqualTo(msgResultA.hashCode());
     }
 
 
     @Test
     public void testEqualsSymmetric() throws Exception {
-        assertEquals(msgResultA, msgResultACopy);
-        assertEquals(msgResultACopy, msgResultA);
+        assertThat(msgResultACopy).isEqualTo(msgResultA);
+        assertThat(msgResultA).isEqualTo(msgResultACopy);
     }
 
 
     @Test
     public void testHashCodeSymmetric() throws Exception {
-        assertEquals(msgResultA.hashCode(), msgResultACopy.hashCode());
-        assertEquals(msgResultACopy.hashCode(), msgResultA.hashCode());
+        assertThat(msgResultACopy.hashCode()).isEqualTo(msgResultA.hashCode());
+        assertThat(msgResultA.hashCode()).isEqualTo(msgResultACopy.hashCode());
     }
 
 
     @Test
     public void testEqualsTransitive() throws Exception {
-        assertEquals(msgResultA, msgResultACopy);
-        assertEquals(msgResultACopy, msgResultB);
-        assertEquals(msgResultA, msgResultB);
+        assertThat(msgResultACopy).isEqualTo(msgResultA);
+        assertThat(msgResultB).isEqualTo(msgResultACopy);
+        assertThat(msgResultB).isEqualTo(msgResultA);
     }
 
 
     @Test
     public void testCompareToTransitive() throws Exception {
-        assertEquals(0, msgResultA.compareTo(msgResultACopy));
-        assertEquals(0, msgResultACopy.compareTo(msgResultB));
-        assertEquals(0, msgResultA.compareTo(msgResultB));
+        assertThat(msgResultA.compareTo(msgResultACopy)).isEqualTo(0);
+        assertThat(msgResultACopy.compareTo(msgResultB)).isEqualTo(0);
+        assertThat(msgResultA.compareTo(msgResultB)).isEqualTo(0);
     }
 
 
     @Test
     public void testHashCodeTransitive() throws Exception {
-        assertEquals(msgResultA.hashCode(), msgResultACopy.hashCode());
-        assertEquals(msgResultACopy.hashCode(), msgResultB.hashCode());
-        assertEquals(msgResultA.hashCode(), msgResultB.hashCode());
+        assertThat(msgResultACopy.hashCode()).isEqualTo(msgResultA.hashCode());
+        assertThat(msgResultB.hashCode()).isEqualTo(msgResultACopy.hashCode());
+        assertThat(msgResultB.hashCode()).isEqualTo(msgResultA.hashCode());
     }
 
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java
index 12f3cdf..8dd9e95 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderComplexMultipartTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.mailbox.store;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Fail.fail;
 
 import java.io.ByteArrayInputStream;
@@ -186,8 +186,8 @@ public class PartContentBuilderComplexMultipartTest {
     private void check(String full, String body, String contentType,
             int[] position) throws Exception {
         checkContentType(contentType, position);
-        assertEquals(body, bodyContent(position));
-        assertEquals(full, fullContent(position));
+        assertThat(bodyContent(position)).isEqualTo(body);
+        assertThat(fullContent(position)).isEqualTo(full);
     }
 
     private String fullContent(int[] position) throws Exception {
@@ -203,10 +203,10 @@ public class PartContentBuilderComplexMultipartTest {
     private void checkContentType(String contentType, int[] position)
             throws Exception {
         List<Header> headers = headers(position);
-        assertEquals(1, headers.size());
+        assertThat(headers.size()).isEqualTo(1);
         ResultHeader header = (ResultHeader) headers.get(0);
-        assertEquals(CONTENT_TYPE, header.getName());
-        assertEquals(contentType, header.getValue());
+        assertThat(header.getName()).isEqualTo(CONTENT_TYPE);
+        assertThat(header.getValue()).isEqualTo(contentType);
     }
 
     private List<Header> headers(int[] position) throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java
index abff3b0..da1b920 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/PartContentBuilderMultipartAlternativeTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.mailbox.store;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
@@ -80,9 +80,9 @@ public class PartContentBuilderMultipartAlternativeTest {
 
     @Test
     public void testShouldLocatePartsOfMultipartAlterative() throws Exception {
-        assertEquals(ALT_PLAIN_BODY, bodyContent(MULTIPART_ALTERNATIVE, 1));
-        assertEquals(ALT_HTML_BODY, bodyContent(MULTIPART_ALTERNATIVE, 2));
-        assertEquals(ALT_XHTML_BODY, bodyContent(MULTIPART_ALTERNATIVE, 3));
+        assertThat(bodyContent(MULTIPART_ALTERNATIVE, 1)).isEqualTo(ALT_PLAIN_BODY);
+        assertThat(bodyContent(MULTIPART_ALTERNATIVE, 2)).isEqualTo(ALT_HTML_BODY);
+        assertThat(bodyContent(MULTIPART_ALTERNATIVE, 3)).isEqualTo(ALT_XHTML_BODY);
     }
 
     @Test
@@ -95,9 +95,9 @@ public class PartContentBuilderMultipartAlternativeTest {
     @Test
     public void testShouldLocateFullContentOfMultipartAlterative()
             throws Exception {
-        assertEquals(ALT_PART_PLAIN, fullContent(MULTIPART_ALTERNATIVE, 1));
-        assertEquals(ALT_PART_HTML, fullContent(MULTIPART_ALTERNATIVE, 2));
-        assertEquals(ALT_PART_XHTML, fullContent(MULTIPART_ALTERNATIVE, 3));
+        assertThat(fullContent(MULTIPART_ALTERNATIVE, 1)).isEqualTo(ALT_PART_PLAIN);
+        assertThat(fullContent(MULTIPART_ALTERNATIVE, 2)).isEqualTo(ALT_PART_HTML);
+        assertThat(fullContent(MULTIPART_ALTERNATIVE, 3)).isEqualTo(ALT_PART_XHTML);
     }
 
     private String fullContent(String mail, int position) throws Exception {
@@ -119,10 +119,10 @@ public class PartContentBuilderMultipartAlternativeTest {
     private void checkContentType(String contentType, String mail, int position)
             throws Exception {
         List<Header> headers = headers(mail, position);
-        assertEquals(1, headers.size());
+        assertThat(headers.size()).isEqualTo(1);
         ResultHeader header = (ResultHeader) headers.get(0);
-        assertEquals(CONTENT_TYPE, header.getName());
-        assertEquals(contentType, header.getValue());
+        assertThat(header.getName()).isEqualTo(CONTENT_TYPE);
+        assertThat(header.getValue()).isEqualTo(contentType);
     }
 
     private List<Header> headers(String mail, int position) throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessageTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessageTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessageTest.java
index 2f8c3f6..fa60940 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessageTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/DelegatingMailboxMessageTest.java
@@ -20,7 +20,6 @@
 package org.apache.james.mailbox.store.mail.model;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
 
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.store.MessageBuilder;
@@ -54,6 +53,6 @@ public class DelegatingMailboxMessageTest {
     public void testShouldReturnZeroWhenFirstEqualsSecond() throws Exception {
         MailboxMessage one = buildMessage(90);
         MailboxMessage two = buildMessage(90);
-        assertEquals(0, one.compareTo(two));
+        assertThat(one.compareTo(two)).isEqualTo(0);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/SearchUtilTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/SearchUtilTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/SearchUtilTest.java
index ffffbd9..3995a0a 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/SearchUtilTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/search/SearchUtilTest.java
@@ -19,7 +19,6 @@
 package org.apache.james.mailbox.store.search;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -32,43 +31,43 @@ public class SearchUtilTest {
     @Test
     public void testSimpleSubject() {
         String subject = "This is my subject";
-        assertEquals(subject, SearchUtil.getBaseSubject(subject));
+        assertThat(SearchUtil.getBaseSubject(subject)).isEqualTo(subject);
     }
     
     @Test
     public void testReplaceSpacesAndTabsInSubject() {
         String subject = "This   is my\tsubject";
-        assertEquals("This is my subject", SearchUtil.getBaseSubject(subject));
+        assertThat(SearchUtil.getBaseSubject(subject)).isEqualTo("This is my subject");
     }
     
     @Test
     public void testRemoveTrailingSpace() {
         String subject = "This is my subject ";
-        assertEquals("This is my subject", SearchUtil.getBaseSubject(subject));
+        assertThat(SearchUtil.getBaseSubject(subject)).isEqualTo("This is my subject");
     }
     
     
     @Test
     public void testRemoveTrailingFwd() {
         String subject = "This is my subject (fwd)";
-        assertEquals("This is my subject", SearchUtil.getBaseSubject(subject));
+        assertThat(SearchUtil.getBaseSubject(subject)).isEqualTo("This is my subject");
     }
     
 
     @Test
     public void testSimpleExtraction() {
         String expectedSubject = "Test";
-        assertEquals(expectedSubject, SearchUtil.getBaseSubject("Re: Test"));
-        assertEquals(expectedSubject, SearchUtil.getBaseSubject("re: Test"));
-        assertEquals(expectedSubject, SearchUtil.getBaseSubject("Fwd: Test"));
-        assertEquals(expectedSubject, SearchUtil.getBaseSubject("fwd: Test"));
-        assertEquals(expectedSubject, SearchUtil.getBaseSubject("Fwd: Re: Test"));
-        assertEquals(expectedSubject, SearchUtil.getBaseSubject("Fwd: Re: Test (fwd)"));
+        assertThat(SearchUtil.getBaseSubject("Re: Test")).isEqualTo(expectedSubject);
+        assertThat(SearchUtil.getBaseSubject("re: Test")).isEqualTo(expectedSubject);
+        assertThat(SearchUtil.getBaseSubject("Fwd: Test")).isEqualTo(expectedSubject);
+        assertThat(SearchUtil.getBaseSubject("fwd: Test")).isEqualTo(expectedSubject);
+        assertThat(SearchUtil.getBaseSubject("Fwd: Re: Test")).isEqualTo(expectedSubject);
+        assertThat(SearchUtil.getBaseSubject("Fwd: Re: Test (fwd)")).isEqualTo(expectedSubject);
     }
   
     @Test
     public void testComplexExtraction() {
-        assertEquals("Test", SearchUtil.getBaseSubject("Re: re:re: fwd:[fwd: \t  Test]  (fwd)  (fwd)(fwd) "));
+        assertThat(SearchUtil.getBaseSubject("Re: re:re: fwd:[fwd: \t  Test]  (fwd)  (fwd)(fwd) ")).isEqualTo("Test");
     }
     
     @Test
@@ -119,7 +118,7 @@ public class SearchUtilTest {
         String serialiazedMessageId = SearchUtil.getSerializedMessageIdIfSupportedByUnderlyingStorageOrNull(message);
 
         //expect
-        assertEquals(serialiazedMessageId, messageIdString);
+        assertThat(messageIdString).isEqualTo(serialiazedMessageId);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/zoo-seq-provider/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/zoo-seq-provider/pom.xml b/mailbox/zoo-seq-provider/pom.xml
index b49060e..ceabcc9 100644
--- a/mailbox/zoo-seq-provider/pom.xml
+++ b/mailbox/zoo-seq-provider/pom.xml
@@ -81,6 +81,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailbox/zoo-seq-provider/src/test/java/org/apache/james/mailbox/store/mail/ZooUidProviderTest.java
----------------------------------------------------------------------
diff --git a/mailbox/zoo-seq-provider/src/test/java/org/apache/james/mailbox/store/mail/ZooUidProviderTest.java b/mailbox/zoo-seq-provider/src/test/java/org/apache/james/mailbox/store/mail/ZooUidProviderTest.java
index 2ffe627..0fb8c0a 100644
--- a/mailbox/zoo-seq-provider/src/test/java/org/apache/james/mailbox/store/mail/ZooUidProviderTest.java
+++ b/mailbox/zoo-seq-provider/src/test/java/org/apache/james/mailbox/store/mail/ZooUidProviderTest.java
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.james.mailbox.store.mail;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.Serializable;
 import java.util.Optional;
@@ -173,24 +173,24 @@ public class ZooUidProviderTest {
     @Test
     public void testNextUid() throws Exception {
         MessageUid result = uuidProvider.nextUid(null, mailboxUUID);
-        assertEquals("Next UID is 1", 1, result.asLong());
+        assertThat(result.asLong()).describedAs("Next UID is 1").isEqualTo(1);
         result = longProvider.nextUid(null, mailboxLong);
-        assertEquals("Next UID is 1", 1, result.asLong());
+        assertThat(result.asLong()).describedAs("Next UID is 1").isEqualTo(1);
     }
 
     @Test
     public void testLastUid() throws Exception {
         Optional<MessageUid> result = uuidProvider.lastUid(null, mailboxUUID);
-        assertEquals("Next UID is empty", Optional.empty(), result);
+        assertThat(result).describedAs("Next UID is empty").isEqualTo(Optional.empty());
         MessageUid nextResult = uuidProvider.nextUid(null, mailboxUUID);
-        assertEquals("Next UID is 1", 1, nextResult.asLong());
+        assertThat(nextResult.asLong()).describedAs("Next UID is 1").isEqualTo(1);
     }
 
     @Test
     public void testLongLastUid() throws Exception {
         Optional<MessageUid> result = longProvider.lastUid(null, mailboxLong);
-        assertEquals("Next UID is empty", Optional.empty(), result);
+        assertThat(result).describedAs("Next UID is empty").isEqualTo(Optional.empty());
         MessageUid nextResult = longProvider.nextUid(null, mailboxLong);
-        assertEquals("Next UID is 1", 1, nextResult.asLong());
+        assertThat(nextResult.asLong()).describedAs("Next UID is 1").isEqualTo(1);
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailet/base/src/test/java/org/apache/mailet/base/MatcherInverterTest.java
----------------------------------------------------------------------
diff --git a/mailet/base/src/test/java/org/apache/mailet/base/MatcherInverterTest.java b/mailet/base/src/test/java/org/apache/mailet/base/MatcherInverterTest.java
index 0701484..9615445 100644
--- a/mailet/base/src/test/java/org/apache/mailet/base/MatcherInverterTest.java
+++ b/mailet/base/src/test/java/org/apache/mailet/base/MatcherInverterTest.java
@@ -20,7 +20,6 @@
 package org.apache.mailet.base;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
 
 import java.util.Arrays;
 import java.util.Collection;
@@ -85,6 +84,6 @@ public class MatcherInverterTest {
                 .recipients(address1, address2)
                 .build();
 
-        assertEquals("Should match one recipient", address2.toString(), inverter.match(mail).iterator().next().toString());
+        assertThat(inverter.match(mail).iterator().next().toString()).describedAs("Should match one recipient").isEqualTo(address2.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailet/standard/src/test/java/org/apache/james/transport/mailets/OnlyTextTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/OnlyTextTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/OnlyTextTest.java
index 22a72a8..24adad7 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/OnlyTextTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/OnlyTextTest.java
@@ -20,8 +20,6 @@
 package org.apache.james.transport.mailets;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
 import java.util.Properties;
@@ -73,8 +71,8 @@ class OnlyTextTest {
                 .build();
         mailet.service(mail);
 
-        assertEquals("prova", mail.getMessage().getSubject());
-        assertEquals("Questa è una prova", mail.getMessage().getContent());
+        assertThat(mail.getMessage().getSubject()).isEqualTo("prova");
+        assertThat(mail.getMessage().getContent()).isEqualTo("Questa è una prova");
 
         // -----------------
 
@@ -100,9 +98,9 @@ class OnlyTextTest {
                 .build();
         mailet.service(mail);
 
-        assertEquals("prova", mail.getMessage().getSubject());
-        assertEquals("Questo è un part interno1", mail.getMessage()
-                .getContent());
+        assertThat(mail.getMessage().getSubject()).isEqualTo("prova");
+        assertThat(mail.getMessage()
+                .getContent()).isEqualTo("Questo è un part interno1");
 
         // -----------------
 
@@ -133,9 +131,9 @@ class OnlyTextTest {
                 .build();
         mailet.service(mail);
 
-        assertEquals("prova", mail.getMessage().getSubject());
-        assertEquals("Questo è un part interno1", mail.getMessage()
-                .getContent());
+        assertThat(mail.getMessage().getSubject()).isEqualTo("prova");
+        assertThat(mail.getMessage()
+                .getContent()).isEqualTo("Questo è un part interno1");
 
         // ---------------------
 
@@ -150,9 +148,9 @@ class OnlyTextTest {
                 .build();
         mailet.service(mail);
 
-        assertEquals("prova", mail.getMessage().getSubject());
-        assertEquals("Questa è una prova\ndi html\n", mail.getMessage()
-                .getContent());
+        assertThat(mail.getMessage().getSubject()).isEqualTo("prova");
+        assertThat(mail.getMessage()
+                .getContent()).isEqualTo("Questa è una prova\ndi html\n");
         assertThat(mail.getMessage().isMimeType("text/plain")).isTrue();
 
         // -----------------
@@ -175,9 +173,9 @@ class OnlyTextTest {
                 .build();
         mailet.service(mail);
 
-        assertEquals("prova", mail.getMessage().getSubject());
-        assertEquals("Questa è una prova\ndi html\n", mail.getMessage()
-                .getContent());
+        assertThat(mail.getMessage().getSubject()).isEqualTo("prova");
+        assertThat(mail.getMessage()
+                .getContent()).isEqualTo("Questa è una prova\ndi html\n");
         assertThat(mail.getMessage().isMimeType("text/plain")).isTrue();
     }
 
@@ -190,14 +188,10 @@ class OnlyTextTest {
 
         String html;
         html = "<b>Prova di html</b><br /><p>Un paragrafo</p><LI>e ci mettiamo anche una lista</LI><br>";
-        assertEquals(
-                "Prova di html\nUn paragrafo\n\n* e ci mettiamo anche una lista\n",
-                mailet.html2Text(html));
+        assertThat(mailet.html2Text(html)).isEqualTo("Prova di html\nUn paragrafo\n\n* e ci mettiamo anche una lista\n");
 
         html = "<b>Vediamo invece come andiamo con gli entities</b><br />&egrave;&agrave; &amp;grave;<br>";
-        assertEquals(
-                "Vediamo invece come andiamo con gli entities\nèà &grave;\n",
-                mailet.html2Text(html));
+        assertThat(mailet.html2Text(html)).isEqualTo("Vediamo invece come andiamo con gli entities\nèà &grave;\n");
     }
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailet/standard/src/test/java/org/apache/james/transport/mailets/UnwrapTextTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/UnwrapTextTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/UnwrapTextTest.java
index 3fd47c5..7daecf0 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/UnwrapTextTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/UnwrapTextTest.java
@@ -19,7 +19,8 @@
 
 package org.apache.james.transport.mailets;
 
-import org.junit.jupiter.api.Assertions;
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.junit.jupiter.api.Test;
 
 public class UnwrapTextTest {
@@ -32,8 +33,8 @@ public class UnwrapTextTest {
         String input;
         String output;
 
-        Assertions.assertEquals("", UnwrapText.unwrap(""));
-        Assertions.assertEquals("a", UnwrapText.unwrap("a"));
+        assertThat(UnwrapText.unwrap("")).isEqualTo("");
+        assertThat(UnwrapText.unwrap("a")).isEqualTo("a");
 
         input =
                 "Prova per vedere se effettivamente il testo viene wrappato\r\n" +
@@ -46,7 +47,7 @@ public class UnwrapTextTest {
                         "Chissà se funziona davvero\r\n" +
                         "o se va solo come gli pare";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input));
+        assertThat(UnwrapText.unwrap(input)).isEqualTo(output);
 
         input =
                 "> Prova per vedere se effettivamente il testo viene wrappato\r\n" +
@@ -59,7 +60,7 @@ public class UnwrapTextTest {
                         "> Chissà se funziona davvero\r\n" +
                         "> o se va solo come gli pare";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input));
+        assertThat(UnwrapText.unwrap(input)).isEqualTo(output);
 
         input =
                 "> Prova per vedere se effettivamente il testo viene wrappato\r\n" +
@@ -75,7 +76,7 @@ public class UnwrapTextTest {
                         "> o se va solo come gli pare\r\n" +
                         "> Prova per vedere se effettivamente il testo viene wrappato come dovrebbe.\r\n";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input));
+        assertThat(UnwrapText.unwrap(input)).isEqualTo(output);
 
         input =
                 "> volevo chiedervi un piccolo aiutino. Una signora con un circolare ha un\r\n" +
@@ -91,7 +92,7 @@ public class UnwrapTextTest {
                         "trucco da  suggerirmi per rimuovere il ponte? Il ponte è in ceramica, per " +
                         "cui  l'utilizzo degli ultrasuoni puo' essere rischioso (?).\r\n";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input));
+        assertThat(UnwrapText.unwrap(input)).isEqualTo(output);
 
         input =
                 "> Prova per vedere se effettivamente il testo viene wrappato\r\n" +
@@ -104,7 +105,7 @@ public class UnwrapTextTest {
                 "> Prova per vedere se effettivamente il testo viene wrappato com dovrebbe.\r\n" +
                         "> Prova per vedere se effettivamente il testo viene wrappato come dovrebbe.\r\n";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input));
+        assertThat(UnwrapText.unwrap(input)).isEqualTo(output);
 
         input =
                 "> Prova per vedere se effettivamente il testo viene wrappato\r\n" +
@@ -118,7 +119,7 @@ public class UnwrapTextTest {
                         "> Prova per vedere se effettivamente il testo viene wrappato come\r\n" +
                         ">> dovrebbe.\r\n";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input));
+        assertThat(UnwrapText.unwrap(input)).isEqualTo(output);
 
         input =
                 "> Prova per vedere se effettivamente il testo viene wrappato\r\n" +
@@ -131,7 +132,7 @@ public class UnwrapTextTest {
                         "> Prova per vedere se effettivamente il testo viene wrappato\r\n" +
                         "come dovrebbe.\r\n";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input));
+        assertThat(UnwrapText.unwrap(input)).isEqualTo(output);
 
         input =
                 "...pero' devo dire che ai congressi vedo moltissimi casi di carico\r\n" +
@@ -147,7 +148,7 @@ public class UnwrapTextTest {
                         "\"parodontosici\" che io terrei li per altri 15 anni...\r\n" +
                         "Non voglio polemizzare ne tantomento accusare nessuno, ma credo che spesso a accada quello che Alessio suggerisce...\r\n";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input));
+        assertThat(UnwrapText.unwrap(input)).isEqualTo(output);
 
         input =
                 "> mi trovo in difficolta,ho eseguito un lavoro di protesizzazione in\r\n" +
@@ -175,7 +176,7 @@ public class UnwrapTextTest {
                         "a tirar giu il lavoro anche con tutte le cautele del caso rischio la " +
                         "rottura\r\n";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input, 79));
+        assertThat(UnwrapText.unwrap(input, 79)).isEqualTo(output);
 
         // Controllo spazi
         input =
@@ -193,7 +194,7 @@ public class UnwrapTextTest {
                         "o se va solo come gli pare \r\n" +
                         "> Prova per vedere se effettivamente il testo viene wrappato come dovrebbe. \r\n";
 
-        Assertions.assertEquals(output, UnwrapText.unwrap(input, 79));
+        assertThat(UnwrapText.unwrap(input, 79)).isEqualTo(output);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailet/standard/src/test/java/org/apache/james/transport/matchers/AbstractHasMailAttributeTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/matchers/AbstractHasMailAttributeTest.java b/mailet/standard/src/test/java/org/apache/james/transport/matchers/AbstractHasMailAttributeTest.java
index d6eb21e..652955a 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/matchers/AbstractHasMailAttributeTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/matchers/AbstractHasMailAttributeTest.java
@@ -20,7 +20,7 @@
 
 package org.apache.james.transport.matchers;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 
@@ -85,8 +85,8 @@ public abstract class AbstractHasMailAttributeTest {
         Collection<MailAddress> matchedRecipients = matcher.match(mockedMail);
 
         assertNotNull(matchedRecipients);
-        assertEquals(matchedRecipients.size(), mockedMail.getRecipients()
-                .size());
+        assertThat(mockedMail.getRecipients()
+                .size()).isEqualTo(matchedRecipients.size());
     }
 
     protected void init() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mailet/standard/src/test/java/org/apache/james/transport/matchers/HasMailAttributeWithValueRegexTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/matchers/HasMailAttributeWithValueRegexTest.java b/mailet/standard/src/test/java/org/apache/james/transport/matchers/HasMailAttributeWithValueRegexTest.java
index 201929e..a42b126 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/matchers/HasMailAttributeWithValueRegexTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/matchers/HasMailAttributeWithValueRegexTest.java
@@ -20,7 +20,7 @@
 
 package org.apache.james.transport.matchers;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 
@@ -61,8 +61,8 @@ public class HasMailAttributeWithValueRegexTest extends AbstractHasMailAttribute
         Collection<MailAddress> matchedRecipients = matcher.match(mockedMail);
 
         assertNotNull(matchedRecipients);
-        assertEquals(matchedRecipients.size(), mockedMail.getRecipients()
-                .size());
+        assertThat(mockedMail.getRecipients()
+                .size()).isEqualTo(matchedRecipients.size());
     }
 
     @Test
@@ -96,11 +96,11 @@ public class HasMailAttributeWithValueRegexTest extends AbstractHasMailAttribute
         assertNull(matchedRecipients);
         
         try {
-            assertEquals(exception, regexException);
+            assertThat(regexException).isEqualTo(exception);
         } catch (AssertionFailedError e) {
             // NOTE the expected exception changes when the project is built/run
             // against non java 1.4 jvm. 
-            assertEquals(exception + " (org.apache.oro.text.regex.MalformedPatternException: Unmatched parentheses.)", regexException);
+            assertThat(regexException).isEqualTo(exception + " (org.apache.oro.text.regex.MalformedPatternException: Unmatched parentheses.)");
         }
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mpt/antlib/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/antlib/pom.xml b/mpt/antlib/pom.xml
index 352fba5..ae61a87 100644
--- a/mpt/antlib/pom.xml
+++ b/mpt/antlib/pom.xml
@@ -63,6 +63,10 @@ to the library requiring no extra coding.</description>
             <artifactId>ant-antunit</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestAddUser.java
----------------------------------------------------------------------
diff --git a/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestAddUser.java b/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestAddUser.java
index dd54b3b..2b1ec72 100644
--- a/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestAddUser.java
+++ b/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestAddUser.java
@@ -19,11 +19,12 @@
 
 package org.apache.james.mpt.ant;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.apache.james.mpt.DiscardProtocol;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.resources.Union;
 import org.junit.After;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -62,6 +63,6 @@ public class TestAddUser {
         final String script = "This script adds a user";
         user.addText("C: " + script);
         subject.execute();
-        Assert.assertEquals(script + "\r\n", record.complete());
+        assertThat(record.complete()).isEqualTo(script + "\r\n");
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestRunScripts.java
----------------------------------------------------------------------
diff --git a/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestRunScripts.java b/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestRunScripts.java
index c589c42..04aef79 100644
--- a/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestRunScripts.java
+++ b/mpt/antlib/src/test/java/org/apache/james/mpt/ant/TestRunScripts.java
@@ -19,6 +19,8 @@
 
 package org.apache.james.mpt.ant;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.InputStream;
@@ -29,7 +31,6 @@ import org.apache.tools.ant.types.Resource;
 import org.apache.tools.ant.types.resources.StringResource;
 import org.apache.tools.ant.types.resources.Union;
 import org.junit.After;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -77,14 +78,14 @@ public class TestRunScripts {
         stubResourceCollection.add(unsupportedResource);
         subject.add(stubResourceCollection);
         subject.execute();
-        Assert.assertEquals(SCRIPT + "\r\n", record.complete());
+        assertThat(record.complete()).isEqualTo(SCRIPT + "\r\n");
     }
 
     @Test
     public void testRunOneScriptFromCollection() throws Exception {
         subject.add(stubResourceCollection);
         subject.execute();
-        Assert.assertEquals(SCRIPT + "\r\n", record.complete());
+        assertThat(record.complete()).isEqualTo(SCRIPT + "\r\n");
     }
 
     @Test
@@ -96,6 +97,6 @@ public class TestRunScripts {
         writer.close();
         subject.setScript(file);
         subject.execute();
-        Assert.assertEquals(SCRIPT + "\r\n", record.complete());
+        assertThat(record.complete()).isEqualTo(SCRIPT + "\r\n");
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mpt/core/src/test/java/org/apache/james/mpt/TestDiscardProtocol.java
----------------------------------------------------------------------
diff --git a/mpt/core/src/test/java/org/apache/james/mpt/TestDiscardProtocol.java b/mpt/core/src/test/java/org/apache/james/mpt/TestDiscardProtocol.java
index 9c18f36..7ff9dd4 100644
--- a/mpt/core/src/test/java/org/apache/james/mpt/TestDiscardProtocol.java
+++ b/mpt/core/src/test/java/org/apache/james/mpt/TestDiscardProtocol.java
@@ -29,7 +29,6 @@ import java.net.Socket;
 import javax.net.SocketFactory;
 
 import org.junit.After;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -81,7 +80,7 @@ public class TestDiscardProtocol {
         assertThat(socket.isConnected()).isTrue();
         input();
         String output = record.complete();
-        Assert.assertEquals(INPUT, output);
+        assertThat(output).isEqualTo(INPUT);
     }
 
     private void input() throws IOException {
@@ -97,7 +96,7 @@ public class TestDiscardProtocol {
         Thread thread = new Thread(inputLater);
         thread.start();
         String output = record.complete();
-        Assert.assertEquals(INPUT, output);
+        assertThat(output).isEqualTo(INPUT);
         inputLater.assertExecutedSuccessfully();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/mpt/core/src/test/java/org/apache/james/mpt/TestScriptedUserAdder.java
----------------------------------------------------------------------
diff --git a/mpt/core/src/test/java/org/apache/james/mpt/TestScriptedUserAdder.java b/mpt/core/src/test/java/org/apache/james/mpt/TestScriptedUserAdder.java
index 596322f..eb1373c 100644
--- a/mpt/core/src/test/java/org/apache/james/mpt/TestScriptedUserAdder.java
+++ b/mpt/core/src/test/java/org/apache/james/mpt/TestScriptedUserAdder.java
@@ -19,9 +19,10 @@
 
 package org.apache.james.mpt;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.apache.james.mpt.user.ScriptedUserAdder;
 import org.junit.After;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -47,6 +48,6 @@ public class TestScriptedUserAdder {
     public void testShouldExecuteScriptAgainstPort() throws Exception {
         ScriptedUserAdder adder = new ScriptedUserAdder("localhost", protocol.getPort(), "C: USER='${user}' password='${password}'");
         adder.addUser("A User", "Some Password");
-        Assert.assertEquals("USER='A User' password='Some Password'\r\n", record.complete());
+        assertThat(record.complete()).isEqualTo("USER='A User' password='Some Password'\r\n");
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/protocols/api/pom.xml
----------------------------------------------------------------------
diff --git a/protocols/api/pom.xml b/protocols/api/pom.xml
index 472f541..79cfc2e 100644
--- a/protocols/api/pom.xml
+++ b/protocols/api/pom.xml
@@ -51,6 +51,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/protocols/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java
----------------------------------------------------------------------
diff --git a/protocols/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java b/protocols/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java
index 1e56046..41d6763 100644
--- a/protocols/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java
+++ b/protocols/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.protocols.api;
 
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
@@ -206,7 +206,7 @@ public class AbstractProtocolTransportTest {
         }
         latch.await();
         
-        assertEquals(messages.size(), writtenMessages.size());
+        assertThat(writtenMessages.size()).isEqualTo(messages.size());
         
         for (int i = 0; i < messages.size(); i++) {
             Response response = messages.get(i);
@@ -216,9 +216,9 @@ public class AbstractProtocolTransportTest {
     
     private void checkBytesEquals(byte[] expected, byte[] received) throws UnsupportedEncodingException {
         
-        assertEquals("'" + new String(expected, US_ASCII) + "'=>'" + new String(received, US_ASCII) + "'", expected.length, received.length - 2);
+        assertThat(received.length - 2).describedAs("'" + new String(expected, US_ASCII) + "'=>'" + new String(received, US_ASCII) + "'").isEqualTo(expected.length);
         for (int i = 0; i < expected.length; i++) {
-            assertEquals("'" + new String(expected, US_ASCII) + "'=>'" + new String(received, US_ASCII) + "'", expected[i], received[i]);
+            assertThat(received[i]).describedAs("'" + new String(expected, US_ASCII) + "'=>'" + new String(received, US_ASCII) + "'").isEqualTo(expected[i]);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/491e8642/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java b/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java
index 92d2707..df965f4 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java
@@ -19,7 +19,6 @@
 package org.apache.james.imap.api;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -42,7 +41,7 @@ public class IdRangeTest {
         ranges.add(r3);
         
         List<IdRange> merged = IdRange.mergeRanges(ranges);
-        assertEquals(3, merged.size());
+        assertThat(merged.size()).isEqualTo(3);
         Iterator<IdRange> rIt = merged.iterator();
         checkIdRange(r,rIt.next());
         checkIdRange(r2,rIt.next());
@@ -63,7 +62,7 @@ public class IdRangeTest {
         ranges.add(r3);
         
         List<IdRange> merged = IdRange.mergeRanges(ranges);
-        assertEquals(2, merged.size());
+        assertThat(merged.size()).isEqualTo(2);
         Iterator<IdRange> rIt = merged.iterator();
         checkIdRange(new IdRange(0, 4),rIt.next());
         checkIdRange(r3,rIt.next());
@@ -83,7 +82,7 @@ public class IdRangeTest {
         ranges.add(r3);
         
         List<IdRange> merged = IdRange.mergeRanges(ranges);
-        assertEquals(1, merged.size());
+        assertThat(merged.size()).isEqualTo(1);
         Iterator<IdRange> rIt = merged.iterator();
         checkIdRange(new IdRange(0, 10),rIt.next());
         assertThat(rIt.hasNext()).isFalse();
@@ -101,7 +100,7 @@ public class IdRangeTest {
         ranges.add(r3);
         
         List<IdRange> merged = IdRange.mergeRanges(ranges);
-        assertEquals(1, merged.size());
+        assertThat(merged.size()).isEqualTo(1);
         Iterator<IdRange> rIt = merged.iterator();
         checkIdRange(new IdRange(0, 15),rIt.next());
         assertThat(rIt.hasNext()).isFalse();
@@ -119,14 +118,14 @@ public class IdRangeTest {
         ranges.add(r3);
         
         List<IdRange> merged = IdRange.mergeRanges(ranges);
-        assertEquals(1, merged.size());
+        assertThat(merged.size()).isEqualTo(1);
         Iterator<IdRange> rIt = merged.iterator();
         checkIdRange(new IdRange(0, 2),rIt.next());
         assertThat(rIt.hasNext()).isFalse();
     }
     
     private void checkIdRange(IdRange r1, IdRange r2) {
-        assertEquals(r1.getLowVal(), r2.getLowVal());
-        assertEquals(r1.getHighVal(), r2.getHighVal());
+        assertThat(r2.getLowVal()).isEqualTo(r1.getLowVal());
+        assertThat(r2.getHighVal()).isEqualTo(r1.getHighVal());
     }
 }


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


Mime
View raw message