summaryrefslogtreecommitdiffstats
path: root/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/StateRestAPITest.java
diff options
context:
space:
mode:
Diffstat (limited to 'clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/StateRestAPITest.java')
-rw-r--r--clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/StateRestAPITest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/StateRestAPITest.java b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/StateRestAPITest.java
index 8328ecc491f..3492c632e60 100644
--- a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/StateRestAPITest.java
+++ b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/staterestapi/StateRestAPITest.java
@@ -526,4 +526,17 @@ public class StateRestAPITest {
} catch (IllegalArgumentException e) {
}
}
+
+ @Test
+ public void deadline_exceeded_exception_returns_http_504_error() throws Exception {
+ setupDummyStateApi();
+ stateApi.induceException(new DeadlineExceededException("argh!"));
+ HttpResult result = execute(new HttpRequest().setPath("/cluster/v2"));
+
+ assertEquals(result.toString(true), 504, result.getHttpReturnCode());
+ assertEquals(result.toString(true), "Gateway Timeout", result.getHttpReturnCodeDescription());
+ assertEquals(result.toString(true), "application/json", result.getHeader("Content-Type"));
+ String expected = "{\"message\":\"argh!\"}";
+ assertEquals(expected, result.getContent().toString());
+ }
}