@Test public void testSaveNew() throws ObjectNotFoundException { UUID saved; JournalStepDetail obj = new JournalStepDetail(); obj.setName("new name"); obj.setObjectStatus(ObjectStatus.ACTIVE); dao.save(obj); assertNotNull(obj.getId()); saved = obj.getId(); LOGGER.debug(obj.toString()); obj = dao.get(saved); assertNotNull(obj); assertNotNull(obj.getId()); assertNotNull(obj.getName()); final Collection<JournalStepDetail> all = dao.getAll(ObjectStatus.ACTIVE).getRows(); assertNotNull(all); assertTrue(all.size() > 0); assertList(all); dao.delete(obj); }
@Test public void uuidGeneration() { final JournalStepDetail obj = new JournalStepDetail(); obj.setName("new name"); obj.setObjectStatus(ObjectStatus.ACTIVE); dao.save(obj); final JournalStepDetail obj2 = new JournalStepDetail(); obj2.setName("new name"); obj2.setObjectStatus(ObjectStatus.ACTIVE); dao.save(obj2); LOGGER.debug("obj1 id: " + obj.getId().toString() + ", obj2 id: " + obj2.getId().toString()); dao.delete(obj); dao.delete(obj2); }
private void assertList(final Collection<JournalStepDetail> objects) { for (final JournalStepDetail object : objects) { assertNotNull(object.getId()); } }