@Test
public void testAuditWithLimit() throws InterruptedException {
int nb = 500;
int limit = 25;
EventPublisher pub = new EventPublisher();
pub.setRepository(new InMemoryEventRepository(limit));
for (int i = 0; i < nb; i++) {
pub.publish(new Event("aer", EventType.HIT_FLIPPED));
Thread.sleep(2);
}
Assert.assertEquals(limit, pub.getRepository().getTotalEventCount());