summaryrefslogtreecommitdiffstats
path: root/container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java
diff options
context:
space:
mode:
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.java8
1 files changed, 3 insertions, 5 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 e206188dcd8..9e0f9685328 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
@@ -1,8 +1,8 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.handler.metrics;
+import ai.vespa.json.Jackson;
import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
import com.yahoo.container.jdisc.RequestHandlerTestDriver;
@@ -28,8 +28,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class PrometheusV1HandlerTest {
- private static final ObjectMapper jsonMapper = new ObjectMapper();
-
private static final String URI_BASE = "http://localhost";
private static final String V1_URI = URI_BASE + PrometheusV1Handler.V1_PATH;
@@ -76,7 +74,7 @@ public class PrometheusV1HandlerTest {
@Test
void v1_response_contains_values_uri() throws Exception {
String response = testDriver.sendRequest(V1_URI).readAll();
- JsonNode root = jsonMapper.readTree(response);
+ JsonNode root = Jackson.mapper().readTree(response);
assertTrue(root.has("resources"));
ArrayNode resources = (ArrayNode) root.get("resources");
@@ -96,7 +94,7 @@ public class PrometheusV1HandlerTest {
@Test
void invalid_path_yields_error_response() throws Exception {
String response = testDriver.sendRequest(V1_URI + "/invalid").readAll();
- JsonNode root = jsonMapper.readTree(response);
+ JsonNode root = Jackson.mapper().readTree(response);
assertTrue(root.has("error"));
assertTrue(root.get("error").textValue().startsWith("No content"));
}