@Test public void testMultipleSend() throws IOException { ImmutableList<Result> results = ImmutableList.of(result, result); List<String> resultsString = ImmutableList.of("Result1", "Result2"); Mockito.when(openTSDBMessageFormatter.formatResults(results, ServerFixtures.dummyServer())).thenReturn(resultsString); writer.write(outputWriter, ServerFixtures.dummyServer(), null, results); Mockito.verify(outputWriter).write("Result1"); Mockito.verify(outputWriter).write("Result2"); }
@Override public void write(@Nonnull final Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { writer.write(resultString); } }
TCollectorUDPWriter2 implements WriterBasedOutputWriter { @Override public void write(@Nonnull final Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { writer.write(resultString); } } }
TCollectorUDPWriter2 implements WriterBasedOutputWriter { @Override public void write(@Nonnull final Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { writer.write(resultString); } } TCollectorUDPWriter2(OpenTSDBMessageFormatter messageFormatter); }
TCollectorUDPWriter2 implements WriterBasedOutputWriter { @Override public void write(@Nonnull final Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { writer.write(resultString); } } TCollectorUDPWriter2(OpenTSDBMessageFormatter messageFormatter); @Override void write(@Nonnull final Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results); }
TCollectorUDPWriter2 implements WriterBasedOutputWriter { @Override public void write(@Nonnull final Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { writer.write(resultString); } } TCollectorUDPWriter2(OpenTSDBMessageFormatter messageFormatter); @Override void write(@Nonnull final Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results);  }