You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rc...@apache.org on 2020/07/28 03:20:33 UTC
[james-project] 05/25: [Refactoring] Migrate MatcherInverterTest to
Junit 5
This is an automated email from the ASF dual-hosted git repository.
rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit fe001cef1953af268b4ce413cc01c99eb5ef174a
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Fri Jul 24 14:55:10 2020 +0700
[Refactoring] Migrate MatcherInverterTest to Junit 5
---
.../java/org/apache/mailet/base/MatcherInverterTest.java | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/mailet/base/src/test/java/org/apache/mailet/base/MatcherInverterTest.java b/mailet/base/src/test/java/org/apache/mailet/base/MatcherInverterTest.java
index 0bd29f7..68cd987 100644
--- a/mailet/base/src/test/java/org/apache/mailet/base/MatcherInverterTest.java
+++ b/mailet/base/src/test/java/org/apache/mailet/base/MatcherInverterTest.java
@@ -29,19 +29,19 @@ import javax.mail.MessagingException;
import org.apache.james.core.MailAddress;
import org.apache.mailet.Mail;
import org.apache.mailet.base.test.FakeMail;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class MatcherInverterTest {
+class MatcherInverterTest {
@Test
- public void testAllMatch() throws MessagingException {
+ void testAllMatch() throws MessagingException {
MatcherInverter inverter = new MatcherInverter(new GenericMatcher() {
-
@Override
public Collection<MailAddress> match(Mail mail) throws MessagingException {
return null;
}
});
+
FakeMail mail = FakeMail.builder()
.name("mail")
.recipient(new MailAddress("user", "domain"))
@@ -51,7 +51,7 @@ public class MatcherInverterTest {
}
@Test
- public void testNonMatch() throws MessagingException {
+ void testNonMatch() throws MessagingException {
final MailAddress address1 = new MailAddress("user", "domain");
final MailAddress address2 = new MailAddress("user", "domain2");
@@ -62,6 +62,7 @@ public class MatcherInverterTest {
return mail.getRecipients();
}
});
+
FakeMail mail = FakeMail.builder()
.name("mail")
.recipients(address1, address2)
@@ -71,17 +72,17 @@ public class MatcherInverterTest {
}
@Test
- public void testOneMatch() throws MessagingException {
+ void testOneMatch() throws MessagingException {
final MailAddress address1 = new MailAddress("user", "domain");
final MailAddress address2 = new MailAddress("user", "domain2");
MatcherInverter inverter = new MatcherInverter(new GenericMatcher() {
-
@Override
public Collection<MailAddress> match(Mail mail) throws MessagingException {
return Arrays.asList(address1);
}
});
+
FakeMail mail = FakeMail.builder()
.name("mail")
.recipients(address1, address2)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org