@Test
public void testNotTooManyErrors() throws Exception {

    ErrorHandler errHandler = getErrorHandler();
    BaseTask.StreamMetrics metrics = new BaseTask.StreamMetrics(new Meter(clock), new Meter(clock));

    when(clock.getTick()).thenReturn(0L);
    metrics.processed.mark(910L);
    metrics.dropped.mark(90L);

    when(clock.getTick()).thenReturn(TimeUnit.SECONDS.toNanos(10));
    assertTrue(metrics.processed.getOneMinuteRate() > 0);
    assertTrue(metrics.dropped.getOneMinuteRate() > 0);
    assertFalse(errHandler.hasTooManyErrors(metrics));
}