### Question:
RepositoryResourceServiceImpl implements RepositoryResourceService { @Override public List<String> findParentPathes(Integer resourceId) { List<String> pathes = new ArrayList<String>(); while(resourceId != Constant.TREE_ROOT_ID) { resourceId = repositoryResourceDao.findById(resourceId).map(resource -> { if(resource.isDependence()) { pathes.add(0, resource.getName()); } else { pathes.add(0, resource.getKey()); } return resource.getParentId(); }).orElse(Constant.TREE_ROOT_ID); } return pathes; }  @Override RepositoryResource insert(Repository repository, RepositoryResource resource); @Override List<RepositoryResource> findChildren(Repository project, Integer parentResourceId); @Override List<String> findParentPathes(Integer resourceId); @Override Optional<RepositoryResource> findByKey(
			Integer projectId, 
			Integer parentId, 
			RepositoryResourceType resourceType,
			AppType appType,
			String key); @Override Optional<RepositoryResource> findByName(
			Integer projectId, 
			Integer parentId, 
			RepositoryResourceType resourceType,
			AppType appType, 
			String name); @Override List<RepositoryResource> findAllPages(Integer projectId, AppType appType); @Override Optional<RepositoryResource> findById(Integer resourceId); @Override List<RepositoryResource> findParentGroupsByParentPath(Integer repositoryId, String parentPath); @Override List<UncommittedFile> findChanges(Repository project); @Override void stageChanges(Repository project, String[] filePathes); @Override void unstageChanges(Repository project, String[] filePathes); @Override String commit(UserInfo user, Repository project, String commitMessage); @Override void updatePageModel(Repository repository, RepositoryResource projectResource, PageModel pageModel); @Override PageModel getPageModel(RepositoryResource page); @Override PageModel createPageModelWithStdPage(Integer pageId); @Override RepositoryResource createWebProject(Repository repository, RepositoryResource project); @Override RepositoryResource createMiniProgram(
			Repository repository, 
			RepositoryResource project,
			ApiRepo apiRepo, 
			ApiWidget appWidget, 
			ApiWidget pageWidget); @Override Optional<RepositoryResource> findProject(Integer repositoryId, String projectKey);  }### Answer:
@Test public void findParentPathAtRoot() { List<String> pathes = repositoryResourceService.findParentPathes(Constant.TREE_ROOT_ID); assertThat(pathes).isEmpty(); }
@Test public void findParentPathSuccess() { RepositoryResource resource = new RepositoryResource(); resource.setRepositoryId(1); resource.setKey("key1"); resource.setName("name1"); resource.setAppType(AppType.WEB); resource.setResourceType(RepositoryResourceType.GROUP); resource.setParentId(Constant.TREE_ROOT_ID); resource.setSeq(1); resource.setCreateUserId(1); resource.setCreateTime(LocalDateTime.now()); Integer savedResourceId = repositortResourceDao.save(resource).getId(); resource = new RepositoryResource(); resource.setRepositoryId(1); resource.setKey("key2"); resource.setName("name2"); resource.setAppType(AppType.WEB); resource.setResourceType(RepositoryResourceType.GROUP); resource.setParentId(savedResourceId); resource.setSeq(1); resource.setCreateUserId(1); resource.setCreateTime(LocalDateTime.now()); savedResourceId = repositortResourceDao.save(resource).getId(); resource = new RepositoryResource(); resource.setRepositoryId(1); resource.setKey("key3"); resource.setName("name3"); resource.setAppType(AppType.WEB); resource.setResourceType(RepositoryResourceType.GROUP); resource.setParentId(savedResourceId); resource.setSeq(1); resource.setCreateUserId(1); resource.setCreateTime(LocalDateTime.now()); savedResourceId = repositortResourceDao.save(resource).getId(); List<String> pathes = repositoryResourceService.findParentPathes(savedResourceId); assertThat(String.join("/", pathes)).isEqualTo("key1/key2/key3"); }