### Question:
AppReleaseServiceImpl implements AppReleaseService { @Override public Optional<AppRelease> findLatestReleaseAppByAppName(String appName) { return appDao.findByAppName(appName).flatMap(app -> { return appReleaseDao.findFirstByAppIdOrderByIdDesc(app.getId()); }); }  @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_latest_release_app_by_app_name_success() { App app = new App(); app.setAppName("app"); app.setCreateUserId(1); app.setCreateTime(LocalDateTime.now()); Integer appId = appDao.save(app).getId(); AppRelease appRelease = new AppRelease(); appRelease.setAppId(appId); 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); appRelease = new AppRelease(); appRelease.setAppId(appId); appRelease.setVersion("0.0.2"); 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.findLatestReleaseAppByAppName("app"); assertThat(appReleaseOption.get().getVersion()).isEqualTo("0.0.2"); }