@Test
public void persistReportEntities_setsManualFlushModeAndResetsIt() {

    AccountPerformanceReport report = generateReport(1);
    Mockito.when(session.getHibernateFlushMode()).thenReturn(FlushMode.AUTO);
    sqlEntitiesPersister.persistReportEntities(Arrays.asList(report));
    sequence.verify(session).getHibernateFlushMode();
    sequence.verify(session).setHibernateFlushMode(FlushMode.MANUAL);
    sequence.verify(session).setHibernateFlushMode(FlushMode.AUTO);
}