ReleaseDaoImpl implements ReleaseDao { @Override public void updateRelease(final String releaseApiUrl) { try { List<Release> releases = new ObjectMapper().readValue(new URL(releaseApiUrl), new TypeReference<List<Release>>() { }); for (Release release : releases) { if (!release.isDraft()) { LOGGER.info("Latest Holmes release available {}", release.getName()); latestRelease = release; break; } } } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } ReleaseDaoImpl(); @Override void updateRelease(final String releaseApiUrl); @Override Release getLatestRelease();  }
@Test public void testUpdateRelease() { String releaseApiUrl = this.getClass().getResource("/githubReleaseApi.json").toString(); ReleaseDaoImpl releaseDao = new ReleaseDaoImpl(); releaseDao.updateRelease(releaseApiUrl); Release latestRelease = releaseDao.getLatestRelease(); assertNotNull(latestRelease); assertNotNull(latestRelease.toString()); assertFalse(latestRelease.isDraft()); assertNotNull(latestRelease.getName()); assertNotNull(latestRelease.getUrl()); }