@Test public void testParsesVersion() { setResponse("0.2.0", "0.1.0"); VersionInformation version = checker.loadInfos(); assertEquals("0.2.0", version.getAppinfos().getDesktop().getCurrentAppVersion()); assertEquals("0.1.0", version.getAppinfos().getDesktop().getMinimumAppVersion()); }
@Override public VersionInformation loadInfos() { HttpGet request = new HttpGet("https: try (CloseableHttpResponse response = (CloseableHttpResponse) client.execute(request)) { String body = IOUtils.toString(response.getEntity().getContent()); return new Gson().fromJson(body, VersionInformation.class); } catch (Exception e) { throw new IllegalStateException("Failed to check for updates: " + e.getMessage(), e); } }
HttpUpdateChecker implements UpdateChecker { @Override public VersionInformation loadInfos() { HttpGet request = new HttpGet("https: try (CloseableHttpResponse response = (CloseableHttpResponse) client.execute(request)) { String body = IOUtils.toString(response.getEntity().getContent()); return new Gson().fromJson(body, VersionInformation.class); } catch (Exception e) { throw new IllegalStateException("Failed to check for updates: " + e.getMessage(), e); } } }
HttpUpdateChecker implements UpdateChecker { @Override public VersionInformation loadInfos() { HttpGet request = new HttpGet("https: try (CloseableHttpResponse response = (CloseableHttpResponse) client.execute(request)) { String body = IOUtils.toString(response.getEntity().getContent()); return new Gson().fromJson(body, VersionInformation.class); } catch (Exception e) { throw new IllegalStateException("Failed to check for updates: " + e.getMessage(), e); } } HttpUpdateChecker(HttpClient client);  HttpUpdateChecker(); }
HttpUpdateChecker implements UpdateChecker { @Override public VersionInformation loadInfos() { HttpGet request = new HttpGet("https: try (CloseableHttpResponse response = (CloseableHttpResponse) client.execute(request)) { String body = IOUtils.toString(response.getEntity().getContent()); return new Gson().fromJson(body, VersionInformation.class); } catch (Exception e) { throw new IllegalStateException("Failed to check for updates: " + e.getMessage(), e); } } HttpUpdateChecker(HttpClient client);  HttpUpdateChecker(); @Override VersionInformation loadInfos(); @Override boolean isCurrent(String version); @Override LatestVersionInfo getDesktopVersion(); @Override boolean isAllowed(String version); }
HttpUpdateChecker implements UpdateChecker { @Override public VersionInformation loadInfos() { HttpGet request = new HttpGet("https: try (CloseableHttpResponse response = (CloseableHttpResponse) client.execute(request)) { String body = IOUtils.toString(response.getEntity().getContent()); return new Gson().fromJson(body, VersionInformation.class); } catch (Exception e) { throw new IllegalStateException("Failed to check for updates: " + e.getMessage(), e); } } HttpUpdateChecker(HttpClient client);  HttpUpdateChecker(); @Override VersionInformation loadInfos(); @Override boolean isCurrent(String version); @Override LatestVersionInfo getDesktopVersion(); @Override boolean isAllowed(String version);  }