### Question:
AppReleaseServiceImpl implements AppReleaseService { @Override public Optional<AppRelease> findByAppIdAndVersion(Integer appId, String version) { return appReleaseDao.findByAppIdAndVersion(appId, version); }  @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_appId_and_version_no_data() { Optional<AppRelease> appReleaseOption = appReleaseService.findByAppIdAndVersion(1, "0.1.0"); assertThat(appReleaseOption).isEmpty(); }
@Test public void find_by_appId_and_version_success() { AppRelease appRelease = new AppRelease(); appRelease.setAppId(1); appRelease.setVersion("0.0.1"); appRelease.setTitle("title"); appRelease.setDescription("description"); appRelease.setReleaseTime(LocalDateTime.now()); appRelease.setReleaseMethod(ReleaseMethod.AUTO); appRelease.setCreateUserId(1); appRelease.setCreateTime(LocalDateTime.now()); appReleaseDao.save(appRelease); Optional<AppRelease> appReleaseOption = appReleaseService.findByAppIdAndVersion(1, "0.0.1"); assertThat(appReleaseOption).isPresent(); }