james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [3/8] james-project git commit: structural refactoring from assert{True, Fase} to assertj assertThat().is{True, False}
Date Thu, 06 Sep 2018 12:34:47 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsTest.java b/protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsTest.java
index 108d9c0..e831820 100644
--- a/protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsTest.java
@@ -19,10 +19,9 @@
 
 package org.apache.james.protocols.imap.utils;
 
+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.assertNotNull;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.Calendar;
@@ -59,16 +58,16 @@ public class DecoderUtilsTest {
     public void testSetOtherFlag() throws Exception {
         Flags flags = new Flags();
         DecoderUtils.setFlag(A_CUSTOM_FLAG, flags);
-        assertTrue("Unknown flags should be added", flags
-                .contains(A_CUSTOM_FLAG));
+        assertThat(flags
+                .contains(A_CUSTOM_FLAG)).describedAs("Unknown flags should be added").isTrue();
     }
 
     @Test
     public void testExtensionFlag() throws Exception {
         Flags flags = new Flags();
         DecoderUtils.setFlag(EXTENSION_FLAG, flags);
-        assertTrue("Extension flags should be added", flags
-                .contains(EXTENSION_FLAG));
+        assertThat(flags
+                .contains(EXTENSION_FLAG)).describedAs("Extension flags should be added").isTrue();
     }
 
     @Test
@@ -458,30 +457,30 @@ public class DecoderUtilsTest {
 
     @Test
     public void testIsSimpleDigit() {
-        assertTrue(DecoderUtils.isSimpleDigit('0'));
-        assertTrue(DecoderUtils.isSimpleDigit('1'));
-        assertTrue(DecoderUtils.isSimpleDigit('2'));
-        assertTrue(DecoderUtils.isSimpleDigit('3'));
-        assertTrue(DecoderUtils.isSimpleDigit('4'));
-        assertTrue(DecoderUtils.isSimpleDigit('5'));
-        assertTrue(DecoderUtils.isSimpleDigit('6'));
-        assertTrue(DecoderUtils.isSimpleDigit('7'));
-        assertTrue(DecoderUtils.isSimpleDigit('8'));
-        assertTrue(DecoderUtils.isSimpleDigit('9'));
-
-        assertFalse(DecoderUtils.isSimpleDigit('/'));
-        assertFalse(DecoderUtils.isSimpleDigit('.'));
-        assertFalse(DecoderUtils.isSimpleDigit('-'));
-        assertFalse(DecoderUtils.isSimpleDigit('+'));
-        assertFalse(DecoderUtils.isSimpleDigit(','));
-        assertFalse(DecoderUtils.isSimpleDigit('*'));
-        assertFalse(DecoderUtils.isSimpleDigit(':'));
-        assertFalse(DecoderUtils.isSimpleDigit(';'));
-        assertFalse(DecoderUtils.isSimpleDigit('<'));
-        assertFalse(DecoderUtils.isSimpleDigit('='));
-        assertFalse(DecoderUtils.isSimpleDigit('>'));
-        assertFalse(DecoderUtils.isSimpleDigit('A'));
-        assertFalse(DecoderUtils.isSimpleDigit('B'));
+        assertThat(DecoderUtils.isSimpleDigit('0')).isTrue();
+        assertThat(DecoderUtils.isSimpleDigit('1')).isTrue();
+        assertThat(DecoderUtils.isSimpleDigit('2')).isTrue();
+        assertThat(DecoderUtils.isSimpleDigit('3')).isTrue();
+        assertThat(DecoderUtils.isSimpleDigit('4')).isTrue();
+        assertThat(DecoderUtils.isSimpleDigit('5')).isTrue();
+        assertThat(DecoderUtils.isSimpleDigit('6')).isTrue();
+        assertThat(DecoderUtils.isSimpleDigit('7')).isTrue();
+        assertThat(DecoderUtils.isSimpleDigit('8')).isTrue();
+        assertThat(DecoderUtils.isSimpleDigit('9')).isTrue();
+
+        assertThat(DecoderUtils.isSimpleDigit('/')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit('.')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit('-')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit('+')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit(',')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit('*')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit(':')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit(';')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit('<')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit('=')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit('>')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit('A')).isFalse();
+        assertThat(DecoderUtils.isSimpleDigit('B')).isFalse();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java
----------------------------------------------------------------------
diff --git a/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java b/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java
index 29bdb9d..a12a1e4 100644
--- a/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java
+++ b/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java
@@ -18,9 +18,8 @@
  ****************************************************************/
 package org.apache.james.protocols.lmtp;
 
+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.io.IOException;
 import java.net.InetSocketAddress;
@@ -104,20 +103,20 @@ public abstract class AbstractLMTPServerTest extends AbstractSMTPServerTest {
             SMTPClient client = createClient();
             InetSocketAddress bindedAddress = new ProtocolServerUtils(server).retrieveBindedAddress();
             client.connect(bindedAddress.getAddress().getHostAddress(), bindedAddress.getPort());
-            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).isTrue();
             
             client.helo("localhost");
-            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).isTrue();
 
             client.mail(SENDER);
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
             
             client.quit();
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
             client.disconnect();
 
             Iterator<MailEnvelope> queued = hook.getQueued().iterator();
-            assertFalse(queued.hasNext());
+            assertThat(queued.hasNext()).isFalse();
 
         } finally {
             if (server != null) {
@@ -139,22 +138,22 @@ public abstract class AbstractLMTPServerTest extends AbstractSMTPServerTest {
             SMTPClient client = createClient();
             InetSocketAddress bindedAddress = new ProtocolServerUtils(server).retrieveBindedAddress();
             client.connect(bindedAddress.getAddress().getHostAddress(), bindedAddress.getPort());
-            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).isTrue();
             
             client.helo("localhost");
-            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).isTrue();
 
             client.setSender(SENDER);
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
 
             client.rcpt(RCPT1);
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
             client.quit();
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
             client.disconnect();
 
             Iterator<MailEnvelope> queued = hook.getQueued().iterator();
-            assertFalse(queued.hasNext());
+            assertThat(queued.hasNext()).isFalse();
 
         } finally {
             if (server != null) {
@@ -175,17 +174,17 @@ public abstract class AbstractLMTPServerTest extends AbstractSMTPServerTest {
             SMTPClient client = createClient();
             InetSocketAddress bindedAddress = new ProtocolServerUtils(server).retrieveBindedAddress();
             client.connect(bindedAddress.getAddress().getHostAddress(), bindedAddress.getPort());
-            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).isTrue();
             
             client.sendCommand("HELO localhost");
-            assertTrue(SMTPReply.isNegativePermanent(client.getReplyCode()));
+            assertThat(SMTPReply.isNegativePermanent(client.getReplyCode())).isTrue();
             
             client.quit();
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
             client.disconnect();
 
             Iterator<MailEnvelope> queued = hook.getQueued().iterator();
-            assertFalse(queued.hasNext());
+            assertThat(queued.hasNext()).isFalse();
 
         } finally {
             if (server != null) {
@@ -206,39 +205,39 @@ public abstract class AbstractLMTPServerTest extends AbstractSMTPServerTest {
             SMTPClient client = createClient();
             InetSocketAddress bindedAddress = new ProtocolServerUtils(server).retrieveBindedAddress();
             client.connect(bindedAddress.getAddress().getHostAddress(), bindedAddress.getPort());
-            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).isTrue();
             
             client.helo("localhost");
-            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).isTrue();
 
             client.setSender(SENDER);
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
 
             client.addRecipient(RCPT1);
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
 
             client.addRecipient(RCPT2);
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
 
-            assertTrue(client.sendShortMessageData(MSG1));
+            assertThat(client.sendShortMessageData(MSG1)).isTrue();
 
             int[] replies = ((LMTPClient)client).getReplies();
             
             assertEquals("Expected two replies",2, replies.length);
             
-            assertTrue(SMTPReply.isNegativePermanent(replies[0]));
-            assertTrue(SMTPReply.isPositiveCompletion(replies[1]));
+            assertThat(SMTPReply.isNegativePermanent(replies[0])).isTrue();
+            assertThat(SMTPReply.isPositiveCompletion(replies[1])).isTrue();
 
             client.quit();
-            assertTrue("Reply=" + client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
+            assertThat(SMTPReply.isPositiveCompletion(client.getReplyCode())).describedAs("Reply=" + client.getReplyString()).isTrue();
             client.disconnect();
 
             Iterator<MailEnvelope> queued = deliverHook.getDelivered().iterator();
-            assertTrue(queued.hasNext());
+            assertThat(queued.hasNext()).isTrue();
             
             MailEnvelope env = queued.next();
             checkEnvelope(env, SENDER, Arrays.asList(RCPT1, RCPT2), MSG1);
-            assertFalse(queued.hasNext());
+            assertThat(queued.hasNext()).isFalse();
 
         } finally {
             if (server != null) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractStartTlsPOP3ServerTest.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractStartTlsPOP3ServerTest.java b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractStartTlsPOP3ServerTest.java
index eae5020..8df10a5 100644
--- a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractStartTlsPOP3ServerTest.java
+++ b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractStartTlsPOP3ServerTest.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.protocols.pop3;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 import java.net.InetSocketAddress;
 import java.util.Arrays;
@@ -80,9 +80,9 @@ public abstract class AbstractStartTlsPOP3ServerTest {
 
             boolean startTlsCapa = Arrays.stream(client.getReplyStrings())
                 .anyMatch(cap -> cap.equalsIgnoreCase("STLS"));
-            assertTrue(startTlsCapa);
+            assertThat(startTlsCapa).isTrue();
             
-            assertTrue(client.execTLS());
+            assertThat(client.execTLS()).isTrue();
             // TODO: Reenable when commons-net 3.1.0 was released
             //       See NET-430
             //

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/POP3StartTlsResponseTest.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/POP3StartTlsResponseTest.java b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/POP3StartTlsResponseTest.java
index 8fda248..50a7801 100644
--- a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/POP3StartTlsResponseTest.java
+++ b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/POP3StartTlsResponseTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.protocols.pop3;
 
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.james.protocols.api.StartTlsResponse;
 import org.junit.Test;
@@ -33,7 +33,7 @@ public class POP3StartTlsResponseTest {
     @Test
     public void testImmutable() {
         POP3StartTlsResponse response = new POP3StartTlsResponse(POP3Response.OK_RESPONSE);
-        assertTrue(response instanceof StartTlsResponse);
-        assertTrue(response.immutable() instanceof StartTlsResponse);
+        assertThat(response instanceof StartTlsResponse).isTrue();
+        assertThat(response.immutable() instanceof StartTlsResponse).isTrue();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/SMTPStartTlsResponseTest.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/SMTPStartTlsResponseTest.java b/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/SMTPStartTlsResponseTest.java
index 332d48d..a0a881a 100644
--- a/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/SMTPStartTlsResponseTest.java
+++ b/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/SMTPStartTlsResponseTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.protocols.smtp;
 
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.james.protocols.api.StartTlsResponse;
 import org.junit.Test;
@@ -32,7 +32,7 @@ public class SMTPStartTlsResponseTest {
     @Test
     public void testImmutable() {
         SMTPStartTlsResponse response = new SMTPStartTlsResponse("554", "Reject");
-        assertTrue(response instanceof StartTlsResponse);
-        assertTrue(response.immutable() instanceof StartTlsResponse);
+        assertThat(response instanceof StartTlsResponse).isTrue();
+        assertThat(response.immutable() instanceof StartTlsResponse).isTrue();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageCopyOnWriteProxyTest.java
----------------------------------------------------------------------
diff --git a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageCopyOnWriteProxyTest.java b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageCopyOnWriteProxyTest.java
index 9543d72..119f1e9 100644
--- a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageCopyOnWriteProxyTest.java
+++ b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageCopyOnWriteProxyTest.java
@@ -18,12 +18,11 @@
  ****************************************************************/
 package org.apache.james.server.core;
 
+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.assertNotNull;
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
@@ -62,15 +61,15 @@ public class MimeMessageCopyOnWriteProxyTest extends MimeMessageFromStreamTest {
         assertNotSame(m2, mail);
         assertNotSame(m2.getMessage(), mail.getMessage());
         // test that the wrapped message is the same
-        assertTrue(isSameMimeMessage(m2.getMessage(), mail.getMessage()));
+        assertThat(isSameMimeMessage(m2.getMessage(), mail.getMessage())).isTrue();
         // test it is the same after read only operations!
         mail.getMessage().getSubject();
-        assertTrue(isSameMimeMessage(m2.getMessage(), mail.getMessage()));
+        assertThat(isSameMimeMessage(m2.getMessage(), mail.getMessage())).isTrue();
         mail.getMessage().setText("new body");
         mail.getMessage().saveChanges();
         // test it is different after a write operation!
         mail.getMessage().setSubject("new Subject");
-        assertTrue(!isSameMimeMessage(m2.getMessage(), mail.getMessage()));
+        assertThat(!isSameMimeMessage(m2.getMessage(), mail.getMessage())).isTrue();
         LifecycleUtil.dispose(mail);
         LifecycleUtil.dispose(m2);
         LifecycleUtil.dispose(messageFromSources);
@@ -88,21 +87,21 @@ public class MimeMessageCopyOnWriteProxyTest extends MimeMessageFromStreamTest {
         assertNotSame(m2, mail);
         assertNotSame(m2.getMessage(), mail.getMessage());
         // test that the wrapped message is the same
-        assertTrue(isSameMimeMessage(m2.getMessage(), mail.getMessage()));
+        assertThat(isSameMimeMessage(m2.getMessage(), mail.getMessage())).isTrue();
         // test it is the same after real only operations!
         m2.getMessage().getSubject();
-        assertTrue(isSameMimeMessage(m2.getMessage(), mail.getMessage()));
+        assertThat(isSameMimeMessage(m2.getMessage(), mail.getMessage())).isTrue();
         m2.getMessage().setText("new body");
         m2.getMessage().saveChanges();
         // test it is different after a write operation!
         m2.getMessage().setSubject("new Subject");
-        assertTrue(!isSameMimeMessage(m2.getMessage(), mail.getMessage()));
+        assertThat(!isSameMimeMessage(m2.getMessage(), mail.getMessage())).isTrue();
         // check that the subjects are correct on both mails!
         assertEquals(m2.getMessage().getSubject(), "new Subject");
         assertEquals(mail.getMessage().getSubject(), "foo");
         // cloning again the messages
         Mail m2clone = m2.duplicate("clone2");
-        assertTrue(isSameMimeMessage(m2clone.getMessage(), m2.getMessage()));
+        assertThat(isSameMimeMessage(m2clone.getMessage(), m2.getMessage())).isTrue();
         MimeMessage mm = getWrappedMessage(m2.getMessage());
         assertNotSame(m2.getMessage(), m2clone.getMessage());
         // test that m2clone has a valid wrapped message
@@ -116,7 +115,7 @@ public class MimeMessageCopyOnWriteProxyTest extends MimeMessageFromStreamTest {
         // been disposed, so it should not clone it!
         m2clone.getMessage().setSubject("new Subject 2");
         m2clone.getMessage().setText("new Body 3");
-        assertTrue(isSameMimeMessage(m2clone.getMessage(), mm));
+        assertThat(isSameMimeMessage(m2clone.getMessage(), mm)).isTrue();
         LifecycleUtil.dispose(mail);
         LifecycleUtil.dispose(messageFromSources);
     }
@@ -135,7 +134,7 @@ public class MimeMessageCopyOnWriteProxyTest extends MimeMessageFromStreamTest {
         MailImpl mail = new MailImpl("test", new MailAddress("test@test.com"), r, messageFromSources);
         // cloning the message
         Mail mailClone = MailImpl.duplicate(mail);
-        assertTrue(isSameMimeMessage(mailClone.getMessage(), mail.getMessage()));
+        assertThat(isSameMimeMessage(mailClone.getMessage(), mail.getMessage())).isTrue();
         MimeMessage mm = getWrappedMessage(mail.getMessage());
         assertNotSame(mail.getMessage(), mailClone.getMessage());
         // dispose mail and check that the clone has still a valid message and
@@ -147,12 +146,12 @@ public class MimeMessageCopyOnWriteProxyTest extends MimeMessageFromStreamTest {
         System.gc();
         Thread.sleep(1000);
         // dumb test
-        assertTrue(isSameMimeMessage(mailClone.getMessage(), mailClone.getMessage()));
+        assertThat(isSameMimeMessage(mailClone.getMessage(), mailClone.getMessage())).isTrue();
         // change the message that should be not referenced by mail that has
         // been disposed, so it should not clone it!
         mailClone.getMessage().setSubject("new Subject 2");
         mailClone.getMessage().setText("new Body 3");
-        assertTrue(isSameMimeMessage(mailClone.getMessage(), mm));
+        assertThat(isSameMimeMessage(mailClone.getMessage(), mm)).isTrue();
         LifecycleUtil.dispose(mailClone);
         LifecycleUtil.dispose(mm);
     }
@@ -171,7 +170,7 @@ public class MimeMessageCopyOnWriteProxyTest extends MimeMessageFromStreamTest {
             .build();
         MailImpl mail = new MailImpl("test", new MailAddress("test@test.com"), r,
             mimeMessage);
-        assertTrue(isSameMimeMessage(mimeMessage, mail.getMessage()));
+        assertThat(isSameMimeMessage(mimeMessage, mail.getMessage())).isTrue();
         // change the message that should be not referenced by mail that has
         // been disposed, so it should not clone it!
         System.gc();
@@ -180,7 +179,7 @@ public class MimeMessageCopyOnWriteProxyTest extends MimeMessageFromStreamTest {
         mail.getMessage().setText("new Body 3");
         System.gc();
         Thread.sleep(100);
-        assertFalse(isSameMimeMessage(mimeMessage, mail.getMessage()));
+        assertThat(isSameMimeMessage(mimeMessage, mail.getMessage())).isFalse();
         LifecycleUtil.dispose(mail);
         LifecycleUtil.dispose(mimeMessage);
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java
----------------------------------------------------------------------
diff --git a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java
index 0998146..21ac2e6 100644
--- a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java
+++ b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageTest.java
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.james.server.core;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
@@ -296,7 +297,7 @@ public class MimeMessageTest {
         MimeMessage mm = getMissingEncodingMessage();
         try {
             int count = mm.getLineCount();
-            assertTrue(count == -1 || count == 7);
+            assertThat(count == -1 || count == 7).isTrue();
         } catch (Exception e) {
             fail("Unexpected exception in getLineCount");
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageWrapperTest.java
----------------------------------------------------------------------
diff --git a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageWrapperTest.java b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageWrapperTest.java
index 617ca4d..3a15cae 100644
--- a/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageWrapperTest.java
+++ b/server/container/core/src/test/java/org/apache/james/server/core/MimeMessageWrapperTest.java
@@ -113,10 +113,10 @@ public class MimeMessageWrapperTest extends MimeMessageFromStreamTest {
     @Test
     public void testDeferredMessageLoading() throws MessagingException, IOException {
         assertEquals("foo", mw.getSubject());
-        assertFalse(mw.messageParsed());
+        assertThat(mw.messageParsed()).isFalse();
         assertEquals("bar\r\n", mw.getContent());
-        assertTrue(mw.messageParsed());
-        assertFalse(mw.isModified());
+        assertThat(mw.messageParsed()).isTrue();
+        assertThat(mw.isModified()).isFalse();
     }
 
     /**
@@ -191,10 +191,10 @@ public class MimeMessageWrapperTest extends MimeMessageFromStreamTest {
         message.setHeader(RFC2822Headers.RETURN_PATH, "<test@test.de>");
         Enumeration<String> e = message.getMatchingHeaderLines(new String[]{"Return-Path"});
         assertEquals("Return-Path: <test@test.de>", e.nextElement());
-        assertFalse(e.hasMoreElements());
+        assertThat(e.hasMoreElements()).isFalse();
         Enumeration<String> h = message.getAllHeaderLines();
         assertEquals("Return-Path: <test@test.de>", h.nextElement());
-        assertFalse(h.nextElement().startsWith("Return-Path:"));
+        assertThat(h.nextElement().startsWith("Return-Path:")).isFalse();
         LifecycleUtil.dispose(message);
     }
 
@@ -228,7 +228,7 @@ public class MimeMessageWrapperTest extends MimeMessageFromStreamTest {
         boolean headerUpdated = reader.lines()
             .anyMatch(line -> line.equals("X-Test: X-Value"));
         reader.close();
-        assertTrue(headerUpdated);
+        assertThat(headerUpdated).isTrue();
     }
 
     /**
@@ -247,7 +247,7 @@ public class MimeMessageWrapperTest extends MimeMessageFromStreamTest {
         boolean contentUpdated = reader.lines()
             .anyMatch(line -> line.equals(newContent));
         reader.close();
-        assertTrue(contentUpdated);
+        assertThat(contentUpdated).isTrue();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/container/guice/onami/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/onami/pom.xml b/server/container/guice/onami/pom.xml
index 8117abb..2c0d916 100644
--- a/server/container/guice/onami/pom.xml
+++ b/server/container/guice/onami/pom.xml
@@ -43,6 +43,11 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/DefaultStagerTestCase.java
----------------------------------------------------------------------
diff --git a/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/DefaultStagerTestCase.java b/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/DefaultStagerTestCase.java
index 856231b..ff1b81e 100644
--- a/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/DefaultStagerTestCase.java
+++ b/server/container/guice/onami/src/test/java/org/apache/james/onami/lifecycle/DefaultStagerTestCase.java
@@ -19,9 +19,10 @@
 
 package org.apache.james.onami.lifecycle;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.junit.Assert;
 import org.junit.Test;
 
 public class DefaultStagerTestCase {
@@ -36,7 +37,7 @@ public class DefaultStagerTestCase {
 
         stager.stage();
 
-        Assert.assertTrue(staged.get());
+        assertThat(staged.get()).isTrue();
     }
 
     /*
@@ -62,6 +63,6 @@ public class DefaultStagerTestCase {
 
         stager.stage();
 
-        Assert.assertTrue(staged.get());
+        assertThat(staged.get()).isTrue();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/container/util/src/test/java/org/apache/james/util/retry/DoublingRetryScheduleTest.java
----------------------------------------------------------------------
diff --git a/server/container/util/src/test/java/org/apache/james/util/retry/DoublingRetryScheduleTest.java b/server/container/util/src/test/java/org/apache/james/util/retry/DoublingRetryScheduleTest.java
index c2f7510..02b0956 100644
--- a/server/container/util/src/test/java/org/apache/james/util/retry/DoublingRetryScheduleTest.java
+++ b/server/container/util/src/test/java/org/apache/james/util/retry/DoublingRetryScheduleTest.java
@@ -19,8 +19,8 @@
  */
 package org.apache.james.util.retry;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 import org.apache.james.util.retry.api.RetrySchedule;
 import org.junit.Test;
@@ -35,7 +35,7 @@ public class DoublingRetryScheduleTest {
      */
     @Test
     public final void testDoublingRetrySchedule() {
-    assertTrue(RetrySchedule.class.isAssignableFrom(DoublingRetrySchedule.class));
+    assertThat(RetrySchedule.class.isAssignableFrom(DoublingRetrySchedule.class)).isTrue();
     assertEquals(0, new DoublingRetrySchedule(0, 0).getInterval(0));
     assertEquals(0, new DoublingRetrySchedule(-1, -1).getInterval(0));
     assertEquals(0, new DoublingRetrySchedule(-1, 0).getInterval(0));

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/container/util/src/test/java/org/apache/james/util/retry/ExceptionRetryHandlerTest.java
----------------------------------------------------------------------
diff --git a/server/container/util/src/test/java/org/apache/james/util/retry/ExceptionRetryHandlerTest.java b/server/container/util/src/test/java/org/apache/james/util/retry/ExceptionRetryHandlerTest.java
index 9848efd..4da42e9 100644
--- a/server/container/util/src/test/java/org/apache/james/util/retry/ExceptionRetryHandlerTest.java
+++ b/server/container/util/src/test/java/org/apache/james/util/retry/ExceptionRetryHandlerTest.java
@@ -19,8 +19,8 @@
  */
 package org.apache.james.util.retry;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -64,14 +64,14 @@ public class ExceptionRetryHandlerTest {
 
     @Test
     public final void testExceptionRetryHandler() {
-        assertTrue(RetryHandler.class.isAssignableFrom(new ExceptionRetryHandler(
+        assertThat(RetryHandler.class.isAssignableFrom(new ExceptionRetryHandler(
             exceptionClasses, proxy, schedule, 0) {
 
             @Override
             public Object operation() {
                 return null;
             }
-        }.getClass()));
+        }.getClass())).isTrue();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/container/util/src/test/java/org/apache/james/util/retry/naming/NamingExceptionRetryHandlerTest.java
----------------------------------------------------------------------
diff --git a/server/container/util/src/test/java/org/apache/james/util/retry/naming/NamingExceptionRetryHandlerTest.java b/server/container/util/src/test/java/org/apache/james/util/retry/naming/NamingExceptionRetryHandlerTest.java
index 7e0bd34..bbbeced 100644
--- a/server/container/util/src/test/java/org/apache/james/util/retry/naming/NamingExceptionRetryHandlerTest.java
+++ b/server/container/util/src/test/java/org/apache/james/util/retry/naming/NamingExceptionRetryHandlerTest.java
@@ -19,8 +19,8 @@
  */
 package org.apache.james.util.retry.naming;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 import javax.naming.Context;
 import javax.naming.NamingException;
@@ -62,14 +62,14 @@ public class NamingExceptionRetryHandlerTest {
 
     @Test
     public void testExceptionRetryHandler() {
-        assertTrue(RetryHandler.class.isAssignableFrom(new NamingExceptionRetryHandler(
+        assertThat(RetryHandler.class.isAssignableFrom(new NamingExceptionRetryHandler(
             exceptionClasses, proxy, schedule, 0) {
 
             @Override
             public Object operation() {
                 return null;
             }
-        }.getClass()));
+        }.getClass())).isTrue();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/data/data-file/src/test/java/org/apache/james/mailrepository/MBoxMailRepositoryTest.java
----------------------------------------------------------------------
diff --git a/server/data/data-file/src/test/java/org/apache/james/mailrepository/MBoxMailRepositoryTest.java b/server/data/data-file/src/test/java/org/apache/james/mailrepository/MBoxMailRepositoryTest.java
index 30ff7b0..3af04b3 100644
--- a/server/data/data-file/src/test/java/org/apache/james/mailrepository/MBoxMailRepositoryTest.java
+++ b/server/data/data-file/src/test/java/org/apache/james/mailrepository/MBoxMailRepositoryTest.java
@@ -18,8 +18,7 @@
  ****************************************************************/
 package org.apache.james.mailrepository;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
 import java.util.Iterator;
@@ -70,13 +69,13 @@ public class MBoxMailRepositoryTest {
 
         Iterator<MailKey> keys = mr.list();
 
-        assertTrue("Two messages in list", keys.hasNext());
+        assertThat(keys.hasNext()).describedAs("Two messages in list").isTrue();
         keys.next();
 
-        assertTrue("One messages in list", keys.hasNext());
+        assertThat(keys.hasNext()).describedAs("One messages in list").isTrue();
         keys.next();
 
-        assertFalse("No messages", keys.hasNext());
+        assertThat(keys.hasNext()).describedAs("No messages").isFalse();
     }
 
     /*

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/data/data-memory/src/test/java/org/apache/james/user/memory/UsersRepositoryManagementTest.java
----------------------------------------------------------------------
diff --git a/server/data/data-memory/src/test/java/org/apache/james/user/memory/UsersRepositoryManagementTest.java b/server/data/data-memory/src/test/java/org/apache/james/user/memory/UsersRepositoryManagementTest.java
index adb7c26..ea4063f 100644
--- a/server/data/data-memory/src/test/java/org/apache/james/user/memory/UsersRepositoryManagementTest.java
+++ b/server/data/data-memory/src/test/java/org/apache/james/user/memory/UsersRepositoryManagementTest.java
@@ -18,9 +18,8 @@
  ****************************************************************/
 package org.apache.james.user.memory;
 
+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 static org.junit.Assert.fail;
 
 import java.util.Arrays;
@@ -58,19 +57,19 @@ public class UsersRepositoryManagementTest {
     @Test
     public void testAddUserAndVerify() throws Exception {
         usersRepository.addUser("testcount1", "testCount");
-        assertFalse("user not there", userManagement.verifyExists("testNotAdded"));
-        assertTrue("user is there", userManagement.verifyExists("testCount1"));
+        assertThat(userManagement.verifyExists("testNotAdded")).describedAs("user not there").isFalse();
+        assertThat(userManagement.verifyExists("testCount1")).describedAs("user is there").isTrue();
         usersRepository.removeUser("testcount1");
-        assertFalse("user not there", userManagement.verifyExists("testCount1"));
+        assertThat(userManagement.verifyExists("testCount1")).describedAs("user not there").isFalse();
     }
 
     @Test
     public void testDelUser() throws Exception {
         usersRepository.addUser("testdel", "test");
-        assertFalse("user not there", userManagement.verifyExists("testNotDeletable"));
-        assertTrue("user is there", userManagement.verifyExists("testdel"));
+        assertThat(userManagement.verifyExists("testNotDeletable")).describedAs("user not there").isFalse();
+        assertThat(userManagement.verifyExists("testdel")).describedAs("user is there").isTrue();
         usersRepository.removeUser("testdel");
-        assertFalse("user no longer there", userManagement.verifyExists("testdel"));
+        assertThat(userManagement.verifyExists("testdel")).describedAs("user no longer there").isFalse();
     }
 
     @Test
@@ -96,19 +95,19 @@ public class UsersRepositoryManagementTest {
     public void testSetPassword() throws Exception {
         userManagement.addUser("testpwduser", "pwd1");
 
-        assertTrue("initial password", usersRepository.test("testpwduser", "pwd1"));
+        assertThat(usersRepository.test("testpwduser", "pwd1")).describedAs("initial password").isTrue();
 
         // set empty pwd
         userManagement.setPassword("testpwduser", "");
-        assertTrue("password changed to empty", usersRepository.test("testpwduser", ""));
+        assertThat(usersRepository.test("testpwduser", "")).describedAs("password changed to empty").isTrue();
 
         // change pwd
         userManagement.setPassword("testpwduser", "pwd2");
-        assertTrue("password not changed to pwd2", usersRepository.test("testpwduser", "pwd2"));
+        assertThat(usersRepository.test("testpwduser", "pwd2")).describedAs("password not changed to pwd2").isTrue();
 
         // assure case sensitivity
         userManagement.setPassword("testpwduser", "pWD2");
-        assertFalse("password no longer pwd2", usersRepository.test("testpwduser", "pwd2"));
-        assertTrue("password changed to pWD2", usersRepository.test("testpwduser", "pWD2"));
+        assertThat(usersRepository.test("testpwduser", "pwd2")).describedAs("password no longer pwd2").isFalse();
+        assertThat(usersRepository.test("testpwduser", "pWD2")).describedAs("password changed to pWD2").isTrue();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/dns-service/dnsservice-api/pom.xml
----------------------------------------------------------------------
diff --git a/server/dns-service/dnsservice-api/pom.xml b/server/dns-service/dnsservice-api/pom.xml
index a1d8d43..faa6367 100644
--- a/server/dns-service/dnsservice-api/pom.xml
+++ b/server/dns-service/dnsservice-api/pom.xml
@@ -43,6 +43,11 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/dns-service/dnsservice-dnsjava/pom.xml
----------------------------------------------------------------------
diff --git a/server/dns-service/dnsservice-dnsjava/pom.xml b/server/dns-service/dnsservice-dnsjava/pom.xml
index 25a44a6..b9dca8b 100644
--- a/server/dns-service/dnsservice-dnsjava/pom.xml
+++ b/server/dns-service/dnsservice-dnsjava/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>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/dns-service/dnsservice-dnsjava/src/test/java/org/apache/james/dnsservice/dnsjava/DNSJavaServiceTest.java
----------------------------------------------------------------------
diff --git a/server/dns-service/dnsservice-dnsjava/src/test/java/org/apache/james/dnsservice/dnsjava/DNSJavaServiceTest.java b/server/dns-service/dnsservice-dnsjava/src/test/java/org/apache/james/dnsservice/dnsjava/DNSJavaServiceTest.java
index d0d1011..921cf58 100644
--- a/server/dns-service/dnsservice-dnsjava/src/test/java/org/apache/james/dnsservice/dnsjava/DNSJavaServiceTest.java
+++ b/server/dns-service/dnsservice-dnsjava/src/test/java/org/apache/james/dnsservice/dnsjava/DNSJavaServiceTest.java
@@ -18,9 +18,9 @@
  ****************************************************************/
 package org.apache.james.dnsservice.dnsjava;
 
+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 static org.junit.Assert.fail;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
@@ -163,8 +163,8 @@ public class DNSJavaServiceTest {
         // a.setSearchPath(new String[] { "searchdomain.com." });
         Collection<String> records = dnsServer.findMXRecords("two-mx.sameprio.");
         assertEquals(2, records.size());
-        assertTrue(records.contains("mx1.two-mx.sameprio."));
-        assertTrue(records.contains("mx2.two-mx.sameprio."));
+        assertThat(records.contains("mx1.two-mx.sameprio.")).isTrue();
+        assertThat(records.contains("mx2.two-mx.sameprio.")).isTrue();
     }
 
     @Test
@@ -176,8 +176,8 @@ public class DNSJavaServiceTest {
         // a.setSearchPath(new String[] { "searchdomain.com." });
         ArrayList<String> records = new ArrayList<>(dnsServer.findMXRecords("three-mx.bar."));
         assertEquals(3, records.size());
-        assertTrue(records.contains("mx1.three-mx.bar."));
-        assertTrue(records.contains("mx2.three-mx.bar."));
+        assertThat(records.contains("mx1.three-mx.bar.")).isTrue();
+        assertThat(records.contains("mx2.three-mx.bar.")).isTrue();
         assertEquals("mx3.three-mx.bar.", records.get(2));
 
     }
@@ -193,8 +193,8 @@ public class DNSJavaServiceTest {
         // a.setSearchPath(new String[] { "searchdomain.com." });
         Collection<String> records = dnsServer.findMXRecords("two-mx.differentprio.");
         assertEquals(2, records.size());
-        assertTrue(records.contains("mx1.two-mx.differentprio."));
-        assertTrue(records.contains("mx2.two-mx.differentprio."));
+        assertThat(records.contains("mx1.two-mx.differentprio.")).isTrue();
+        assertThat(records.contains("mx2.two-mx.differentprio.")).isTrue();
 
     }
 
@@ -210,7 +210,7 @@ public class DNSJavaServiceTest {
         // a.setSearchPath(new String[] { "searchdomain.com." });
         Collection<String> records = dnsServer.findMXRecords("one-mx.bar.");
         assertEquals(1, records.size());
-        assertTrue(records.contains("mx1.one-mx.bar."));
+        assertThat(records.contains("mx1.one-mx.bar.")).isTrue();
     }
     /*
      * public void testCNAMEasMXrecords() throws Exception { // Zone z =

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/dns-service/dnsservice-library/pom.xml
----------------------------------------------------------------------
diff --git a/server/dns-service/dnsservice-library/pom.xml b/server/dns-service/dnsservice-library/pom.xml
index cf4a9cf..5bec891 100644
--- a/server/dns-service/dnsservice-library/pom.xml
+++ b/server/dns-service/dnsservice-library/pom.xml
@@ -60,6 +60,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/MXHostAddressIteratorTest.java
----------------------------------------------------------------------
diff --git a/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/MXHostAddressIteratorTest.java b/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/MXHostAddressIteratorTest.java
index 7e6bb45..96e7816 100644
--- a/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/MXHostAddressIteratorTest.java
+++ b/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/MXHostAddressIteratorTest.java
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.james.dnsservice.library;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -48,17 +49,17 @@ public class MXHostAddressIteratorTest {
 
         MXHostAddressIterator it = new MXHostAddressIterator(Arrays.asList("localhost", "localhost2").iterator(), dns, false);
         for (int i = 0; i < 4; i++) {
-            assertTrue(it.hasNext());
+            assertThat(it.hasNext()).isTrue();
             assertNotNull(it.next());
         }
-        assertFalse(it.hasNext());
+        assertThat(it.hasNext()).isFalse();
 
         it = new MXHostAddressIterator(Arrays.asList("localhost", "localhost2").iterator(), dns, true);
         for (int i = 0; i < 2; i++) {
-            assertTrue(it.hasNext());
+            assertThat(it.hasNext()).isTrue();
             assertNotNull(it.next());
         }
-        assertFalse(it.hasNext());
+        assertThat(it.hasNext()).isFalse();
     }
 
     @Test
@@ -66,6 +67,6 @@ public class MXHostAddressIteratorTest {
 
         // See JAMES-1271
         MXHostAddressIterator it = new MXHostAddressIterator(Arrays.asList("localhost").iterator(), new InMemoryDNSService(), false);
-        assertFalse(it.hasNext());
+        assertThat(it.hasNext()).isFalse();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/inetnetwork/model/InetNetworkTest.java
----------------------------------------------------------------------
diff --git a/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/inetnetwork/model/InetNetworkTest.java b/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/inetnetwork/model/InetNetworkTest.java
index 35904e1..909535f 100644
--- a/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/inetnetwork/model/InetNetworkTest.java
+++ b/server/dns-service/dnsservice-library/src/test/java/org/apache/james/dnsservice/library/inetnetwork/model/InetNetworkTest.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.dnsservice.library.inetnetwork.model;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 import java.net.Inet4Address;
 import java.net.Inet6Address;
@@ -72,9 +72,9 @@ public class InetNetworkTest {
         // Test Bad IP V4 address.
         try {
             address = InetAddress.getByAddress(getBytesFromAddress("127.0.0.1.1"));
-            assertTrue(false);
+            assertThat(false).isTrue();
         } catch (UnknownHostException e) {
-            assertTrue(true);
+            assertThat(true).isTrue();
         }
 
         // Test IP V4 address.
@@ -109,9 +109,9 @@ public class InetNetworkTest {
         // Test Bad IP V6 address.
         try {
             address = InetAddress.getByAddress(getBytesFromAddress("0000:0000:0000:0000:0000:0000:0000:0001:00001"));
-            assertTrue(false);
+            assertThat(false).isTrue();
         } catch (UnknownHostException e) {
-            assertTrue(true);
+            assertThat(true).isTrue();
         }
 
         // Test IP V6 address.
@@ -140,9 +140,9 @@ public class InetNetworkTest {
         Inet4Network network4;
         try {
             network4 = new Inet4Network(address, null);
-            assertTrue(false);
+            assertThat(false).isTrue();
         } catch (NullPointerException e) {
-            assertTrue(true);
+            assertThat(true).isTrue();
         }
 
         // Test IP V4.
@@ -165,9 +165,9 @@ public class InetNetworkTest {
         Inet6Network network6;
         try {
             network6 = new Inet6Network(address, null);
-            assertTrue(false);
+            assertThat(false).isTrue();
         } catch (NullPointerException e) {
-            assertTrue(true);
+            assertThat(true).isTrue();
         }
 
         // Test IP V6 with subnet mask 32768.

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/dns-service/dnsservice-test/pom.xml
----------------------------------------------------------------------
diff --git a/server/dns-service/dnsservice-test/pom.xml b/server/dns-service/dnsservice-test/pom.xml
index 2b203db..715ea8d 100644
--- a/server/dns-service/dnsservice-test/pom.xml
+++ b/server/dns-service/dnsservice-test/pom.xml
@@ -46,6 +46,10 @@
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java
----------------------------------------------------------------------
diff --git a/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java
index edcba79..5be85c0 100644
--- a/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java
+++ b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.dnsservice.api;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
@@ -77,7 +77,7 @@ public class AbstractDNSServiceTest {
         String localHost = DNS_SERVER.getHostName(InetAddress.getByName("127.0.0.1"));
         // We only can check if the returned localhost is not empty. Its value
         // depends on the hosts file.
-        assertTrue(localHost.length() > 0);
+        assertThat(localHost.length() > 0).isTrue();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessorTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessorTest.java b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessorTest.java
index 9da66b3..a787279 100644
--- a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessorTest.java
+++ b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessorTest.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.mailetcontainer.lib;
 
+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.assertNotNull;
 import static org.junit.Assert.assertNull;
 
@@ -270,7 +270,7 @@ public abstract class AbstractStateMailetProcessorTest {
             public void afterMailet(Mailet m, String mailName, String state, long processTime, Exception e) {
                 if (ExceptionThrowingMailet.class.equals(m.getClass())) {
                     // the name should be not the same as we have a part match
-                    assertFalse(mail.getName().equals(mailName));
+                    assertThat(mail.getName().equals(mailName)).isFalse();
                     assertNotNull(e);
                     assertEquals(Mail.ERROR, state);
                     latch.countDown();

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/protocols/protocols-pop3/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-pop3/pom.xml b/server/protocols/protocols-pop3/pom.xml
index 010bc49..5ce737b 100644
--- a/server/protocols/protocols-pop3/pom.xml
+++ b/server/protocols/protocols-pop3/pom.xml
@@ -148,6 +148,11 @@
             <artifactId>protocols-pop3</artifactId>
         </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/63ab7ab8/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java b/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
index 849fb63..1eb7aa5 100644
--- a/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
+++ b/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.pop3server;
 
+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.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
@@ -111,7 +111,7 @@ public class POP3ServerTest {
 
         pop3Client.login("known", "test");
         assertEquals(0, pop3Client.getState());
-        assertTrue(pop3Client.getReplyString().startsWith("-ERR"));
+        assertThat(pop3Client.getReplyString().startsWith("-ERR")).isTrue();
     }
 
     @Test
@@ -124,7 +124,7 @@ public class POP3ServerTest {
 
         pop3Client.login("unknown", "test");
         assertEquals(0, pop3Client.getState());
-        assertTrue(pop3Client.getReplyString().startsWith("-ERR"));
+        assertThat(pop3Client.getReplyString().startsWith("-ERR")).isTrue();
     }
 
     @Test
@@ -328,17 +328,17 @@ public class POP3ServerTest {
 
         // existing message
         boolean deleted = pop3Client.deleteMessage(entries[0].number);
-        assertTrue(deleted);
+        assertThat(deleted).isTrue();
 
         // already deleted message
         deleted = pop3Client.deleteMessage(entries[0].number);
 
         // TODO: Understand why this fails...
-        assertFalse(deleted);
+        assertThat(deleted).isFalse();
 
         // unexisting message
         deleted = pop3Client.deleteMessage(10);
-        assertFalse(deleted);
+        assertThat(deleted).isFalse();
 
         pop3Client.logout();
         //m_pop3Protocol.disconnect();
@@ -490,7 +490,7 @@ public class POP3ServerTest {
         assertEquals(msgCount, uidlEntries2.length);
         assertEquals(msgCount, statInfo2.number);
 
-        assertTrue(pop3Client.logout());
+        assertThat(pop3Client.logout()).isTrue();
         pop3Client.disconnect();
 
         // even after the message was deleted and the session was quit it should
@@ -563,7 +563,7 @@ public class POP3ServerTest {
 
         pop3Client.login("foo", pass);
         assertEquals(1, pop3Client.getState());
-        assertTrue(POP3BeforeSMTPHelper.isAuthorized("127.0.0.1"));
+        assertThat(POP3BeforeSMTPHelper.isAuthorized("127.0.0.1")).isTrue();
 
     }
 
@@ -584,7 +584,7 @@ public class POP3ServerTest {
         pop3Client.getReplyString();
         List<String> replies = Arrays.asList(pop3Client.getReplyStrings());
 
-        assertTrue("contains USER", replies.contains("USER"));
+        assertThat(replies.contains("USER")).describedAs("contains USER").isTrue();
 
         pop3Client.login("foo", pass);
         assertEquals(POP3Reply.OK, pop3Client.sendCommand("CAPA"));
@@ -592,9 +592,9 @@ public class POP3ServerTest {
         pop3Client.getAdditionalReply();
         pop3Client.getReplyString();
         replies = Arrays.asList(pop3Client.getReplyStrings());
-        assertTrue("contains USER", replies.contains("USER"));
-        assertTrue("contains UIDL", replies.contains("UIDL"));
-        assertTrue("contains TOP", replies.contains("TOP"));
+        assertThat(replies.contains("USER")).describedAs("contains USER").isTrue();
+        assertThat(replies.contains("UIDL")).describedAs("contains UIDL").isTrue();
+        assertThat(replies.contains("TOP")).describedAs("contains TOP").isTrue();
         
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/63ab7ab8/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/POP3BeforeSMTPHandlerTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/POP3BeforeSMTPHandlerTest.java b/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/POP3BeforeSMTPHandlerTest.java
index d3f7def..4fa2de3 100644
--- a/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/POP3BeforeSMTPHandlerTest.java
+++ b/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/POP3BeforeSMTPHandlerTest.java
@@ -18,8 +18,7 @@
  ****************************************************************/
 package org.apache.james.smtpserver;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.net.InetSocketAddress;
 
@@ -66,9 +65,9 @@ public class POP3BeforeSMTPHandlerTest {
         setupMockedSMTPSession();
         POP3BeforeSMTPHelper.addIPAddress("192.168.200.1");
 
-        assertFalse(mockedSession.isRelayingAllowed());
+        assertThat(mockedSession.isRelayingAllowed()).isFalse();
         handler.onConnect(mockedSession);
-        assertTrue(mockedSession.isRelayingAllowed());
+        assertThat(mockedSession.isRelayingAllowed()).isTrue();
     }
 
     @Test
@@ -78,13 +77,13 @@ public class POP3BeforeSMTPHandlerTest {
 
         setupMockedSMTPSession();
         POP3BeforeSMTPHelper.addIPAddress("192.168.200.1");
-        assertFalse(mockedSession.isRelayingAllowed());
+        assertThat(mockedSession.isRelayingAllowed()).isFalse();
 
         try {
             Thread.sleep(sleepTime);
             POP3BeforeSMTPHelper.removeExpiredIP(10);
             handler.onConnect(mockedSession);
-            assertFalse(mockedSession.isRelayingAllowed());
+            assertThat(mockedSession.isRelayingAllowed()).isFalse();
 
         } catch (InterruptedException e) {
             // ignore
@@ -103,7 +102,7 @@ public class POP3BeforeSMTPHandlerTest {
         } catch (NumberFormatException e) {
             exception = true;
         }
-        assertTrue(exception);
+        assertThat(exception).isTrue();
     }
 
     @Test
@@ -118,6 +117,6 @@ public class POP3BeforeSMTPHandlerTest {
         } catch (NumberFormatException e) {
             exception = true;
         }
-        assertFalse(exception);
+        assertThat(exception).isFalse();
     }
 }


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