This is an automated email from the ASF dual-hosted git repository.

chibenwa pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 1deeab017de5af711e2c3580fdbf7784469be046
Author: Quan Tran <[email protected]>
AuthorDate: Thu Jun 4 14:22:06 2026 +0700

    [REFACTORING] Split IMAPServerAppendLimitTest
---
 .../netty/IMAPServerAppendLimitTest.java           | 100 +++++++++++++++++++++
 .../james/imapserver/netty/IMAPServerTest.java     |  70 ---------------
 2 files changed, 100 insertions(+), 70 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerAppendLimitTest.java
 
b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerAppendLimitTest.java
new file mode 100644
index 0000000000..53ad89ba87
--- /dev/null
+++ 
b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerAppendLimitTest.java
@@ -0,0 +1,100 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.imapserver.netty;
+
+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 org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+
+@SuppressWarnings("checkstyle:membername")
+class IMAPServerAppendLimitTest extends AbstractIMAPServerTest {
+    IMAPServer imapServer;
+    private int port;
+
+    @BeforeEach
+    void beforeEach() throws Exception {
+        imapServer = createImapServer("imapServer.xml");
+        port = imapServer.getListenAddresses().get(0).getPort();
+    }
+
+    @AfterEach
+    void tearDown() {
+        imapServer.destroy();
+    }
+
+    @Test
+    void smallAppendsShouldWork() throws Exception {
+        assertThatCode(() ->
+            testIMAPClient.connect("127.0.0.1", port)
+                .login(USER.asString(), USER_PASS)
+                .append("INBOX", SMALL_MESSAGE))
+            .doesNotThrowAnyException();
+
+        assertThat(testIMAPClient.select("INBOX")
+            .readFirstMessage())
+            .contains("\r\n" + SMALL_MESSAGE + ")\r\n");
+    }
+
+    @Test
+    void mediumAppendsShouldWork() throws Exception {
+        assertThatCode(() ->
+            testIMAPClient.connect("127.0.0.1", port)
+                .login(USER.asString(), USER_PASS)
+                .append("INBOX", _65K_MESSAGE))
+            .doesNotThrowAnyException();
+
+        assertThat(testIMAPClient.select("INBOX")
+            .readFirstMessage())
+            .contains("\r\n" + _65K_MESSAGE + ")\r\n");
+    }
+
+    @Test
+    void largeAppendsShouldBeRejected() {
+        assertThatThrownBy(() ->
+            testIMAPClient.connect("127.0.0.1", port)
+                .login(USER.asString(), USER_PASS)
+                .append("INBOX", _129K_MESSAGE))
+            .isInstanceOf(RuntimeException.class)
+            .hasMessageContaining("BAD APPEND failed.");
+    }
+
+    @Test
+    void capabilityAdvertizeAppendLimit() throws Exception {
+        assertThat(
+            testIMAPClient.connect("127.0.0.1", port)
+                .login(USER.asString(), USER_PASS)
+                .capability())
+            .contains("APPENDLIMIT=131072");
+    }
+
+    @Test
+    void statusAdvertizeAppendLimit() throws Exception {
+        assertThat(
+            testIMAPClient.connect("127.0.0.1", port)
+                .login(USER.asString(), USER_PASS)
+                .sendCommand("STATUS \"INBOX\" (APPENDLIMIT)"))
+            .contains("* STATUS \"INBOX\" (APPENDLIMIT 131072)");
+    }
+}
diff --git 
a/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
 
b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
index 267c9476ab..f237fc6c62 100644
--- 
a/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
+++ 
b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
@@ -256,76 +256,6 @@ class IMAPServerTest {
 
 
 
-    @Nested
-    class Limit {
-        IMAPServer imapServer;
-        private int port;
-
-        @BeforeEach
-        void beforeEach() throws Exception {
-            imapServer = createImapServer("imapServer.xml");
-            port = imapServer.getListenAddresses().get(0).getPort();
-        }
-
-        @AfterEach
-        void tearDown() {
-            imapServer.destroy();
-        }
-
-        @Test
-        void smallAppendsShouldWork() throws Exception {
-            assertThatCode(() ->
-                testIMAPClient.connect("127.0.0.1", port)
-                    .login(USER.asString(), USER_PASS)
-                    .append("INBOX", SMALL_MESSAGE))
-                .doesNotThrowAnyException();
-
-            assertThat(testIMAPClient.select("INBOX")
-                .readFirstMessage())
-                .contains("\r\n" + SMALL_MESSAGE + ")\r\n");
-        }
-
-        @Test
-        void mediumAppendsShouldWork() throws Exception {
-            assertThatCode(() ->
-                testIMAPClient.connect("127.0.0.1", port)
-                    .login(USER.asString(), USER_PASS)
-                    .append("INBOX", _65K_MESSAGE))
-                .doesNotThrowAnyException();
-
-            assertThat(testIMAPClient.select("INBOX")
-                .readFirstMessage())
-                .contains("\r\n" + _65K_MESSAGE + ")\r\n");
-        }
-
-        @Test
-        void largeAppendsShouldBeRejected() {
-            assertThatThrownBy(() ->
-                testIMAPClient.connect("127.0.0.1", port)
-                    .login(USER.asString(), USER_PASS)
-                    .append("INBOX", _129K_MESSAGE))
-                .isInstanceOf(RuntimeException.class)
-                .hasMessageContaining("BAD APPEND failed.");
-        }
-
-        @Test
-        void capabilityAdvertizeAppendLimit() throws Exception {
-            assertThat(
-                testIMAPClient.connect("127.0.0.1", port)
-                    .login(USER.asString(), USER_PASS)
-                    .capability())
-                .contains("APPENDLIMIT=131072");
-        }
-
-        @Test
-        void statusAdvertizeAppendLimit() throws Exception {
-            assertThat(
-                testIMAPClient.connect("127.0.0.1", port)
-                    .login(USER.asString(), USER_PASS)
-                    .sendCommand("STATUS \"INBOX\" (APPENDLIMIT)"))
-                .contains("* STATUS \"INBOX\" (APPENDLIMIT 131072)");
-        }
-    }
 
     @Nested
     class AdminUsers {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to