String childFolderName = "child-folder-name";
String childFolderDescription = "child-folder-description";
Session session = HibernateUtil.getInstance().getSession();
Transaction tx = session.beginTransaction();
Folder parentFolder = new Folder();
parentFolder.setName(parentName);
parentFolder.setDescription(parentDescription);
session.save(parentFolder);
Folder childFolder = new Folder();
childFolder.setParent(parentFolder);
childFolder.setName(childFolderName);
childFolder.setDescription(childFolderDescription);
session.save(childFolder);
tx.commit();
session.close();
session = HibernateUtil.getInstance().getSession();
childFolder = SecurityHelper.getFolder(session, parentFolder, childFolderName);
session.close();
assertEquals(childFolder.getName(), childFolderName);
assertEquals(childFolder.getDescription(), childFolderDescription);
}