aboutsummaryrefslogtreecommitdiffstats
path: root/metrics-proxy/src/test
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2020-01-17 13:33:18 +0100
committergjoranv <gv@verizonmedia.com>2020-01-17 13:33:18 +0100
commitf9e7cdf92ad1867ed7ed7813fe0577a061c000e9 (patch)
tree3fd65690ba4cd2e7dd1dba295cc192fb9cdb56ad /metrics-proxy/src/test
parentca80f4634d471c078047337e1d10a7f73c163900 (diff)
Move MetricsHandler to new package and add 'V1' to its name.
Diffstat (limited to 'metrics-proxy/src/test')
-rw-r--r--metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java4
-rw-r--r--metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/metrics/MetricsV1HandlerTest.java (renamed from metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/MetricsHandlerTest.java)17
2 files changed, 11 insertions, 10 deletions
diff --git a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java
index 0c800c0ff63..c3e34920163 100644
--- a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java
+++ b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java
@@ -1,7 +1,7 @@
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.metricsproxy.http.application;
-import ai.vespa.metricsproxy.http.MetricsHandler;
+import ai.vespa.metricsproxy.http.metrics.MetricsV1Handler;
import ai.vespa.metricsproxy.metric.model.MetricsPacket;
import com.github.tomakehurst.wiremock.junit.WireMockClassRule;
import com.yahoo.test.ManualClock;
@@ -55,7 +55,7 @@ public class NodeMetricsClientTest {
@BeforeClass
public static void setupWireMock() {
- node = new Node("id", "localhost", wireMockRule.port(), MetricsHandler.VALUES_PATH);
+ node = new Node("id", "localhost", wireMockRule.port(), MetricsV1Handler.VALUES_PATH);
URI metricsUri = node.metricsUri(DEFAULT_PUBLIC_CONSUMER_ID);
wireMockRule.stubFor(get(urlPathEqualTo(metricsUri.getPath()))
.willReturn(aResponse().withBody(RESPONSE)));
diff --git a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/MetricsHandlerTest.java b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/metrics/MetricsV1HandlerTest.java
index 1444f5c57f5..22f61114622 100644
--- a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/MetricsHandlerTest.java
+++ b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/metrics/MetricsV1HandlerTest.java
@@ -1,6 +1,7 @@
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package ai.vespa.metricsproxy.http;
+package ai.vespa.metricsproxy.http.metrics;
+import ai.vespa.metricsproxy.http.HttpHandlerTestBase;
import ai.vespa.metricsproxy.metric.model.json.GenericJsonModel;
import ai.vespa.metricsproxy.metric.model.json.GenericMetrics;
import ai.vespa.metricsproxy.metric.model.json.GenericService;
@@ -17,8 +18,8 @@ import java.io.IOException;
import java.util.concurrent.Executors;
import static ai.vespa.metricsproxy.core.VespaMetrics.INSTANCE_DIMENSION_ID;
-import static ai.vespa.metricsproxy.http.MetricsHandler.V1_PATH;
-import static ai.vespa.metricsproxy.http.MetricsHandler.VALUES_PATH;
+import static ai.vespa.metricsproxy.http.metrics.MetricsV1Handler.V1_PATH;
+import static ai.vespa.metricsproxy.http.metrics.MetricsV1Handler.VALUES_PATH;
import static ai.vespa.metricsproxy.metric.model.StatusCode.DOWN;
import static ai.vespa.metricsproxy.metric.model.json.JacksonUtil.createObjectMapper;
import static ai.vespa.metricsproxy.service.DummyService.METRIC_1;
@@ -33,17 +34,17 @@ import static org.junit.Assert.fail;
* @author gjoranv
*/
@SuppressWarnings("UnstableApiUsage")
-public class MetricsHandlerTest extends HttpHandlerTestBase {
+public class MetricsV1HandlerTest extends HttpHandlerTestBase {
private static final String V1_URI = URI_BASE + V1_PATH;
private static final String VALUES_URI = URI_BASE + VALUES_PATH;
@BeforeClass
public static void setup() {
- MetricsHandler handler = new MetricsHandler(Executors.newSingleThreadExecutor(),
- getMetricsManager(),
- vespaServices,
- getMetricsConsumers());
+ var handler = new MetricsV1Handler(Executors.newSingleThreadExecutor(),
+ getMetricsManager(),
+ vespaServices,
+ getMetricsConsumers());
testDriver = new RequestHandlerTestDriver(handler);
}