### Question:
ToolDao extends NamedParameterJdbcDaoSupport { @Transactional(propagation = Propagation.MANDATORY) public void createTool(Tool tool) { Assert.isNull(loadTool(tool.getRegistryId(), tool.getImage()), messageHelper.getMessage(MessageConstants.ERROR_TOOL_ALREADY_EXIST, tool.getRegistry(), tool.getImage()) ); tool.setId(daoHelper.createId(toolSequence)); getNamedParameterJdbcTemplate().update(createToolQuery, getParameters(tool, getConnection())); }  @Transactional(propagation = Propagation.MANDATORY) void createTool(Tool tool); @Transactional(propagation = Propagation.MANDATORY) void updateTool(Tool tool); @Transactional(propagation = Propagation.MANDATORY) void updateOwner(Tool tool); List<Tool> loadAllTools(Long registryId); List<Tool> loadAllTools(List<String> labels); List<Tool> loadAllTools(); @Transactional(propagation = Propagation.SUPPORTS) List<Tool> loadAllTools(Long registryId, List<String> labels); @Transactional(propagation = Propagation.SUPPORTS) Tool loadTool(Long registryId, String image); @Transactional(propagation = Propagation.SUPPORTS) Optional<Tool> loadToolByGroupAndImage(Long groupId, String image); @Transactional(propagation = Propagation.SUPPORTS) List<Tool> loadToolsByGroup(Long groupId); List<ToolWithIssuesCount> loadToolsWithIssuesCountByGroup(Long groupId); @Transactional(propagation = Propagation.MANDATORY) void deleteTool(Long toolId); @Transactional(propagation = Propagation.MANDATORY) long updateIcon(long toolId, String fileName, byte[] image); @Transactional(propagation = Propagation.MANDATORY) void deleteToolIcon(long toolId); Optional<Pair<String, InputStream>> loadIcon(long toolId); Tool loadTool(Long id); List<Tool> loadWithSameImageNameFromOtherRegistries(String image, String registry); @Required void setToolSequence(String toolSequence); @Required void setToolIconSequence(String toolIconSequence); @Required void setCreateToolQuery(String createToolQuery); @Required void setLoadAllToolsQuery(String loadAllToolsQuery); @Required void setDeleteToolQuery(String deleteToolQuery); @Required void setLoadToolByRegistryAndImageQuery(String loadToolByRegistryAndImageQuery); @Required void setUpdateToolQuery(String updateToolQuery); @Required void setUpdateOwnerQuery(String updateOwnerQuery); @Required void setLoadToolQuery(String loadToolQuery); @Required void setLoadToolsByGroupQuery(String loadToolsByGroupQuery); @Required void setLoadToolByGroupAndImageQuery(String loadToolByGroupAndImageQuery); @Required void setLoadToolsFromOtherRegistriesByImageQuery(String loadToolsFromOtherRegistriesByImageQuery); @Required void setLoadToolsWithIssueCountByGroupQuery(String loadToolsWithIssueCountByGroupQuery); @Required void setUpdateToolIconQuery(String updateToolIconQuery); @Required void setUpdateToolIconIdQuery(String updateToolIconIdQuery); @Required void setLoadToolIconQuery(String loadToolIconQuery); @Required void setDeleteToolIconQuery(String deleteToolIconQuery);  }### Answer:
@Test @Transactional public void testToolCanBeLoadedWithAnyAvailableMethod() { final Tool tool = createTool(); assertToolCanBeLoaded(tool); }
@Test @Transactional public void testSymlinkCanBeLoadedWithAnyAvailableMethod() { final Tool tool = createTool(); final Tool symlink = createSymlink(tool); assertSymlinkCanBeLoaded(tool, symlink); }
@Test @Transactional public void testToolIsNotAffectedAfterSymlinkIsDeleted() { final Tool tool = createTool(); final Tool symlink = createSymlink(tool); assertToolCanBeLoaded(tool); deleteSymlink(symlink); assertToolCanBeLoaded(tool); assertToolCannotBeLoaded(symlink); }
@Test @Transactional public void testSymlinkWithIssuesCountCanBeLoaded() { final Tool tool = createTool(); final Tool symlink = createSymlink(tool); createIssue(tool, ISSUE_NAME); createIssue(tool, ISSUE_NAME2); final ToolWithIssuesCount loadedSymlink = loadToolWithIssuesCount(symlink); assertThat(loadedSymlink.getIssuesCount(), is(2L)); }