summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorAmund Bergland Kvalsvik <akvalsvik@verizonmedia.com>2020-06-29 13:57:58 +0200
committerAmund Bergland Kvalsvik <akvalsvik@verizonmedia.com>2020-06-29 13:57:58 +0200
commitac21189ef5ff8561153a4f1b6dc8d8b2dc870fda (patch)
treedc96dca81c6cfa77a4defbf6d4650ea7b8d1cc37 /container-core
parent1eb53a6d6cb87750ece9dbb688cbaa9a48eee434 (diff)
Fixed throwing
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java b/container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java
index 389c1e687cc..a0e8c131c2b 100644
--- a/container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java
+++ b/container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java
@@ -97,15 +97,11 @@ public class PrometheusV1HandlerTest {
}
@Test
- public void invalid_path_yields_error_response() {
+ public void invalid_path_yields_error_response() throws Exception {
String response = testDriver.sendRequest(V1_URI + "/invalid").readAll();
- try {
- JSONObject root = new JSONObject(response);
- assertTrue(root.has("error"));
- assertTrue(root.getString("error" ).startsWith("No content"));
- } catch (JSONException e) {
- fail();
- }
+ JSONObject root = new JSONObject(response);
+ assertTrue(root.has("error"));
+ assertTrue(root.getString("error" ).startsWith("No content"));
}
@Test
@@ -115,7 +111,7 @@ public class PrometheusV1HandlerTest {
}
@Test
- public void consumer_is_propagated_to_metrics_proxy_api() throws JSONException {
+ public void consumer_is_propagated_to_metrics_proxy_api() {
String response = testDriver.sendRequest(VALUES_URI + consumerQuery(CUSTOM_CONSUMER)).readAll();
assertTrue(response.contains(REPLACED_CPU_METRIC));