### Question:
FolderDao extends NamedParameterJdbcDaoSupport { public Folder loadFolder(Long id) { Collection<Folder> items = getJdbcTemplate().query(loadFolderByIdQuery, FolderParameters.getFolderExtractor(false), id); if (CollectionUtils.isEmpty(items)) { return null; } else { return items.stream().filter(folder -> folder.getId().equals(id)).findAny().orElse(null); } }  @Transactional(propagation = Propagation.MANDATORY) Long createFolderId(); @Transactional(propagation = Propagation.MANDATORY) void createFolder(Folder folder); @Transactional(propagation = Propagation.MANDATORY) void updateFolder(Folder folder); List<Folder> loadAllFolders(); Folder loadFolder(Long id); List<Folder> loadAllProjects(Map<String, PipeConfValue> projectIndicator); Folder loadFolderByName(String name); Folder loadFolderByNameAndParentId(String name, Long parentId); List<FolderWithMetadata> loadParentFolders(Long folderId); List<Folder> loadFolderWithParents(final Long id); @Transactional(propagation = Propagation.MANDATORY) void deleteFolder(Long id); @Transactional(propagation = Propagation.MANDATORY) void updateLocks(List<Long> folderIds, boolean isLocked); @Required void setFolderSequence(String folderSequence); @Required void setCreateFolderQuery(String createFolderQuery); @Required void setUpdateFolderQuery(String updateFolderQuery); @Required void setLoadAllFoldersQuery(String loadAllFoldersQuery); @Required void setDeleteFolderQuery(String deleteFolderQuery); @Required void setLoadFolderByIdQuery(String loadFolderByIdQuery); @Required void setLoadFolderByNameQuery(String loadFolderByNameQuery); @Required void setLoadFolderByNameAndParentIdQuery(String loadFolderByNameAndParentIdQuery); @Required void setLoadParentFoldersQuery(String loadParentFoldersQuery); @Required void setUpdateFolderLocksQuery(String updateFolderLocksQuery); @Required void setLoadAllProjectsQuery(String loadAllProjectsQuery);  }### Answer:
@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void testCreateAndLoadFolderWithStorages() { Folder folder = getFolder(); AbstractDataStorage storage = addStorage(folder); Folder loaded = folderDao.loadFolder(folder.getId()); assertEquals(folder.getId(), loaded.getId()); assertEquals(folder.getName(), loaded.getName()); assertNull(folder.getParentId()); checkStorageIsPresent(storage, loaded); }
@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void testCreateAndLoadFolderWithConfigurations() { Folder folder = getFolder(); AbstractDataStorage storage = addStorage(folder); RunConfiguration configuration = addConfiguration(folder); Folder loaded = folderDao.loadFolder(folder.getId()); assertEquals(folder.getId(), loaded.getId()); assertEquals(folder.getName(), loaded.getName()); assertNull(folder.getParentId()); checkStorageIsPresent(storage, loaded); checkConfigIsPresent(configuration, loaded); }