@Test @Transactional public void testListWorkReportLine() { int previous = workReportLineDAO.list(WorkReportLine.class).size(); WorkReportLine workReportType1 = createValidWorkReportLine(); workReportLineDAO.save(workReportType1); WorkReportLine workReportType2 = createValidWorkReportLine(); workReportLineDAO.save(workReportType1); workReportLineDAO.save(workReportType2); List<WorkReportLine> list = workReportLineDAO.list(WorkReportLine.class); assertEquals(previous + 2, list.size()); }
@Test @Transactional public void testSaveWorkReportLine() { WorkReportLine workReportLine = createValidWorkReportLine(); workReportLineDAO.save(workReportLine); assertTrue(workReportLineDAO.exists(workReportLine.getId())); }
@Test @Transactional public void testRemoveWorkReportLine() throws InstanceNotFoundException { WorkReportLine workReportLine = createValidWorkReportLine(); workReportLineDAO.save(workReportLine); workReportLine.getWorkReport().removeWorkReportLine(workReportLine); workReportLineDAO.remove(workReportLine.getId()); assertFalse(workReportLineDAO.exists(workReportLine.getId())); }