@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, null)).thenReturn(resultsString); writer.write(outputWriter, null, null, results); Mockito.verify(outputWriter).write("put Result1\n"); Mockito.verify(outputWriter).write("put Result2\n"); }
@Override public void write( @Nonnull Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { logger.trace(resultString); writer.write("put " + resultString + "\n"); } }
OpenTSDBWriter2 implements WriterBasedOutputWriter { @Override public void write( @Nonnull Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { logger.trace(resultString); writer.write("put " + resultString + "\n"); } } }
OpenTSDBWriter2 implements WriterBasedOutputWriter { @Override public void write( @Nonnull Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { logger.trace(resultString); writer.write("put " + resultString + "\n"); } } OpenTSDBWriter2(OpenTSDBMessageFormatter messageFormatter); }
OpenTSDBWriter2 implements WriterBasedOutputWriter { @Override public void write( @Nonnull Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { logger.trace(resultString); writer.write("put " + resultString + "\n"); } } OpenTSDBWriter2(OpenTSDBMessageFormatter messageFormatter); @Override void write(
			@Nonnull Writer writer,
			@Nonnull Server server,
			@Nonnull Query query,
			@Nonnull Iterable<Result> results); }
OpenTSDBWriter2 implements WriterBasedOutputWriter { @Override public void write( @Nonnull Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { for(String resultString : messageFormatter.formatResults(results, server)) { logger.trace(resultString); writer.write("put " + resultString + "\n"); } } OpenTSDBWriter2(OpenTSDBMessageFormatter messageFormatter); @Override void write(
			@Nonnull Writer writer,
			@Nonnull Server server,
			@Nonnull Query query,
			@Nonnull Iterable<Result> results);  }