This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 84958ae88deaabde0d20f011721dd9dc7b3a922b Author: datph <[email protected]> AuthorDate: Tue Apr 2 15:38:50 2019 +0700 JAMES-2706 Refactor LocalDeliveryTest with non-mock test --- .../apache/james/transport/mailets/delivery/LocalDeliveryTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 747babd..30816cc 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 @@ -20,7 +20,6 @@ package org.apache.james.transport.mailets.delivery; 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; @@ -38,8 +37,8 @@ import org.apache.james.mailbox.MailboxManager; import org.apache.james.mailbox.MailboxSession; import org.apache.james.mailbox.MessageManager; import org.apache.james.mailbox.model.MailboxPath; -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.transport.mailets.LocalDelivery; import org.apache.james.user.api.UsersRepository; import org.apache.mailet.Mail; @@ -64,8 +63,7 @@ public class LocalDeliveryTest { usersRepository = mock(UsersRepository.class); mailboxManager = mock(MailboxManager.class); - MetricFactory metricFactory = mock(MetricFactory.class); - when(metricFactory.generate(anyString())).thenReturn(mock(Metric.class)); + MetricFactory metricFactory = new NoopMetricFactory(); testee = new LocalDelivery(usersRepository, mailboxManager, metricFactory); session = mock(MailboxSession.class); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
