@Test public void argumentIsNotFlushedBeforeDelay() throws IOException { ManualClock clock = new ManualClock(); TimeBasedFlush timeBasedFlush = new TimeBasedFlush(clock, 60, SECONDS); timeBasedFlush.flush(flushable); verifyZeroInteractions(flushable); clock.waitFor(10, SECONDS); timeBasedFlush.flush(flushable); verifyZeroInteractions(flushable); clock.waitFor(10, SECONDS); timeBasedFlush.flush(flushable); verifyZeroInteractions(flushable); }
@Override public void flush(@Nonnull Flushable flushable) throws IOException { if (shouldFlush()) flushable.flush(); }
TimeBasedFlush implements FlushStrategy { @Override public void flush(@Nonnull Flushable flushable) throws IOException { if (shouldFlush()) flushable.flush(); } }
TimeBasedFlush implements FlushStrategy { @Override public void flush(@Nonnull Flushable flushable) throws IOException { if (shouldFlush()) flushable.flush(); } TimeBasedFlush(@Nonnull Clock clock, long flushPeriod, @Nonnull TimeUnit unit); }
TimeBasedFlush implements FlushStrategy { @Override public void flush(@Nonnull Flushable flushable) throws IOException { if (shouldFlush()) flushable.flush(); } TimeBasedFlush(@Nonnull Clock clock, long flushPeriod, @Nonnull TimeUnit unit); @Override void flush(@Nonnull Flushable flushable); }
TimeBasedFlush implements FlushStrategy { @Override public void flush(@Nonnull Flushable flushable) throws IOException { if (shouldFlush()) flushable.flush(); } TimeBasedFlush(@Nonnull Clock clock, long flushPeriod, @Nonnull TimeUnit unit); @Override void flush(@Nonnull Flushable flushable);  }