@Test public void checkDynamicUpgradeServer() throws Exception { upgradeAPI.setUpgradeVersionLocation("http: String response = RestAssured.when().get("/api/upgrade/check").asString(); final List<UpgradeServerVersion> versions = mapper.readerFor(new TypeReference<List<UpgradeServerVersion>>() { }).readValue(response); assertEquals(1, versions.size()); final UpgradeServerVersion actual = versions.get(0); final String expectedVersion = versionService.version().getVersionId(); final String expectedToken = TokenGenerator.generateMachineToken(new CryptoHelper("DataPrepIsSoCool")); assertEquals(expectedToken, actual.getTitle()); assertEquals(expectedVersion, actual.getDownloadUrl()); }
void setUpgradeVersionLocation(String upgradeVersionLocation) { this.upgradeVersionLocation = upgradeVersionLocation; }
UpgradeAPI extends APIService { void setUpgradeVersionLocation(String upgradeVersionLocation) { this.upgradeVersionLocation = upgradeVersionLocation; } }
UpgradeAPI extends APIService { void setUpgradeVersionLocation(String upgradeVersionLocation) { this.upgradeVersionLocation = upgradeVersionLocation; }  }
UpgradeAPI extends APIService { void setUpgradeVersionLocation(String upgradeVersionLocation) { this.upgradeVersionLocation = upgradeVersionLocation; }  @PostConstruct void init(); @RequestMapping(value = "/api/upgrade/check", method = GET) @ApiOperation(value = "Checks if a newer versions are available and returns them as JSON.", produces = MediaType.APPLICATION_JSON_VALUE) @Timed @PublicAPI Stream<UpgradeServerVersion> check(); }
UpgradeAPI extends APIService { void setUpgradeVersionLocation(String upgradeVersionLocation) { this.upgradeVersionLocation = upgradeVersionLocation; }  @PostConstruct void init(); @RequestMapping(value = "/api/upgrade/check", method = GET) @ApiOperation(value = "Checks if a newer versions are available and returns them as JSON.", produces = MediaType.APPLICATION_JSON_VALUE) @Timed @PublicAPI Stream<UpgradeServerVersion> check();  }