@Test(groups = INTEGRATION)
public void testReturnsEventsOrderedByDateAndThenEventId() throws SQLException {

    MysqlEvent event1 = new MysqlEvent(1, TEST_TABLE_NAME, INSERT_TYPE, "{}", "{}", DateUtils.addDays(TODAY, 2));
    MysqlEvent event2 = new MysqlEvent(2, TEST_TABLE_NAME, INSERT_TYPE, "{}", "{}", DateUtils.addDays(TODAY, 2));
    MysqlEvent event3 = new MysqlEvent(3, TEST_TABLE_NAME, INSERT_TYPE, "{}", "{}", DateUtils.addDays(TODAY, 1));
    MysqlEvent event4 = new MysqlEvent(4, TEST_TABLE_NAME, INSERT_TYPE, "{}", "{}", DateUtils.addDays(TODAY, 3));
    insertEventWithDate(event2, connection);
    insertEventWithDate(event1, connection);
    insertEventWithDate(event3, connection);
    insertEventWithDate(event4, connection);
    List<MysqlEvent> mysqlEvents = repo.getNewEventsForListener(listener, connection);
    assertEquals(mysqlEvents.size(), 4);
    assertEquals(mysqlEvents.get(0).getEventId(), 3);
    assertEquals(mysqlEvents.get(1).getEventId(), 1);
    assertEquals(mysqlEvents.get(2).getEventId(), 2);
    assertEquals(mysqlEvents.get(3).getEventId(), 4);
}