summaryrefslogtreecommitdiffstats
path: root/metrics-proxy
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-11-20 10:45:22 +0100
committerjonmv <venstad@gmail.com>2023-11-20 10:47:30 +0100
commita534a4b08f4eddc0022ddce8bff47222a725db98 (patch)
tree76d8fbd5f12c0543ec5957736274871d78aaaa0a /metrics-proxy
parent58596788da2e3fc0afac6ea8f3de0b3af6ce1c32 (diff)
Don't swallow exception in test
Diffstat (limited to 'metrics-proxy')
-rw-r--r--metrics-proxy/src/test/java/ai/vespa/metricsproxy/service/ContainerServiceTest.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/service/ContainerServiceTest.java b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/service/ContainerServiceTest.java
index 1fadc66c46a..47912e958c6 100644
--- a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/service/ContainerServiceTest.java
+++ b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/service/ContainerServiceTest.java
@@ -7,12 +7,15 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import java.io.IOException;
+
import static ai.vespa.metricsproxy.TestUtil.getFileContents;
import static ai.vespa.metricsproxy.metric.model.DimensionId.toDimensionId;
import static ai.vespa.metricsproxy.metric.model.MetricId.toMetricId;
import static ai.vespa.metricsproxy.service.RemoteMetricsFetcher.METRICS_PATH;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
* @author Unknown
@@ -27,13 +30,9 @@ public class ContainerServiceTest {
}
@Before
- public void setupHTTPServer() {
- try {
- String response = getFileContents("metrics-container-state-multi-chain.json");
- httpServer = new MockHttpServer(response, METRICS_PATH);
- } catch (Exception e) {
- e.printStackTrace();
- }
+ public void setupHTTPServer() throws IOException {
+ String response = getFileContents("metrics-container-state-multi-chain.json");
+ httpServer = new MockHttpServer(response, METRICS_PATH);
}
@Test
@@ -49,7 +48,7 @@ public class ContainerServiceTest {
} else if (m.getDimensions().get(toDimensionId("chain")).equals("blendingResult")) {
assertEquals(0.36666666666666664, m.getValue());
} else {
- assertTrue("Unknown unknown chain", false);
+ fail("Unknown unknown chain");
}
}
}