CliService { public String getCliUrl() { Map<String, Object> arguments = new HashMap<>(); arguments.put("version", version); arguments.put("gitCommit", gitInfo.getCommit().getId()); arguments.put("gitShortCommit", gitInfo.getCommit().getId().substring(0, 7)); String format = MessageFormat.format(cliConfig.getUrl(), arguments); return format; }  Optional<FileSystemResource> getLocalCliFile(); String getCliUrl(); String generateInstallCliScript(String requestUrl, String installDirectory); String getVersion();  }
@Test public void testGetCliUrlDefault() throws RepositoryNameAlreadyUsedException { String url = cliService.getCliUrl(); Assert.assertEquals("https: }
@Test public void testGetCliUrl() { CliService cliService = new CliService(); cliService.version = "0.1"; CliConfig cliConfig = new CliConfig(); cliConfig.url = "http: cliService.cliConfig = cliConfig; cliService.gitInfo = new GitInfo(); cliService.gitInfo.getCommit().setId("141708fc7e80556d69261c2cf4cdc82acfa337bc"); Assert.assertEquals("http: }