@Test public void applicationDependencies() { Config config = mock(Config.class); when(config.valueList(Config.KEY_DEPENDENCIES)).thenReturn(Config.Value.empty(Config.KEY_DEPENDENCIES)); List<Dependency> applicationDependencies = DependencyHelper.applicationDependencies(config); assertThat(applicationDependencies, is(nullValue())); when(config.valueList(Config.KEY_DEPENDENCIES)).thenReturn(Config.Value.of(Config.KEY_DEPENDENCIES, Arrays.asList("com.example:hello:1.0.0"))); applicationDependencies = DependencyHelper.applicationDependencies(config); assertThat(applicationDependencies, contains(Dependency.parse("com.example:hello:1.0.0"))); assertThat(applicationDependencies, not(contains(Dependency.parse("com.example:hello:1.0.1")))); }
static public List<Dependency> applicationDependencies(Config config) { List<String> ds = config.valueList(Config.KEY_DEPENDENCIES).getOrNull(); if (ds == null || ds.isEmpty()) { return null; } List<Dependency> dependencies = new ArrayList<>(ds.size()); ds.stream().forEach((d) -> { dependencies.add(Dependency.parse(d)); }); return dependencies; }
DependencyHelper { static public List<Dependency> applicationDependencies(Config config) { List<String> ds = config.valueList(Config.KEY_DEPENDENCIES).getOrNull(); if (ds == null || ds.isEmpty()) { return null; } List<Dependency> dependencies = new ArrayList<>(ds.size()); ds.stream().forEach((d) -> { dependencies.add(Dependency.parse(d)); }); return dependencies; } }
DependencyHelper { static public List<Dependency> applicationDependencies(Config config) { List<String> ds = config.valueList(Config.KEY_DEPENDENCIES).getOrNull(); if (ds == null || ds.isEmpty()) { return null; } List<Dependency> dependencies = new ArrayList<>(ds.size()); ds.stream().forEach((d) -> { dependencies.add(Dependency.parse(d)); }); return dependencies; }  }
DependencyHelper { static public List<Dependency> applicationDependencies(Config config) { List<String> ds = config.valueList(Config.KEY_DEPENDENCIES).getOrNull(); if (ds == null || ds.isEmpty()) { return null; } List<Dependency> dependencies = new ArrayList<>(ds.size()); ds.stream().forEach((d) -> { dependencies.add(Dependency.parse(d)); }); return dependencies; }  static List<Dependency> wellKnownEngineDependencies(String fileExtension); static List<Dependency> applicationDependencies(Config config); static String cleanMavenDependencyLine(String dependency); static List<Dependency> alreadyBundled(); static void collect(List<Dependency> collect, List<Dependency> dependencies); static Set<String> toGroupArtifactSet(List<Dependency> dependencies); }
DependencyHelper { static public List<Dependency> applicationDependencies(Config config) { List<String> ds = config.valueList(Config.KEY_DEPENDENCIES).getOrNull(); if (ds == null || ds.isEmpty()) { return null; } List<Dependency> dependencies = new ArrayList<>(ds.size()); ds.stream().forEach((d) -> { dependencies.add(Dependency.parse(d)); }); return dependencies; }  static List<Dependency> wellKnownEngineDependencies(String fileExtension); static List<Dependency> applicationDependencies(Config config); static String cleanMavenDependencyLine(String dependency); static List<Dependency> alreadyBundled(); static void collect(List<Dependency> collect, List<Dependency> dependencies); static Set<String> toGroupArtifactSet(List<Dependency> dependencies);  }