### Question:
AppReleaseServiceImpl implements AppReleaseService { @Override public Optional<AppRelease> findById(int releaseId) { return appReleaseDao.findById(releaseId); }  @Override Optional<AppRelease> findById(int releaseId); @Override Optional<AppRelease> findLatestReleaseApp(Integer appId); @Override Optional<AppRelease> findByAppIdAndVersion(Integer appId, String version); @Override List<AppRelease> findAllByAppName(String appName); @Override Optional<AppRelease> findLatestReleaseAppByAppName(String appName);  }### Answer:
@Test public void find_by_id_no_data() { Optional<AppRelease> appReleaseOption = appReleaseService.findById(9999); assertThat(appReleaseOption.isEmpty()).isTrue(); }
@Test public void find_by_id_success() { AppRelease appRelease = new AppRelease(); appRelease.setAppId(1); appRelease.setVersion("0.0.1"); appRelease.setTitle("title"); appRelease.setDescription(StringUtils.repeat("x", 3000)); appRelease.setReleaseTime(LocalDateTime.now()); appRelease.setReleaseMethod(ReleaseMethod.AUTO); appRelease.setCreateUserId(1); appRelease.setCreateTime(LocalDateTime.now()); Optional<AppRelease> appReleaseOption = appReleaseService.findById(appReleaseDao.save(appRelease).getId()); assertThat(appReleaseOption).isPresent(); }