diff options
author | Amund Bergland Kvalsvik <akvalsvik@verizonmedia.com> | 2020-06-24 15:04:04 +0200 |
---|---|---|
committer | Amund Bergland Kvalsvik <akvalsvik@verizonmedia.com> | 2020-06-24 15:04:04 +0200 |
commit | a45749b1400f86e112bb7520a288b90c762931d5 (patch) | |
tree | c9b61397ca4d7dd1d321a3825e38f13201c615a9 /container-core/src/test | |
parent | a213b7e58869e5f5a39e6e6ad795d0f22d8dd904 (diff) |
Cleaned up code
Diffstat (limited to 'container-core/src/test')
-rw-r--r-- | container-core/src/test/java/com/yahoo/container/handler/metrics/PrometheusV1HandlerTest.java | 22 |
1 files changed, 8 insertions, 14 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 5be2e8df519..f49eeb80cbf 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 @@ -5,28 +5,22 @@ import com.yahoo.container.jdisc.RequestHandlerTestDriver; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; import java.util.concurrent.Executors; import java.util.stream.Collectors; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.equalTo; import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; import static com.yahoo.container.handler.metrics.PrometheusV1Handler.consumerQuery; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; public class PrometheusV1HandlerTest { @@ -49,6 +43,14 @@ public class PrometheusV1HandlerTest { @Rule public WireMockRule wireMockRule = new WireMockRule(80); + private static String getFileContents(String filename) { + InputStream in = PrometheusV1HandlerTest.class.getClassLoader().getResourceAsStream(filename); + if (in == null) { + throw new RuntimeException("File not found: " + filename); + } + return new BufferedReader(new InputStreamReader(in)).lines().collect(Collectors.joining("\n")); + } + @Before public void setup() { setupWireMock(); @@ -116,12 +118,4 @@ public class PrometheusV1HandlerTest { private String getResponseAsString(String consumer) { return testDriver.sendRequest(VALUES_URI + consumerQuery(consumer)).readAll(); } - - private static String getFileContents(String filename) { - InputStream in = PrometheusV1HandlerTest.class.getClassLoader().getResourceAsStream(filename); - if (in == null) { - throw new RuntimeException("File not found: " + filename); - } - return new BufferedReader(new InputStreamReader(in)).lines().collect(Collectors.joining("\n")); - } } |