JAMES-2366 migration RegexRewriterTest to junit 5

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

Branch: refs/heads/master
Commit: f0ce9cc7d8dda486628f5bd8140a8626a77bfe85
Parents: a7a8735
Author: Matthieu Baechler <matth...@apache.org>
Authored: Fri Apr 20 15:14:22 2018 +0200
Committer: Matthieu Baechler <matth...@apache.org>
Committed: Tue Apr 24 14:49:33 2018 +0200

----------------------------------------------------------------------
 .../apache/james/rrt/lib/RegexRewriterTest.java | 21 ++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/f0ce9cc7/server/data/data-api/src/test/java/org/apache/james/rrt/lib/RegexRewriterTest.java
----------------------------------------------------------------------
diff --git 
a/server/data/data-api/src/test/java/org/apache/james/rrt/lib/RegexRewriterTest.java
 
b/server/data/data-api/src/test/java/org/apache/james/rrt/lib/RegexRewriterTest.java
index b8682a3..30be389 100644
--- 
a/server/data/data-api/src/test/java/org/apache/james/rrt/lib/RegexRewriterTest.java
+++ 
b/server/data/data-api/src/test/java/org/apache/james/rrt/lib/RegexRewriterTest.java
@@ -27,56 +27,57 @@ import java.util.regex.PatternSyntaxException;
 import org.apache.james.core.MailAddress;
 import org.junit.jupiter.api.Test;
 
-public class RegexRewriterTest {
+class RegexRewriterTest {
+    
     @Test
-    public void regexMapShouldCorrectlyReplaceMatchingUsername() throws 
Exception {
+    void regexMapShouldCorrectlyReplaceMatchingUsername() throws Exception {
         MailAddress mailAddress = new MailAddress("prefix_abc@test");
         assertThat(new 
UserRewritter.RegexRewriter().regexMap(mailAddress,"prefix_.*:admin@test"))
             .contains("admin@test");
     }
 
     @Test
-    public void regexMapShouldThrowOnNullAddress() throws Exception {
+    void regexMapShouldThrowOnNullAddress() throws Exception {
         MailAddress address = null;
         assertThatThrownBy(() -> new 
UserRewritter.RegexRewriter().regexMap(address, "prefix_.*:admin@test"))
             .isInstanceOf(NullPointerException.class);
     }
 
     @Test
-    public void regexMapShouldThrowOnNullRegexMapping() throws Exception {
+    void regexMapShouldThrowOnNullRegexMapping() throws Exception {
         String regexMapping = null;
         assertThatThrownBy(() -> new 
UserRewritter.RegexRewriter().regexMap(new MailAddress("abc@test"), 
regexMapping))
             .isInstanceOf(NullPointerException.class);
     }
 
     @Test
-    public void regexMapShouldThrowOnInvalidSyntax() throws Exception {
+    void regexMapShouldThrowOnInvalidSyntax() throws Exception {
         assertThatThrownBy(() -> new 
UserRewritter.RegexRewriter().regexMap(new MailAddress("abc@test"), 
"singlepart"))
             .isInstanceOf(PatternSyntaxException.class);
     }
 
     @Test
-    public void regexMapShouldReturnInputWhenRegexDoesntMatch() throws 
Exception {
+    void regexMapShouldReturnInputWhenRegexDoesntMatch() throws Exception {
         assertThat(new UserRewritter.RegexRewriter().regexMap(new 
MailAddress("abc@test"), "notmatching:notreplaced"))
             .isEmpty();
     }
 
     @Test
-    public void regexMapShouldCorrectlyReplaceMatchingGroups() throws 
Exception {
+    void regexMapShouldCorrectlyReplaceMatchingGroups() throws Exception {
         MailAddress mailAddress = new MailAddress("prefix_abc@test");
         assertThat(new UserRewritter.RegexRewriter().regexMap(mailAddress, 
"prefix_(.*)@test:admin@${1}"))
             .contains("admin@abc");
     }
 
     @Test
-    public void regexMapShouldCorrectlyReplaceSeveralMatchingGroups() throws 
Exception {
+    void regexMapShouldCorrectlyReplaceSeveralMatchingGroups() throws 
Exception {
         MailAddress mailAddress = new MailAddress("prefix_abc_def@test");
         assertThat(new UserRewritter.RegexRewriter().regexMap(mailAddress, 
"prefix_(.*)_(.*)@test:admin@${1}.${2}"))
             .contains("ad...@abc.def");
     }
 
     @Test
-    public void 
regexMapShouldCorrectlyReplaceSeveralOutOfOrderMatchingGroups() throws 
Exception {
+    void regexMapShouldCorrectlyReplaceSeveralOutOfOrderMatchingGroups() 
throws Exception {
         MailAddress mailAddress = new MailAddress("prefix_abc_def@test");
         assertThat(new UserRewritter.RegexRewriter().regexMap(mailAddress, 
"prefix_(.*)_(.*)@test:admin@${2}.${1}"))
             .contains("ad...@def.abc");
@@ -84,7 +85,7 @@ public class RegexRewriterTest {
 
 
     @Test
-    public void regexMapShouldCorrectlyReplaceRepeatingMatchingGroups() throws 
Exception {
+    void regexMapShouldCorrectlyReplaceRepeatingMatchingGroups() throws 
Exception {
         MailAddress mailAddress = new MailAddress("prefix_abc_def@test");
         assertThat(new UserRewritter.RegexRewriter().regexMap(mailAddress, 
"prefix_(.*)_(.*)@test:admin@${1}.${1}"))
             .contains("ad...@abc.abc");


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to