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 bt...@apache.org on 2019/06/05 03:01:30 UTC

[james-project] 04/06: JAMES-2777 WebAdmin routes; more tests upon Task cancellation

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

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

commit e37240899d3961bbea2a42e116f82f32de831fb6
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri May 31 14:56:44 2019 +0700

    JAMES-2777 WebAdmin routes; more tests upon Task cancellation
---
 .../james/webadmin/routes/TasksRoutesTest.java     | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

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 de01cde..c345466 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
@@ -191,6 +191,37 @@ class TasksRoutesTest {
     }
 
     @Test
+    void getAwaitShouldNotFailUponError() {
+        TaskId taskId = taskManager.submit(() -> {
+            throw new RuntimeException();
+        });
+
+        when()
+            .get("/" + taskId.getValue() + "/await")
+        .then()
+            .statusCode(HttpStatus.OK_200)
+            .body("status", is("failed"));
+    }
+
+    @Test
+    void getAwaitShouldNotFailUponFutureError() {
+        TaskId taskId = taskManager.submit(() -> {
+            try {
+                Thread.sleep(200);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            throw new RuntimeException();
+        });
+
+        when()
+            .get("/" + taskId.getValue() + "/await")
+        .then()
+            .statusCode(HttpStatus.OK_200)
+            .body("status", is("failed"));
+    }
+
+    @Test
     void deleteShouldReturnOk() {
         TaskId taskId = taskManager.submit(() -> {
             await();


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