### Question:
ApiRepoServiceImpl implements ApiRepoService { @Override public Optional<ApiRepo> findById(Integer apiRepoId) { return apiRepoDao.findById(apiRepoId); }  @Override Optional<ApiRepo> findById(Integer apiRepoId); @Override Optional<ApiRepo> findByGitUrlAndCreateUserId(String apiGitUrl, Integer userId);  }### Answer:
@Test public void find_by_id_no_data() { assertThat(apiRepoService.findById(1)).isEmpty(); }
@Test public void find_by_id_no_success() { ApiRepo repo = new ApiRepo(); repo.setGitRepoUrl("a"); repo.setGitRepoWebsite("b"); repo.setGitRepoOwner("c"); repo.setGitRepoName("d"); repo.setCategory(RepoCategory.CLIENT_API); repo.setCreateUserId(1); repo.setCreateTime(LocalDateTime.now()); repo.setLastPublishTime(LocalDateTime.now()); ApiRepo savedRepo = apiRepoDao.save(repo); assertThat(apiRepoService.findById(savedRepo.getId())).isPresent(); }