@Test
public void persistReportEntities_retriesAfterDeadlockThenFails() {

  AccountPerformanceReport report = generateReport(1);
  Mockito.doThrow(new LockAcquisitionException("", null)).when(session).saveOrUpdate(any());
  try {
    sqlEntitiesPersister.persistReportEntities(Arrays.asList(report));
    fail();
  } catch (LockAcquisitionException ex) {
    // expected
  }
  sequence.verify(session, Mockito.times(20)).saveOrUpdate(report);
}