@Test public void deleteReport() { reportDAO.delete(1L); reportDAO.flush(); assertNull(reportDAO.find(1L)); assertNull(reportExecDAO.find(1L)); }
@Test(expected = EntityExistsException.class) public void saveWithExistingName() { Report report = reportDAO.find(1L); assertNotNull(report); String name = report.getName(); report = entityFactory.newEntity(Report.class); report.setName(name); reportDAO.save(report); reportDAO.flush(); }