@Test public void testPushMetrics() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); StdOutMetricsSender sender = new StdOutMetricsSender("expectedHostName", out); sender.pushMetrics("test"); System.out.println(baos.toString()); }
@Override public String pushMetrics(String payload) { out.println("Sending to " + metricsHostName + ": " + payload); return "OK"; }
StdOutMetricsSender implements MetricsSender { @Override public String pushMetrics(String payload) { out.println("Sending to " + metricsHostName + ": " + payload); return "OK"; } }
StdOutMetricsSender implements MetricsSender { @Override public String pushMetrics(String payload) { out.println("Sending to " + metricsHostName + ": " + payload); return "OK"; } StdOutMetricsSender(String metricsHostName);  StdOutMetricsSender(String metricsHostName, PrintStream out); }
StdOutMetricsSender implements MetricsSender { @Override public String pushMetrics(String payload) { out.println("Sending to " + metricsHostName + ": " + payload); return "OK"; } StdOutMetricsSender(String metricsHostName);  StdOutMetricsSender(String metricsHostName, PrintStream out); @Override String pushMetrics(String payload); }
StdOutMetricsSender implements MetricsSender { @Override public String pushMetrics(String payload) { out.println("Sending to " + metricsHostName + ": " + payload); return "OK"; } StdOutMetricsSender(String metricsHostName);  StdOutMetricsSender(String metricsHostName, PrintStream out); @Override String pushMetrics(String payload); final PrintStream out; }