james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [09/10] james-project git commit: MAILBOX-351 ReIndexerRoutes: Fail with not found upon unknown mailboxes
Date Thu, 29 Nov 2018 03:53:23 GMT
MAILBOX-351 ReIndexerRoutes: Fail with not found upon unknown mailboxes


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

Branch: refs/heads/master
Commit: 1d57440765f10feeeaab08a19d79e7e499053078
Parents: f1f981a
Author: Benoit Tellier <btellier@linagora.com>
Authored: Wed Nov 28 15:50:18 2018 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Thu Nov 29 10:52:45 2018 +0700

----------------------------------------------------------------------
 .../apache/james/webadmin/routes/ReindexingRoutes.java  |  4 ++--
 .../james/webadmin/routes/ReindexingRoutesTest.java     | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/1d574407/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/routes/ReindexingRoutes.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/routes/ReindexingRoutes.java
b/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/routes/ReindexingRoutes.java
index ffb7d98..28b10cc 100644
--- a/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/routes/ReindexingRoutes.java
+++ b/server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/routes/ReindexingRoutes.java
@@ -232,8 +232,8 @@ public class ReindexingRoutes implements Routes {
             return TaskIdDto.respond(response, taskId);
         } catch (MailboxNotFoundException e) {
             throw ErrorResponder.builder()
-                .statusCode(HttpStatus.BAD_REQUEST_400)
-                .type(ErrorResponder.ErrorType.INVALID_ARGUMENT)
+                .statusCode(HttpStatus.NOT_FOUND_404)
+                .type(ErrorResponder.ErrorType.NOT_FOUND)
                 .message("mailbox not found")
                 .cause(e)
                 .haltError();

http://git-wip-us.apache.org/repos/asf/james-project/blob/1d574407/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ReindexingRoutesTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ReindexingRoutesTest.java
b/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ReindexingRoutesTest.java
index f5e9382..38d0205 100644
--- a/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ReindexingRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ReindexingRoutesTest.java
@@ -416,9 +416,9 @@ class ReindexingRoutesTest {
                 when()
                     .post("/mailboxIndex/mailboxes/36?task=reIndex")
                 .then()
-                    .statusCode(HttpStatus.BAD_REQUEST_400)
-                    .body("statusCode", is(400))
-                    .body("type", is(ErrorResponder.ErrorType.INVALID_ARGUMENT.getType()))
+                    .statusCode(HttpStatus.NOT_FOUND_404)
+                    .body("statusCode", is(404))
+                    .body("type", is(ErrorResponder.ErrorType.NOT_FOUND.getType()))
                     .body("message", is("mailbox not found"));
             }
         }
@@ -570,9 +570,9 @@ class ReindexingRoutesTest {
                 when()
                     .post("/mailboxIndex/mailboxes/36/mails/7?task=reIndex")
                 .then()
-                    .statusCode(HttpStatus.BAD_REQUEST_400)
-                    .body("statusCode", is(400))
-                    .body("type", is(ErrorResponder.ErrorType.INVALID_ARGUMENT.getType()))
+                    .statusCode(HttpStatus.NOT_FOUND_404)
+                    .body("statusCode", is(404))
+                    .body("type", is(ErrorResponder.ErrorType.NOT_FOUND.getType()))
                     .body("message", is("mailbox not found"));
             }
 


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