james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [james-project] 06/09: JAMES-2314 Fix some IntelliJ warnings in WebAdmin tests
Date Tue, 11 Jun 2019 13:22:36 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit bf94eadb2b1778a957c1a95071f93f844ed211d2
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Wed Jun 5 15:53:41 2019 +0700

    JAMES-2314 Fix some IntelliJ warnings in WebAdmin tests
---
 .../routes/CassandraMigrationRoutesTest.java       | 29 +++++-----
 .../webadmin/routes/HealthCheckRoutesTest.java     |  3 +-
 .../james/webadmin/routes/TasksRoutesTest.java     |  2 +-
 .../james/webadmin/routes/GroupsRoutesTest.java    |  2 +-
 .../webadmin/routes/SieveScriptRoutesTest.java     | 35 +++++-------
 .../webadmin/routes/UserMailboxesRoutesTest.java   |  2 +-
 .../james/webadmin/routes/MailQueueRoutesTest.java | 66 +++++++++++-----------
 .../routes/MailRepositoriesRoutesTest.java         |  2 +-
 8 files changed, 67 insertions(+), 74 deletions(-)

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 d94b2f7..1db9388 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
@@ -86,14 +86,14 @@ public class CassandraMigrationRoutesTest {
             new CassandraMigrationRoutes(new CassandraMigrationService(schemaVersionDAO,
allMigrationClazz, LATEST_VERSION),
                 taskManager, jsonTransformer),
             new TasksRoutes(taskManager, jsonTransformer));
-        
+
         RestAssured.requestSpecification = WebAdminUtils.buildRequestSpecification(webAdminServer)
             .setBasePath(CassandraMigrationRoutes.VERSION_BASE)
             .build();
     }
 
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         createServer();
     }
 
@@ -104,7 +104,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void getShouldReturnTheCurrentVersion() throws Exception {
+    public void getShouldReturnTheCurrentVersion() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(CURRENT_VERSION)));
 
         Integer version =
@@ -121,8 +121,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void getShouldReturnTheLatestVersionWhenSetUpTheLatestVersion() throws Exception
{
-
+    public void getShouldReturnTheLatestVersionWhenSetUpTheLatestVersion() {
         Integer version =
             when()
                 .get("/latest")
@@ -138,7 +137,7 @@ public class CassandraMigrationRoutesTest {
 
     @Ignore
     @Test
-    public void postShouldReturnConflictWhenMigrationOnRunning() throws Exception {
+    public void postShouldReturnConflictWhenMigrationOnRunning() {
         when()
             .post("/upgrade")
         .then()
@@ -146,7 +145,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void postShouldReturnErrorCodeWhenInvalidVersion() throws Exception {
+    public void postShouldReturnErrorCodeWhenInvalidVersion() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(OLDER_VERSION)));
 
         Map<String, Object> errors = given()
@@ -171,7 +170,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void postShouldDoMigrationToNewVersion() throws Exception {
+    public void postShouldDoMigrationToNewVersion() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(OLDER_VERSION)));
 
         String taskId = with()
@@ -193,7 +192,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void postShouldCreateTaskWhenCurrentVersionIsNewerThan() throws Exception {
+    public void postShouldCreateTaskWhenCurrentVersionIsNewerThan() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(CURRENT_VERSION)));
 
         String taskId =  given()
@@ -212,7 +211,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void postShouldNotUpdateVersionWhenCurrentVersionIsNewerThan() throws Exception
{
+    public void postShouldNotUpdateVersionWhenCurrentVersionIsNewerThan() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(CURRENT_VERSION)));
 
         String taskId =  given()
@@ -231,7 +230,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void postShouldDoMigrationToLatestVersion() throws Exception {
+    public void postShouldDoMigrationToLatestVersion() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(OLDER_VERSION)));
 
         String taskId = with()
@@ -250,7 +249,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void postShouldReturnTaskIdAndLocation() throws Exception {
+    public void postShouldReturnTaskIdAndLocation() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(OLDER_VERSION)));
 
         when()
@@ -261,7 +260,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void createdTaskShouldHaveDetails() throws Exception {
+    public void createdTaskShouldHaveDetails() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(OLDER_VERSION)));
 
         String taskId = with()
@@ -284,7 +283,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void postShouldCreateTaskWhenItIsUpToDate() throws Exception {
+    public void postShouldCreateTaskWhenItIsUpToDate() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(LATEST_VERSION)));
 
         String taskId = with()
@@ -301,7 +300,7 @@ public class CassandraMigrationRoutesTest {
     }
 
     @Test
-    public void postShouldNotUpdateVersionWhenItIsUpToDate() throws Exception {
+    public void postShouldNotUpdateVersionWhenItIsUpToDate() {
         when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(LATEST_VERSION)));
 
         String taskId = with()
diff --git a/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/HealthCheckRoutesTest.java
b/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/HealthCheckRoutesTest.java
index 5117d96..b15f6a4 100644
--- a/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/HealthCheckRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/HealthCheckRoutesTest.java
@@ -27,7 +27,6 @@ import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.nullValue;
 
-import java.net.MalformedURLException;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -379,7 +378,7 @@ public class HealthCheckRoutesTest {
     }
     
     @Test
-    public void performHealthCheckShouldWorkWithEscapedPathParam() throws MalformedURLException
{
+    public void performHealthCheckShouldWorkWithEscapedPathParam() {
         healthChecks.add(healthCheck(Result.healthy(COMPONENT_NAME_3)));
         
         // disable URL encoding
diff --git a/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java
b/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java
index d3a57fc..92877ce 100644
--- a/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java
@@ -52,7 +52,7 @@ class TasksRoutesTest {
     private WebAdminServer webAdminServer;
 
     @BeforeEach
-    void setUp() throws Exception {
+    void setUp() {
         taskManager = new MemoryTaskManager();
 
         webAdminServer = WebAdminUtils.createWebAdminServer(
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java
b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java
index 7119c80..cfe0a15 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java
@@ -675,7 +675,7 @@ class GroupsRoutesTest {
         }
 
         @Test
-        void getShouldReturnErrorWhenRuntimeExceptionIsThrown() throws Exception {
+        void getShouldReturnErrorWhenRuntimeExceptionIsThrown() {
             doThrow(RuntimeException.class)
                 .when(memoryRecipientRewriteTable)
                 .getStoredMappings(any());
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/SieveScriptRoutesTest.java
b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/SieveScriptRoutesTest.java
index d53e461..d2333d9 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/SieveScriptRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/SieveScriptRoutesTest.java
@@ -32,7 +32,6 @@ import java.io.InputStream;
 import java.net.URL;
 import java.nio.charset.StandardCharsets;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.io.IOUtils;
 import org.apache.james.core.User;
 import org.apache.james.filesystem.api.FileSystem;
@@ -42,10 +41,8 @@ import org.apache.james.sieverepository.api.ScriptContent;
 import org.apache.james.sieverepository.api.ScriptName;
 import org.apache.james.sieverepository.api.SieveRepository;
 import org.apache.james.sieverepository.api.exception.ScriptNotFoundException;
-import org.apache.james.sieverepository.api.exception.StorageException;
 import org.apache.james.sieverepository.file.SieveFileRepository;
 import org.apache.james.user.api.UsersRepository;
-import org.apache.james.user.api.UsersRepositoryException;
 import org.apache.james.user.memory.MemoryUsersRepository;
 import org.apache.james.webadmin.WebAdminServer;
 import org.apache.james.webadmin.WebAdminUtils;
@@ -58,17 +55,15 @@ import org.junit.jupiter.api.extension.ExtendWith;
 import io.restassured.RestAssured;
 
 @ExtendWith(TemporaryFolderExtension.class)
-public class SieveScriptRoutesTest {
+class SieveScriptRoutesTest {
 
-    private FileSystem fileSystem;
     private WebAdminServer webAdminServer;
     private SieveRepository sieveRepository;
-    private UsersRepository usersRepository;
     private String sieveContent;
 
     @BeforeEach
-    public void setUp(TemporaryFolderExtension.TemporaryFolder temporaryFolder) throws ConfigurationException,
IOException, UsersRepositoryException {
-        this.fileSystem = new FileSystem() {
+    void setUp(TemporaryFolderExtension.TemporaryFolder temporaryFolder) throws Exception
{
+        FileSystem fileSystem = new FileSystem() {
             @Override
             public File getBasedir() {
                 return temporaryFolder.getTempDir();
@@ -86,7 +81,7 @@ public class SieveScriptRoutesTest {
         };
 
         sieveRepository = new SieveFileRepository(fileSystem);
-        usersRepository = MemoryUsersRepository.withoutVirtualHosting();
+        UsersRepository usersRepository = MemoryUsersRepository.withoutVirtualHosting();
         usersRepository.addUser("userA", "password");
 
         URL sieveResource = ClassLoader.getSystemResource("sieve/my_sieve");
@@ -102,12 +97,12 @@ public class SieveScriptRoutesTest {
     }
 
     @AfterEach
-    public void tearDown() {
+    void tearDown() {
         webAdminServer.destroy();
     }
 
     @Test
-    public void defineAddActiveSieveScriptShouldReturnNotFoundWhenUserNotExisted() throws
IOException {
+    void defineAddActiveSieveScriptShouldReturnNotFoundWhenUserNotExisted() {
         given()
             .pathParam("userName", "unknown")
             .pathParam("scriptName", "scriptA")
@@ -119,7 +114,7 @@ public class SieveScriptRoutesTest {
     }
 
     @Test
-    public void defineAddActiveSieveScriptShouldReturnNotFoundWhenScriptNameIsWhiteSpace()
throws IOException {
+    void defineAddActiveSieveScriptShouldReturnNotFoundWhenScriptNameIsWhiteSpace() {
         String errorBody =
             "{\"statusCode\": 400," +
             " \"type\":\"InvalidArgument\"," +
@@ -141,7 +136,7 @@ public class SieveScriptRoutesTest {
     }
 
     @Test
-    public void defineAddActiveSieveScriptShouldReturnNotFoundWhenUserNameWhiteSpace() {
+    void defineAddActiveSieveScriptShouldReturnNotFoundWhenUserNameWhiteSpace() {
         String errorBody =
             "{\"statusCode\": 400," +
             " \"type\":\"InvalidArgument\"," +
@@ -163,7 +158,7 @@ public class SieveScriptRoutesTest {
     }
 
     @Test
-    public void defineAddActiveSieveScriptShouldReturnBadRequestWhenScriptIsNotSet() {
+    void defineAddActiveSieveScriptShouldReturnBadRequestWhenScriptIsNotSet() {
         given()
             .pathParam("userName", "userA")
             .pathParam("scriptName", "scriptA")
@@ -174,7 +169,7 @@ public class SieveScriptRoutesTest {
     }
 
     @Test
-    public void defineAddActiveSieveScriptShouldReturnSucceededWhenScriptIsWhiteSpace() throws
ScriptNotFoundException, StorageException, IOException {
+     void defineAddActiveSieveScriptShouldReturnSucceededWhenScriptIsWhiteSpace() throws
Exception {
         given()
             .pathParam("userName", "userA")
             .pathParam("scriptName", "scriptA")
@@ -190,7 +185,7 @@ public class SieveScriptRoutesTest {
     }
 
     @Test
-    public void defineAddActiveSieveScriptAddScriptSucceededOneWhenNotAddActivateParam()
throws Exception {
+    void defineAddActiveSieveScriptAddScriptSucceededOneWhenNotAddActivateParam() throws
Exception {
         given()
             .pathParam("userName", "userA")
             .pathParam("scriptName", "scriptA")
@@ -206,7 +201,7 @@ public class SieveScriptRoutesTest {
     }
 
     @Test
-    public void defineAddActiveSieveScriptSetActiveTrueWhenAddActivateParamTrue() throws
Exception {
+    void defineAddActiveSieveScriptSetActiveTrueWhenAddActivateParamTrue() throws Exception
{
         given()
             .pathParam("userName", "userA")
             .pathParam("scriptName", "scriptA")
@@ -223,7 +218,7 @@ public class SieveScriptRoutesTest {
     }
 
     @Test
-    public void defineAddActiveSieveScriptGetActiveShouldThrowsExceptionWhenAddActivateParamFalse()
{
+    void defineAddActiveSieveScriptGetActiveShouldThrowsExceptionWhenAddActivateParamFalse()
{
         given()
             .pathParam("userName", "userA")
             .pathParam("scriptName", "scriptA")
@@ -239,7 +234,7 @@ public class SieveScriptRoutesTest {
     }
 
     @Test
-    public void defineAddActiveSieveScriptInvokeShouldReturnBadRequestWhenAddActivateParamWithNotBooleanValue()
{
+    void defineAddActiveSieveScriptInvokeShouldReturnBadRequestWhenAddActivateParamWithNotBooleanValue()
{
         given()
             .pathParam("userName", "userA")
             .pathParam("scriptName", "scriptA")
@@ -252,7 +247,7 @@ public class SieveScriptRoutesTest {
             .body("message", equalTo("Invalid activate query parameter"));
     }
 
-    protected ScriptContent getScriptContent(InputStream inputStream) throws IOException
{
+    ScriptContent getScriptContent(InputStream inputStream) throws IOException {
         return new ScriptContent(IOUtils.toString(inputStream, StandardCharsets.UTF_8));
     }
 }
diff --git a/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/UserMailboxesRoutesTest.java
b/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/UserMailboxesRoutesTest.java
index 4441d10..890323d 100644
--- a/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/UserMailboxesRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/UserMailboxesRoutesTest.java
@@ -63,9 +63,9 @@ import io.restassured.RestAssured;
 import io.restassured.http.ContentType;
 
 class UserMailboxesRoutesTest {
-
     private static final String USERNAME = "username";
     private static final String MAILBOX_NAME = "myMailboxName";
+
     private WebAdminServer webAdminServer;
     private UsersRepository usersRepository;
 
diff --git a/server/protocols/webadmin/webadmin-mailqueue/src/test/java/org/apache/james/webadmin/routes/MailQueueRoutesTest.java
b/server/protocols/webadmin/webadmin-mailqueue/src/test/java/org/apache/james/webadmin/routes/MailQueueRoutesTest.java
index 5f30300..45f2db1 100644
--- a/server/protocols/webadmin/webadmin-mailqueue/src/test/java/org/apache/james/webadmin/routes/MailQueueRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-mailqueue/src/test/java/org/apache/james/webadmin/routes/MailQueueRoutesTest.java
@@ -66,7 +66,7 @@ import io.restassured.builder.RequestSpecBuilder;
 import io.restassured.http.ContentType;
 import io.restassured.specification.RequestSpecification;
 
-public class MailQueueRoutesTest {
+class MailQueueRoutesTest {
 
     static final String FIRST_QUEUE = "first one";
     static final String SECOND_QUEUE = "second one";
@@ -106,7 +106,7 @@ public class MailQueueRoutesTest {
     }
 
     @BeforeEach
-    public void setUp() throws Exception {
+    void setUp() {
         mailQueueFactory = new MemoryMailQueueFactory(new RawMailQueueItemDecoratorFactory());
         webAdminServer = createServer(mailQueueFactory);
         RestAssured.requestSpecification = buildRequestSpecification(webAdminServer);
@@ -114,7 +114,7 @@ public class MailQueueRoutesTest {
     }
 
     @AfterEach
-    public void tearDown() {
+    void tearDown() {
         webAdminServer.destroy();
     }
 
@@ -124,7 +124,7 @@ public class MailQueueRoutesTest {
         @Nested
         class DataValidation {
             @Test
-            public void listMailsShouldReturnBadRequestWhenLimitIsLessThanZero() throws Exception
{
+            void listMailsShouldReturnBadRequestWhenLimitIsLessThanZero() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -136,7 +136,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void listMailsShouldReturnBadRequestWhenLimitEqualsToZero() throws Exception
{
+            void listMailsShouldReturnBadRequestWhenLimitEqualsToZero() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -148,7 +148,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void listMailsShouldReturnBadRequestWhenLimitIsInvalid() throws Exception
{
+            void listMailsShouldReturnBadRequestWhenLimitIsInvalid() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -164,7 +164,7 @@ public class MailQueueRoutesTest {
         class HttpBodies {
 
             @Test
-            public void listAllMailQueuesShouldReturnEmptyWhenNone() {
+            void listAllMailQueuesShouldReturnEmptyWhenNone() {
                 List<String> actual = when()
                     .get()
                 .then()
@@ -179,7 +179,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void listAllMailQueuesShouldReturnSingleElementListWhenOnlyOneMailQueue()
{
+            void listAllMailQueuesShouldReturnSingleElementListWhenOnlyOneMailQueue() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 List<String> actual = when()
@@ -196,7 +196,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void listAllMailQueuesShouldReturnListWhenSeveralMailQueues() {
+            void listAllMailQueuesShouldReturnListWhenSeveralMailQueues() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
                 mailQueueFactory.createQueue(SECOND_QUEUE);
                 mailQueueFactory.createQueue(THIRD_QUEUE);
@@ -216,7 +216,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void listMailsShouldReturnEmptyListWhenNoMails() {
+            void listMailsShouldReturnEmptyListWhenNoMails() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 when()
@@ -348,7 +348,7 @@ public class MailQueueRoutesTest {
         }
 
         @Test
-        public void getMailQueueShouldReturnNotFoundWhenMailQueueDoesntExist() {
+        void getMailQueueShouldReturnNotFoundWhenMailQueueDoesntExist() {
             when()
                 .get(FIRST_QUEUE)
             .then()
@@ -363,7 +363,7 @@ public class MailQueueRoutesTest {
         class DataValidation {
 
             @Test
-            public void forcingDelayedMailsDeliveryShouldReturnNoContent() throws Exception
{
+            void forcingDelayedMailsDeliveryShouldReturnNoContent() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -376,7 +376,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryForUnknownQueueShouldReturnNotFound()
throws Exception {
+            void forcingDelayedMailsDeliveryForUnknownQueueShouldReturnNotFound() {
                 given()
                     .queryParam("delayed", "true")
                     .body("{\"delayed\": \"false\"}")
@@ -387,7 +387,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryRequiresDelayedParameter() throws Exception
{
+            void forcingDelayedMailsDeliveryRequiresDelayedParameter() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -399,7 +399,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryShouldRejectFalseDelayedParam() throws
Exception {
+            void forcingDelayedMailsDeliveryShouldRejectFalseDelayedParam() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -412,7 +412,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryShouldRejectNonBooleanDelayedParam() throws
Exception {
+            void forcingDelayedMailsDeliveryShouldRejectNonBooleanDelayedParam() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -425,7 +425,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryShouldRejectRequestWithoutBody() throws
Exception {
+            void forcingDelayedMailsDeliveryShouldRejectRequestWithoutBody() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -437,7 +437,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryShouldRejectRequestWithoutDelayedParameter()
throws Exception {
+            void forcingDelayedMailsDeliveryShouldRejectRequestWithoutDelayedParameter()
{
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -450,7 +450,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryShouldAcceptRequestWithUnknownFields()
throws Exception {
+            void forcingDelayedMailsDeliveryShouldAcceptRequestWithUnknownFields() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -466,7 +466,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryShouldRejectMalformedJsonPayload() throws
Exception {
+            void forcingDelayedMailsDeliveryShouldRejectMalformedJsonPayload() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -479,7 +479,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryShouldRejectTrueDelayedAttribute() throws
Exception {
+            void forcingDelayedMailsDeliveryShouldRejectTrueDelayedAttribute() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -492,7 +492,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void forcingDelayedMailsDeliveryShouldRejectStringDelayedAttribute() throws
Exception {
+            void forcingDelayedMailsDeliveryShouldRejectStringDelayedAttribute() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -539,7 +539,7 @@ public class MailQueueRoutesTest {
         class DataValidation {
 
             @Test
-            public void deleteMailsShouldReturnNotFoundWhenMailQueueDoesntExist() {
+            void deleteMailsShouldReturnNotFoundWhenMailQueueDoesntExist() {
                 when()
                     .delete(FIRST_QUEUE + "/mails")
                 .then()
@@ -547,7 +547,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void deleteMailsShouldReturnBadRequestWhenSenderIsInvalid() {
+            void deleteMailsShouldReturnBadRequestWhenSenderIsInvalid() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -559,7 +559,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void deleteMailsShouldReturnBadRequestWhenRecipientIsInvalid() {
+            void deleteMailsShouldReturnBadRequestWhenRecipientIsInvalid() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 given()
@@ -571,7 +571,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void deleteMailsShouldReturnBadRequestWhenAllParametersAreGiven() throws
Exception {
+            void deleteMailsShouldReturnBadRequestWhenAllParametersAreGiven() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
                 given()
                     .param("sender", "sender@james.org")
@@ -584,7 +584,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void deleteMailsShouldReturnBadRequestWhenTwoParametersAreGiven() throws
Exception {
+            void deleteMailsShouldReturnBadRequestWhenTwoParametersAreGiven() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
                 given()
                     .param("sender", "sender@james.org")
@@ -600,7 +600,7 @@ public class MailQueueRoutesTest {
         class HttpBodies {
 
             @Test
-            public void deleteMailsTasksShouldCompleteWhenSenderIsValid() throws Exception
{
+            void deleteMailsTasksShouldCompleteWhenSenderIsValid() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 String taskId = with()
@@ -618,7 +618,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void deleteMailsShouldCompleteWhenNameIsValid() {
+            void deleteMailsShouldCompleteWhenNameIsValid() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 String taskId = with()
@@ -636,7 +636,7 @@ public class MailQueueRoutesTest {
             }
 
             @Test
-            public void deleteMailsShouldCompleteWhenRecipientIsValid() {
+            void deleteMailsShouldCompleteWhenRecipientIsValid() {
                 mailQueueFactory.createQueue(FIRST_QUEUE);
 
                 String taskId = with()
@@ -912,7 +912,7 @@ public class MailQueueRoutesTest {
     class ClearMail {
 
         @Test
-        public void clearMailQueueShouldReturnNotFoundWhenMailQueueDoesNotExist() throws
Exception {
+        void clearMailQueueShouldReturnNotFoundWhenMailQueueDoesNotExist() {
             mailQueueFactory.createQueue(FIRST_QUEUE);
 
             when()
@@ -922,7 +922,7 @@ public class MailQueueRoutesTest {
         }
 
         @Test
-        public void clearMailQueueShouldCompleteWhenNoQueryParameters() {
+        void clearMailQueueShouldCompleteWhenNoQueryParameters() {
             mailQueueFactory.createQueue(FIRST_QUEUE);
 
             String taskId = with()
@@ -976,7 +976,7 @@ public class MailQueueRoutesTest {
         }
 
         @Test
-        public void clearMailQueueShouldDeleteAllMailsInQueueWhenNoQueryParameters() throws
Exception {
+        void clearMailQueueShouldDeleteAllMailsInQueueWhenNoQueryParameters() throws Exception
{
             MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
 
             queue.enQueue(FakeMail.builder()
diff --git a/server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
b/server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
index b4291a7..184e801 100644
--- a/server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
@@ -154,7 +154,7 @@ public class MailRepositoriesRoutesTest {
     }
 
     @Test
-    public void putMailRepositoryShouldReturnOkWhenRepositoryAlreadyExists() throws Exception
{
+    public void putMailRepositoryShouldReturnOkWhenRepositoryAlreadyExists() {
         given()
             .params("protocol", "memory")
         .when()


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