@Test public void buildEmptyDependencyMapTest() { List<ArtifactCoordinates> dependencies = new ArrayList<>(); Map<String, List<ArtifactCoordinates>> actualDependencyMap = validator.buildDependencyMap(dependencies); assertThat("Dependency map should be empty", actualDependencyMap.size(), equalTo(0)); }
protected Map<String, List<ArtifactCoordinates>> buildDependencyMap(List<ArtifactCoordinates> dependencyList) { Map<String, List<ArtifactCoordinates>> dependencyMap = new HashMap<>(); for (ArtifactCoordinates plugin : dependencyList) { String key = plugin.getGroupId() + ":" + plugin.getArtifactId(); dependencyMap.computeIfAbsent(key, k -> new ArrayList<>()); dependencyMap.get(key).add(plugin); } return dependencyMap; }
MulePluginsCompatibilityValidator { protected Map<String, List<ArtifactCoordinates>> buildDependencyMap(List<ArtifactCoordinates> dependencyList) { Map<String, List<ArtifactCoordinates>> dependencyMap = new HashMap<>(); for (ArtifactCoordinates plugin : dependencyList) { String key = plugin.getGroupId() + ":" + plugin.getArtifactId(); dependencyMap.computeIfAbsent(key, k -> new ArrayList<>()); dependencyMap.get(key).add(plugin); } return dependencyMap; } }
MulePluginsCompatibilityValidator { protected Map<String, List<ArtifactCoordinates>> buildDependencyMap(List<ArtifactCoordinates> dependencyList) { Map<String, List<ArtifactCoordinates>> dependencyMap = new HashMap<>(); for (ArtifactCoordinates plugin : dependencyList) { String key = plugin.getGroupId() + ":" + plugin.getArtifactId(); dependencyMap.computeIfAbsent(key, k -> new ArrayList<>()); dependencyMap.get(key).add(plugin); } return dependencyMap; }  }
MulePluginsCompatibilityValidator { protected Map<String, List<ArtifactCoordinates>> buildDependencyMap(List<ArtifactCoordinates> dependencyList) { Map<String, List<ArtifactCoordinates>> dependencyMap = new HashMap<>(); for (ArtifactCoordinates plugin : dependencyList) { String key = plugin.getGroupId() + ":" + plugin.getArtifactId(); dependencyMap.computeIfAbsent(key, k -> new ArrayList<>()); dependencyMap.get(key).add(plugin); } return dependencyMap; }  void validate(List<ArtifactCoordinates> mulePlugins); }
MulePluginsCompatibilityValidator { protected Map<String, List<ArtifactCoordinates>> buildDependencyMap(List<ArtifactCoordinates> dependencyList) { Map<String, List<ArtifactCoordinates>> dependencyMap = new HashMap<>(); for (ArtifactCoordinates plugin : dependencyList) { String key = plugin.getGroupId() + ":" + plugin.getArtifactId(); dependencyMap.computeIfAbsent(key, k -> new ArrayList<>()); dependencyMap.get(key).add(plugin); } return dependencyMap; }  void validate(List<ArtifactCoordinates> mulePlugins);  }