Beispiel #1
0
  @Test
  public void deleteReport() {
    reportDAO.delete(1L);

    reportDAO.flush();

    assertNull(reportDAO.find(1L));
    assertNull(reportExecDAO.find(1L));
  }
Beispiel #2
0
  @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();
  }