james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [2/2] james-project git commit: JAMES-2506 upgrade mockito
Date Wed, 01 Aug 2018 11:12:38 GMT
JAMES-2506 upgrade mockito


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

Branch: refs/heads/master
Commit: 8d22e356856eecc0d0504e55128e9e619eb373e0
Parents: 8e17dca
Author: duc <dtran@linagora.com>
Authored: Mon Jul 30 15:43:30 2018 +0700
Committer: benwa <btellier@linagora.com>
Committed: Wed Aug 1 18:12:00 2018 +0700

----------------------------------------------------------------------
 .../CassandraMigrationServiceTest.java          |  4 +-
 .../eventsourcing/EventSourcingSystemTest.java  |  4 +-
 .../CassandraMailboxManagerAttachmentTest.java  |  2 +-
 .../AttachmentMessageIdCreationTest.java        |  2 +-
 .../migration/AttachmentV2MigrationTest.java    |  2 +-
 ...icSearchListeningMessageSearchIndexTest.java |  6 +--
 .../json/IndexableMessageTest.java              |  2 +-
 .../InMemoryMailboxManagerAttachmentTest.java   |  2 +-
 .../spamassassin/SpamAssassinListenerTest.java  |  2 +-
 .../AbstractMessageIdManagerSideEffectTest.java |  4 +-
 .../store/StoreAttachmentManagerTest.java       |  2 +-
 .../mailbox/store/StoreBlobManagerTest.java     |  2 +-
 .../StoreMailboxManagerAnnotationTest.java      |  4 +-
 .../mailbox/store/StoreMailboxManagerTest.java  |  2 +-
 .../event/MailboxAnnotationListenerTest.java    |  4 +-
 .../mailbox/store/mail/MessageUtilsTest.java    |  2 +-
 .../mailbox/tika/CachingTextExtractorTest.java  |  2 +-
 .../mailbox/indexer/ReIndexerImplTest.java      |  4 +-
 .../james/transport/mailets/AddFooterTest.java  | 13 -----
 .../mailets/AmqpForwardAttributeTest.java       |  2 +-
 .../transport/mailets/ContactExtractorTest.java |  2 +-
 .../james/transport/mailets/LogMessageTest.java |  4 +-
 pom.xml                                         |  3 +-
 .../james/imap/processor/CopyProcessorTest.java |  2 +-
 .../imap/processor/DeleteACLProcessorTest.java  |  4 +-
 .../imap/processor/GetACLProcessorTest.java     |  4 +-
 .../processor/GetAnnotationProcessorTest.java   |  4 +-
 .../imap/processor/GetQuotaProcessorTest.java   |  2 +-
 .../imap/processor/ListRightsProcessorTest.java |  4 +-
 .../james/imap/processor/MoveProcessorTest.java |  4 +-
 .../imap/processor/SetACLProcessorTest.java     |  4 +-
 .../processor/SetAnnotationProcessorTest.java   |  4 +-
 .../base/MailboxEventAnalyserTest.java          |  2 +-
 .../processor/base/SelectedMailboxImplTest.java |  4 +-
 .../mailbox/MailboxListenersLoaderImplTest.java |  2 +-
 .../AbstractDomainListPrivateMethodsTest.java   |  8 ++-
 .../dnsservice/dnsjava/DNSJavaServiceTest.java  |  4 +-
 .../transport/mailets/MetricsMailetTest.java    |  2 +-
 .../RecipientRewriteTableProcessorTest.java     | 29 +----------
 .../transport/mailets/ToRepositoryTest.java     |  2 +-
 .../mailets/ToSenderDomainRepositoryTest.java   |  2 +-
 .../mailets/delivery/LocalDeliveryTest.java     |  6 +--
 .../mailets/delivery/MailDispatcherTest.java    |  2 +-
 .../mailets/delivery/SimpleMailStoreTest.java   |  4 +-
 .../mailets/delivery/ToRecipientFolderTest.java |  6 +--
 .../managesieve/ManageSieveMailetTestCase.java  |  2 +-
 .../remote/delivery/DeliveryRunnableTest.java   | 12 ++---
 .../remote/delivery/MailDelivrerTest.java       |  4 +-
 .../AccessTokenAuthenticationStrategyTest.java  |  2 +-
 .../james/jmap/AuthenticationFilterTest.java    |  4 +-
 .../apache/james/jmap/DownloadServletTest.java  |  4 +-
 .../org/apache/james/jmap/JMAPServletTest.java  |  3 +-
 .../jmap/JWTAuthenticationStrategyTest.java     |  2 +-
 .../james/jmap/UserProvisioningFilterTest.java  |  4 +-
 .../TextCalendarBodyToAttachmentTest.java       |  2 +-
 .../james/jmap/mailet/VacationMailetTest.java   |  4 +-
 .../james/jmap/mailet/VacationReplyTest.java    |  4 +-
 .../jmap/methods/GetMailboxesMethodTest.java    |  2 +-
 .../jmap/methods/GetMessagesMethodTest.java     |  2 +-
 .../SetMessagesCreationProcessorTest.java       | 16 ++++--
 .../methods/SetMessagesUpdateProcessorTest.java |  2 +-
 .../methods/SetVacationResponseMethodTest.java  |  4 +-
 .../UpdateMessagePatchConverterTest.java        |  2 +-
 .../UpdateMessagePatchValidatorTest.java        |  4 +-
 .../james/jmap/model/MessageFactoryTest.java    |  2 +-
 .../apache/james/jmap/send/MailFactoryTest.java |  2 +-
 .../jmap/send/PostDequeueDecoratorTest.java     |  4 +-
 .../utils/SystemMailboxesProviderImplTest.java  |  2 +-
 .../routes/CassandraMigrationRoutesTest.java    |  5 +-
 .../routes/DLPConfigurationRoutesTest.java      |  2 +-
 .../routes/DomainMappingsRoutesTest.java        |  3 +-
 .../webadmin/routes/DomainsRoutesTest.java      |  2 +-
 .../webadmin/routes/ForwardRoutesTest.java      | 54 ++------------------
 .../james/webadmin/routes/GroupsRoutesTest.java | 52 +------------------
 .../james/webadmin/routes/UsersRoutesTest.java  |  3 +-
 .../routes/UserMailboxesRoutesTest.java         |  3 +-
 .../routes/MailRepositoriesRoutesTest.java      |  3 +-
 .../library/AbstractMailQueueFactoryTest.java   |  7 ++-
 78 files changed, 141 insertions(+), 263 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
----------------------------------------------------------------------
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
index 18c60dc..7730e80 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.backends.cassandra.migration;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/event-sourcing/event-sourcing-core/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java
----------------------------------------------------------------------
diff --git a/event-sourcing/event-sourcing-core/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java b/event-sourcing/event-sourcing-core/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java
index 02c9eec..9d1bc23 100644
--- a/event-sourcing/event-sourcing-core/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java
+++ b/event-sourcing/event-sourcing-core/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java
@@ -21,8 +21,8 @@ package org.apache.james.eventsourcing;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyListOf;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyListOf;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java
index 13ca350..d850be4 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxManagerAttachmentTest.java
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.james.mailbox.cassandra.mail;
 
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java
index 7cd3f71..ad9b9b7 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentMessageIdCreationTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.mailbox.cassandra.mail.migration;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java
index 76f2099..26bcf94 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.mailbox.cassandra.mail.migration;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java
index 62eb3ee..176a617 100644
--- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java
+++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java
@@ -18,9 +18,9 @@
  ****************************************************************/
 package org.apache.james.mailbox.elasticsearch.events;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.refEq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.refEq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessageTest.java
----------------------------------------------------------------------
diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessageTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessageTest.java
index 60390c9..40b641e 100644
--- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessageTest.java
+++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessageTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.mailbox.elasticsearch.json;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java
index 3927b95..51f993d 100644
--- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java
+++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.mailbox.inmemory.mail;
 
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/plugin/spamassassin/src/test/java/org/apache/james/mailbox/spamassassin/SpamAssassinListenerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/plugin/spamassassin/src/test/java/org/apache/james/mailbox/spamassassin/SpamAssassinListenerTest.java b/mailbox/plugin/spamassassin/src/test/java/org/apache/james/mailbox/spamassassin/SpamAssassinListenerTest.java
index a384c4b..3426ecf 100644
--- a/mailbox/plugin/spamassassin/src/test/java/org/apache/james/mailbox/spamassassin/SpamAssassinListenerTest.java
+++ b/mailbox/plugin/spamassassin/src/test/java/org/apache/james/mailbox/spamassassin/SpamAssassinListenerTest.java
@@ -19,7 +19,7 @@
 package org.apache.james.mailbox.spamassassin;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMessageIdManagerSideEffectTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMessageIdManagerSideEffectTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMessageIdManagerSideEffectTest.java
index fdf0480..75df4bc 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMessageIdManagerSideEffectTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMessageIdManagerSideEffectTest.java
@@ -21,8 +21,8 @@ package org.apache.james.mailbox.store;
 
 import static org.apache.james.mailbox.fixture.MailboxFixture.ALICE;
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.times;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreAttachmentManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreAttachmentManagerTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreAttachmentManagerTest.java
index d753fca..2d910ae 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreAttachmentManagerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreAttachmentManagerTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.mailbox.store;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreBlobManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreBlobManagerTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreBlobManagerTest.java
index fc387bb..322c8d5 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreBlobManagerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreBlobManagerTest.java
@@ -21,7 +21,7 @@ package org.apache.james.mailbox.store;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerAnnotationTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerAnnotationTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerAnnotationTest.java
index 16ff2d3..0d48de8 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerAnnotationTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerAnnotationTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.mailbox.store;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
index 7228e55..3707b98 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxManagerTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.mailbox.store;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/MailboxAnnotationListenerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/MailboxAnnotationListenerTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/MailboxAnnotationListenerTest.java
index 1319543..cbc1ae3 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/MailboxAnnotationListenerTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/MailboxAnnotationListenerTest.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.mailbox.store.event;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/MessageUtilsTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/MessageUtilsTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/MessageUtilsTest.java
index 4a438d5..4944ff5 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/MessageUtilsTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/MessageUtilsTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.mailbox.store.mail;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/CachingTextExtractorTest.java
----------------------------------------------------------------------
diff --git a/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/CachingTextExtractorTest.java b/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/CachingTextExtractorTest.java
index 1cc2a40..91a9eba 100644
--- a/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/CachingTextExtractorTest.java
+++ b/mailbox/tika/src/test/java/org/apache/james/mailbox/tika/CachingTextExtractorTest.java
@@ -21,7 +21,7 @@ package org.apache.james.mailbox.tika;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.times;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailbox/tool/src/test/java/org/apache/james/mailbox/indexer/ReIndexerImplTest.java
----------------------------------------------------------------------
diff --git a/mailbox/tool/src/test/java/org/apache/james/mailbox/indexer/ReIndexerImplTest.java b/mailbox/tool/src/test/java/org/apache/james/mailbox/indexer/ReIndexerImplTest.java
index 5f0acaa..7bc15ab 100644
--- a/mailbox/tool/src/test/java/org/apache/james/mailbox/indexer/ReIndexerImplTest.java
+++ b/mailbox/tool/src/test/java/org/apache/james/mailbox/indexer/ReIndexerImplTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.mailbox.indexer;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailet/standard/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
index 0c3b75a..2243686 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
@@ -367,17 +367,4 @@ class AddFooterTest {
         assertThat(MailUtil.toString(mail, javaCharset)).endsWith(expectedFooter);
     }
     
-    @SuppressWarnings("unchecked")
-    @Test
-    void shouldThrowMessagingExceptionWhenIOExceptionReadingMessage() throws MessagingException {
-        FakeMailetConfig mailetConfig = FakeMailetConfig.builder()
-                .mailetName("Test")
-                .setProperty("text", "------ " + MY_FOOTER + " à/€ ------")
-                .build();
-        mailet.init(mailetConfig);
-        
-        Mail mail = mock(Mail.class);
-        when(mail.getMessage()).thenThrow(IOException.class);
-        assertThatThrownBy(() -> mailet.service(mail)).isInstanceOf(MessagingException.class);
-    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java
index 4b549d2..6b959cf 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/AmqpForwardAttributeTest.java
@@ -21,7 +21,7 @@ package org.apache.james.transport.mailets;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyZeroInteractions;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java
index 0a2319a..83b9ddb 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/ContactExtractorTest.java
@@ -21,7 +21,7 @@ package org.apache.james.transport.mailets;
 import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java
----------------------------------------------------------------------
diff --git a/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java b/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java
index 963d3e3..7857dc9 100644
--- a/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java
+++ b/mailet/standard/src/test/java/org/apache/james/transport/mailets/LogMessageTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.transport.mailets;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 26b645c..0164ebe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -659,7 +659,6 @@
         <xercesImpl.version>2.12.0</xercesImpl.version>
         <xml-apis.version>1.4.01</xml-apis.version>
         <geronimo-activation-spec.version>1.1</geronimo-activation-spec.version>
-        <mockito-core.version>1.9.0</mockito-core.version>
         <jasypt.version>1.9.2</jasypt.version>
         <guice.version>4.1.0</guice.version>
         <jackrabbit-core.version>2.5.2</jackrabbit-core.version>
@@ -2391,7 +2390,7 @@
             <dependency>
                 <groupId>org.mockito</groupId>
                 <artifactId>mockito-core</artifactId>
-                <version>${mockito-core.version}</version>
+                <version>2.20.1</version>
             </dependency>
             <dependency>
                 <groupId>org.ops4j.pax.exam</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/CopyProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/CopyProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/CopyProcessorTest.java
index eb61e67..76323ba 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/CopyProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/CopyProcessorTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.imap.processor;
 
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java
index aaa908d..6cc2cbd 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.imap.processor;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java
index 5e46bfa..8522169 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.imap.processor;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/GetAnnotationProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetAnnotationProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetAnnotationProcessorTest.java
index 3838797..5a9796a 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetAnnotationProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetAnnotationProcessorTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.imap.processor;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java
index 1d375e7..c3136d1 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.imap.processor;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java
index 6ebcb96..ff7f0e5 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.imap.processor;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/MoveProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/MoveProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/MoveProcessorTest.java
index 7b45822..0a6d718 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/MoveProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/MoveProcessorTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.imap.processor;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java
index 0e5096e..8f70752 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.imap.processor;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/SetAnnotationProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/SetAnnotationProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/SetAnnotationProcessorTest.java
index 1cf4960..e9cc6b6 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/SetAnnotationProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/SetAnnotationProcessorTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.imap.processor;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
index 183d816..0f797a7 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.imap.processor.base;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java
index a401be8..2e881cb 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.imap.processor.base;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/MailboxListenersLoaderImplTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/MailboxListenersLoaderImplTest.java b/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/MailboxListenersLoaderImplTest.java
index c592907..c1d6f5f 100644
--- a/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/MailboxListenersLoaderImplTest.java
+++ b/server/container/guice/mailbox/src/test/java/org/apache/james/modules/mailbox/MailboxListenersLoaderImplTest.java
@@ -20,7 +20,7 @@ package org.apache.james.modules.mailbox;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/data/data-library/src/test/java/org/apache/james/domainlist/lib/AbstractDomainListPrivateMethodsTest.java
----------------------------------------------------------------------
diff --git a/server/data/data-library/src/test/java/org/apache/james/domainlist/lib/AbstractDomainListPrivateMethodsTest.java b/server/data/data-library/src/test/java/org/apache/james/domainlist/lib/AbstractDomainListPrivateMethodsTest.java
index abc0f32..787e3e8 100644
--- a/server/data/data-library/src/test/java/org/apache/james/domainlist/lib/AbstractDomainListPrivateMethodsTest.java
+++ b/server/data/data-library/src/test/java/org/apache/james/domainlist/lib/AbstractDomainListPrivateMethodsTest.java
@@ -20,11 +20,12 @@
 package org.apache.james.domainlist.lib;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 
+import java.net.Inet4Address;
 import java.net.InetAddress;
 import java.util.List;
 
@@ -167,6 +168,7 @@ public class AbstractDomainListPrivateMethodsTest {
         domainList.configure(configuration);
 
         String detected = "detected.tld";
+        when(dnsService.getLocalHost()).thenReturn(InetAddress.getByName("127.0.0.1"));
         when(dnsService.getHostName(any(InetAddress.class))).thenReturn(detected);
 
         assertThat(domainList.getDomains()).contains(Domain.of(detected));
@@ -182,6 +184,7 @@ public class AbstractDomainListPrivateMethodsTest {
 
         String detected = "detected.tld";
         String detectedIp = "148.25.32.1";
+        when(dnsService.getLocalHost()).thenReturn(InetAddress.getByName("127.0.0.1"));
         when(dnsService.getHostName(any(InetAddress.class))).thenReturn(detected);
         InetAddress detectedAddress = mock(InetAddress.class);
         when(detectedAddress.getHostAddress()).thenReturn(detectedIp);
@@ -202,6 +205,7 @@ public class AbstractDomainListPrivateMethodsTest {
         String detected = "detected.tld";
         String detectedIp1 = "148.25.32.1";
         String detectedIp2 = "148.25.32.2";
+        when(dnsService.getLocalHost()).thenReturn(InetAddress.getByName("127.0.0.1"));
         when(dnsService.getHostName(any(InetAddress.class))).thenReturn(detected);
         InetAddress detectedAddress1 = mock(InetAddress.class);
         InetAddress detectedAddress2 = mock(InetAddress.class);
@@ -235,6 +239,7 @@ public class AbstractDomainListPrivateMethodsTest {
     public void containsDomainShouldReturnDetectedIp() throws Exception {
         String detected = "detected.tld";
         String detectedIp = "148.25.32.1";
+        when(dnsService.getLocalHost()).thenReturn(InetAddress.getByName("127.0.0.1"));
         when(dnsService.getHostName(any(InetAddress.class))).thenReturn(detected);
         InetAddress detectedAddress = mock(InetAddress.class);
         when(detectedAddress.getHostAddress()).thenReturn(detectedIp);
@@ -289,6 +294,7 @@ public class AbstractDomainListPrivateMethodsTest {
         domainList.configure(configuration);
 
         String detected = "detected.tld";
+        when(dnsService.getLocalHost()).thenReturn(InetAddress.getByName("127.0.0.1"));
         when(dnsService.getHostName(any(InetAddress.class))).thenReturn(detected);
 
         assertThat(domainList.containsDomain(Domain.of(detected))).isTrue();

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/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 e4d9323..d0d1011 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
@@ -22,8 +22,8 @@ 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.Matchers.any;
-import static org.mockito.Matchers.anyInt;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.mock;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/MetricsMailetTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/MetricsMailetTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/MetricsMailetTest.java
index 29032ab..49a21ac 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/MetricsMailetTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/MetricsMailetTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.transport.mailets;
 
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessorTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessorTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessorTest.java
index 41eafac..448afeb 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessorTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessorTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.transport.mailets;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.when;
 
 import java.util.Collection;
@@ -285,31 +285,6 @@ public class RecipientRewriteTableProcessorTest {
         assertThat(mail.getRecipients()).containsOnly(MailAddressFixture.ANY_AT_LOCAL);
     }
     
-    @SuppressWarnings("unchecked")
-    @Test
-    public void processShouldSendMailToAllErrorRecipientsWhenMessagingException() throws Exception {
-        when(virtualTableStore.getMappings(eq("other"), eq(Domain.of(MailAddressFixture.JAMES_LOCAL)))).thenThrow(MessagingException.class);
-
-        mail = FakeMail.builder()
-            .sender(MailAddressFixture.ANY_AT_JAMES)
-            .mimeMessage(message)
-            .recipients(MailAddressFixture.OTHER_AT_LOCAL, MailAddressFixture.ANY_AT_LOCAL)
-            .build();
-
-        processor.processMail(mail);
-
-        FakeMailContext.SentMail expected = FakeMailContext.sentMailBuilder()
-                .sender(MailAddressFixture.ANY_AT_JAMES)
-                .recipient(MailAddressFixture.OTHER_AT_LOCAL)
-                .message(message)
-                .fromMailet()
-                .state(Mail.ERROR)
-                .build();
-
-        assertThat(mailetContext.getSentMails()).containsOnly(expected);
-        assertThat(mail.getRecipients()).containsOnly(MailAddressFixture.ANY_AT_LOCAL);
-    }
-    
     @Test
     public void processShouldNotSendMailWhenNoErrorRecipients() throws Exception {
         when(virtualTableStore.getMappings(any(String.class), any(Domain.class))).thenReturn(null);

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToRepositoryTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToRepositoryTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToRepositoryTest.java
index a876f77..ae069a4 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToRepositoryTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToRepositoryTest.java
@@ -19,7 +19,7 @@
 package org.apache.james.transport.mailets;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToSenderDomainRepositoryTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToSenderDomainRepositoryTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToSenderDomainRepositoryTest.java
index 73ddca9..55c704a 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToSenderDomainRepositoryTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/ToSenderDomainRepositoryTest.java
@@ -23,7 +23,7 @@ import static org.apache.mailet.base.MailAddressFixture.JAMES_LOCAL;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java
index 5eb2eff..5dc037c 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/LocalDeliveryTest.java
@@ -19,9 +19,9 @@
 
 package org.apache.james.transport.mailets.delivery;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/MailDispatcherTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/MailDispatcherTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/MailDispatcherTest.java
index 663b178..953b95d 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/MailDispatcherTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/MailDispatcherTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.transport.mailets.delivery;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SimpleMailStoreTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SimpleMailStoreTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SimpleMailStoreTest.java
index 414ec8e..7a5b95e 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SimpleMailStoreTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/SimpleMailStoreTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.transport.mailets.delivery;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/ToRecipientFolderTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/ToRecipientFolderTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/ToRecipientFolderTest.java
index d130100..9f2c022 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/ToRecipientFolderTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/delivery/ToRecipientFolderTest.java
@@ -20,9 +20,9 @@
 package org.apache.james.transport.mailets.delivery;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/managesieve/ManageSieveMailetTestCase.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/managesieve/ManageSieveMailetTestCase.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/managesieve/ManageSieveMailetTestCase.java
index e9967b5..01bc770 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/managesieve/ManageSieveMailetTestCase.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/managesieve/ManageSieveMailetTestCase.java
@@ -21,7 +21,7 @@
 package org.apache.james.transport.mailets.managesieve;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/DeliveryRunnableTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/DeliveryRunnableTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/DeliveryRunnableTest.java
index 8cfd16a..6324f5e 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/DeliveryRunnableTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/DeliveryRunnableTest.java
@@ -19,9 +19,9 @@
 
 package org.apache.james.transport.mailets.remote.delivery;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
@@ -36,12 +36,6 @@ import org.apache.james.metrics.api.Metric;
 import org.apache.james.metrics.api.MetricFactory;
 import org.apache.james.metrics.api.NoopMetricFactory;
 import org.apache.james.queue.api.MailQueue;
-import org.apache.james.transport.mailets.remote.delivery.Bouncer;
-import org.apache.james.transport.mailets.remote.delivery.DeliveryRetriesHelper;
-import org.apache.james.transport.mailets.remote.delivery.DeliveryRunnable;
-import org.apache.james.transport.mailets.remote.delivery.ExecutionResult;
-import org.apache.james.transport.mailets.remote.delivery.MailDelivrer;
-import org.apache.james.transport.mailets.remote.delivery.RemoteDeliveryConfiguration;
 import org.apache.mailet.Mail;
 import org.apache.mailet.base.test.FakeMail;
 import org.apache.mailet.base.test.FakeMailetConfig;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/MailDelivrerTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/MailDelivrerTest.java b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/MailDelivrerTest.java
index 7ece906..62375c5 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/MailDelivrerTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/MailDelivrerTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.transport.mailets.remote.delivery;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/AccessTokenAuthenticationStrategyTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/AccessTokenAuthenticationStrategyTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/AccessTokenAuthenticationStrategyTest.java
index 4ddf582..c178242 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/AccessTokenAuthenticationStrategyTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/AccessTokenAuthenticationStrategyTest.java
@@ -20,7 +20,7 @@ package org.apache.james.jmap;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/AuthenticationFilterTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/AuthenticationFilterTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/AuthenticationFilterTest.java
index b9bb7d1..c090cc7 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/AuthenticationFilterTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/AuthenticationFilterTest.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.jmap;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/DownloadServletTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/DownloadServletTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/DownloadServletTest.java
index a336da7..2943b64 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/DownloadServletTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/DownloadServletTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPServletTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPServletTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPServletTest.java
index 666bcc3..0a67286 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPServletTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/JMAPServletTest.java
@@ -22,7 +22,7 @@ import static io.restassured.RestAssured.given;
 import static io.restassured.config.EncoderConfig.encoderConfig;
 import static io.restassured.config.RestAssuredConfig.newConfig;
 import static org.hamcrest.Matchers.equalTo;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -44,6 +44,7 @@ import org.junit.Test;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
+
 import io.restassured.RestAssured;
 import io.restassured.builder.RequestSpecBuilder;
 import io.restassured.http.ContentType;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/JWTAuthenticationStrategyTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/JWTAuthenticationStrategyTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/JWTAuthenticationStrategyTest.java
index 88b4239..7a7f740 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/JWTAuthenticationStrategyTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/JWTAuthenticationStrategyTest.java
@@ -20,7 +20,7 @@ package org.apache.james.jmap;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/UserProvisioningFilterTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/UserProvisioningFilterTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/UserProvisioningFilterTest.java
index 29e652b..79f1c34 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/UserProvisioningFilterTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/UserProvisioningFilterTest.java
@@ -19,8 +19,8 @@
 package org.apache.james.jmap;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/TextCalendarBodyToAttachmentTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/TextCalendarBodyToAttachmentTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/TextCalendarBodyToAttachmentTest.java
index 2484aa9..e10e953 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/TextCalendarBodyToAttachmentTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/TextCalendarBodyToAttachmentTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.mailet;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java
index ee978fa..8680ee2 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.mailet;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationReplyTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationReplyTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationReplyTest.java
index ae25317..e6f9e69 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationReplyTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationReplyTest.java
@@ -20,11 +20,11 @@
 package org.apache.james.jmap.mailet;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.argThat;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
 
 import java.util.Optional;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
index 9132571..c09d18e 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
@@ -19,7 +19,7 @@
 package org.apache.james.jmap.methods;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
index f237073..3973ed5 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMessagesMethodTest.java
@@ -20,7 +20,7 @@ package org.apache.james.jmap.methods;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java
index 6fea083..0c93184 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesCreationProcessorTest.java
@@ -21,8 +21,9 @@ package org.apache.james.jmap.methods;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
@@ -36,6 +37,7 @@ import org.apache.james.jmap.exceptions.MailboxNotOwnedException;
 import org.apache.james.jmap.model.CreationMessage;
 import org.apache.james.jmap.model.CreationMessage.DraftEmailer;
 import org.apache.james.jmap.model.CreationMessageId;
+import org.apache.james.jmap.model.Envelope;
 import org.apache.james.jmap.model.MessageFactory;
 import org.apache.james.jmap.model.MessagePreviewGenerator;
 import org.apache.james.jmap.model.SetMessagesRequest;
@@ -67,6 +69,7 @@ import org.apache.james.metrics.api.NoopMetricFactory;
 import org.apache.james.util.OptionalUtils;
 import org.apache.james.util.mime.MessageContentExtractor;
 import org.apache.mailet.Mail;
+import org.apache.mailet.base.test.FakeMail;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Rule;
@@ -118,6 +121,7 @@ public class SetMessagesCreationProcessorTest {
     private MessageAppender messageAppender;
     private MessageSender messageSender;
     private ReferenceUpdater referenceUpdater;
+    private MailFactory mockedMailFactory;
 
     @Before
     public void setUp() throws MailboxException {
@@ -129,7 +133,7 @@ public class SetMessagesCreationProcessorTest {
         when(blobManager.toBlobId(any(MessageId.class))).thenReturn(org.apache.james.mailbox.model.BlobId.fromString("fake"));
         messageFactory = new MessageFactory(blobManager, messagePreview, messageContentExtractor, htmlTextExtractor);
         mockedMailSpool = mock(MailSpool.class);
-        MailFactory mockedMailFactory = mock(MailFactory.class);
+        mockedMailFactory = mock(MailFactory.class);
         mockedAttachmentManager = mock(AttachmentManager.class);
         mockedMailboxManager = mock(MailboxManager.class);
         mockedMailboxIdFactory = mock(Factory.class);
@@ -272,11 +276,15 @@ public class SetMessagesCreationProcessorTest {
 
     @Test
     public void processShouldSendMailWhenRequestHasNonEmptyCreate() throws Exception {
+        FakeMail fakeMail = FakeMail.builder().sender(USER).build();
+        when(mockedMailFactory.build(any(MessageFactory.MetaDataWithContent.class), any(Envelope.class)))
+            .thenReturn(fakeMail);
+
         // When
         sut.process(createMessageInOutbox, session);
 
         // Then
-        verify(mockedMailSpool).send(any(Mail.class), any(MailMetadata.class));
+        verify(mockedMailSpool).send(eq(fakeMail), any(MailMetadata.class));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java
index 0d04935..8fde32d 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetMessagesUpdateProcessorTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.methods;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetVacationResponseMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetVacationResponseMethodTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetVacationResponseMethodTest.java
index cbbc554..595567a 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetVacationResponseMethodTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/SetVacationResponseMethodTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.jmap.methods;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchConverterTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchConverterTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchConverterTest.java
index 50ddcb5..931972c 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchConverterTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchConverterTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.methods;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchValidatorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchValidatorTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchValidatorTest.java
index c0c703e..413fefa 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchValidatorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/UpdateMessagePatchValidatorTest.java
@@ -20,8 +20,8 @@
 package org.apache.james.jmap.methods;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessageFactoryTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessageFactoryTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessageFactoryTest.java
index ef69791..a8ae758 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessageFactoryTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/MessageFactoryTest.java
@@ -19,7 +19,7 @@
 package org.apache.james.jmap.model;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java
index 776cd2b..5b1f468 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/MailFactoryTest.java
@@ -19,7 +19,7 @@
 package org.apache.james.jmap.send;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
index da27f4b..844ba85 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/send/PostDequeueDecoratorTest.java
@@ -19,8 +19,8 @@
 package org.apache.james.jmap.send;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SystemMailboxesProviderImplTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SystemMailboxesProviderImplTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SystemMailboxesProviderImplTest.java
index 7efcf9a..1427ed2 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SystemMailboxesProviderImplTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SystemMailboxesProviderImplTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.jmap.utils;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/webadmin/webadmin-cassandra/src/test/java/org/apache/james/webadmin/routes/CassandraMigrationRoutesTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-cassandra/src/test/java/org/apache/james/webadmin/routes/CassandraMigrationRoutesTest.java b/server/protocols/webadmin/webadmin-cassandra/src/test/java/org/apache/james/webadmin/routes/CassandraMigrationRoutesTest.java
index 1df072f..50cc86b 100644
--- a/server/protocols/webadmin/webadmin-cassandra/src/test/java/org/apache/james/webadmin/routes/CassandraMigrationRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-cassandra/src/test/java/org/apache/james/webadmin/routes/CassandraMigrationRoutesTest.java
@@ -26,8 +26,8 @@ import static org.apache.james.webadmin.WebAdminServer.NO_CONFIGURATION;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.notNullValue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
@@ -56,6 +56,7 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 import com.google.common.collect.ImmutableMap;
+
 import io.restassured.RestAssured;
 import io.restassured.http.ContentType;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d22e356/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DLPConfigurationRoutesTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DLPConfigurationRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DLPConfigurationRoutesTest.java
index ead7860..5228655 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DLPConfigurationRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DLPConfigurationRoutesTest.java
@@ -28,7 +28,7 @@ import static org.apache.james.webadmin.Constants.JSON_CONTENT_TYPE;
 import static org.apache.james.webadmin.WebAdminServer.NO_CONFIGURATION;
 import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.is;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 
 import java.net.InetAddress;


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