aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java
diff options
context:
space:
mode:
authorAmund Bergland Kvalsvik <akvalsvik@verizonmedia.com>2020-06-29 13:45:03 +0200
committerAmund Bergland Kvalsvik <akvalsvik@verizonmedia.com>2020-06-29 13:45:03 +0200
commit1eb53a6d6cb87750ece9dbb688cbaa9a48eee434 (patch)
tree070a78236f881bb9ba523b1d5aba8e14160e8448 /container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java
parentc2fbfa9ebf866d9be5ec4826bab056b2f517f8a4 (diff)
Fixed minor naming errors and throws
Diffstat (limited to 'container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java')
-rw-r--r--container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java17
1 files changed, 11 insertions, 6 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 4a94b4a1a7d..389c1e687cc 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
@@ -26,6 +26,7 @@ import static com.yahoo.container.handler.metrics.MetricsV2Handler.consumerQuery
import static com.yahoo.container.handler.metrics.MetricsV2HandlerTest.getFileContents;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
* @author gjoranv
@@ -76,7 +77,7 @@ public class PrometheusV1HandlerTest {
}
@Test
- public void v2_response_contains_values_uri() throws Exception {
+ public void v1_response_contains_values_uri() throws Exception {
String response = testDriver.sendRequest(V1_URI).readAll();
JSONObject root = new JSONObject(response);
assertTrue(root.has("resources"));
@@ -90,17 +91,21 @@ public class PrometheusV1HandlerTest {
@Ignore
@Test
- public void visually_inspect_values_response() throws Exception {
+ public void visually_inspect_values_response() {
String response = testDriver.sendRequest(VALUES_URI).readAll();
System.out.println(response);
}
@Test
- public void invalid_path_yields_error_response() throws Exception {
+ public void invalid_path_yields_error_response() {
String response = testDriver.sendRequest(V1_URI + "/invalid").readAll();
- JSONObject root = new JSONObject(response);
- assertTrue(root.has("error"));
- assertTrue(root.getString("error" ).startsWith("No content"));
+ try {
+ JSONObject root = new JSONObject(response);
+ assertTrue(root.has("error"));
+ assertTrue(root.getString("error" ).startsWith("No content"));
+ } catch (JSONException e) {
+ fail();
+ }
}
@Test