@Test public void testDependencyAdder() { InputStream resource = FeaturePluginFilter.class.getResourceAsStream(ADDITIONAL_DEPENDENCIES_FILE); Set<Dependency> dependencies = AdditionalDependencyProvider.readAdditionalDependencies(resource); assertThat(dependencies.size(), equalTo(1)); if (dependencies.size() == 1) { Dependency dependency = dependencies.iterator().next(); assertThat(dependency.getGroupId(), equalTo(GROUP_ID)); assertThat(dependency.getArtifactId(), equalTo(ARTIFACT_ID)); assertThat(dependency.getVersion(), equalTo(VERSION)); } }
static Set<Dependency> readAdditionalDependencies(InputStream additionalDependenciesFile) { Set<Dependency> additionalDependencies = new HashSet<>(); try (Scanner sc = new Scanner(additionalDependenciesFile)) { while (sc.hasNextLine()) { handleDependency(additionalDependencies, sc.nextLine(), additionalDependenciesFile.toString()); } } return additionalDependencies; }
AdditionalDependencyProvider { static Set<Dependency> readAdditionalDependencies(InputStream additionalDependenciesFile) { Set<Dependency> additionalDependencies = new HashSet<>(); try (Scanner sc = new Scanner(additionalDependenciesFile)) { while (sc.hasNextLine()) { handleDependency(additionalDependencies, sc.nextLine(), additionalDependenciesFile.toString()); } } return additionalDependencies; } }
AdditionalDependencyProvider { static Set<Dependency> readAdditionalDependencies(InputStream additionalDependenciesFile) { Set<Dependency> additionalDependencies = new HashSet<>(); try (Scanner sc = new Scanner(additionalDependenciesFile)) { while (sc.hasNextLine()) { handleDependency(additionalDependencies, sc.nextLine(), additionalDependenciesFile.toString()); } } return additionalDependencies; }  }
AdditionalDependencyProvider { static Set<Dependency> readAdditionalDependencies(InputStream additionalDependenciesFile) { Set<Dependency> additionalDependencies = new HashSet<>(); try (Scanner sc = new Scanner(additionalDependenciesFile)) { while (sc.hasNextLine()) { handleDependency(additionalDependencies, sc.nextLine(), additionalDependenciesFile.toString()); } } return additionalDependencies; }   }
AdditionalDependencyProvider { static Set<Dependency> readAdditionalDependencies(InputStream additionalDependenciesFile) { Set<Dependency> additionalDependencies = new HashSet<>(); try (Scanner sc = new Scanner(additionalDependenciesFile)) { while (sc.hasNextLine()) { handleDependency(additionalDependencies, sc.nextLine(), additionalDependenciesFile.toString()); } } return additionalDependencies; }    }