@Test public void intervalElapsed() throws InterruptedException { Logger logger = mock(Logger.class); String arg = "arg"; Object[] argArray = {arg}; ProgressLogIntervalHelper underTest = new ProgressLogIntervalHelper(logger, 1); underTest.info("Test 1", arg); verify(logger, never()).info(PROGRESS, "Test 1", argArray); sleep(1100); underTest.info("Test 2", arg); verify(logger).info(PROGRESS, "Test 2", argArray); }
public void info(String message, Object... args) { if (hasIntervalElapsed()) { logger.info(PROGRESS, message, args); } else { TaskLoggerHelper.progress(logger, message, args); } }
ProgressLogIntervalHelper { public void info(String message, Object... args) { if (hasIntervalElapsed()) { logger.info(PROGRESS, message, args); } else { TaskLoggerHelper.progress(logger, message, args); } } }
ProgressLogIntervalHelper { public void info(String message, Object... args) { if (hasIntervalElapsed()) { logger.info(PROGRESS, message, args); } else { TaskLoggerHelper.progress(logger, message, args); } } ProgressLogIntervalHelper(final Logger logger, int intervalInSeconds); }
ProgressLogIntervalHelper { public void info(String message, Object... args) { if (hasIntervalElapsed()) { logger.info(PROGRESS, message, args); } else { TaskLoggerHelper.progress(logger, message, args); } } ProgressLogIntervalHelper(final Logger logger, int intervalInSeconds); String getElapsed(); void info(String message, Object... args); void flush(); }
ProgressLogIntervalHelper { public void info(String message, Object... args) { if (hasIntervalElapsed()) { logger.info(PROGRESS, message, args); } else { TaskLoggerHelper.progress(logger, message, args); } } ProgressLogIntervalHelper(final Logger logger, int intervalInSeconds); String getElapsed(); void info(String message, Object... args); void flush();  }