LicenseTextCollector { @NotNull public CompletableFuture<String> getLicenseText() { return CompletableFuture.supplyAsync(this::getLicenseTextSync); } LicenseTextCollector(@NotNull Path ideHome, @NotNull List<Path> licenses); @NotNull CompletableFuture<String> getLicenseText();  }
@Test public void collectAllLicenses() throws Exception { Path testRoot = Paths.get(AndroidTestBase.getTestDataPath(), "licenseLocator"); Path ideHome = testRoot.resolve("linux"); CompletableFuture<String> cf = new LicenseTextCollector(ideHome, new LicensesLocator(ideHome, false).getLicenseFiles()).getLicenseText(); String expected = "------------ License file: NOTICE.txt------------<br><br>main notice<br><br>" + "------------ License file: LICENSE.txt------------<br><br>main license<br><br>" + "------------ License file: license/ant_license.txt------------<br><br>ant<br><br>" + "------------ License file: plugins/android/lib/licenses/antlr4-runtime-4.5.3.jar-NOTICE------------<br><br>antlr4<br><br>" + "------------ License file: plugins/android/lib/licenses/asm-5.0.3-NOTICE------------<br><br>asm5<br><br>"; if (SystemInfo.isWindows) { expected = expected.replace('/', '\\'); } assertThat(cf.get(20, TimeUnit.SECONDS)).isEqualTo(expected); }