james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [5/8] james-project git commit: structural refactoring from assert{True, Fase} to assertj assertThat().is{True, False}
Date Thu, 06 Sep 2018 12:34:49 GMT
structural refactoring from assert{True,Fase} to assertj assertThat().is{True,False}


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

Branch: refs/heads/master
Commit: 63ab7ab820ece018bd647ff16e73e4c230251b13
Parents: e6ef174
Author: Matthieu Baechler <matthieu@apache.org>
Authored: Thu May 31 21:22:37 2018 +0200
Committer: Antoine Duprat <aduprat@linagora.com>
Committed: Thu Sep 6 14:30:04 2018 +0200

----------------------------------------------------------------------
 .../org/apache/james/core/MailAddressTest.java  |  34 +-
 .../james/mailbox/MailboxManagerStressTest.java |   4 +-
 .../acl/UnionMailboxACLResolverTest.java        |  84 +-
 .../HBaseMailboxSessionMapperFactoryTest.java   |   8 +-
 .../james/mailbox/hbase/HBaseUtilsTest.java     |  34 +-
 .../hbase/mail/HBaseMailboxMapperTest.java      |   7 +-
 .../hbase/user/HBaseSubscriptionMapperTest.java |   7 +-
 .../store/MailboxMessageResultImplTest.java     |  13 +-
 .../store/SearchUtilsMultipartMixedTest.java    | 127 ++-
 .../mailbox/store/SearchUtilsRFC822Test.java    |  59 +-
 .../james/mailbox/store/SearchUtilsTest.java    | 869 +++++++++----------
 .../model/DelegatingMailboxMessageTest.java     |   6 +-
 .../james/transport/mailets/OnlyTextTest.java   |   5 +-
 .../org/apache/james/imap/api/IdRangeTest.java  |  12 +-
 .../FetchResponseEncoderNoExtensionsTest.java   |   9 +-
 .../imap/encode/FetchResponseEncoderTest.java   |   9 +-
 .../imap/encode/ListResponseEncoderTest.java    |   5 +-
 .../MailboxStatusResponseEncoderTest.java       |  11 +-
 .../encode/NamespaceResponseEncoderTest.java    |   9 +-
 .../imap/encode/SearchResponseEncoderTest.java  |  11 +-
 .../imap/encode/XListResponseEncoderTest.java   |   5 +-
 ...ImapRequestHandlerAdandonConnectionTest.java |   4 +-
 .../protocols/imap/utils/DecoderUtilsTest.java  |  59 +-
 .../protocols/lmtp/AbstractLMTPServerTest.java  |  55 +-
 .../pop3/AbstractStartTlsPOP3ServerTest.java    |   6 +-
 .../pop3/POP3StartTlsResponseTest.java          |   6 +-
 .../smtp/SMTPStartTlsResponseTest.java          |   6 +-
 .../core/MimeMessageCopyOnWriteProxyTest.java   |  29 +-
 .../james/server/core/MimeMessageTest.java      |   3 +-
 .../server/core/MimeMessageWrapperTest.java     |  14 +-
 server/container/guice/onami/pom.xml            |   5 +
 .../onami/lifecycle/DefaultStagerTestCase.java  |   7 +-
 .../util/retry/DoublingRetryScheduleTest.java   |   4 +-
 .../util/retry/ExceptionRetryHandlerTest.java   |   6 +-
 .../naming/NamingExceptionRetryHandlerTest.java |   6 +-
 .../mailrepository/MBoxMailRepositoryTest.java  |   9 +-
 .../memory/UsersRepositoryManagementTest.java   |  25 +-
 server/dns-service/dnsservice-api/pom.xml       |   5 +
 server/dns-service/dnsservice-dnsjava/pom.xml   |   5 +
 .../dnsservice/dnsjava/DNSJavaServiceTest.java  |  16 +-
 server/dns-service/dnsservice-library/pom.xml   |   5 +
 .../library/MXHostAddressIteratorTest.java      |  11 +-
 .../inetnetwork/model/InetNetworkTest.java      |  18 +-
 server/dns-service/dnsservice-test/pom.xml      |   4 +
 .../dnsservice/api/AbstractDNSServiceTest.java  |   4 +-
 .../lib/AbstractStateMailetProcessorTest.java   |   4 +-
 server/protocols/protocols-pop3/pom.xml         |   5 +
 .../apache/james/pop3server/POP3ServerTest.java |  24 +-
 .../smtpserver/POP3BeforeSMTPHandlerTest.java   |  15 +-
 49 files changed, 852 insertions(+), 836 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/core/src/test/java/org/apache/james/core/MailAddressTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/james/core/MailAddressTest.java b/core/src/test/java/org/apache/james/core/MailAddressTest.java
index f7cfc02..dceeaed 100644
--- a/core/src/test/java/org/apache/james/core/MailAddressTest.java
+++ b/core/src/test/java/org/apache/james/core/MailAddressTest.java
@@ -89,7 +89,7 @@ public class MailAddressTest {
 
         MailAddress a = new MailAddress(GOOD_ADDRESS);
         MailAddress b = new MailAddress(GOOD_ADDRESS);
-        Assert.assertTrue(a.hashCode() + " != " + b.hashCode(), a.hashCode() == b.hashCode());
+        assertThat(a.hashCode() == b.hashCode()).describedAs(a.hashCode() + " != " + b.hashCode()).isTrue();
     }
 
     /**
@@ -101,7 +101,7 @@ public class MailAddressTest {
     public void testMailAddressString() throws AddressException {
 
         MailAddress a = new MailAddress(GOOD_ADDRESS);
-        Assert.assertTrue(GOOD_ADDRESS.equals(a.toString()));
+        assertThat(GOOD_ADDRESS.equals(a.toString())).isTrue();
 
         for (String goodAddress : GOOD_ADDRESSES) {
             try {
@@ -126,13 +126,13 @@ public class MailAddressTest {
         try {
             new MailAddress("local-part", "domain");
         } catch (AddressException e) {
-            Assert.assertTrue(e.getMessage(), false);
+            assertThat(false).describedAs(e.getMessage()).isTrue();
         }
         try {
             MailAddress a = new MailAddress("local-part", "-domain");
-            Assert.assertFalse(a.toString(), true);
+            assertThat(true).describedAs(a.toString()).isFalse();
         } catch (AddressException e) {
-            Assert.assertTrue(true);
+            assertThat(true).isTrue();
         }
     }
 
@@ -146,7 +146,7 @@ public class MailAddressTest {
             new MailAddress(new InternetAddress(GOOD_QUOTED_LOCAL_PART));
         } catch (AddressException e) {
             System.out.println("AddressException" + e.getMessage());
-            Assert.assertTrue(e.getMessage(), false);
+            assertThat(false).describedAs(e.getMessage()).isTrue();
         }
     }
 
@@ -158,10 +158,10 @@ public class MailAddressTest {
 
         try {
             MailAddress a = new MailAddress(new InternetAddress(GOOD_ADDRESS));
-            Assert.assertTrue(a.getDomain() + " != " + GOOD_DOMAIN, a.getDomain().equals(GOOD_DOMAIN));
+            assertThat(a.getDomain().equals(GOOD_DOMAIN)).describedAs(a.getDomain() + " != " + GOOD_DOMAIN).isTrue();
         } catch (AddressException e) {
             System.out.println("AddressException" + e.getMessage());
-            Assert.assertTrue(e.getMessage(), false);
+            assertThat(false).describedAs(e.getMessage()).isTrue();
         }
     }
 
@@ -173,10 +173,10 @@ public class MailAddressTest {
 
         try {
             MailAddress a = new MailAddress(new InternetAddress(GOOD_QUOTED_LOCAL_PART));
-            Assert.assertTrue(GOOD_LOCAL_PART + " != " + a.getLocalPart(), a.getLocalPart().equals(GOOD_LOCAL_PART));
+            assertThat(a.getLocalPart().equals(GOOD_LOCAL_PART)).describedAs(GOOD_LOCAL_PART + " != " + a.getLocalPart()).isTrue();
         } catch (AddressException e) {
             System.out.println("AddressException" + e.getMessage());
-            Assert.assertTrue(e.getMessage(), false);
+            assertThat(false).describedAs(e.getMessage()).isTrue();
         }
     }
 
@@ -188,10 +188,10 @@ public class MailAddressTest {
 
         try {
             MailAddress a = new MailAddress(new InternetAddress(GOOD_ADDRESS));
-            Assert.assertTrue(a.toString() + " != " + GOOD_ADDRESS, a.toString().equals(GOOD_ADDRESS));
+            assertThat(a.toString().equals(GOOD_ADDRESS)).describedAs(a.toString() + " != " + GOOD_ADDRESS).isTrue();
         } catch (AddressException e) {
             System.out.println("AddressException" + e.getMessage());
-            Assert.assertTrue(e.getMessage(), false);
+            assertThat(false).describedAs(e.getMessage()).isTrue();
         }
     }
 
@@ -204,11 +204,11 @@ public class MailAddressTest {
         try {
             InternetAddress b = new InternetAddress(GOOD_ADDRESS);
             MailAddress a = new MailAddress(b);
-            Assert.assertTrue(a.toInternetAddress().equals(b));
-            Assert.assertTrue(a.toString() + " != " + GOOD_ADDRESS, a.toString().equals(GOOD_ADDRESS));
+            assertThat(a.toInternetAddress().equals(b)).isTrue();
+            assertThat(a.toString().equals(GOOD_ADDRESS)).describedAs(a.toString() + " != " + GOOD_ADDRESS).isTrue();
         } catch (AddressException e) {
             System.out.println("AddressException" + e.getMessage());
-            Assert.assertTrue(e.getMessage(), false);
+            assertThat(false).describedAs(e.getMessage()).isTrue();
         }
     }
 
@@ -223,8 +223,8 @@ public class MailAddressTest {
         MailAddress a = new MailAddress(GOOD_ADDRESS);
         MailAddress b = new MailAddress(GOOD_ADDRESS);
 
-        Assert.assertTrue(a.toString() + " != " + b.toString(), a.equals(b));
-        Assert.assertFalse(a.toString() + " != " + null, a.equals(null));
+        assertThat(a.equals(b)).describedAs(a.toString() + " != " + b.toString()).isTrue();
+        assertThat(a.equals(null)).describedAs(a.toString() + " != " + null).isFalse();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/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 fc26d15..60a2726 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
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.mailbox;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 
 import java.nio.charset.StandardCharsets;
 import java.util.Collection;
@@ -126,7 +126,7 @@ public abstract class MailboxManagerStressTest {
         // we can not check the order on the event listener
         // No UID duplicates prevents message loss
         assertEquals(APPEND_OPERATIONS, ImmutableSet.copyOf(uList).size());
-        assertFalse("Unable to append all messages", fail.get());
+        assertThat(fail.get()).describedAs("Unable to append all messages").isFalse();
         pool.shutdown();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/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 76d2b48..ab75f1e 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
@@ -105,61 +105,61 @@ public class UnionMailboxACLResolverTest {
     @Test
     public void testAppliesNullUser() throws UnsupportedRightException {
 
-        Assert.assertFalse(UnionMailboxACLResolver.applies(user1Key, null, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(user2Key, null, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(group1Key, null, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(group2Key, null, groupMembershipResolver, USER_1, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, null, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, null, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, null, groupMembershipResolver, USER_1, false));
+        assertThat(UnionMailboxACLResolver.applies(user1Key, null, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(user2Key, null, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(group1Key, null, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(group2Key, null, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, null, groupMembershipResolver, USER_1, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, null, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, null, groupMembershipResolver, USER_1, false)).isFalse();
     }
 
     @Test
     public void testAppliesUser() throws UnsupportedRightException {
         /* requester is the resource owner */
-        Assert.assertTrue(UnionMailboxACLResolver.applies(user1Key, user1Key, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(user2Key, user1Key, groupMembershipResolver, USER_1, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(group1Key, user1Key, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(group2Key, user1Key, groupMembershipResolver, USER_1, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, user1Key, groupMembershipResolver, USER_1, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, user1Key, groupMembershipResolver, USER_1, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, user1Key, groupMembershipResolver, USER_1, false));
+        assertThat(UnionMailboxACLResolver.applies(user1Key, user1Key, groupMembershipResolver, USER_1, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(user2Key, user1Key, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(group1Key, user1Key, groupMembershipResolver, USER_1, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(group2Key, user1Key, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, user1Key, groupMembershipResolver, USER_1, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, user1Key, groupMembershipResolver, USER_1, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, user1Key, groupMembershipResolver, USER_1, false)).isTrue();
 
         /* requester is not the resource user */
-        Assert.assertTrue(UnionMailboxACLResolver.applies(user1Key, user1Key, groupMembershipResolver, USER_2, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(user2Key, user1Key, groupMembershipResolver, USER_2, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(group1Key, user1Key, groupMembershipResolver, USER_2, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(group2Key, user1Key, groupMembershipResolver, USER_2, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, user1Key, groupMembershipResolver, USER_2, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, user1Key, groupMembershipResolver, USER_2, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, user1Key, groupMembershipResolver, USER_2, false));
+        assertThat(UnionMailboxACLResolver.applies(user1Key, user1Key, groupMembershipResolver, USER_2, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(user2Key, user1Key, groupMembershipResolver, USER_2, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(group1Key, user1Key, groupMembershipResolver, USER_2, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(group2Key, user1Key, groupMembershipResolver, USER_2, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, user1Key, groupMembershipResolver, USER_2, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, user1Key, groupMembershipResolver, USER_2, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, user1Key, groupMembershipResolver, USER_2, false)).isFalse();
 
         /* requester member of owner group */
-        Assert.assertTrue(UnionMailboxACLResolver.applies(user1Key, user1Key, groupMembershipResolver, GROUP_1, true));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(user2Key, user1Key, groupMembershipResolver, GROUP_1, true));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(group1Key, user1Key, groupMembershipResolver, GROUP_1, true));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(group2Key, user1Key, groupMembershipResolver, GROUP_1, true));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, user1Key, groupMembershipResolver, GROUP_1, true));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, user1Key, groupMembershipResolver, GROUP_1, true));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, user1Key, groupMembershipResolver, GROUP_1, true));
+        assertThat(UnionMailboxACLResolver.applies(user1Key, user1Key, groupMembershipResolver, GROUP_1, true)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(user2Key, user1Key, groupMembershipResolver, GROUP_1, true)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(group1Key, user1Key, groupMembershipResolver, GROUP_1, true)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(group2Key, user1Key, groupMembershipResolver, GROUP_1, true)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, user1Key, groupMembershipResolver, GROUP_1, true)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, user1Key, groupMembershipResolver, GROUP_1, true)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, user1Key, groupMembershipResolver, GROUP_1, true)).isTrue();
 
         /* requester not member of owner group */
-        Assert.assertTrue(UnionMailboxACLResolver.applies(user1Key, user1Key, groupMembershipResolver, GROUP_2, true));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(user2Key, user1Key, groupMembershipResolver, GROUP_2, true));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(group1Key, user1Key, groupMembershipResolver, GROUP_2, true));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(group2Key, user1Key, groupMembershipResolver, GROUP_2, true));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, user1Key, groupMembershipResolver, GROUP_2, true));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, user1Key, groupMembershipResolver, GROUP_2, true));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, user1Key, groupMembershipResolver, GROUP_2, true));
+        assertThat(UnionMailboxACLResolver.applies(user1Key, user1Key, groupMembershipResolver, GROUP_2, true)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(user2Key, user1Key, groupMembershipResolver, GROUP_2, true)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(group1Key, user1Key, groupMembershipResolver, GROUP_2, true)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(group2Key, user1Key, groupMembershipResolver, GROUP_2, true)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, user1Key, groupMembershipResolver, GROUP_2, true)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, user1Key, groupMembershipResolver, GROUP_2, true)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, user1Key, groupMembershipResolver, GROUP_2, true)).isFalse();
 
         /* owner query */
-        Assert.assertFalse(UnionMailboxACLResolver.applies(user1Key, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(user2Key, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(group1Key, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false));
-        Assert.assertFalse(UnionMailboxACLResolver.applies(group2Key, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false));
-        Assert.assertTrue(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false));
+        assertThat(UnionMailboxACLResolver.applies(user1Key, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(user2Key, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(group1Key, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(group2Key, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false)).isFalse();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.ANYBODY_KEY, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.AUTHENTICATED_KEY, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false)).isTrue();
+        assertThat(UnionMailboxACLResolver.applies(MailboxACL.OWNER_KEY, MailboxACL.OWNER_KEY, groupMembershipResolver, USER_1, false)).isTrue();
 
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/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 0733577..d08af07 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
@@ -29,9 +29,9 @@ 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.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 
@@ -92,7 +92,7 @@ public class HBaseMailboxSessionMapperFactoryTest {
         HBaseMailboxSessionMapperFactory instance = new HBaseMailboxSessionMapperFactory(conf, null, null, messageIdFactory);
         MessageMapper messageMapper = instance.createMessageMapper(session);
         assertNotNull(messageMapper);
-        assertTrue(messageMapper instanceof MessageMapper);
+        assertThat(messageMapper instanceof MessageMapper).isTrue();
     }
 
     /**
@@ -107,7 +107,7 @@ public class HBaseMailboxSessionMapperFactoryTest {
         HBaseMailboxSessionMapperFactory instance = new HBaseMailboxSessionMapperFactory(conf, null, null, messageIdFactory);
         MailboxMapper mailboxMapper = instance.createMailboxMapper(session);
         assertNotNull(mailboxMapper);
-        assertTrue(mailboxMapper instanceof MailboxMapper);
+        assertThat(mailboxMapper instanceof MailboxMapper).isTrue();
     }
 
     /**
@@ -122,7 +122,7 @@ public class HBaseMailboxSessionMapperFactoryTest {
         HBaseMailboxSessionMapperFactory instance = new HBaseMailboxSessionMapperFactory(conf, null, null, messageIdFactory);
         SubscriptionMapper subscriptionMapper = instance.createSubscriptionMapper(session);
         assertNotNull(subscriptionMapper);
-        assertTrue(subscriptionMapper instanceof SubscriptionMapper);
+        assertThat(subscriptionMapper instanceof SubscriptionMapper).isTrue();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/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 b76ff9d..e1404d3 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
@@ -42,9 +42,9 @@ import static org.apache.james.mailbox.hbase.HBaseUtils.hBaseIdFromRowKey;
 import static org.apache.james.mailbox.hbase.HBaseUtils.toPut;
 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 static org.junit.Assert.assertTrue;
 
 import java.util.Date;
 import java.util.UUID;
@@ -98,13 +98,13 @@ public class HBaseUtilsTest {
 
         Put result = toPut(instance);
         assertArrayEquals(instance.getMailboxId().toBytes(), result.getRow());
-        assertTrue(result.has(MAILBOX_CF, MAILBOX_USER, Bytes.toBytes(instance.getUser())));
-        assertTrue(result.has(MAILBOX_CF, MAILBOX_NAME, Bytes.toBytes(instance.getName())));
-        assertTrue(result.has(MAILBOX_CF, MAILBOX_NAMESPACE, Bytes.toBytes(instance.getNamespace())));
-        assertTrue(result.has(MAILBOX_CF, MAILBOX_UIDVALIDITY, Bytes.toBytes(instance.getUidValidity())));
-        assertTrue(result.has(MAILBOX_CF, MAILBOX_LASTUID, Bytes.toBytes(instance.getLastUid())));
-        assertTrue(result.has(MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, Bytes.toBytes(instance.getHighestModSeq())));
-        assertTrue(result.has(MAILBOX_CF, MAILBOX_MESSAGE_COUNT, Bytes.toBytes(0L)));
+        assertThat(result.has(MAILBOX_CF, MAILBOX_USER, Bytes.toBytes(instance.getUser()))).isTrue();
+        assertThat(result.has(MAILBOX_CF, MAILBOX_NAME, Bytes.toBytes(instance.getName()))).isTrue();
+        assertThat(result.has(MAILBOX_CF, MAILBOX_NAMESPACE, Bytes.toBytes(instance.getNamespace()))).isTrue();
+        assertThat(result.has(MAILBOX_CF, MAILBOX_UIDVALIDITY, Bytes.toBytes(instance.getUidValidity()))).isTrue();
+        assertThat(result.has(MAILBOX_CF, MAILBOX_LASTUID, Bytes.toBytes(instance.getLastUid()))).isTrue();
+        assertThat(result.has(MAILBOX_CF, MAILBOX_HIGHEST_MODSEQ, Bytes.toBytes(instance.getHighestModSeq()))).isTrue();
+        assertThat(result.has(MAILBOX_CF, MAILBOX_MESSAGE_COUNT, Bytes.toBytes(0L))).isTrue();
     }
 
     /**
@@ -131,7 +131,7 @@ public class HBaseUtilsTest {
         Subscription subscription = new SimpleSubscription("ieugen", "INBOX");
         Put put = toPut(subscription);
         assertArrayEquals(Bytes.toBytes(subscription.getUser()), put.getRow());
-        assertTrue(put.has(SUBSCRIPTION_CF, Bytes.toBytes(subscription.getMailbox()), MARKER_PRESENT));
+        assertThat(put.has(SUBSCRIPTION_CF, Bytes.toBytes(subscription.getMailbox()), MARKER_PRESENT)).isTrue();
     }
 
     @Test
@@ -149,13 +149,13 @@ public class HBaseUtilsTest {
         message.setUid(MessageUid.of(1));
         Put put = flagsToPut(message, flags);
         //test for the system flags
-        assertTrue(put.has(MESSAGES_META_CF, FLAGS_SEEN, MARKER_PRESENT));
-        assertTrue(put.has(MESSAGES_META_CF, FLAGS_DRAFT, MARKER_PRESENT));
-        assertTrue(put.has(MESSAGES_META_CF, FLAGS_RECENT, MARKER_PRESENT));
-        assertTrue(put.has(MESSAGES_META_CF, FLAGS_FLAGGED, MARKER_PRESENT));
-        assertTrue(put.has(MESSAGES_META_CF, FLAGS_ANSWERED, MARKER_MISSING));
-        assertTrue(put.has(MESSAGES_META_CF, FLAGS_DELETED, MARKER_MISSING));
-        assertTrue(put.has(MESSAGES_META_CF, userFlagToBytes("userFlag1"), MARKER_PRESENT));
-        assertTrue(put.has(MESSAGES_META_CF, userFlagToBytes("userFlag2"), MARKER_PRESENT));
+        assertThat(put.has(MESSAGES_META_CF, FLAGS_SEEN, MARKER_PRESENT)).isTrue();
+        assertThat(put.has(MESSAGES_META_CF, FLAGS_DRAFT, MARKER_PRESENT)).isTrue();
+        assertThat(put.has(MESSAGES_META_CF, FLAGS_RECENT, MARKER_PRESENT)).isTrue();
+        assertThat(put.has(MESSAGES_META_CF, FLAGS_FLAGGED, MARKER_PRESENT)).isTrue();
+        assertThat(put.has(MESSAGES_META_CF, FLAGS_ANSWERED, MARKER_MISSING)).isTrue();
+        assertThat(put.has(MESSAGES_META_CF, FLAGS_DELETED, MARKER_MISSING)).isTrue();
+        assertThat(put.has(MESSAGES_META_CF, userFlagToBytes("userFlag1"), MARKER_PRESENT)).isTrue();
+        assertThat(put.has(MESSAGES_META_CF, userFlagToBytes("userFlag2"), MARKER_PRESENT)).isTrue();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/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 aca1d7f..01349d2 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
@@ -27,6 +27,7 @@ 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.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;
@@ -264,9 +265,9 @@ public class HBaseMailboxMapperTest {
             boolean result = mapper.hasChildren(mailbox, SEPARATOR);
             mailbox.setName(oldName);
             if (path.getUser().equals("user3")) {
-                assertTrue(result);
+                assertThat(result).isTrue();
             } else {
-                assertFalse(result);
+                assertThat(result).isFalse();
             }
 
         }
@@ -313,7 +314,7 @@ public class HBaseMailboxMapperTest {
                 bout.write(b);
             }
             String s = bout.toString();
-            assertTrue(original.equals(s));
+            assertThat(original.equals(s)).isTrue();
         } finally {
             in.close();
             out.close();

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/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 c7ad909..029fa95 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
@@ -29,10 +29,9 @@ 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.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -160,7 +159,7 @@ public class HBaseSubscriptionMapperTest {
             get.addFamily(SUBSCRIPTION_CF);
             final Result result = subscriptions.get(get);
             for (Subscription subscription : subscriptionList.get(user)) {
-                assertTrue(result.containsColumn(SUBSCRIPTION_CF, Bytes.toBytes(subscription.getMailbox())));
+                assertThat(result.containsColumn(SUBSCRIPTION_CF, Bytes.toBytes(subscription.getMailbox()))).isTrue();
             }
         }
         subscriptions.close();
@@ -205,7 +204,7 @@ public class HBaseSubscriptionMapperTest {
                 mapper.delete(subscription);
                 final Get get = new Get(Bytes.toBytes(subscription.getUser()));
                 final Result result = subscriptions.get(get);
-                assertFalse(result.containsColumn(SUBSCRIPTION_CF, Bytes.toBytes(subscription.getMailbox())));
+                assertThat(result.containsColumn(SUBSCRIPTION_CF, Bytes.toBytes(subscription.getMailbox()))).isFalse();
             }
         }
         subscriptions.close();

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/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 3510206..bb4a489 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
@@ -19,9 +19,8 @@
 
 package org.apache.james.mailbox.store;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 
 import java.util.Date;
 
@@ -63,7 +62,7 @@ public class MailboxMessageResultImplTest {
 
     @Test
     public void testEqualsNull() throws Exception {
-        assertFalse(msgResultA.equals(null));
+        assertThat(msgResultA.equals(null)).isFalse();
     }
 
 
@@ -125,19 +124,19 @@ public class MailboxMessageResultImplTest {
 
     @Test
     public void testNotEqualDiffValue() throws Exception {
-        assertFalse(msgResultA.equals(msgResultC));
-        assertFalse(msgResultC.equals(msgResultA));
+        assertThat(msgResultA.equals(msgResultC)).isFalse();
+        assertThat(msgResultC.equals(msgResultA)).isFalse();
     }
 
     @Test
     public void testShouldReturnPositiveWhenFirstGreaterThanSecond()
             throws Exception {
-        assertTrue(msgResultC.compareTo(msgResultB) > 0);
+        assertThat(msgResultC.compareTo(msgResultB) > 0).isTrue();
     }
 
     @Test
     public void testShouldReturnNegativeWhenFirstLessThanSecond()
             throws Exception {
-        assertTrue(msgResultB.compareTo(msgResultC) < 0);
+        assertThat(msgResultB.compareTo(msgResultC) < 0).isTrue();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
index 6a5e8df..0e2b6e4 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
@@ -19,8 +19,7 @@
 
 package org.apache.james.mailbox.store;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.nio.charset.Charset;
 import java.util.ArrayList;
@@ -136,95 +135,95 @@ public class SearchUtilsMultipartMixedTest {
 
     @Test
     public void testShouldNotFindWhatIsNotThere() throws Exception {
-        assertFalse(messageSearches.isMatch(SearchQuery.bodyContains("BOGUS"), row,
-                recent));
-        assertFalse(messageSearches.isMatch(SearchQuery.mailContains("BOGUS"), row,
-                recent));
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains("BOGUS"), row,
+                recent)).isFalse();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains("BOGUS"), row,
+                recent)).isFalse();
     }
 
     @Test
     public void testBodyShouldFindTextInBody() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery
-                .bodyContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE),
-                row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO),
-                row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery
+                .bodyContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE),
+                row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO),
+                row, recent)).isTrue();
     }
 
     @Test
     public void testBodyShouldFindTextInBodyCaseInsensitive() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery
-                .bodyContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE),
-                row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO),
-                row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery
+        assertThat(messageSearches.isMatch(SearchQuery
+                .bodyContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE),
+                row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO),
+                row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery
                 .bodyContains(SAMPLE_INNER_MAIL_BODY_ONE.toLowerCase(Locale.US)), row,
-                recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE
-                .toLowerCase(Locale.US)), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO
-                .toLowerCase(Locale.US)), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery
+                recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE
+                .toLowerCase(Locale.US)), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO
+                .toLowerCase(Locale.US)), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery
                 .bodyContains(SAMPLE_INNER_MAIL_BODY_ONE.toUpperCase(Locale.US)), row,
-                recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE
-                .toUpperCase(Locale.US)), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO
-                .toUpperCase(Locale.US)), row, recent));
+                recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE
+                .toUpperCase(Locale.US)), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO
+                .toUpperCase(Locale.US)), row, recent)).isTrue();
     }
 
     @Test
     public void testBodyShouldNotFindTextInHeaders() throws Exception {
-        assertFalse(messageSearches.isMatch(SearchQuery
-                .bodyContains(SAMPLE_INNER_MAIL_FIELD), row, recent));
-        assertFalse(messageSearches.isMatch(SearchQuery
-                .bodyContains(SAMPLE_PART_TWO_FIELD), row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery
+                .bodyContains(SAMPLE_INNER_MAIL_FIELD), row, recent)).isFalse();
+        assertThat(messageSearches.isMatch(SearchQuery
+                .bodyContains(SAMPLE_PART_TWO_FIELD), row, recent)).isFalse();
     }
 
     @Test
     public void testTextShouldFindTextInBody() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery
-                .mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE),
-                row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO),
-                row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery
+                .mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE),
+                row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO),
+                row, recent)).isTrue();
     }
 
     @Test
     public void testTextShouldFindTextInBodyCaseInsensitive() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery
-                .mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE),
-                row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO),
-                row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery
+        assertThat(messageSearches.isMatch(SearchQuery
+                .mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE),
+                row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO),
+                row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery
                 .mailContains(SAMPLE_INNER_MAIL_BODY_ONE.toLowerCase(Locale.US)), row,
-                recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE
-                .toLowerCase(Locale.US)), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO
-                .toLowerCase(Locale.US)), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery
+                recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE
+                .toLowerCase(Locale.US)), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO
+                .toLowerCase(Locale.US)), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery
                 .mailContains(SAMPLE_INNER_MAIL_BODY_ONE.toUpperCase(Locale.US)), row,
-                recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE
-                .toUpperCase(Locale.US)), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO
-                .toUpperCase(Locale.US)), row, recent));
+                recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE
+                .toUpperCase(Locale.US)), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO
+                .toUpperCase(Locale.US)), row, recent)).isTrue();
     }
 
     @Test
     public void testTextShouldFindTextInHeaders() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery
-                .mailContains(SAMPLE_INNER_MAIL_FIELD), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery
-                .mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery
-                .mailContains(SAMPLE_PART_TWO_FIELD), row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery
+                .mailContains(SAMPLE_INNER_MAIL_FIELD), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery
+                .mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery
+                .mailContains(SAMPLE_PART_TWO_FIELD), row, recent)).isTrue();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
index 32ff7c8..2752856 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
@@ -19,8 +19,7 @@
 
 package org.apache.james.mailbox.store;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.nio.charset.Charset;
 import java.util.ArrayList;
@@ -76,53 +75,53 @@ public class SearchUtilsRFC822Test {
 
     @Test
     public void testBodyShouldMatchPhraseInBody() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(CUSTARD), row,
-                recent));
-        assertFalse(messageSearches.isMatch(SearchQuery
-                .bodyContains(CUSTARD + CUSTARD), row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(CUSTARD), row,
+                recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery
+                .bodyContains(CUSTARD + CUSTARD), row, recent)).isFalse();
     }
 
     @Test
     public void testBodyMatchShouldBeCaseInsensitive() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(RHUBARD), row,
-                recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(RHUBARD
-                .toLowerCase(Locale.US)), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.bodyContains(RHUBARD
-                .toLowerCase(Locale.US)), row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(RHUBARD), row,
+                recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(RHUBARD
+                .toLowerCase(Locale.US)), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(RHUBARD
+                .toLowerCase(Locale.US)), row, recent)).isTrue();
     }
 
     @Test
     public void testBodyShouldNotMatchPhraseOnlyInHeader() throws Exception {
-        assertFalse(messageSearches.isMatch(SearchQuery.bodyContains(FROM_ADDRESS),
-                row, recent));
-        assertFalse(messageSearches.isMatch(SearchQuery.bodyContains(SUBJECT_PART),
-                row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(FROM_ADDRESS),
+                row, recent)).isFalse();
+        assertThat(messageSearches.isMatch(SearchQuery.bodyContains(SUBJECT_PART),
+                row, recent)).isFalse();
     }
 
     @Test
     public void testTextShouldMatchPhraseInBody() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(CUSTARD), row,
-                recent));
-        assertFalse(messageSearches.isMatch(SearchQuery
-                .mailContains(CUSTARD + CUSTARD), row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(CUSTARD), row,
+                recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery
+                .mailContains(CUSTARD + CUSTARD), row, recent)).isFalse();
     }
 
     @Test
     public void testTextMatchShouldBeCaseInsensitive() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(RHUBARD), row,
-                recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(RHUBARD
-                .toLowerCase(Locale.US)), row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(RHUBARD
-                .toLowerCase(Locale.US)), row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(RHUBARD), row,
+                recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(RHUBARD
+                .toLowerCase(Locale.US)), row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(RHUBARD
+                .toLowerCase(Locale.US)), row, recent)).isTrue();
     }
 
     @Test
     public void testBodyShouldMatchPhraseOnlyInHeader() throws Exception {
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(FROM_ADDRESS),
-                row, recent));
-        assertTrue(messageSearches.isMatch(SearchQuery.mailContains(SUBJECT_PART),
-                row, recent));
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(FROM_ADDRESS),
+                row, recent)).isTrue();
+        assertThat(messageSearches.isMatch(SearchQuery.mailContains(SUBJECT_PART),
+                row, recent)).isTrue();
     }
 }


---------------------------------------------------------------------
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