PluginSelector { public List<PluginDefine> select(List<PluginDefine> pluginDefines) { if (!EXCLUDE_PLUGINS.isEmpty()) { List<String> excludes = Arrays.asList(EXCLUDE_PLUGINS.toLowerCase().split(",")); return pluginDefines.stream() .filter(item -> !excludes.contains(item.getName().toLowerCase())) .collect(Collectors.toList()); } return pluginDefines; }  List<PluginDefine> select(List<PluginDefine> pluginDefines);  }
@Test public void selectDefaultTest() { EXCLUDE_PLUGINS = ""; List<PluginDefine> select = selector.select(pluginDefines); Assert.assertEquals(2, select.size()); }
@Test public void selectNormalTest() { EXCLUDE_PLUGINS = "mysql"; List<PluginDefine> plugins = selector.select(pluginDefines); Assert.assertEquals(1, plugins.size()); Assert.assertEquals("elasticsearch", plugins.get(0).getName()); }