### Question:
RepositoryResourceServiceImpl implements RepositoryResourceService { @Override public Optional<RepositoryResource> findProject(Integer repositoryId, String projectKey) { return repositoryResourceDao.findByRepositoryIdAndParentIdAndResourceTypeAndKeyIgnoreCase(repositoryId, Constant.TREE_ROOT_ID, RepositoryResourceType.PROJECT, projectKey); }  @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 findProjectNoData() { Integer repositoryId = 1; String projectKey = "project1"; assertThat(repositoryResourceService.findProject(repositoryId, projectKey)).isEmpty(); }
@Test public void findProjectSuccess() { Integer repositoryId = 1; Integer userId = 2; String projectKey = "project1"; RepositoryResource project = new RepositoryResource(); project.setRepositoryId(repositoryId); project.setParentId(Constant.TREE_ROOT_ID); project.setKey(projectKey); project.setAppType(AppType.WEB); project.setResourceType(RepositoryResourceType.PROJECT); project.setCreateTime(LocalDateTime.now()); project.setCreateUserId(userId); project.setSeq(1); RepositoryResource savedProject = repositortResourceDao.save(project); RepositoryResource page = new RepositoryResource(); page.setRepositoryId(repositoryId); page.setParentId(savedProject.getId()); page.setKey("page1"); page.setAppType(AppType.WEB); page.setResourceType(RepositoryResourceType.PAGE); page.setCreateTime(LocalDateTime.now()); page.setCreateUserId(userId); page.setSeq(1); repositortResourceDao.save(project); assertThat(repositoryResourceService.findProject(repositoryId, projectKey)).isPresent(); }