context.put(HTTPMetricsServer.CONFIG_PORT, String.valueOf(port));
} else {
port = HTTPMetricsServer.DEFAULT_PORT;
}
srv.configure(context);
srv.start();
Thread.sleep(1000);
URL url = new URL("http://0.0.0.0:" + String.valueOf(port) + "/metrics");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod(method);
Assert.assertEquals(HttpServletResponse.SC_FORBIDDEN,