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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to