CliService { InstallCliContext getInstallCliContext(String requestUrl, String installDirectory) { try { URL url = new URL(requestUrl); return new InstallCliContext( installDirectory, url.getProtocol(), url.getHost(), getPort(url)); } catch (MalformedURLException e) { throw new RuntimeException("Can't get install CLI context because of malformed URL", e); } }  Optional<FileSystemResource> getLocalCliFile(); String getCliUrl(); String generateInstallCliScript(String requestUrl, String installDirectory); String getVersion();  }
@Test public void getInstallCliContext() { InstallCliContext installCliContext = cliService.getInstallCliContext("https: assertEquals("https", installCliContext.scheme); assertEquals("someinstall.org", installCliContext.host); assertEquals("443", installCliContext.port); assertEquals("someplace", installCliContext.installDirectory); }